diff --git a/.gitignore b/.gitignore index 8f01f60bf9c979a098c81d1609cc176cab630a5c..71b77da25c4d53db49b24642d88062906e7db219 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,6 @@ cython_debug/ # Sqlite *.db + +# TeraFlowSDN-generated files +tfs_runtime_env_vars.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e35c2cb390fdc44a4d3f1da0ffdfc32e5d96c07..ffbf9e9f5f02bd0514d4584f6f2ad32761b6264f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # stages of the cicd pipeline stages: - dependencies @@ -12,16 +26,18 @@ stages: include: - local: '/manifests/.gitlab-ci.yml' - local: '/src/monitoring/.gitlab-ci.yml' - #- local: '/src/centralizedattackdetector/.gitlab-ci.yml' + - local: '/src/compute/.gitlab-ci.yml' - local: '/src/context/.gitlab-ci.yml' - local: '/src/device/.gitlab-ci.yml' - local: '/src/service/.gitlab-ci.yml' - local: '/src/dbscanserving/.gitlab-ci.yml' - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' - #- local: '/src/tester_integration/.gitlab-ci.yml' - #- local: '/src/tester_functional/.gitlab-ci.yml' - #- local: '/src/automation/.gitlab-ci.yml' + - local: '/src/automation/.gitlab-ci.yml' + - local: '/src/policy/.gitlab-ci.yml' + - local: '/src/webui/.gitlab-ci.yml' #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' #- local: '/src/l3_attackmitigator/.gitlab-ci.yml' + #- local: '/src/slice/.gitlab-ci.yml' + #- local: '/src/interdomain/.gitlab-ci.yml' diff --git a/INSTALL.md b/INSTALL.md index 84e3c80680c3bb0c87ff3254cac85b2c6fdde34c..670af487313498ad60f8c0fc89029218efe29405 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,22 +1,4 @@ # TeraFlow OS SDN Controller Installation Instructions -Assuming you have a running Kubernetes deployment installed following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](../../../wikis/Installing-Kubernetes-on-your-Linux-machine), the following instructions will let you deploy TeraFlow OS SDN Controller in your local Kubernetes environment. +Assuming you have a running Kubernetes deployment installed following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine), the following instructions will let you deploy TeraFlow OS SDN Controller in your local Kubernetes environment. -Among others, it is assumed that you can run the command kubectl cluster-info in the machine you use for running the deployment script below. - - -## 1. Clone the repository -Create a folder (e.g., ~/deploy-test/teraflow/controller) to place the source code, move to that folder, clone the repository, and checkout the target branch you want to deploy (e.g., master or develop): - -mkdir -p ~/deploy-test/teraflow/controller; cd ~/deploy-test/teraflow/controller - -git clone https://gitlab.com/teraflow-h2020/controller.git . - -git checkout develop - - -## 2. Adapt deployment script -Find the script deploy_to_kubernetes.sh and modify the configuration settings at the top of the script according to your local Kubernetes environment. - - -## 3. Run the deployment script -Execute the script deploy_to_kubernetes.sh to build and deploy the components at your local Kubernetes environment. +Then, follow the instructions in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance) to deploy your instance of TeraFlow OS. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..20f197da064d771be1fa7fb37e3fd35ca48da26c --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + 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 2022 teraflow + + 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.md b/README.md index 77f581608a78940dd5f7f00f65dcbf7ae1d7fbc6..0336b9f6cdb9562ccff27d73f058d6293604de6b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TeraFlow OS SDN Controller +# TeraFlowSDN Controller [Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows @@ -7,4 +7,4 @@ Branch "master" : [![pipeline status](https://gitlab.com/teraflow-h2020/controll Branch "develop" : [![pipeline status](https://gitlab.com/teraflow-h2020/controller/badges/develop/pipeline.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop) [![coverage report](https://gitlab.com/teraflow-h2020/controller/badges/develop/coverage.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop) # Installation Instructions -To install TeraFlow OS SDN Controller in your local Kubernetes deployment, we assume you deployed Kubernetes following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](../../../wikis/Installing-Kubernetes-on-your-Linux-machine). Then, follow instructions in [INSTALL.md](./INSTALL.md). +For devel and upcoming release 2.0, we have prepared the following tutorial: [TeraFlowSDN tutorial](https://gitlab.com/teraflow-h2020/controller/-/tree/develop/tutorial). diff --git a/clean_testing_environment.sh b/clean_testing_environment.sh index 2cec5c5a4d290bf6fd5f314c4f37d2d7db0232ae..09bff95d82fe37a86d3a7c6569c6e3d0a00d64db 100755 --- a/clean_testing_environment.sh +++ b/clean_testing_environment.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + find . -iname __pycache__ | xargs -r rm -rf find . -iname .benchmarks | xargs -r rm -rf diff --git a/common_requirements.in b/common_requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..772c1115d857664ed113007b89a6f7f9d9c48b99 --- /dev/null +++ b/common_requirements.in @@ -0,0 +1,9 @@ +coverage==6.3 +grpcio==1.47.* +grpcio-health-checking==1.47.* +grpcio-tools==1.47.* +prometheus-client==0.13.0 +protobuf==3.20.* +pytest==6.2.5 +pytest-benchmark==3.4.1 +python-dateutil==2.8.2 diff --git a/data/.gitignore b/data/.gitignore index 6722cd96e785ac093e976a48df83409bf618b0a1..4507f94635b46c4364e46fefee8974870f678245 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1 +1,3 @@ +!.gitkeep +*.dot *.xml diff --git a/data/topo_nsfnet.json b/data/topo_nsfnet.json deleted file mode 100644 index f2cbb53a8f3f9648c4a8b60f97c2212485ac5cc9..0000000000000000000000000000000000000000 --- a/data/topo_nsfnet.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "topoId": { - "contextId": {"contextUuid": {"uuid": "default"}}, - "topoId": {"uuid": "topo0-nsfnet"} - }, - "device" : [ - {"device_id": {"device_id": {"uuid": "1" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "1" }}, "port_id": {"uuid" : "101"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "2" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "2" }}, "port_id": {"uuid" : "201"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "3" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "3" }}, "port_id": {"uuid" : "301"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "4" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "4" }}, "port_id": {"uuid" : "401"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "5" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "5" }}, "port_id": {"uuid" : "501"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "6" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "6" }}, "port_id": {"uuid" : "601"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "7" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "7" }}, "port_id": {"uuid" : "701"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "8" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "8" }}, "port_id": {"uuid" : "801"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "9" }}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "9" }}, "port_id": {"uuid" : "901"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "10"}}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "10"}}, "port_id": {"uuid" : "1001"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "11"}}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "11"}}, "port_id": {"uuid" : "1101"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "12"}}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "12"}}, "port_id": {"uuid" : "1201"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "13"}}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "13"}}, "port_id": {"uuid" : "1301"}}, "port_type": "LINE"} - ]}, - {"device_id": {"device_id": {"uuid": "14"}}, "device_type": "ROADM", "device_config": {"device_config": ""}, "devOperationalStatus": 1, "endpointList" : [ - {"port_id": {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "14"}}, "port_id": {"uuid" : "1401"}}, "port_type": "LINE"} - ]} - ], - "link" : [ - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "1" }}, "port_id": {"uuid": "101" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "2" }}, "port_id": {"uuid": "201" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "1" }}, "port_id": {"uuid": "101" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "3" }}, "port_id": {"uuid": "301" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "1" }}, "port_id": {"uuid": "101" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "8" }}, "port_id": {"uuid": "801" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "2" }}, "port_id": {"uuid": "201" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "3" }}, "port_id": {"uuid": "301" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "2" }}, "port_id": {"uuid": "201" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "4" }}, "port_id": {"uuid": "401" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "3" }}, "port_id": {"uuid": "301" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "6" }}, "port_id": {"uuid": "601" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "4" }}, "port_id": {"uuid": "401" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "5" }}, "port_id": {"uuid": "501" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "4" }}, "port_id": {"uuid": "401" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "11"}}, "port_id": {"uuid": "1101"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "5" }}, "port_id": {"uuid": "501" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "6" }}, "port_id": {"uuid": "601" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "5" }}, "port_id": {"uuid": "501" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "7" }}, "port_id": {"uuid": "701" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "6" }}, "port_id": {"uuid": "601" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "10"}}, "port_id": {"uuid": "1001"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "6" }}, "port_id": {"uuid": "601" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "13"}}, "port_id": {"uuid": "1301"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "7" }}, "port_id": {"uuid": "701" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "8" }}, "port_id": {"uuid": "801" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "8" }}, "port_id": {"uuid": "801" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "9" }}, "port_id": {"uuid": "901" }} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "9" }}, "port_id": {"uuid": "901" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "10"}}, "port_id": {"uuid": "1001"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "9" }}, "port_id": {"uuid": "901" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "12"}}, "port_id": {"uuid": "1201"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "9" }}, "port_id": {"uuid": "901" }}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "14"}}, "port_id": {"uuid": "1401"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "11"}}, "port_id": {"uuid": "1101"}}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "12"}}, "port_id": {"uuid": "1201"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "11"}}, "port_id": {"uuid": "1101"}}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "14"}}, "port_id": {"uuid": "1401"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "12"}}, "port_id": {"uuid": "1201"}}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "13"}}, "port_id": {"uuid": "1301"}} - ]}, - {"endpointList" : [ - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "13"}}, "port_id": {"uuid": "1301"}}, - {"topoId": {"topoId": {"uuid": "topo0-nsfnet"}}, "dev_id": {"device_id": {"uuid": "14"}}, "port_id": {"uuid": "1401"}} - ]} - ] -} diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..172889c07acdc2347b2dee2ddee8bf3061fdc53a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,236 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the URL of your local Docker registry where the images will be uploaded to. +# Leave it blank if you do not want to use any Docker registry. +export TFS_REGISTRY_IMAGE=${TFS_REGISTRY_IMAGE:-""} +#export TFS_REGISTRY_IMAGE="http://my-container-registry.local/" + +# If not already set, set the list of components you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} + +# If not already set, set the tag you want to use for your images. +export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +# If not already set, set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} + +# If not already set, set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +GITLAB_REPO_URL="registry.gitlab.com/teraflow-h2020/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +echo "Deleting and Creating a new namespace..." +kubectl delete namespace $TFS_K8S_NAMESPACE +kubectl create namespace $TFS_K8S_NAMESPACE +printf "\n" + +if [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then + echo "Creating secrets for InfluxDB..." + #TODO: make sure to change this when having a production deployment + kubectl create secret generic influxdb-secrets --namespace=$TFS_K8S_NAMESPACE \ + --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" \ + --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" + kubectl create secret generic monitoring-secrets --namespace=$TFS_K8S_NAMESPACE \ + --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" \ + --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" + printf "\n" +fi + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh +echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT + +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$TFS_IMAGE_TAG" + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGE/$IMAGE_NAME" | sed 's,//,/,g' | sed 's,http:/,,g') + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + else + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" + fi + + if [ -n "$TFS_REGISTRY_IMAGE" ]; then + echo " Pushing Docker image to '$TFS_REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + + if [ -n "$TFS_REGISTRY_IMAGE" ]; then + # Registry is set + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + else + # Registry is not set + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + fi + + echo " Deploying '$COMPONENT' component to Kubernetes..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" + kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +echo "Deploying extra manifests..." +for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $TFS_COMPONENTS; do + echo "Waiting for '$COMPONENT' component..." + kubectl wait --namespace $TFS_K8S_NAMESPACE \ + --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + +if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + sleep 3 + + INFLUXDB_HOST="monitoringservice" + INFLUXDB_PORT=$(kubectl --namespace $TFS_K8S_NAMESPACE get service/monitoringservice -o jsonpath='{.spec.ports[?(@.name=="influxdb")].port}') + INFLUXDB_URL="http://${INFLUXDB_HOST}:${INFLUXDB_PORT}" + INFLUXDB_USER=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) + INFLUXDB_PASSWORD=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) + INFLUXDB_DATABASE=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) + + # Exposed through the ingress controller "tfs-ingress" + GRAFANA_HOSTNAME="127.0.0.1" + GRAFANA_PORT="80" + GRAFANA_BASEURL="/grafana" + + # Default Grafana credentials + GRAFANA_USERNAME="admin" + GRAFANA_PASSWORD="admin" + + # Default Grafana API URL + GRAFANA_URL_DEFAULT="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}${GRAFANA_BASEURL}" + + # Updated Grafana API URL + GRAFANA_URL_UPDATED="http://${GRAFANA_USERNAME}:${TFS_GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}${GRAFANA_BASEURL}" + + echo "Connecting to grafana at URL: ${GRAFANA_URL_DEFAULT}..." + + # Configure Grafana Admin Password + # Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password + curl -X PUT -H "Content-Type: application/json" -d '{ + "oldPassword": "'${GRAFANA_PASSWORD}'", + "newPassword": "'${TFS_GRAFANA_PASSWORD}'", + "confirmNew" : "'${TFS_GRAFANA_PASSWORD}'" + }' ${GRAFANA_URL_DEFAULT}/api/user/password + echo + + # Create InfluxDB DataSource + # Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ + curl -X POST -H "Content-Type: application/json" -d '{ + "type" : "influxdb", + "name" : "InfluxDB", + "url" : "'"$INFLUXDB_URL"'", + "access" : "proxy", + "basicAuth": false, + "user" : "'"$INFLUXDB_USER"'", + "password" : "'"$INFLUXDB_PASSWORD"'", + "isDefault": true, + "database" : "'"$INFLUXDB_DATABASE"'" + }' ${GRAFANA_URL_UPDATED}/api/datasources + echo + + # Create Monitoring Dashboard + # Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/ + curl -X POST -H "Content-Type: application/json" \ + -d '@src/webui/grafana_dashboard.json' \ + ${GRAFANA_URL_UPDATED}/api/dashboards/db + echo + + DASHBOARD_URL="${GRAFANA_URL_UPDATED}/api/dashboards/uid/tf-l3-monit" + DASHBOARD_ID=$(curl -s "${DASHBOARD_URL}" | jq '.dashboard.id') + curl -X POST ${GRAFANA_URL_UPDATED}/api/user/stars/dashboard/${DASHBOARD_ID} + + printf "\n\n" +fi + +./show_deploy.sh + +echo "Done!" diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh new file mode 100755 index 0000000000000000000000000000000000000000..8a4c837406d06ae8971a4d6ab2c5a8ae30cfc87f --- /dev/null +++ b/expose_ingress_grpc.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +# If not already set, set the list of components you want to build images for, and deploy. +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Exposing GRPC ports for components..." +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + + SERVICE_GRPC_PORT=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.name=="grpc")].port}') + if [ -z "${SERVICE_GRPC_PORT}" ]; then + printf "\n" + continue; + fi + + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + PATCH='{"data": {"'${SERVICE_GRPC_PORT}'": "'$TFS_K8S_NAMESPACE'/'${COMPONENT_OBJNAME}service':'${SERVICE_GRPC_PORT}'"}}' + #echo "PATCH: ${PATCH}" + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${SERVICE_GRPC_PORT}', "hostPort": '${SERVICE_GRPC_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + #echo "PATCH: ${PATCH}" + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + + printf "\n" +done + +echo "Done!" diff --git a/install_development_dependencies.sh b/install_development_dependencies.sh deleted file mode 100755 index f995c4a748c792a0d0e86d200e8d0af27c8c000e..0000000000000000000000000000000000000000 --- a/install_development_dependencies.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# installing basic tools -pip install --upgrade pip setuptools wheel pip-tools pylint pytest pytest-benchmark coverage grpcio-tools - -# creating an empty file -echo "" > requirements.in - -#TODO: include here your component -COMPONENTS="compute context device monitoring centralizedattackdetector opticalcentralizedattackdetector opticalattackmitigator dbscanserving" - -# compiling dependencies from all components -for component in $COMPONENTS -do - echo "computing requirements for component $component" - diff requirements.in src/$component/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in -done - -pip-compile --output-file=requirements.txt requirements.in -python -m pip install -r requirements.txt - -# removing the temporary files -rm requirements.in -rm requirements.txt diff --git a/install_requirements.sh b/install_requirements.sh new file mode 100755 index 0000000000000000000000000000000000000000..ea9385729a6199be29926e4c13b6a05152446155 --- /dev/null +++ b/install_requirements.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# If not already set, set the list of components you want to install dependencies for. +# By default, dependencies for all components are installed. +# Components still not supported by this script: +# automation & policy : implemented in Java +# dlt : under design +# pathcomp : under design +ALL_COMPONENTS="context device service compute monitoring webui interdomain slice" +ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalcentralizedattackdetector" +ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector" +TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS} + +echo "Updating PIP, SetupTools and Wheel..." +pip install --upgrade pip # ensure next packages get the latest versions +pip install --upgrade setuptools wheel # bring basic tooling for other requirements +pip install --upgrade pip-tools pylint # bring tooling for package compilation and code linting +printf "\n" + +echo "Creating integrated requirements file..." +touch requirements.in +diff requirements.in common_requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in +printf "\n" + +echo "Collecting requirements from components..." +for COMPONENT in $TFS_COMPONENTS +do + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi + diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in +done +printf "\n" + +echo "Compiling requirements..." +# Done in a single step to prevent breaking dependencies between components +pip-compile --quiet --output-file=requirements.txt requirements.in +printf "\n" + +echo "Installing requirements..." +python -m pip install -r requirements.txt +printf "\n" + +#echo "Removing the temporary files..." +rm requirements.in +rm requirements.txt +printf "\n" diff --git a/manifests/.gitignore b/manifests/.gitignore index 7ca2c51d3ca0ade4160bd94025769882bce3fb08..74cb209abec0711bfa467772708b137606e98b9a 100644 --- a/manifests/.gitignore +++ b/manifests/.gitignore @@ -1,4 +1,4 @@ # Internal manifest used for local testings. # CTTC section: -cttc-ols.yaml +cttc-ols/ diff --git a/manifests/.gitlab-ci.yml b/manifests/.gitlab-ci.yml index 9fc872ca61752d1be012aa4b866b3b592171e2cd..d20b67e531c33bfeae9c796ed95488b4c81d0fe4 100644 --- a/manifests/.gitlab-ci.yml +++ b/manifests/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # Deployment of the dependency services in Kubernetes Cluster dependencies all: diff --git a/manifests/centralizedattackdetectorservice.yaml b/manifests/centralizedattackdetectorservice.yaml deleted file mode 100644 index faf42a5550098c9e73d19e2587cc508dbd3cf7be..0000000000000000000000000000000000000000 --- a/manifests/centralizedattackdetectorservice.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: centralizedattackdetectorervice -spec: - selector: - matchLabels: - app: centralizedattackdetectorervice - template: - metadata: - labels: - app: centralizedattackdetectorervice - spec: - terminationGracePeriodSeconds: 5 - containers: - - name: server - image: registry.gitlab.com/teraflow-h2020/controller/centralizedcybersecurity:latest - imagePullPolicy: Always - ports: - - containerPort: 10000 - env: - - name: DB_ENGINE - value: "redis" - - name: REDIS_DATABASE_ID - value: "0" - - name: LOG_LEVEL - value: "DEBUG" - readinessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:10000"] - livenessProbe: - exec: - command: ["/bin/grpc_health_probe", "-addr=:10000"] - resources: - requests: - cpu: 250m - memory: 512Mi - limits: - cpu: 700m - memory: 1024Mi ---- -apiVersion: v1 -kind: Service -metadata: - name: centralizedattackdetectorervice -spec: - type: ClusterIP - selector: - app: centralizedattackdetectorervice - ports: - - name: grpc - port: 10000 - targetPort: 10000 ---- -apiVersion: v1 -kind: Service -metadata: - name: centralizedattackdetectorervice-public - labels: - app: centralizedattackdetectorervice -spec: - type: NodePort - selector: - app: centralizedattackdetectorervice - ports: - - name: grpc - protocol: TCP - port: 10000 - targetPort: 10000 ---- diff --git a/manifests/computeservice.yaml b/manifests/computeservice.yaml index cdca52eb890d832cfb56457b89d44a045ee4af57..0c8d0a6724a49f4dec0f903570ff04e49cb4e793 100644 --- a/manifests/computeservice.yaml +++ b/manifests/computeservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -17,10 +31,11 @@ spec: image: registry.gitlab.com/teraflow-h2020/controller/compute:latest imagePullPolicy: Always ports: + - containerPort: 8080 - containerPort: 9090 env: - name: LOG_LEVEL - value: "DEBUG" + value: "INFO" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:9090"] @@ -44,23 +59,11 @@ spec: selector: app: computeservice ports: - - name: grpc - port: 9090 - targetPort: 9090 ---- -apiVersion: v1 -kind: Service -metadata: - name: computeservice-public - labels: - app: computeservice -spec: - type: NodePort - selector: - app: computeservice - ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 - name: grpc protocol: TCP port: 9090 targetPort: 9090 ---- diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml index c0ea046e0ae1d9e4bb6b6a70de5a8b26844981fc..04da586dfeb25a01a6f5267aa31441498ce4f2cc 100644 --- a/manifests/contextservice.yaml +++ b/manifests/contextservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -34,12 +48,14 @@ spec: env: - name: DB_BACKEND value: "redis" + - name: MB_BACKEND + value: "redis" - name: REDIS_DATABASE_ID value: "0" - name: LOG_LEVEL value: "INFO" - name: POPULATE_FAKE_DATA - value: "true" + value: "false" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:1010"] @@ -64,25 +80,10 @@ spec: app: contextservice ports: - name: grpc + protocol: TCP port: 1010 targetPort: 1010 - - name: http - port: 8080 - targetPort: 8080 ---- -apiVersion: v1 -kind: Service -metadata: - name: contextservice-public - labels: - app: contextservice -spec: - type: NodePort - selector: - app: contextservice - ports: - name: http protocol: TCP port: 8080 targetPort: 8080 ---- diff --git a/manifests/dbscanservingservice.yaml b/manifests/dbscanservingservice.yaml index ca8982db25f0fe94588418dc67787f63babc9826..9553ed556bddaa437d89881f0c4220ae6e418239 100644 --- a/manifests/dbscanservingservice.yaml +++ b/manifests/dbscanservingservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -47,20 +61,3 @@ spec: - name: grpc port: 10006 targetPort: 10006 ---- -apiVersion: v1 -kind: Service -metadata: - name: dbscanservingservice-public - labels: - app: dbscanservingservice -spec: - type: NodePort - selector: - app: dbscanservingservice - ports: - - name: http - protocol: TCP - port: 10006 - targetPort: 10006 ---- diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index 35c19279027ca7bed1f0ab79a9c34a44b1e50e3c..171394f7c43b2447e898902c78d5276fe1bcbc7c 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -20,7 +34,7 @@ spec: - containerPort: 2020 env: - name: LOG_LEVEL - value: "DEBUG" + value: "INFO" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:2020"] diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca30da0101659f801440af343e42851146d17bda --- /dev/null +++ b/manifests/interdomainservice.yaml @@ -0,0 +1,64 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: interdomainservice +spec: + selector: + matchLabels: + app: interdomainservice + template: + metadata: + labels: + app: interdomainservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/interdomain:latest + imagePullPolicy: Always + ports: + - containerPort: 10010 + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: interdomainservice +spec: + type: ClusterIP + selector: + app: interdomainservice + ports: + - name: grpc + protocol: TCP + port: 10010 + targetPort: 10010 diff --git a/manifests/l3_attackmitigatorservice.yaml b/manifests/l3_attackmitigatorservice.yaml index 7ac91b02fd2b3be51a9e810ae194fb0d7a9bf0d7..2240776ebb2e234b58febe9520a4b9e07d42b6d4 100644 --- a/manifests/l3_attackmitigatorservice.yaml +++ b/manifests/l3_attackmitigatorservice.yaml @@ -1,20 +1,34 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: - name: attackmitigatorservice + name: l3-attackmitigatorservice spec: selector: matchLabels: - app: attackmitigatorservice + app: l3-attackmitigatorservice template: metadata: labels: - app: attackmitigatorservice + app: l3-attackmitigatorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/attackmitigator:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_attackmitigator:latest imagePullPolicy: Always ports: - containerPort: 10002 @@ -38,11 +52,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: attackmitigatorservice + name: l3-attackmitigatorservice spec: type: ClusterIP selector: - app: attackmitigatorservice + app: l3-attackmitigatorservice ports: - name: grpc port: 10002 diff --git a/manifests/l3_centralizedattackdetectorservice.yaml b/manifests/l3_centralizedattackdetectorservice.yaml index 4b4b629294dc72f0d158b923364bb65d559df624..fa7ee9dccd99982d35d7f7705e463ecee30c7c9b 100644 --- a/manifests/l3_centralizedattackdetectorservice.yaml +++ b/manifests/l3_centralizedattackdetectorservice.yaml @@ -1,20 +1,34 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: - name: centralizedattackdetectorservice + name: l3-centralizedattackdetectorservice spec: selector: matchLabels: - app: centralizedattackdetectorservice + app: l3-centralizedattackdetectorservice template: metadata: labels: - app: centralizedattackdetectorservice + app: l3-centralizedattackdetectorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/centralizedattackdetector:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_centralizedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10001 @@ -38,11 +52,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: centralizedattackdetectorservice + name: l3-centralizedattackdetectorservice spec: type: ClusterIP selector: - app: centralizedattackdetectorservice + app: l3-centralizedattackdetectorservice ports: - name: grpc port: 10001 diff --git a/manifests/l3_distributedattackdetectorservice.yaml b/manifests/l3_distributedattackdetectorservice.yaml index 22157d9a4e9faa3af6ea76c6212c7914a0868726..6b28f68dd5e08561eb29e4512af330b26f6408cf 100644 --- a/manifests/l3_distributedattackdetectorservice.yaml +++ b/manifests/l3_distributedattackdetectorservice.yaml @@ -1,20 +1,34 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: - name: distributedattackdetectorservice + name: l3-distributedattackdetectorservice spec: selector: matchLabels: - app: distributedattackdetectorservice + app: l3-distributedattackdetectorservice template: metadata: labels: - app: distributedattackdetectorservice + app: l3-distributedattackdetectorservice spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/distributedattackdetector:latest + image: registry.gitlab.com/teraflow-h2020/controller/l3_distributedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10000 @@ -38,11 +52,11 @@ spec: apiVersion: v1 kind: Service metadata: - name: distributedattackdetectorservice + name: l3-distributedattackdetectorservice spec: type: ClusterIP selector: - app: distributedattackdetectorservice + app: l3-distributedattackdetectorservice ports: - name: grpc port: 10000 diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml index ca5f7108860570044fed9b149ec500c547010f9c..7f0bee9efc68e66c72487624241e763dccb2fc76 100644 --- a/manifests/monitoringservice.yaml +++ b/manifests/monitoringservice.yaml @@ -1,33 +1,51 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: - name: monitoring + name: monitoringservice spec: selector: matchLabels: - app: monitoring + app: monitoringservice replicas: 1 template: metadata: labels: - app: monitoring + app: monitoringservice spec: terminationGracePeriodSeconds: 5 restartPolicy: Always containers: - - name: influxdb - image: influxdb:1.8 + - name: metricsdb + image: questdb/questdb ports: - - containerPort: 8086 - envFrom: - - secretRef: - name: influxdb-secrets + - containerPort: 9000 + - containerPort: 9009 + - containerPort: 9003 + env: + - name: QDB_CAIRO_COMMIT_LAG + value: "1000" + - name: QDB_CAIRO_MAX_UNCOMMITTED_ROWS + value: "100000" readinessProbe: exec: - command: ["curl", "-XGET", "localhost:8086/health"] + command: ["curl", "-XGET", "localhost:9000"] livenessProbe: exec: - command: ["curl", "-XGET", "localhost:8086/health"] + command: ["curl", "-XGET", "localhost:9003/metrics"] resources: requests: cpu: 250m @@ -40,9 +58,15 @@ spec: imagePullPolicy: Always ports: - containerPort: 7070 - envFrom: - - secretRef: - name: monitoring-secrets + env: + - name: METRICSDB_HOSTNAME + value: "localhost" + - name: METRICSDB_ILP_PORT + value: "9009" + - name: METRICSDB_REST_PORT + value: "9000" + - name: METRICSDB_TABLE + value: "monitoring" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:7070"] @@ -56,22 +80,22 @@ spec: limits: cpu: 700m memory: 1024Mi + --- apiVersion: v1 kind: Service metadata: - name: monitoring + name: monitoringservice spec: type: ClusterIP selector: - app: monitoring + app: monitoringservice ports: - name: grpc protocol: TCP port: 7070 targetPort: 7070 - - name: influxdb + - name: questdb protocol: TCP - port: 8086 - targetPort: 8086 ---- \ No newline at end of file + port: 9000 + targetPort: 9000 \ No newline at end of file diff --git a/manifests/nginx_ingress_http.yaml b/manifests/nginx_ingress_http.yaml new file mode 100644 index 0000000000000000000000000000000000000000..50ff81c79eaa02647562456809226d1aed847204 --- /dev/null +++ b/manifests/nginx_ingress_http.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/manifests/opticalattackmitigatorservice.yaml b/manifests/opticalattackmitigatorservice.yaml index 1cc03ba0575edcc66e1cf3f9b57fd161a763a696..afe2e4069fbae2fd3b5300da614b4deb5d785fab 100644 --- a/manifests/opticalattackmitigatorservice.yaml +++ b/manifests/opticalattackmitigatorservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -47,20 +61,3 @@ spec: - name: grpc port: 10007 targetPort: 10007 ---- -apiVersion: v1 -kind: Service -metadata: - name: opticalattackmitigatorservice-public - labels: - app: opticalattackmitigatorservice -spec: - type: NodePort - selector: - app: opticalattackmitigatorservice - ports: - - name: http - protocol: TCP - port: 10007 - targetPort: 10007 ---- diff --git a/manifests/opticalcentralizedattackdetectorservice.yaml b/manifests/opticalcentralizedattackdetectorservice.yaml index d3ceb3ea49ac1421e14faf00dbb81b1fdaff5537..664bcb54348e533ff40c7f882b5668f727a39053 100644 --- a/manifests/opticalcentralizedattackdetectorservice.yaml +++ b/manifests/opticalcentralizedattackdetectorservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -47,20 +61,3 @@ spec: - name: grpc port: 10005 targetPort: 10005 ---- -apiVersion: v1 -kind: Service -metadata: - name: opticalcentralizedattackdetectorservice-public - labels: - app: opticalcentralizedattackdetectorservice -spec: - type: NodePort - selector: - app: opticalcentralizedattackdetectorservice - ports: - - name: grpc - protocol: TCP - port: 10005 - targetPort: 10005 ---- diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b5316e22f1eefd4177ae33f4fc89da256f65bff8 --- /dev/null +++ b/manifests/pathcompservice.yaml @@ -0,0 +1,64 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pathcompservice +spec: + selector: + matchLabels: + app: pathcompservice + template: + metadata: + labels: + app: pathcompservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/pathcomp:latest + imagePullPolicy: Always + ports: + - containerPort: 10020 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10020"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10020"] + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: pathcompservice +spec: + type: ClusterIP + selector: + app: pathcompservice + ports: + - name: grpc + protocol: TCP + port: 10020 + targetPort: 10020 diff --git a/manifests/prometheus.yaml b/manifests/prometheus.yaml index 72e2e65c8c8b266ebdfef974c6795d12f1c682c4..221123eea5cf8ba61d078ccfccd697d7c6c01127 100644 --- a/manifests/prometheus.yaml +++ b/manifests/prometheus.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + --- kind: ConfigMap apiVersion: v1 diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml index 72fd1c61564831f61bdf78aa494092829f0dd676..75832b94fa2a6ba97617641e7b249157508614bf 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + apiVersion: apps/v1 kind: Deployment metadata: @@ -19,12 +33,8 @@ spec: ports: - containerPort: 3030 env: - - name: DB_ENGINE - value: "redis" - - name: REDIS_DATABASE_ID - value: "0" - name: LOG_LEVEL - value: "DEBUG" + value: "INFO" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:3030"] diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eeed3776c10958751b74fc81b52ab79806153b18 --- /dev/null +++ b/manifests/sliceservice.yaml @@ -0,0 +1,64 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sliceservice +spec: + selector: + matchLabels: + app: sliceservice + template: + metadata: + labels: + app: sliceservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/slice:latest + imagePullPolicy: Always + ports: + - containerPort: 4040 + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: sliceservice +spec: + type: ClusterIP + selector: + app: sliceservice + ports: + - name: grpc + protocol: TCP + port: 4040 + targetPort: 4040 diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..52fc75a9868001d50f7380cfe238fa344de27f6e --- /dev/null +++ b/manifests/webuiservice.yaml @@ -0,0 +1,115 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webuiservice +spec: + selector: + matchLabels: + app: webuiservice + template: + metadata: + labels: + app: webuiservice + spec: + terminationGracePeriodSeconds: 5 + securityContext: + fsGroup: 472 + supplementalGroups: + - 0 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/webui:latest + imagePullPolicy: Always + ports: + - containerPort: 8004 # TODO: define the real port + env: + - name: LOG_LEVEL + value: "DEBUG" + - name: WEBUISERVICE_SERVICE_BASEURL_HTTP + value: "/webui" + readinessProbe: + httpGet: + path: /healthz/ready + port: 8004 + initialDelaySeconds: 5 + timeoutSeconds: 1 + livenessProbe: + httpGet: + path: /healthz/live + port: 8004 + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi + - name: grafana + image: grafana/grafana:8.2.6 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + name: http-grafana + protocol: TCP + env: + - name: GF_SERVER_ROOT_URL + value: "http://0.0.0.0:3000/grafana/" + - name: GF_SERVER_SERVE_FROM_SUB_PATH + value: "true" + readinessProbe: + failureThreshold: 3 + httpGet: + path: /robots.txt + port: 3000 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 2 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 750Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice +spec: + type: ClusterIP + selector: + app: webuiservice + ports: + - name: webui + port: 8004 + targetPort: 8004 + - name: grafana + port: 3000 + targetPort: 3000 diff --git a/my_deploy.sh b/my_deploy.sh new file mode 100644 index 0000000000000000000000000000000000000000..67a2e0558c25d767e14b635e6dd9174433827156 --- /dev/null +++ b/my_deploy.sh @@ -0,0 +1,22 @@ +# Set the URL of your local Docker registry where the images will be uploaded to. +export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" + +# Set the list of components, separated by comas, you want to build images for, and deploy. +# Supported components are: +# context device automation policy service compute monitoring webui +# interdomain slice pathcomp dlt +# dbscanserving opticalattackmitigator opticalcentralizedattackdetector +# l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector +export TFS_COMPONENTS="context device automation service compute monitoring webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" diff --git a/oeccpsc22 b/oeccpsc22 new file mode 120000 index 0000000000000000000000000000000000000000..4f55befad3e8730c8b7eb1a4cf2fbc7600d1878b --- /dev/null +++ b/oeccpsc22 @@ -0,0 +1 @@ +src/tests/oeccpsc22/ \ No newline at end of file diff --git a/ofc22 b/ofc22 new file mode 120000 index 0000000000000000000000000000000000000000..1102ec2a635bd3fcc1142dd2982d4e3224ccaca5 --- /dev/null +++ b/ofc22 @@ -0,0 +1 @@ +src/tests/ofc22/ \ No newline at end of file diff --git a/open_dashboard.sh b/open_dashboard.sh new file mode 100755 index 0000000000000000000000000000000000000000..8291a22c75cd2c2b83bedcab2ac0167c56c966a6 --- /dev/null +++ b/open_dashboard.sh @@ -0,0 +1,29 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +#/bin/bash + +# this script opens the dashboard + +K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} + +GRAFANA_IP=$(kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}') +GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') +URL=http://${GRAFANA_IP}:${GRAFANA_PORT} + +echo Opening Dashboard on URL ${URL} + +# curl -kL ${URL} + +python3 -m webbrowser ${URL} diff --git a/open_webui.sh b/open_webui.sh new file mode 100755 index 0000000000000000000000000000000000000000..e4dfdb709ef5008091f3f73357087272dfd7c34e --- /dev/null +++ b/open_webui.sh @@ -0,0 +1,37 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# this script opens the webui + +K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} + +WEBUI_SERVICE_NAME="webuiservice-public" +WEBUI_PROTO=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[0].name}'` +WEBUI_IP=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` +# WEBUI_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8004)].nodePort}') +WEBUI_PORT=8004 +# GRAFANA_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') +GRAFANA_PORT=3000 + +# Open WebUI +URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT} +echo Opening web UI on URL ${URL} +# curl -kL ${URL} +python3 -m webbrowser ${URL} + +# Open Dashboard +URL=${WEBUI_PROTO}://${WEBUI_IP}:${GRAFANA_PORT} +echo Opening Dashboard on URL ${URL} +# curl -kL ${URL} +python3 -m webbrowser ${URL} diff --git a/proto/.gitignore b/proto/.gitignore index 79d17a55d24e501e34b462c9005e8e5429fc43ba..d1dea37b3a85abaa18b5bd65d3ec0e1d3c6fe9b6 100644 --- a/proto/.gitignore +++ b/proto/.gitignore @@ -1,2 +1,7 @@ -src/ +src/*/* + +# used to prevent breaking symbolic links from source code folders +!src/*/.gitignore +!src/python/__init__.py + uml/generated diff --git a/proto/acl.proto b/proto/acl.proto new file mode 100644 index 0000000000000000000000000000000000000000..d3717e9c4cdcf978324d08757b260ab1e9be028a --- /dev/null +++ b/proto/acl.proto @@ -0,0 +1,69 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package acl; + +enum AclRuleTypeEnum { + ACLRULETYPE_UNDEFINED = 0; + ACLRULETYPE_IPV4 = 1; + ACLRULETYPE_IPV6 = 2; + ACLRULETYPE_L2 = 3; + ACLRULETYPE_MPLS = 4; + ACLRULETYPE_MIXED = 5; +} + +enum AclForwardActionEnum { + ACLFORWARDINGACTION_UNDEFINED = 0; + ACLFORWARDINGACTION_DROP = 1; + ACLFORWARDINGACTION_ACCEPT = 2; + ACLFORWARDINGACTION_REJECT = 3; +} + +enum AclLogActionEnum { + ACLLOGACTION_UNDEFINED = 0; + ACLLOGACTION_NOLOG = 1; + ACLLOGACTION_SYSLOG = 2; +} + +message AclMatch { + uint32 dscp = 1; + uint32 protocol = 2; + string src_address = 3; + string dst_address = 4; + uint32 src_port = 5; + uint32 dst_port = 6; + uint32 start_mpls_label = 7; + uint32 end_mpls_label = 8; +} + +message AclAction { + AclForwardActionEnum forward_action = 1; + AclLogActionEnum log_action = 2; +} + +message AclEntry { + uint32 sequence_id = 1; + string description = 2; + AclMatch match = 3; + AclAction action = 4; +} + +message AclRuleSet { + string name = 1; + AclRuleTypeEnum type = 2; + string description = 3; + string user_id = 4; + repeated AclEntry entries = 5; +} diff --git a/proto/attack_mitigator.proto b/proto/attack_mitigator.proto index b65857f3b1a2ab86289735704c14ddc89e30d3d7..e538a9d2e62f7bc0cf91497b6b13414c36e1bc41 100644 --- a/proto/attack_mitigator.proto +++ b/proto/attack_mitigator.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + // protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 syntax = "proto3"; package attack_mitigator; diff --git a/proto/automation.proto b/proto/automation.proto index 95526d36d75047f0f351d77b2dfa760934883dfc..f41bef9e28588fbd2a0acf416d347eb530c48df0 100644 --- a/proto/automation.proto +++ b/proto/automation.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package automation; @@ -9,7 +23,7 @@ service AutomationService { rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {} rpc ZtpUpdate(DeviceRole) returns (DeviceRoleState) {} rpc ZtpDelete(DeviceRole) returns (DeviceRoleState) {} - rpc ZtpDeleteAll(Empty) returns (DeviceDeletionResult) {} + rpc ZtpDeleteAll(context.Empty) returns (DeviceDeletionResult) {} } enum DeviceRoleType { @@ -42,8 +56,6 @@ message DeviceDeletionResult { repeated string deleted = 1; } -message Empty {} - enum ZtpDeviceState { ZTP_DEV_STATE_UNDEFINED = 0; ZTP_DEV_STATE_CREATED = 1; diff --git a/proto/centralized_attack_detector.proto b/proto/centralized_attack_detector.proto index b2547fae525e757b31d3192fc970a53f8af1042d..4ce34cfa443b67aa8d060802dca6c9c29b2f7087 100644 --- a/proto/centralized_attack_detector.proto +++ b/proto/centralized_attack_detector.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + // protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 syntax = "proto3"; package centralized_attack_detector; diff --git a/proto/compile.sh b/proto/compile.sh deleted file mode 100755 index 9a28ac860259c57a25cd304a9089451c2a08525d..0000000000000000000000000000000000000000 --- a/proto/compile.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -python3 -m grpc_tools.protoc -I=./ --python_out=../src/ --grpc_python_out=../src/ *.proto -#requires installation of protoc-gen-uml -export PATH=${HOME}/protoc-gen-uml/target/universal/stage/bin:$PATH -protoc --uml_out=uml/ -I ./ *.proto -cd uml -java -jar plantuml.7997.jar *.puml -rm *.puml - - diff --git a/proto/compute.proto b/proto/compute.proto index a44bde55ef94b5b4a827a4724e81c29e07a7e421..0e7c7a7386b5c8d5924f93745bc9aa3039b60703 100644 --- a/proto/compute.proto +++ b/proto/compute.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package compute; diff --git a/proto/context.proto b/proto/context.proto index 27c5f2233afb08ef27bab8643b1f53cf4df15308..866876175f108c056f7e35c6457a1bf48a226a9c 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -1,43 +1,72 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package context; +import "acl.proto"; import "kpi_sample_types.proto"; service ContextService { - rpc ListContextIds (Empty ) returns ( ContextIdList ) {} - rpc ListContexts (Empty ) returns ( ContextList ) {} - rpc GetContext (ContextId ) returns ( Context ) {} - rpc SetContext (Context ) returns ( ContextId ) {} - rpc RemoveContext (ContextId ) returns ( Empty ) {} - rpc GetContextEvents (Empty ) returns (stream ContextEvent ) {} - - rpc ListTopologyIds (ContextId ) returns ( TopologyIdList) {} - rpc ListTopologies (ContextId ) returns ( TopologyList ) {} - rpc GetTopology (TopologyId) returns ( Topology ) {} - rpc SetTopology (Topology ) returns ( TopologyId ) {} - rpc RemoveTopology (TopologyId) returns ( Empty ) {} - rpc GetTopologyEvents(Empty ) returns (stream TopologyEvent ) {} - - rpc ListDeviceIds (Empty ) returns ( DeviceIdList ) {} - rpc ListDevices (Empty ) returns ( DeviceList ) {} - rpc GetDevice (DeviceId ) returns ( Device ) {} - rpc SetDevice (Device ) returns ( DeviceId ) {} - rpc RemoveDevice (DeviceId ) returns ( Empty ) {} - rpc GetDeviceEvents (Empty ) returns (stream DeviceEvent ) {} - - rpc ListLinkIds (Empty ) returns ( LinkIdList ) {} - rpc ListLinks (Empty ) returns ( LinkList ) {} - rpc GetLink (LinkId ) returns ( Link ) {} - rpc SetLink (Link ) returns ( LinkId ) {} - rpc RemoveLink (LinkId ) returns ( Empty ) {} - rpc GetLinkEvents (Empty ) returns (stream LinkEvent ) {} - - rpc ListServiceIds (ContextId ) returns ( ServiceIdList ) {} - rpc ListServices (ContextId ) returns ( ServiceList ) {} - rpc GetService (ServiceId ) returns ( Service ) {} - rpc SetService (Service ) returns ( ServiceId ) {} - rpc RemoveService (ServiceId ) returns ( Empty ) {} - rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} + rpc ListContextIds (Empty ) returns ( ContextIdList ) {} + rpc ListContexts (Empty ) returns ( ContextList ) {} + rpc GetContext (ContextId ) returns ( Context ) {} + rpc SetContext (Context ) returns ( ContextId ) {} + rpc RemoveContext (ContextId ) returns ( Empty ) {} + rpc GetContextEvents (Empty ) returns (stream ContextEvent ) {} + + rpc ListTopologyIds (ContextId ) returns ( TopologyIdList ) {} + rpc ListTopologies (ContextId ) returns ( TopologyList ) {} + rpc GetTopology (TopologyId ) returns ( Topology ) {} + rpc SetTopology (Topology ) returns ( TopologyId ) {} + rpc RemoveTopology (TopologyId ) returns ( Empty ) {} + rpc GetTopologyEvents (Empty ) returns (stream TopologyEvent ) {} + + rpc ListDeviceIds (Empty ) returns ( DeviceIdList ) {} + rpc ListDevices (Empty ) returns ( DeviceList ) {} + rpc GetDevice (DeviceId ) returns ( Device ) {} + rpc SetDevice (Device ) returns ( DeviceId ) {} + rpc RemoveDevice (DeviceId ) returns ( Empty ) {} + rpc GetDeviceEvents (Empty ) returns (stream DeviceEvent ) {} + + rpc ListLinkIds (Empty ) returns ( LinkIdList ) {} + rpc ListLinks (Empty ) returns ( LinkList ) {} + rpc GetLink (LinkId ) returns ( Link ) {} + rpc SetLink (Link ) returns ( LinkId ) {} + rpc RemoveLink (LinkId ) returns ( Empty ) {} + rpc GetLinkEvents (Empty ) returns (stream LinkEvent ) {} + + rpc ListServiceIds (ContextId ) returns ( ServiceIdList ) {} + rpc ListServices (ContextId ) returns ( ServiceList ) {} + rpc GetService (ServiceId ) returns ( Service ) {} + rpc SetService (Service ) returns ( ServiceId ) {} + rpc RemoveService (ServiceId ) returns ( Empty ) {} + rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} + + rpc ListSliceIds (ContextId ) returns ( SliceIdList ) {} + rpc ListSlices (ContextId ) returns ( SliceList ) {} + rpc GetSlice (SliceId ) returns ( Slice ) {} + rpc SetSlice (Slice ) returns ( SliceId ) {} + rpc RemoveSlice (SliceId ) returns ( Empty ) {} + rpc GetSliceEvents (Empty ) returns (stream SliceEvent ) {} + + rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {} + rpc ListConnections (ServiceId ) returns ( ConnectionList ) {} + rpc GetConnection (ConnectionId) returns ( Connection ) {} + rpc SetConnection (Connection ) returns ( ConnectionId ) {} + rpc RemoveConnection (ConnectionId) returns ( Empty ) {} + rpc GetConnectionEvents(Empty ) returns (stream ConnectionEvent ) {} } // ----- Generic ------------------------------------------------------------------------------------------------------- @@ -54,8 +83,12 @@ enum EventTypeEnum { EVENTTYPE_REMOVE = 3; } -message Event { +message Timestamp { double timestamp = 1; +} + +message Event { + Timestamp timestamp = 1; EventTypeEnum event_type = 2; } @@ -195,6 +228,7 @@ message Service { repeated Constraint service_constraints = 4; ServiceStatus service_status = 5; ServiceConfig service_config = 6; + Timestamp timestamp = 7; } enum ServiceTypeEnum { @@ -209,6 +243,7 @@ enum ServiceStatusEnum { SERVICESTATUS_PLANNED = 1; SERVICESTATUS_ACTIVE = 2; SERVICESTATUS_PENDING_REMOVAL = 3; + SERVICESTATUS_SLA_VIOLATED = 4; } message ServiceStatus { @@ -232,6 +267,120 @@ message ServiceEvent { ServiceId service_id = 2; } +// ----- Slice --------------------------------------------------------------------------------------------------------- +message SliceId { + ContextId context_id = 1; + Uuid slice_uuid = 2; +} + +message Slice { + SliceId slice_id = 1; + repeated EndPointId slice_endpoint_ids = 2; + repeated Constraint slice_constraints = 3; + repeated ServiceId slice_service_ids = 4; + repeated SliceId slice_subslice_ids = 5; + SliceStatus slice_status = 6; + SliceConfig slice_config = 7; + SliceOwner slice_owner = 8; + Timestamp timestamp = 9; +} + +message SliceOwner { + Uuid owner_uuid = 1; + string owner_string = 2; +} + +enum SliceStatusEnum { + SLICESTATUS_UNDEFINED = 0; + SLICESTATUS_PLANNED = 1; + SLICESTATUS_INIT = 2; + SLICESTATUS_ACTIVE = 3; + SLICESTATUS_DEINIT = 4; + SLICESTATUS_SLA_VIOLATED = 5; +} + +message SliceStatus { + SliceStatusEnum slice_status = 1; +} + +message SliceConfig { + repeated ConfigRule config_rules = 1; +} + +message SliceIdList { + repeated SliceId slice_ids = 1; +} + +message SliceList { + repeated Slice slices = 1; +} + +message SliceEvent { + Event event = 1; + SliceId slice_id = 2; +} + +// ----- Connection ---------------------------------------------------------------------------------------------------- +message ConnectionId { + Uuid connection_uuid = 1; +} + +message ConnectionSettings_L0 { + string lsp_symbolic_name = 1; +} + +message ConnectionSettings_L2 { + string src_mac_address = 1; + string dst_mac_address = 2; + uint32 ether_type = 3; + uint32 vlan_id = 4; + uint32 mpls_label = 5; + uint32 mpls_traffic_class = 6; +} + +message ConnectionSettings_L3 { + string src_ip_address = 1; + string dst_ip_address = 2; + uint32 dscp = 3; + uint32 protocol = 4; + uint32 ttl = 5; +} + +message ConnectionSettings_L4 { + uint32 src_port = 1; + uint32 dst_port = 2; + uint32 tcp_flags = 3; + uint32 ttl = 4; +} + +message ConnectionSettings { + ConnectionSettings_L0 l0 = 1; + ConnectionSettings_L2 l2 = 2; + ConnectionSettings_L3 l3 = 3; + ConnectionSettings_L4 l4 = 4; +} + +message Connection { + ConnectionId connection_id = 1; + ServiceId service_id = 2; + repeated EndPointId path_hops_endpoint_ids = 3; + repeated ServiceId sub_service_ids = 4; + ConnectionSettings settings = 5; +} + +message ConnectionIdList { + repeated ConnectionId connection_ids = 1; +} + +message ConnectionList { + repeated Connection connections = 1; +} + +message ConnectionEvent { + Event event = 1; + ConnectionId connection_id = 2; +} + // ----- Endpoint ------------------------------------------------------------------------------------------------------ message EndPointId { @@ -244,6 +393,7 @@ message EndPoint { EndPointId endpoint_id = 1; string endpoint_type = 2; repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; + Location endpoint_location = 4; } @@ -254,37 +404,98 @@ enum ConfigActionEnum { CONFIGACTION_DELETE = 2; } +message ConfigRule_Custom { + string resource_key = 1; + string resource_value = 2; +} + +message ConfigRule_ACL { + EndPointId endpoint_id = 1; + acl.AclRuleSet rule_set = 2; +} + message ConfigRule { ConfigActionEnum action = 1; - string resource_key = 2; - string resource_value = 3; + oneof config_rule { + ConfigRule_Custom custom = 2; + ConfigRule_ACL acl = 3; + } } // ----- Constraint ---------------------------------------------------------------------------------------------------- -message Constraint { +message Constraint_Custom { string constraint_type = 1; string constraint_value = 2; } +message Constraint_Schedule { + float start_timestamp = 1; + float duration_days = 2; +} -// ----- Connection ---------------------------------------------------------------------------------------------------- -message ConnectionId { - Uuid connection_uuid = 1; +message GPS_Position { + float latitude = 1; + float longitude = 2; } -message Connection { - ConnectionId connection_id = 1; - ServiceId related_service_id = 2; - repeated EndPointId path = 3; +message Location { + oneof location { + string region = 1; + GPS_Position gps_position = 2; + } } -message ConnectionIdList { - repeated ConnectionId connection_ids = 1; +message Constraint_EndPointLocation { + EndPointId endpoint_id = 1; + Location location = 2; } -message ConnectionList { - repeated Connection connections = 1; +message Constraint_EndPointPriority { + EndPointId endpoint_id = 1; + uint32 priority = 2; +} + +message Constraint_SLA_Latency { + float e2e_latency_ms = 1; +} + +message Constraint_SLA_Capacity { + float capacity_gbps = 1; +} + +message Constraint_SLA_Availability { + uint32 num_disjoint_paths = 1; + bool all_active = 2; +} + +enum IsolationLevelEnum { + NO_ISOLATION = 0; + PHYSICAL_ISOLATION = 1; + LOGICAL_ISOLATION = 2; + PROCESS_ISOLATION = 3; + PHYSICAL_MEMORY_ISOLATION = 4; + PHYSICAL_NETWORK_ISOLATION = 5; + VIRTUAL_RESOURCE_ISOLATION = 6; + NETWORK_FUNCTIONS_ISOLATION = 7; + SERVICE_ISOLATION = 8; +} + +message Constraint_SLA_Isolation_level { + repeated IsolationLevelEnum isolation_level = 1; +} + +message Constraint { + oneof constraint { + Constraint_Custom custom = 1; + Constraint_Schedule schedule = 2; + Constraint_EndPointLocation endpoint_location = 3; + Constraint_EndPointPriority endpoint_priority = 4; + Constraint_SLA_Capacity sla_capacity = 5; + Constraint_SLA_Latency sla_latency = 6; + Constraint_SLA_Availability sla_availability = 7; + Constraint_SLA_Isolation_level sla_isolation = 8; + } } diff --git a/proto/context_policy.proto b/proto/context_policy.proto new file mode 100644 index 0000000000000000000000000000000000000000..9fe25dec5205b66f6d622df2f9435c1321f7e45e --- /dev/null +++ b/proto/context_policy.proto @@ -0,0 +1,28 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package context_policy; + +import "context.proto"; +import "policy.proto"; + +// created as a separate service to prevent import-loops in context and policy +service ContextPolicyService { + rpc ListPolicyRuleIds(context.Empty ) returns (policy.PolicyRuleIdList) {} + rpc ListPolicyRules (context.Empty ) returns (policy.PolicyRuleList ) {} + rpc GetPolicyRule (policy.PolicyRuleId ) returns (policy.PolicyRuleBasic ) {} + rpc SetPolicyRule (policy.PolicyRuleBasic) returns (policy.PolicyRuleId ) {} + rpc RemovePolicyRule (policy.PolicyRuleId ) returns (context.Empty ) {} +} diff --git a/proto/dbscanserving.proto b/proto/dbscanserving.proto index f2c63b15a00481290cfd46ab73940d2f399e01d5..d7d0512b6c5215f05f0c2568a0271e11f8e03a6c 100644 --- a/proto/dbscanserving.proto +++ b/proto/dbscanserving.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package dbscanserving; diff --git a/proto/device.proto b/proto/device.proto index a7f3e44b131908a8931a1ef5257d0261b37537a4..f41e2891a85301da445367db2cf96f9a2d97d313 100644 --- a/proto/device.proto +++ b/proto/device.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package device; diff --git a/proto/distributed_cybersecurity.proto b/proto/distributed_cybersecurity.proto index 69d480a69573510efd32b6fcfb746e9d56bd615e..664e1383f162ee874d1ef89b0e59c70ac2ee62e1 100644 --- a/proto/distributed_cybersecurity.proto +++ b/proto/distributed_cybersecurity.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + // protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 syntax = "proto3"; package distributed_cybersecurity; diff --git a/proto/dlt.proto b/proto/dlt.proto deleted file mode 100644 index f6dacfbb83eca04714b6795d4875f9fab5d08e0b..0000000000000000000000000000000000000000 --- a/proto/dlt.proto +++ /dev/null @@ -1,69 +0,0 @@ -//Example of topology -syntax = "proto3"; -package dlt; - -import "context.proto"; - -service DltService { - rpc RecordToDlt ( DltRecord ) returns ( RecordStatus ) {} - rpc GetFromDlt ( DltRecordId ) returns ( DltRecord ) {} - rpc SubscribeToDlt ( DltRecordSubscription ) returns ( stream DltRecord ) {} - rpc GetDltStatus ( context.Empty ) returns ( DltStatus ) {} -} - -message DltRecordSubscription { - DltRecordType type = 1; - DltRecordOperation operation = 2; -} - -enum DltRecordType { - UNKNOWN = 0; - SERVICE = 1; - DEVICE = 2; - SLICE = 3; -} - -enum DltRecordOperation { - ADD = 0; - UPDATE = 1; - DELETE = 2; -} - -message DltRecord { - DltRecordId id = 1; - DltRecordType type = 2; - DltRecordOperation operation = 3; - string json = 4; -} - -message DltRecordId { - context.Uuid id = 1; -} - -message RecordStatus { - DltRecordId id = 1; - DltRecordStatusEnum status = 2; -} - -enum DltRecordStatusEnum { - REQUESTED = 0; - STORED = 1; - DISABLED = 2; -} - - -message DltStatus { - context.TeraFlowController ctl = 1; - DltStatusEnum status = 2; -} - -enum DltStatusEnum { - NOT_AVAILABLE = 0; - INITIALIZED = 1; - AVAILABLE = 2; - DEINIT = 3; -} - - - - diff --git a/proto/dlt_connector.proto b/proto/dlt_connector.proto new file mode 100644 index 0000000000000000000000000000000000000000..c8cbeb663fafb3c133092e9c49c2ece3f59d75ae --- /dev/null +++ b/proto/dlt_connector.proto @@ -0,0 +1,31 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package dlt; + +import "context.proto"; + +service DltConnectorService { + rpc RecordAll (context.Empty ) returns (context.Empty) {} + + rpc RecordAllDevices (context.Empty ) returns (context.Empty) {} + rpc RecordDevice (context.DeviceId ) returns (context.Empty) {} + + rpc RecordAllServices(context.Empty ) returns (context.Empty) {} + rpc RecordService (context.ServiceId) returns (context.Empty) {} + + rpc RecordAllSlices (context.Empty ) returns (context.Empty) {} + rpc RecordSlice (context.SliceId ) returns (context.Empty) {} +} diff --git a/proto/dlt_gateway.proto b/proto/dlt_gateway.proto new file mode 100644 index 0000000000000000000000000000000000000000..b2c1297ccdd4c765862f4643b554d5373d8eccd3 --- /dev/null +++ b/proto/dlt_gateway.proto @@ -0,0 +1,97 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package dlt; + +import "context.proto"; + +service DltGatewayService { + rpc RecordToDlt (DltRecord ) returns ( DltRecordStatus ) {} + rpc GetFromDlt (DltRecordId ) returns ( DltRecord ) {} + rpc SubscribeToDlt(DltRecordSubscription ) returns (stream DltRecordEvent ) {} + rpc GetDltStatus (context.TeraFlowController) returns ( DltPeerStatus ) {} // NEC is checkig if it is possible + rpc GetDltPeers (context.Empty ) returns ( DltPeerStatusList) {} // NEC is checkig if it is possible +} + +enum DltRecordTypeEnum { + DLTRECORDTYPE_UNDEFINED = 0; + DLTRECORDTYPE_CONTEXT = 1; + DLTRECORDTYPE_TOPOLOGY = 2; + DLTRECORDTYPE_DEVICE = 3; + DLTRECORDTYPE_LINK = 4; + DLTRECORDTYPE_SERVICE = 5; + DLTRECORDTYPE_SLICE = 6; +} + +enum DltRecordOperationEnum { + DLTRECORDOPERATION_UNDEFINED = 0; + DLTRECORDOPERATION_ADD = 1; + DLTRECORDOPERATION_UPDATE = 2; + DLTRECORDOPERATION_DELETE = 3; +} + +enum DltRecordStatusEnum { + DLTRECORDSTATUS_UNDEFINED = 0; + DLTRECORDSTATUS_SUCCEEDED = 1; + DLTRECORDSTATUS_FAILED = 2; +} + +enum DltStatusEnum { + DLTSTATUS_UNDEFINED = 0; + DLTSTATUS_NOTAVAILABLE = 1; + DLTSTATUS_INITIALIZED = 2; + DLTSTATUS_AVAILABLE = 3; + DLTSTATUS_DEINIT = 4; +} + +message DltRecordId { + context.Uuid domain_uuid = 1; // unique identifier of domain owning the record + DltRecordTypeEnum type = 2; // type of record + context.Uuid record_uuid = 3; // unique identifier of the record within the domain context_uuid/topology_uuid +} + +message DltRecord { + DltRecordId record_id = 1; // record identifier + DltRecordOperationEnum operation = 2; // operation to be performed over the record + string data_json = 3; // record content: JSON-encoded record content +} + +message DltRecordSubscription { + // retrieved events have to match ALL conditions. + // i.e., type in types requested, AND operation in operations requested + // TODO: consider adding a more sophisticated filtering + repeated DltRecordTypeEnum type = 1; // selected event types, empty=all + repeated DltRecordOperationEnum operation = 2; // selected event operations, empty=all +} + +message DltRecordEvent { + context.Event event = 1; // common event data (timestamp & event_type) + DltRecordId record_id = 2; // record identifier associated with this event +} + +message DltRecordStatus { + DltRecordId record_id = 1; // identifier of the associated record + DltRecordStatusEnum status = 2; // status of the record + string error_message = 3; // error message in case of failure, empty otherwise +} + +message DltPeerStatus { + context.TeraFlowController controller = 1; // Identifier of the TeraFlow controller instance + DltStatusEnum status = 2; // Status of the TeraFlow controller instance +} + +message DltPeerStatusList { + repeated DltPeerStatus peers = 1; // List of peers and their status +} diff --git a/proto/forecaster.proto b/proto/forecaster.proto new file mode 100644 index 0000000000000000000000000000000000000000..576afb101ea4c8d733f3adf37fdf061e44b390eb --- /dev/null +++ b/proto/forecaster.proto @@ -0,0 +1,45 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package forecaster; + +import "context.proto"; + +service ForecasterService { + rpc GetForecastOfTopology (context.TopologyId) returns (Forecast) {} + rpc GetForecastOfLink(context.LinkId) returns (Forecast) {} + rpc CheckService (context.ServiceId) returns (ForecastPrediction) {} +} + +message SingleForecast { + context.Timestamp timestamp= 1; + double value = 2; +} + +message Forecast { + oneof uuid { + context.TopologyId topologyId= 1; + context.LinkId linkId = 2; + } + repeated SingleForecast forecast = 3; +} + +enum AvailabilityPredictionEnum { + FORECASTED_AVAILABILITY = 0; + FORECASTED_UNAVAILABILITY = 1; +} +message ForecastPrediction { + AvailabilityPredictionEnum prediction = 1; +} diff --git a/proto/generate_code_python.sh b/proto/generate_code_python.sh new file mode 100755 index 0000000000000000000000000000000000000000..b0df357eb079fb2721cffca43465588f7013e341 --- /dev/null +++ b/proto/generate_code_python.sh @@ -0,0 +1,42 @@ +#!/bin/bash -eu +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Make folder containing the script the root folder for its execution +cd $(dirname $0) + +mkdir -p src/python +rm -rf src/python/*.py + +tee src/python/__init__.py << EOF > /dev/null +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. +EOF + +# Generate Python code +python3 -m grpc_tools.protoc -I=./ --python_out=src/python/ --grpc_python_out=src/python/ *.proto + +# Arrange generated code imports to enable imports from arbitrary subpackages +find src/python -type f -iname *.py -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; diff --git a/proto/generate_uml.sh b/proto/generate_uml.sh new file mode 100755 index 0000000000000000000000000000000000000000..6f20b6f4cf695274fe5d6ed27e57671196c44b70 --- /dev/null +++ b/proto/generate_uml.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +#requires installation of protoc-gen-uml +export PATH=${HOME}/protoc-gen-uml/target/universal/stage/bin:$PATH +protoc --uml_out=uml/ -I ./ *.proto +cd uml +java -jar plantuml.7997.jar *.puml +rm *.puml diff --git a/proto/health.proto b/proto/health.proto index 378db950b3b49332ad990aa4aea499179bbe5035..0252f5d877343864a75ff641d4a019e7cb6de499 100644 --- a/proto/health.proto +++ b/proto/health.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package grpc.health.v1; diff --git a/proto/interdomain.proto b/proto/interdomain.proto index 7e7f6c10e93ab1ea5563b13d1cad27fb0a2ee90a..b8a31c2498a216e183aecbb975821d5c0ec25885 100644 --- a/proto/interdomain.proto +++ b/proto/interdomain.proto @@ -1,20 +1,28 @@ -//Example of topology +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package interdomain; import "context.proto"; -import "slice.proto"; service InterdomainService { - rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} - rpc LookUpSlice(slice.TransportSlice) returns (slice.SliceId) {} //Slice component or from interdomain component - rpc OrderSliceFromCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} - rpc CreateSliceAndAddToCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} + rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} // Deprecated + rpc RequestSlice (context.Slice ) returns (context.SliceId ) {} + rpc LookUpSlice (context.Slice ) returns (context.SliceId ) {} + rpc OrderSliceFromCatalog (context.Slice ) returns (context.Slice ) {} + rpc CreateSliceAndAddToCatalog(context.Slice ) returns (context.Slice ) {} + rpc OrderSliceWithSLA (context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it. + rpc UpdateSlice (context.Slice ) returns (context.Slice ) {} } - - - - - - - diff --git a/proto/kpi_sample_types.proto b/proto/kpi_sample_types.proto index e06527131007ab278aa92bb1e392aa9e49af9a96..7445a0f25a57df9793bd8761da024581988cf9e6 100644 --- a/proto/kpi_sample_types.proto +++ b/proto/kpi_sample_types.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package kpi_sample_types; diff --git a/proto/l3_attackmitigator.proto b/proto/l3_attackmitigator.proto index 7d76408f892eb960cc61b54596c39833dbeed173..39333718a5904d1617ba827d35149687ff903b65 100644 --- a/proto/l3_attackmitigator.proto +++ b/proto/l3_attackmitigator.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; import "context.proto"; diff --git a/proto/l3_centralizedattackdetector.proto b/proto/l3_centralizedattackdetector.proto index 6a7dff8939a7c47cfde59038a21706a433c40614..3cb1b0991b1dc4df2c268d511c0ebd6f9f9d80aa 100644 --- a/proto/l3_centralizedattackdetector.proto +++ b/proto/l3_centralizedattackdetector.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; service L3Centralizedattackdetector { diff --git a/proto/monitoring.proto b/proto/monitoring.proto index 4b1b930438045d9199f31de2e408e2c56e91d848..8b83afa47b49c130d37dcbcc1024f079ebc2a2fe 100644 --- a/proto/monitoring.proto +++ b/proto/monitoring.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package monitoring; @@ -5,27 +19,52 @@ import "context.proto"; import "kpi_sample_types.proto"; service MonitoringService { - rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} - rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} - rpc IncludeKpi (Kpi ) returns (context.Empty) {} - rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} - rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} - rpc GetInstantKpi (KpiId ) returns (Kpi ) {} + rpc SetKpi (KpiDescriptor ) returns (KpiId ) {} + rpc DeleteKpi (KpiId ) returns (context.Empty ) {} + rpc GetKpiDescriptor (KpiId ) returns (KpiDescriptor ) {} + rpc GetKpiDescriptorList (context.Empty ) returns (KpiDescriptorList ) {} + rpc IncludeKpi (Kpi ) returns (context.Empty ) {} + rpc MonitorKpi (MonitorKpiRequest ) returns (context.Empty ) {} + rpc QueryKpiData (KpiQuery ) returns (KpiList ) {} + rpc SetKpiSubscription (SubsDescriptor ) returns (stream KpiList ) {} + rpc GetSubsDescriptor (SubscriptionID ) returns (SubsDescriptor ) {} + rpc GetSubscriptions (context.Empty ) returns (SubsIDList ) {} + rpc DeleteSubscription (SubscriptionID ) returns (context.Empty ) {} + rpc SetKpiAlarm (AlarmDescriptor ) returns (AlarmID ) {} + rpc GetAlarms (context.Empty ) returns (AlarmIDList ) {} + rpc GetAlarmDescriptor (AlarmID ) returns (AlarmDescriptor ) {} + rpc GetAlarmResponseStream(AlarmSubscription ) returns (stream AlarmResponse) {} + rpc DeleteAlarm (AlarmID ) returns (context.Empty ) {} + rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} + rpc GetInstantKpi (KpiId ) returns (KpiList ) {} } message KpiDescriptor { - string kpi_description = 1; - kpi_sample_types.KpiSampleType kpi_sample_type = 2; - context.DeviceId device_id = 3; - context.EndPointId endpoint_id = 4; - context.ServiceId service_id = 5; -// context.SliceId slice_id = 6; + KpiId kpi_id = 1; + string kpi_description = 2; + repeated KpiId kpi_id_list = 3; + kpi_sample_types.KpiSampleType kpi_sample_type = 4; + context.DeviceId device_id = 5; + context.EndPointId endpoint_id = 6; + context.ServiceId service_id = 7; + context.SliceId slice_id = 8; +} + +message MonitorKpiRequest { + KpiId kpi_id = 1; + float monitoring_window_s = 2; + float sampling_rate_s = 3; + // Pending add field to reflect Available Device Protocols } -message MonitorKpiRequest{ - KpiId kpi_id = 1; - float sampling_duration_s = 2; - float sampling_interval_s = 3; +message KpiQuery { + repeated KpiId kpi_id = 1; + float monitoring_window_s = 2; + float sampling_rate_s = 3; + uint32 last_n_samples = 4; // used when you want something like "get the last N many samples + context.Timestamp start_timestamp = 5; // used when you want something like "get the samples since X date/time" + context.Timestamp end_timestamp = 6; // used when you want something like "get the samples until X date/time" + // Pending add field to reflect Available Device Protocols } message KpiId { @@ -33,20 +72,89 @@ message KpiId { } message Kpi { - KpiId kpi_id = 1; - string timestamp = 2; - KpiValue kpi_value = 4; + KpiId kpi_id = 1; + context.Timestamp timestamp = 2; + KpiValue kpi_value = 3; +} + +message KpiValueRange { + KpiValue kpiMinValue = 1; + KpiValue kpiMaxValue = 2; + bool inRange = 3; // by default True + bool includeMinValue = 4; // False is outside the interval + bool includeMaxValue = 5; // False is outside the interval } message KpiValue { oneof value { - uint32 intVal = 1; - float floatVal = 2; - string stringVal = 3; - bool boolVal = 4; + int32 int32Val = 1; + uint32 uint32Val = 2; + int64 int64Val = 3; + uint64 uint64Val = 4; + float floatVal = 5; + string stringVal = 6; + bool boolVal = 7; } } + message KpiList { repeated Kpi kpi_list = 1; } + +message KpiDescriptorList { + repeated KpiDescriptor kpi_descriptor_list = 1; +} + +message SubsDescriptor{ + SubscriptionID subs_id = 1; + KpiId kpi_id = 2; + float sampling_duration_s = 3; + float sampling_interval_s = 4; + context.Timestamp start_timestamp = 5; // used when you want something like "get the samples since X date/time" + context.Timestamp end_timestamp = 6; // used when you want something like "get the samples until X date/time" + // Pending add field to reflect Available Device Protocols +} + +message SubscriptionID { + context.Uuid subs_id = 1; +} + +message SubsResponse { + SubscriptionID subs_id = 1; + repeated KpiList kpi_list = 2; +} + +message SubsIDList { + repeated SubscriptionID subs_list = 1; +} + +message AlarmDescriptor { + AlarmID alarm_id = 1; + string alarm_description = 2; + string name = 3; + repeated KpiId kpi_id = 4; + repeated KpiValueRange kpi_value_range = 5; + context.Timestamp timestamp = 6; +} + +message AlarmID{ + context.Uuid alarm_id = 1; +} + +message AlarmSubscription{ + AlarmID alarmID = 1; + float subscription_timeout_s = 2; + float subscription_frequency_ms = 3; +} + +message AlarmResponse { + AlarmID alarm_id = 1; + string text = 2; + KpiValue kpi_value = 3; + context.Timestamp timestamp = 4; +} + +message AlarmIDList { + repeated AlarmID alarm_list = 1; +} diff --git a/proto/optical_attack_mitigator.proto b/proto/optical_attack_mitigator.proto index d75a845dd10f605d6894a610f3f82bbef27b8297..881f9fde375bb67b0362ca634ad84b45fb60220b 100644 --- a/proto/optical_attack_mitigator.proto +++ b/proto/optical_attack_mitigator.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + // protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 syntax = "proto3"; package optical_attack_mitigator; diff --git a/proto/optical_centralized_attack_detector.proto b/proto/optical_centralized_attack_detector.proto index 99cc1ce6fabc662de078f58985eae2d4eeb3d24c..d480054f2ca3b1cf32cbb40c51df51c562f9b4d5 100644 --- a/proto/optical_centralized_attack_detector.proto +++ b/proto/optical_centralized_attack_detector.proto @@ -1,3 +1,17 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + // protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3 syntax = "proto3"; package centralized_attack_detector; diff --git a/proto/pathcomp.proto b/proto/pathcomp.proto new file mode 100644 index 0000000000000000000000000000000000000000..9eb650fb9981b4b84f31b63796eec0c7a8e780b6 --- /dev/null +++ b/proto/pathcomp.proto @@ -0,0 +1,48 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package pathcomp; + +import "context.proto"; + +service PathCompService { + rpc Compute(PathCompRequest) returns (PathCompReply) {} +} + +message Algorithm_ShortestPath {} + +message Algorithm_KShortestPath { + uint32 k_inspection = 1; + uint32 k_return = 2; +} + +message PathCompRequest { + repeated context.Service services = 1; + oneof algorithm { + Algorithm_ShortestPath shortest_path = 10; + Algorithm_KShortestPath k_shortest_path = 11; + } +} + +message PathCompReply { + // Services requested completed with possible missing fields, and + // sub-services required for supporting requested services on the + // underlying layers. + repeated context.Service services = 1; + + // Connections supporting the requested services and sub-services + // required for the underlying layers. + repeated context.Connection connections = 2; +} diff --git a/proto/policy.proto b/proto/policy.proto index 6a5874125820c576e75a5adb547173754b6e8316..0879389bf857df51b7f777fd21a4a249ff69682d 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -1,26 +1,47 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package policy; import "context.proto"; +import "policy_condition.proto"; +import "policy_action.proto"; service PolicyService { - rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {} - rpc PolicyUpdate (PolicyRule) returns (PolicyRuleState) {} - rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {} - rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {} - rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {} - rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {} + rpc PolicyAddService (PolicyRuleService) returns (PolicyRuleState) {} + rpc PolicyAddDevice (PolicyRuleDevice) returns (PolicyRuleState) {} + rpc PolicyUpdateService (PolicyRuleService) returns (PolicyRuleState) {} + rpc PolicyUpdateDevice (PolicyRuleDevice) returns (PolicyRuleState) {} + rpc PolicyDelete (PolicyRuleId) returns (PolicyRuleState) {} + rpc GetPolicyService (PolicyRuleId) returns (PolicyRuleService) {} + rpc GetPolicyDevice (PolicyRuleId) returns (PolicyRuleDevice) {} + rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleServiceList) {} } enum RuleState { - POLICY_INACTIVE = 0; // Rule is currently inactive - POLICY_PLANNED = 1; // Rule installation planned - POLICY_ACTIVE = 2; // Rule is currently active -} - -enum PolicyRuleType { - POLICYTYPE_DEVICE = 0; // Device-level - POLICYTYPE_NETWORK = 1; // Network-wide + POLICY_UNDEFINED = 0; // Undefined rule state + POLICY_FAILED = 1; // Rule failed + POLICY_INSERTED = 2; // Rule is just inserted + POLICY_VALIDATED = 3; // Rule content is correct + POLICY_PROVISIONED = 4; // Rule subscribed to Monitoring + POLICY_ACTIVE = 5; // Rule is currently active (alarm is just thrown by Monitoring) + POLICY_ENFORCED = 6; // Rule action is successfully enforced + POLICY_INEFFECTIVE = 7; // The applied rule action did not work as expected + POLICY_EFFECTIVE = 8; // The applied rule action did work as expected + POLICY_UPDATED = 9; // Operator requires a policy to change + POLICY_REMOVED = 10; // Operator requires to remove a policy } message PolicyRuleId { @@ -28,58 +49,56 @@ message PolicyRuleId { } message PolicyRuleState { - context.Uuid policyRuleId = 1; - RuleState policyRuleState = 2; + RuleState policyRuleState = 1; } -message PolicyRuleVariable { - string policyRuleVariable = 1; -} +// Basic policy rule attributes +message PolicyRuleBasic { + PolicyRuleId policyRuleId = 1; + PolicyRuleState policyRuleState = 2; //policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. + uint32 priority = 3; -message PolicyRuleValue { - string policyRuleValue = 1; + // Event-Condition-Action (ECA) model + repeated PolicyRuleCondition conditionList = 4; // When these policy conditions are met, an event is automatically thrown + BooleanOperator booleanOperator = 5; // Evaluation operator to be used + repeated PolicyRuleAction actionList = 6; // One or more actions should be applied } -// IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management -// Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/ -// Event -message PolicyRuleEvent { - context.Event event = 1; -} +// Service-oriented policy rule +message PolicyRuleService { + // Basic policy rule attributes + PolicyRuleBasic policyRuleBasic = 1; -// Condition -message PolicyRuleCondition { - PolicyRuleVariable polRuleConditionVar = 1; - PolicyRuleValue polRuleConditionVal = 2; + // Affected service and (some of) its device(s) + context.ServiceId serviceId = 2; + repeated context.DeviceId deviceList = 3; // List of devices this service is traversing (not exhaustive) } -// Action -message PolicyRuleAction { - PolicyRuleVariable polRuleActionVar = 1; - PolicyRuleValue polRuleActionVal = 2; +// Device-oriented policy rule +message PolicyRuleDevice { + // Basic policy rule attributes + PolicyRuleBasic policyRuleBasic = 1; + + // Affected device(s) + repeated context.DeviceId deviceList = 2; } -// Policy rule partially complies with IETF’s: -// RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060 -// RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460 -// Enhanced with a policy rule event according to the ECA model -message PolicyRule { - // Basic policy rule attributes - PolicyRuleId policyRuleId = 1; - PolicyRuleType policyRuleType = 2; - uint32 PolicyRulePriority = 3; +// A list of policy rule IDs +message PolicyRuleIdList { + repeated PolicyRuleId policyRuleIdList = 1; +} - // Event-Condition-Action model - PolicyRuleEvent event = 4; // A single event triggers the policy - repeated PolicyRuleCondition polRuleConditionList = 5; // One or more conditions must be met - repeated PolicyRuleAction polRuleActionList = 6; // One or more actions should be applied +// A list of service-oriented policy rules +message PolicyRuleServiceList { + repeated PolicyRuleService policyRuleServiceList = 1; +} - // Affected services and devices - repeated context.ServiceId serviceList = 7; - repeated context.DeviceId deviceList = 8; +// A list of device-oriented policy rules +message PolicyRuleDeviceList { + repeated PolicyRuleDevice policyRuleDeviceList = 1; } // A list of policy rules message PolicyRuleList { - repeated PolicyRule policyRuleList = 1; + repeated PolicyRuleId policyRules = 1; } diff --git a/proto/policy_action.proto b/proto/policy_action.proto new file mode 100644 index 0000000000000000000000000000000000000000..374b5975129353219902e270a521496e914b1625 --- /dev/null +++ b/proto/policy_action.proto @@ -0,0 +1,29 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package policy; + +// Action +message PolicyRuleAction { + PolicyRuleActionEnum action = 1; + repeated string parameters = 2; +} + +enum PolicyRuleActionEnum { + POLICYRULE_ACTION_NO_ACTION = 0; + POLICYRULE_ACTION_SET_DEVICE_STATUS = 1; + POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2; + POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3; +} diff --git a/proto/policy_condition.proto b/proto/policy_condition.proto new file mode 100644 index 0000000000000000000000000000000000000000..7cd6576678872df07a2da6a3706349f004b3a8a1 --- /dev/null +++ b/proto/policy_condition.proto @@ -0,0 +1,43 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +syntax = "proto3"; +package policy; + +import "monitoring.proto"; + +// Condition +message PolicyRuleCondition { + monitoring.KpiId kpiId = 1; + NumericalOperator numericalOperator = 2; + monitoring.KpiValue kpiValue = 3; +} + +// Operator to be used when comparing Kpis with condition values +enum NumericalOperator { + POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; // Kpi numerical operator undefined + POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; // Kpi is equal with value + POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; // Kpi is not equal with value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; // Kpi is less than value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; // Kpi is less than or equal with value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; // Kpi is greater than value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; // Kpi is less than or equal with value +} + +// Operator to be used when evaluating each condition +enum BooleanOperator { + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; // Boolean operator undefined + POLICYRULE_CONDITION_BOOLEAN_AND = 1; // Boolean AND operator + POLICYRULE_CONDITION_BOOLEAN_OR = 2; // Boolean OR operator +} \ No newline at end of file diff --git a/proto/service.proto b/proto/service.proto index 98e827c8ac4bfa5e1a8d970e6d8543e1fecdecb0..90a2f2ecf32dcda0366281224d31725fb4f95622 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -1,11 +1,24 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package service; import "context.proto"; service ServiceService { - rpc CreateService (context.Service ) returns (context.ServiceId ) {} - rpc UpdateService (context.Service ) returns (context.ServiceId ) {} - rpc DeleteService (context.ServiceId) returns (context.Empty ) {} - rpc GetConnectionList(context.ServiceId) returns (context.ConnectionList) {} + rpc CreateService(context.Service ) returns (context.ServiceId) {} + rpc UpdateService(context.Service ) returns (context.ServiceId) {} + rpc DeleteService(context.ServiceId) returns (context.Empty ) {} } diff --git a/proto/slice.proto b/proto/slice.proto index ab83b15cfe45316ef7cf7cf43a5c857d313d6043..69fa242e2310f791faa2429d59c01fc2572025d2 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -1,40 +1,26 @@ -//Example of topology +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package slice; import "context.proto"; service SliceService { - rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {} - rpc DeleteSlice (TransportSlice) returns (context.Empty) {} -} - -message SliceEndpoint { - context.EndPoint port_id = 1; -} - -message TransportSlice { - SliceId slice_id = 1; - repeated slice.SliceEndpoint endpoints = 2; - repeated context.Constraint constraints = 3; - repeated context.ServiceId services = 4; - repeated SliceId subSlicesId = 5; - SliceStatus status = 6; -} - -message SliceId { - context.ContextId contextId = 1; - context.Uuid slice_id = 2; -} - -message SliceStatus { - slice.SliceId slice_id = 1; - SliceStatusEnum status = 2; -} - -enum SliceStatusEnum { - PLANNED = 0; - INIT = 1; - ACTIVE = 2; - DEINIT = 3; + rpc CreateSlice(context.Slice ) returns (context.SliceId) {} + rpc UpdateSlice(context.Slice ) returns (context.SliceId) {} + rpc DeleteSlice(context.SliceId) returns (context.Empty ) {} + rpc OrderSliceWithSLA(context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it. + rpc RunSliceGrouping (context.Empty) returns (context.Empty) {} // Optimizes the underlying services and re-maps them to the requested slices. } diff --git a/proto/src/java/.gitignore b/proto/src/java/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..377ccd3fdffacc5b8e7260cff64905faf5e472f2 --- /dev/null +++ b/proto/src/java/.gitignore @@ -0,0 +1,2 @@ +* +!.gitkeep diff --git a/src/centralizedattackdetector/__init__.py b/proto/src/java/.gitkeep similarity index 100% rename from src/centralizedattackdetector/__init__.py rename to proto/src/java/.gitkeep diff --git a/proto/src/python/.gitignore b/proto/src/python/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..53b5ddc0011f758f564b7560108243b5d5b02d0c --- /dev/null +++ b/proto/src/python/.gitignore @@ -0,0 +1,5 @@ +* +!.gitkeep + +# prevent breaking symbolic links on Python source code folders +!__init__.py diff --git a/src/centralizedattackdetector/client/__init__.py b/proto/src/python/.gitkeep similarity index 100% rename from src/centralizedattackdetector/client/__init__.py rename to proto/src/python/.gitkeep diff --git a/proto/src/python/__init__.py b/proto/src/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/proto/src/python/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/proto/te.proto b/proto/te.proto index a0233fab09a024e217a19b46681562db0c0541e1..d639cb7f45f682d3e95d77e8b6d10d404ee51b9f 100644 --- a/proto/te.proto +++ b/proto/te.proto @@ -1,11 +1,24 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + syntax = "proto3"; package te; import "context.proto"; -import "service.proto"; service TEService { - rpc RequestLSP(service.Service ) returns (service.ServiceState) {} - rpc UpdateLSP (service.ServiceId) returns (service.ServiceState) {} - rpc DeleteLSP (service.ServiceId) returns (context.Empty ) {} + rpc RequestLSP(context.Service ) returns (context.ServiceStatus) {} + rpc UpdateLSP (context.ServiceId) returns (context.ServiceStatus) {} + rpc DeleteLSP (context.ServiceId) returns (context.Empty ) {} } diff --git a/proto/uml/acl.png b/proto/uml/acl.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc4e0f9decb0ecac761c6ab971ecdb80890a4b4 Binary files /dev/null and b/proto/uml/acl.png differ diff --git a/proto/uml/context.png b/proto/uml/context.png index 57a2493cf8596d1f4e70f2e3056d1a9d71432aee..3ea3a6e21dd3eddba749c2f0b483d41b365ef11f 100644 Binary files a/proto/uml/context.png and b/proto/uml/context.png differ diff --git a/proto/uml/dlt.png b/proto/uml/dlt.png index 51988d55b4e63230ff62e647f1b52e5f9418ad25..f8d4e25c1881a932c49bf151eab56921a4ff8a7b 100644 Binary files a/proto/uml/dlt.png and b/proto/uml/dlt.png differ diff --git a/proto/uml/forecaster.png b/proto/uml/forecaster.png new file mode 100644 index 0000000000000000000000000000000000000000..d32e142959ca0060556ce6ce622552dc5ff4d416 Binary files /dev/null and b/proto/uml/forecaster.png differ diff --git a/proto/uml/monitoring.png b/proto/uml/monitoring.png index 676389fc6971457b3d0c4194484bb78b4be52404..98f2e1d64766faf55599e465dd30f57e3518b11f 100644 Binary files a/proto/uml/monitoring.png and b/proto/uml/monitoring.png differ diff --git a/proto/uml/pathcomp.png b/proto/uml/pathcomp.png new file mode 100644 index 0000000000000000000000000000000000000000..bd14fe5235febb43b24ffc52291696edc65c4e99 Binary files /dev/null and b/proto/uml/pathcomp.png differ diff --git a/proto/uml/policy.png b/proto/uml/policy.png index e4f5c52848b75643c3a8272fb0223147bced5b90..845a1e883223d7588ab20afabf559067cdc27454 100644 Binary files a/proto/uml/policy.png and b/proto/uml/policy.png differ diff --git a/proto/uml/slice.png b/proto/uml/slice.png deleted file mode 100644 index 01b62425b28f6bb5319a96ddd7fc5b62ff620620..0000000000000000000000000000000000000000 Binary files a/proto/uml/slice.png and /dev/null differ diff --git a/report_coverage_all.sh b/report_coverage_all.sh deleted file mode 100755 index 66e393747ee86afee9e407da902ea3fb0421d707..0000000000000000000000000000000000000000 --- a/report_coverage_all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -PROJECTDIR=`pwd` - -cd $(dirname $0)/src -RCFILE=$PROJECTDIR/coverage/.coveragerc - -echo -echo "Coverage report:" -echo "----------------" -coverage report --rcfile=$RCFILE --sort cover --show-missing --skip-covered -#coverage html --rcfile=$RCFILE -#coverage xml --rcfile=$RCFILE diff --git a/report_coverage_centralized_attack_detector.sh b/report_coverage_centralized_attack_detector.sh deleted file mode 100755 index ea34a11315cfdfbc8c05427c8d4f6e78dad4b42c..0000000000000000000000000000000000000000 --- a/report_coverage_centralized_attack_detector.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^centralizedattackdetector/.*$|$" diff --git a/report_coverage_common.sh b/report_coverage_common.sh deleted file mode 100755 index be7224ad610ddf2c266fa485c6535f165cdc72ca..0000000000000000000000000000000000000000 --- a/report_coverage_common.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^common/.*$|$" diff --git a/report_coverage_compute.sh b/report_coverage_compute.sh deleted file mode 100755 index b63d279ed587a6fce66d08bd71820bfa96e95140..0000000000000000000000000000000000000000 --- a/report_coverage_compute.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^compute/.*$|$" diff --git a/report_coverage_context.sh b/report_coverage_context.sh deleted file mode 100755 index 3a404a62698cdd95f94c9ed7d4c8b4b073778d08..0000000000000000000000000000000000000000 --- a/report_coverage_context.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^context/.*$|$" diff --git a/report_coverage_device.sh b/report_coverage_device.sh deleted file mode 100755 index be2612d89ce56d518d992327f93a24853e591a4d..0000000000000000000000000000000000000000 --- a/report_coverage_device.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^device/.*$|$" diff --git a/report_coverage_l3_attackmitigator.sh b/report_coverage_l3_attackmitigator.sh deleted file mode 100644 index 74df2c280b94af016d974a56e1019e42a54d6753..0000000000000000000000000000000000000000 --- a/report_coverage_l3_attackmitigator.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^l3_attackmitigator/.*$|$" diff --git a/report_coverage_l3_centralizedattackdetector.sh b/report_coverage_l3_centralizedattackdetector.sh deleted file mode 100644 index 46faba45d245bd951c80652af8f3eed8e56a8ab6..0000000000000000000000000000000000000000 --- a/report_coverage_l3_centralizedattackdetector.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^l3_centralizedattackdetector/.*$|$" diff --git a/report_coverage_l3_distributedattackdetector.sh b/report_coverage_l3_distributedattackdetector.sh deleted file mode 100644 index eff6b1ce5e96f4500ae0efc58e6da586cf36fd25..0000000000000000000000000000000000000000 --- a/report_coverage_l3_distributedattackdetector.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^l3_distributedattackdetector/.*$|$" diff --git a/report_coverage_service.sh b/report_coverage_service.sh deleted file mode 100755 index 160f52f126a78be5338456667a97ec9184be421a..0000000000000000000000000000000000000000 --- a/report_coverage_service.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./report_coverage_all.sh | grep --color -E -i "^service/.*$|$" diff --git a/run_tests_in_kubernetes.sh b/run_tests_in_kubernetes.sh deleted file mode 100755 index 7cbbda122078ae1443fe9db8c51d7f47cd92c9d6..0000000000000000000000000000000000000000 --- a/run_tests_in_kubernetes.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -IMAGE_NAME='integration_tester' -IMAGE_TAG='latest' -CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller' - -kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true -kubectl get all -kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i -kubectl get all diff --git a/run_tests_locally.sh b/run_tests_locally.sh deleted file mode 100755 index b483de8062cb884cbdda5530176a97c5dd3f8bfa..0000000000000000000000000000000000000000 --- a/run_tests_locally.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -PROJECTDIR=`pwd` - -cd $PROJECTDIR/src -RCFILE=$PROJECTDIR/coverage/.coveragerc -COVERAGEFILE=$PROJECTDIR/coverage/.coverage - -# configure the correct folder on the .coveragerc file -cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE - -# Run unitary tests and analyze coverage of code at same time - -# Populate environment variables for context to use Redis in a development machine running Kubernetes -# Uncomment below lines to create a Redis instance within Context for testing purposes. -#kubectl delete namespace tf-dev -#kubectl create namespace tf-dev -#kubectl --namespace tf-dev apply -f ../manifests/contextservice.yaml -#kubectl --namespace tf-dev expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests -#echo "Waiting 10 seconds for Redis to start..." -#sleep 10 -export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') - -# First destroy old coverage file -rm -f $COVERAGEFILE - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - common/orm/tests/test_unitary.py \ - common/message_broker/tests/test_unitary.py \ - common/rpc_method_wrapper/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - centralizedattackdetector/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - context/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - device/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ - l3_centralizedattackdetector/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ - l3_distributedattackdetector/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ - l3_attackmitigator/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - opticalcentralizedattackdetector/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - dbscanserving/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - opticalattackmitigator/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - service/tests/test_unitary.py - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - compute/tests/test_unitary.py diff --git a/scripts/add_license_header_to_files.sh b/scripts/add_license_header_to_files.sh new file mode 100755 index 0000000000000000000000000000000000000000..4da23894414cfc57cda9ea1277e144f8e7244056 --- /dev/null +++ b/scripts/add_license_header_to_files.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +docker pull ghcr.io/google/addlicense:latest +docker run -it -v ${PWD}:/src ghcr.io/google/addlicense \ + -l apache -c "H2020 TeraFlow (https://www.teraflow-h2020.eu/)" -y 2021-2023 \ + -ignore "data/*" -ignore "data/**" -ignore "tmp/*" -ignore "tmp/**" -ignore "manifests/cttc-ols/*" \ + -ignore "coverage/*" -ignore "coverage/**" -ignore ".vscode/*" -ignore ".vscode/**" \ + -ignore ".git/*" -ignore ".git/**" -ignore "proto/uml/*" -ignore "proto/uml/**" \ + -ignore "src/**/__pycache__/*" -ignore "src/**/__pycache__/**" \ + -ignore "src/.benchmarks/*" -ignore "src/.benchmarks/**" -ignore ".benchmarks/*" -ignore ".benchmarks/**" \ + -ignore "src/.pytest_cache/*" -ignore "src/.pytest_cache/**" -ignore ".pytest_cache/*" -ignore ".pytest_cache/**" \ + -ignore "src/**/target/generated-sources/grpc/*" -ignore "src/**/target/generated-sources/grpc/**" \ + -ignore "src/**/*_pb2.py" -ignore "src/**/*_pb2_grpc.py" \ + -ignore "src/device/service/drivers/openconfig/templates/**/*.xml" \ + -ignore "src/dlt/*" -ignore "src/dlt/**" \ + -ignore "src/**/.mvn/*" -ignore "src/**/.mvn/**" \ + * diff --git a/scripts/old/configure_dashboards_in_kubernetes.sh b/scripts/old/configure_dashboards_in_kubernetes.sh new file mode 100755 index 0000000000000000000000000000000000000000..4a32d76deb79bb514b6d547c0e3e2b87ec269e77 --- /dev/null +++ b/scripts/old/configure_dashboards_in_kubernetes.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +# If not already set, set the name of the Kubernetes namespace and hostname to deploy to. +K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} +K8S_HOSTNAME=${K8S_HOSTNAME:-'kubernetes-master'} + +INFLUXDB_USER=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) +INFLUXDB_PASSWORD=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) +INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) + +# GRAFANA_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +# GRAFANA_HOSTNAME=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` +GRAFANA_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master -o jsonpath='{$.items[*].status.addresses[?(@.type=="InternalIP")].address}'` +GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') +#GRAFANA_PORT=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].nodePort}'` +GRAFANA_USERNAME="admin" +GRAFANA_PASSWORD=${GRAFANA_PASSWORD:-"admin123+"} +GRAFANA_URL="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}" +echo "Connecting to grafana at URL: ${GRAFANA_URL}..." + +# Configure Grafana Admin Password +# Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password +curl -X PUT -H "Content-Type: application/json" -d '{ + "oldPassword": "admin", + "newPassword": "'${GRAFANA_PASSWORD}'", + "confirmNew" : "'${GRAFANA_PASSWORD}'" +}' http://admin:admin@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}/api/user/password +echo + +# Create InfluxDB DataSource +# Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ +curl -X POST -H "Content-Type: application/json" -d '{ + "type" : "influxdb", + "name" : "InfluxDB", + "url" : "http://monitoringservice:8086", + "access" : "proxy", + "basicAuth": false, + "user" : "'"$INFLUXDB_USER"'", + "password" : "'"$INFLUXDB_PASSWORD"'", + "isDefault": true, + "database" : "'"$INFLUXDB_DATABASE"'" +}' ${GRAFANA_URL}/api/datasources +echo + +# Create Monitoring Dashboard +# Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/ +curl -X POST -H "Content-Type: application/json" \ + -d '@src/webui/grafana_dashboard.json' \ + ${GRAFANA_URL}/api/dashboards/db +echo + +DASHBOARD_URL="${GRAFANA_URL}/api/dashboards/uid/tf-l3-monit" +DASHBOARD_ID=$(python -c 'import json, requests; print(requests.get("'${DASHBOARD_URL}'").json()["dashboard"]["id"])') +curl -X POST ${GRAFANA_URL}/api/user/stars/dashboard/${DASHBOARD_ID} diff --git a/deploy_in_kubernetes.sh b/scripts/old/deploy_in_kubernetes.sh similarity index 52% rename from deploy_in_kubernetes.sh rename to scripts/old/deploy_in_kubernetes.sh index d98fb41e6a64907ffeabaa69dea915217939346e..5e16120bb3b47e993e1d331ccdef3186380304ec 100755 --- a/deploy_in_kubernetes.sh +++ b/scripts/old/deploy_in_kubernetes.sh @@ -1,29 +1,48 @@ #!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + ######################################################################################################################## # Define your deployment settings here ######################################################################################################################## -# Set the URL of your local Docker registry where the images will be uploaded to. Leave it blank if you do not want to -# use any Docker registry. -REGISTRY_IMAGE="" -#REGISTRY_IMAGE="http://my-container-registry.local/" +# If not already set, set the URL of your local Docker registry where the images will be uploaded to. Leave it blank if +# you do not want to use any Docker registry. +export REGISTRY_IMAGE=${REGISTRY_IMAGE:-""} +#export REGISTRY_IMAGE="http://my-container-registry.local/" + +# If not already set, set the list of components you want to build images for, and deploy. +export COMPONENTS=${COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} + +# If not already set, set the tag you want to use for your images. +export IMAGE_TAG=${IMAGE_TAG:-"tf-dev"} -# Set the list of components you want to build images for, and deploy. -COMPONENTS="context device automation policy service compute monitoring centralizedattackdetector dbscanserving opticalattackmitigator opticalcentralizedattackdetector" # TODO: include opticalcentralizedattackdetector +# If not already set, set the name of the Kubernetes namespace to deploy to. +export K8S_NAMESPACE=${K8S_NAMESPACE:-"tf-dev"} -# Set the tag you want to use for your images. -IMAGE_TAG="tf-dev" +# If not already set, set the name of the Kubernetes hostname to deploy to. +export K8S_HOSTNAME=${K8S_HOSTNAME:-"kubernetes-master"} -# Set the name of the Kubernetes namespace to deploy to. -K8S_NAMESPACE="tf-dev" +# If not already set, set additional manifest files to be applied after the deployment +export EXTRA_MANIFESTS=${EXTRA_MANIFESTS:-""} ######################################################################################################################## # Automated steps start here ######################################################################################################################## # Constants -CLONE_URL="https://gitlab.com/teraflow-h2020/controller.git" GITLAB_REPO_URL="registry.gitlab.com/teraflow-h2020/controller" TMP_FOLDER="./tmp" @@ -33,16 +52,24 @@ mkdir -p $TMP_MANIFESTS_FOLDER TMP_LOGS_FOLDER="$TMP_FOLDER/logs" mkdir -p $TMP_LOGS_FOLDER -# Re-create the namespace to prevent being affected by garbage on it +echo "Deleting and Creating a new namespace..." kubectl delete namespace $K8S_NAMESPACE kubectl create namespace $K8S_NAMESPACE printf "\n" -# creating the secrets for the influxdb deployment +echo "Creating secrets for InfluxDB..." #TODO: make sure to change this when having a production deployment kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" +printf "\n" +echo "Pulling/Updating Docker images..." +docker pull redis:6.2 +docker pull influxdb:1.8 +docker pull grafana/grafana:8.2.6 +printf "\n" + +echo "Deploying components..." for COMPONENT in $COMPONENTS; do echo "Processing '$COMPONENT' component..." IMAGE_NAME="$COMPONENT:$IMAGE_TAG" @@ -83,11 +110,38 @@ for COMPONENT in $COMPONENTS; do fi echo " Deploying '$COMPONENT' component to Kubernetes..." - DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" kubectl --namespace $K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" + + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" printf "\n" done +echo "Deploying extra manifests..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE apply -f $EXTRA_MANIFEST + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $COMPONENTS; do + echo "Waiting for '$COMPONENT' component..." + kubectl wait --namespace $K8S_NAMESPACE --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards_in_kubernetes.sh + printf "\n\n" +fi + +echo "Reporting Deployment..." kubectl --namespace $K8S_NAMESPACE get all +printf "\n" -echo "Done!" \ No newline at end of file +echo "Done!" diff --git a/scripts/report_coverage_all.sh b/scripts/report_coverage_all.sh new file mode 100755 index 0000000000000000000000000000000000000000..3b7df170c880ede72dea356752c5120e59dd9d71 --- /dev/null +++ b/scripts/report_coverage_all.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +echo +echo "Coverage report:" +echo "----------------" +coverage report --rcfile=$RCFILE --sort cover --show-missing --skip-covered +#coverage html --rcfile=$RCFILE +#coverage xml --rcfile=$RCFILE diff --git a/scripts/report_coverage_common.sh b/scripts/report_coverage_common.sh new file mode 100755 index 0000000000000000000000000000000000000000..f69c57a01aa83a75263a2dc888951aeaf4867ca2 --- /dev/null +++ b/scripts/report_coverage_common.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^common/.*$|$" diff --git a/scripts/report_coverage_compute.sh b/scripts/report_coverage_compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..15e9e3422e9c2674206dfd17fec9a4396ea77cca --- /dev/null +++ b/scripts/report_coverage_compute.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^compute/.*$|$" diff --git a/scripts/report_coverage_context.sh b/scripts/report_coverage_context.sh new file mode 100755 index 0000000000000000000000000000000000000000..b39c45833189ca755a088983e9fbe341bb6dd471 --- /dev/null +++ b/scripts/report_coverage_context.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^context/.*$|$" diff --git a/scripts/report_coverage_device.sh b/scripts/report_coverage_device.sh new file mode 100755 index 0000000000000000000000000000000000000000..d7a1dc0841f9fb2fa495363b248747668d704886 --- /dev/null +++ b/scripts/report_coverage_device.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^device/.*$|$" diff --git a/scripts/report_coverage_l3_attackmitigator.sh b/scripts/report_coverage_l3_attackmitigator.sh new file mode 100755 index 0000000000000000000000000000000000000000..c34283dbb91e21099ac5246566a3698c280b4725 --- /dev/null +++ b/scripts/report_coverage_l3_attackmitigator.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^l3_attackmitigator/.*$|$" diff --git a/scripts/report_coverage_l3_centralizedattackdetector.sh b/scripts/report_coverage_l3_centralizedattackdetector.sh new file mode 100755 index 0000000000000000000000000000000000000000..1060bae05eb383aea5d9caf6bd1b1a9e5e4cfeaa --- /dev/null +++ b/scripts/report_coverage_l3_centralizedattackdetector.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^l3_centralizedattackdetector/.*$|$" diff --git a/scripts/report_coverage_l3_distributedattackdetector.sh b/scripts/report_coverage_l3_distributedattackdetector.sh new file mode 100755 index 0000000000000000000000000000000000000000..94c2a16f4c6ff9b0a6adfd0a45b59a208297c327 --- /dev/null +++ b/scripts/report_coverage_l3_distributedattackdetector.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^l3_distributedattackdetector/.*$|$" diff --git a/scripts/report_coverage_pathcomp.sh b/scripts/report_coverage_pathcomp.sh new file mode 100755 index 0000000000000000000000000000000000000000..3af2790f838619e495a9b5727506f6829ad12a35 --- /dev/null +++ b/scripts/report_coverage_pathcomp.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^pathcomp/.*$|$" diff --git a/scripts/report_coverage_service.sh b/scripts/report_coverage_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..4a3c5cc067d009d6354939c06d9002f038bc0441 --- /dev/null +++ b/scripts/report_coverage_service.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^service/.*$|$" diff --git a/scripts/report_coverage_slice.sh b/scripts/report_coverage_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..f9b17e8bd162500e2be77a871f7f2976f923ca68 --- /dev/null +++ b/scripts/report_coverage_slice.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +./report_coverage_all.sh | grep --color -E -i "^slice/.*$|$" diff --git a/scripts/run_tests_locally-compute.sh b/scripts/run_tests_locally-compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..d48fe417134d2f8c3078d549b3bb84e2cc745da6 --- /dev/null +++ b/scripts/run_tests_locally-compute.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + compute/tests/test_unitary.py diff --git a/scripts/run_tests_locally-context.sh b/scripts/run_tests_locally-context.sh new file mode 100755 index 0000000000000000000000000000000000000000..a9e601208aa9259219708a5e1ca770232e44faa6 --- /dev/null +++ b/scripts/run_tests_locally-context.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +K8S_NAMESPACE="tf-dev" +K8S_HOSTNAME="kubernetes-master" + +kubectl --namespace $K8S_NAMESPACE expose deployment contextservice --port=6379 --name=redis-tests --type=NodePort +export REDIS_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + context/tests/test_unitary.py diff --git a/scripts/run_tests_locally-device-all.sh b/scripts/run_tests_locally-device-all.sh new file mode 100755 index 0000000000000000000000000000000000000000..a60eab0be932862cf1adc3a81678239de566bd37 --- /dev/null +++ b/scripts/run_tests_locally-device-all.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_locally-device-emulated.sh b/scripts/run_tests_locally-device-emulated.sh new file mode 100755 index 0000000000000000000000000000000000000000..541017f7a6b9f3d1289162ad69b27f572aa046cb --- /dev/null +++ b/scripts/run_tests_locally-device-emulated.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py diff --git a/scripts/run_tests_locally-device-microwave.sh b/scripts/run_tests_locally-device-microwave.sh new file mode 100755 index 0000000000000000000000000000000000000000..21f3e5ab67c882ab51f7c8c14a95ed6df26418de --- /dev/null +++ b/scripts/run_tests_locally-device-microwave.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_locally-device-openconfig.sh b/scripts/run_tests_locally-device-openconfig.sh new file mode 100755 index 0000000000000000000000000000000000000000..f87346fed8ebe9b27c806759fafc851a15afd068 --- /dev/null +++ b/scripts/run_tests_locally-device-openconfig.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py diff --git a/scripts/run_tests_locally-device-p4.sh b/scripts/run_tests_locally-device-p4.sh new file mode 100755 index 0000000000000000000000000000000000000000..4e6754e4d56741f960e1e5562abb0c10abc0ccb4 --- /dev/null +++ b/scripts/run_tests_locally-device-p4.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py diff --git a/scripts/run_tests_locally-device-tapi.sh b/scripts/run_tests_locally-device-tapi.sh new file mode 100755 index 0000000000000000000000000000000000000000..d37e4e2b7f8545c2033b0049722cdbb8c589b55b --- /dev/null +++ b/scripts/run_tests_locally-device-tapi.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py diff --git a/src/l3_attackmitigator/genproto.sh b/scripts/run_tests_locally-pathcomp.sh old mode 100644 new mode 100755 similarity index 53% rename from src/l3_attackmitigator/genproto.sh rename to scripts/run_tests_locally-pathcomp.sh index 40635e44a4d43ec821d734f9fe022d86e37dc831..f56f47a8b592939243a2ec5d9fd95d89046582d1 --- a/src/l3_attackmitigator/genproto.sh +++ b/scripts/run_tests_locally-pathcomp.sh @@ -1,6 +1,5 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,16 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e -# Make folder containing the script the root folder for its execution -cd $(dirname $0) +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py +# Run unitary tests and analyze coverage of code at same time -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_attackmitigator.proto +# Useful flags for pytest: +#-o log_cli=true -o log_file=service.log -o log_file_level=DEBUG -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2_grpc.py +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + pathcomp/tests/test_unitary.py diff --git a/scripts/run_tests_locally-service.sh b/scripts/run_tests_locally-service.sh new file mode 100755 index 0000000000000000000000000000000000000000..8a2a8d0be1d1960c6197a67e471ae29abba501a7 --- /dev/null +++ b/scripts/run_tests_locally-service.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + service/tests/test_unitary.py diff --git a/scripts/run_tests_locally-slice.sh b/scripts/run_tests_locally-slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..fa3af4eba1f9d42a1f9d283964a536a00f9547ae --- /dev/null +++ b/scripts/run_tests_locally-slice.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py diff --git a/scripts/run_tests_locally.sh b/scripts/run_tests_locally.sh new file mode 100755 index 0000000000000000000000000000000000000000..1d48cc1af18629874b0275b1fa92bf31961741c3 --- /dev/null +++ b/scripts/run_tests_locally.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# configure the correct folder on the .coveragerc file +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE + +# Run unitary tests and analyze coverage of code at same time + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE="tf-dev" +K8S_HOSTNAME="kubernetes-master" +# Populate environment variables for context to use Redis in a development machine running Kubernetes +# Uncomment below lines to create a Redis instance within Context for testing purposes. +#kubectl delete namespace $K8S_NAMESPACE +#kubectl create namespace $K8S_NAMESPACE +#kubectl --namespace $K8S_NAMESPACE apply -f ../manifests/contextservice.yaml +#kubectl --namespace $K8S_NAMESPACE apply -f ../manifests/monitoringservice.yaml +#kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +#kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" +#kubectl --namespace $K8S_NAMESPACE expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests +#kubectl --namespace $K8S_NAMESPACE expose deployment monitoringservice --port=8086 --type=NodePort --name=influx-tests +#echo "Waiting 10 seconds for Redis/Influx to start..." +#sleep 10 +export REDIS_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') +export INFLUXDB_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export INFLUXDB_PORT=$(kubectl get service influx-tests --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8086)].nodePort}') +export INFLUXDB_USER=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) +export INFLUXDB_PASSWORD=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) +export INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) + +# First destroy old coverage file +rm -f $COVERAGEFILE + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + common/orm/tests/test_unitary.py \ + common/message_broker/tests/test_unitary.py \ + common/rpc_method_wrapper/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + context/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py + +coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ + l3_centralizedattackdetector/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ + l3_distributedattackdetector/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ + l3_attackmitigator/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + opticalcentralizedattackdetector/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + dbscanserving/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + opticalattackmitigator/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + service/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + compute/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + webui/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + monitoring/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + pathcomp/tests/test_unitary.py diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh new file mode 100755 index 0000000000000000000000000000000000000000..8823f29c09960ce980f48d76463682d34e2ea09f --- /dev/null +++ b/scripts/show_logs_automation.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/automationservice diff --git a/scripts/show_logs_compute.sh b/scripts/show_logs_compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..5e061bb9eb49047b96027a39d3bc846a3e502b5c --- /dev/null +++ b/scripts/show_logs_compute.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/computeservice diff --git a/scripts/show_logs_context.sh b/scripts/show_logs_context.sh new file mode 100755 index 0000000000000000000000000000000000000000..ece545a7e32131880079c2ce65a950c64a16273e --- /dev/null +++ b/scripts/show_logs_context.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server diff --git a/scripts/show_logs_device.sh b/scripts/show_logs_device.sh new file mode 100755 index 0000000000000000000000000000000000000000..e1c2e4aa8a5fd39e525fcf61ffcf5572e3e6c8d0 --- /dev/null +++ b/scripts/show_logs_device.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/deviceservice diff --git a/scripts/show_logs_monitoring.sh b/scripts/show_logs_monitoring.sh new file mode 100755 index 0000000000000000000000000000000000000000..5978035127735c20ddc6387666a5434cbac61ff8 --- /dev/null +++ b/scripts/show_logs_monitoring.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/monitoringservice -c server diff --git a/scripts/show_logs_service.sh b/scripts/show_logs_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..251add7e1641862f3c95dbf038920bc86b3c89ff --- /dev/null +++ b/scripts/show_logs_service.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/serviceservice diff --git a/scripts/show_logs_webui.sh b/scripts/show_logs_webui.sh new file mode 100755 index 0000000000000000000000000000000000000000..c73f5f51a6aefe0caee2620cccca272f1abb8622 --- /dev/null +++ b/scripts/show_logs_webui.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/webuiservice -c server diff --git a/show_deploy.sh b/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..e894d44f3d7f79ac18ce4f3d5b2708a6402764e6 --- /dev/null +++ b/show_deploy.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deployment Resources:" +kubectl --namespace $TFS_K8S_NAMESPACE get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace $TFS_K8S_NAMESPACE get ingress +printf "\n" diff --git a/src/__init__.py b/src/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/automation/.gitlab-ci.yml b/src/automation/.gitlab-ci.yml index 612a6a107075652c8ee624da661a646d0b3f3d1e..87d141d5bef56c8d3fbd5bb5a0a961ac12598dd6 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/automation/.gitlab-ci.yml @@ -1,36 +1,82 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +variables: + IMAGE_NAME: 'automation' + REPORTS_PATH: "src/${IMAGE_NAME}/reports" + BUILD_ENV: build.env + # Package application needed to run tests & build the image on next stage build automation: - variables: - IMAGE_NAME: 'automation' # name of the microservice - IMAGE_NAME_TEST: 'automation-test' # name of the microservice - IMAGE_TAG: '0.0.1' # tag of the container image (production, development, etc) stage: build script: + - export IMAGE_TAG=$(grep -m1 '' ./src/$IMAGE_NAME/pom.xml | grep -oP '(?<=>).*(?=<)') + - echo "IMAGE_TAG=${IMAGE_TAG}" >> ${BUILD_ENV} + - cat ${BUILD_ENV} - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target builder + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + artifacts: + reports: + dotenv: ${BUILD_ENV} rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - src/$IMAGE_NAME/** + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Run tests, build & push the image unit_test automation: variables: - IMAGE_NAME: 'automation' # name of the microservice - IMAGE_NAME_TEST: 'automation-test' # name of the microservice - IMAGE_TAG: '0.0.1' # tag of the container image (production, development, etc) + REPORTS_CONTAINER: "${IMAGE_NAME}-reports" stage: unit_test needs: - build automation before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker rm ${REPORTS_CONTAINER} || true script: + - echo "Running tests for image ${IMAGE_TAG}" - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target unit-test + # Transfer JaCoCo and Surefire reports from within tests image + - docker create --name ${REPORTS_CONTAINER} "$IMAGE_NAME:$IMAGE_TAG" + - mkdir -p ${REPORTS_PATH} + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/index.html ${REPORTS_PATH}/coverage.html + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/jacoco.xml ${REPORTS_PATH}/jacoco.xml + - docker cp ${REPORTS_CONTAINER}:/app/target/surefire-reports/ ${REPORTS_PATH}/ + - cat ${REPORTS_PATH}/coverage.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' + - docker run -v "$(pwd)/src/${IMAGE_NAME}:/${IMAGE_NAME}" --rm registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 python /opt/cover2cover.py ${IMAGE_NAME}/reports/jacoco.xml ${IMAGE_NAME}/src/main/java > ${REPORTS_PATH}/cobertura.xml + # Build final image - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target release - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker rm ${REPORTS_CONTAINER} + - docker rm -f "$IMAGE_NAME:$IMAGE_TAG" + coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' + artifacts: + reports: + junit: + - ${REPORTS_PATH}/surefire-reports/TEST-*.xml rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - src/$IMAGE_NAME/** + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Deployment of automation service in Kubernetes Cluster @@ -42,6 +88,13 @@ deploy automation: script: - kubectl version - kubectl get all + - kubectl delete --ignore-not-found=true -f "manifests/automationservice.yaml" - kubectl apply -f "manifests/automationservice.yaml" - kubectl delete pods --selector app=automationservice - kubectl get all + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual + diff --git a/src/automation/README.md b/src/automation/README.md index a66aab8ca54ea2661b943dc3f2b2d6d18777ca16..099980bcc4172bf9e5c2d59459f40ae4331696cf 100644 --- a/src/automation/README.md +++ b/src/automation/README.md @@ -2,20 +2,38 @@ The Automation service, also known as Zero-Touch Provisioning (ZTP), is tested on Ubuntu 20.04. Follow the instructions below to build, test, and run this service on your local environment. +## Automation Teraflow OS service architecture -## Compile code +| The Automation Teraflow OS service architecture consists of six (6) interfaces listed below: | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 1. The `AutomationGateway` interface that implements all the rpc functions that are described in `automation.proto` file. | +| 2. The `ContextGateway` interface that communicates with a `Context` Service gRPC client and implements all the rpc functions that are described in `context.proto` file. | +| 3. The `DeviceGateway` interface that communicates with a `Device` Service gRPC client and implements all the rpc functions that are described in `device.proto` file. | +| 4. The `AutomationService` interface that implements the `addDevice()` method by communicating with a `Context` gRPC client & a `Device` gRPC client through the use of `ContextService` interface & `DeviceService` interface respectively. | +| 5. The `ContextService` interface that implements the `getDevice()` & `getDeviceEvents()` methods by communicating with a `Context` gRPC client through the use of `ContextGateway` interface. | +| 6. The `DeviceService` interface that implements the `getInitialConfiguration()` & `configureDevice()` methods by communicating with a `Device` gRPC client through the use of `DeviceGateway` interface. | -` -./mvnw compile -` -## Execute unit tests -` -./mvnw test -` -## Run service +## Run with dev profile -` -./mvnw quarkus:dev -` +```bash +./mvnw clean quarkus:dev +``` +## Running tests + +Run unit and functional tests `./mvnw clean test` + +## Deploying on a Kubernetes cluster + +To create the K8s manifest file under `target/kubernetes/kubernetes.yml` to be used run + +```bash +./mvnw clean package -DskipUTs -DskipITs +``` + +To deploy the application in a K8s cluster run + +```bash +kubectl apply -f "manifests/automationservice.yaml" +``` diff --git a/src/automation/pom.xml b/src/automation/pom.xml index 0bf37ea67c0953cc63da34046da93ab281adf76c..4609c2c8db9aae825a86e3820efa9c00a9d737f0 100644 --- a/src/automation/pom.xml +++ b/src/automation/pom.xml @@ -1,11 +1,27 @@ + + 4.0.0 eu.teraflow automation - 0.0.1 + 0.2.0 TeraFlow Automation Component TeraFlow Automation Component @@ -83,6 +99,13 @@ + + + io.github.project-openubl + quarkus-bouncycastle + 1.2.2.Final + + io.quarkus quarkus-grpc @@ -267,6 +290,16 @@ org.jacoco jacoco-maven-plugin ${jacoco.version} + + + automation/* + context/* + device/* + monitoring/* + kpi_sample_types/* + acl/* + + instrument-unit-tests @@ -393,7 +426,7 @@ compile - check + apply diff --git a/src/automation/src/main/docker/Dockerfile.multistage.jvm b/src/automation/src/main/docker/Dockerfile.multistage.jvm index 696c8e18468b1cd57036d3f340f315cd69cc9333..426e154baf71b1854fa688fb9302bbc539a1a635 100644 --- a/src/automation/src/main/docker/Dockerfile.multistage.jvm +++ b/src/automation/src/main/docker/Dockerfile.multistage.jvm @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # Multi-stage Docker image build # Stage 1 @@ -15,7 +29,7 @@ RUN mvn --errors --batch-mode package -Dmaven.test.skip=true # Stage 2 FROM builder AS unit-test -RUN mvn --errors --batch-mode test +RUN mvn --errors --batch-mode -Pgenerate-consolidated-coverage verify # Stage 3 FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4 AS release @@ -46,7 +60,7 @@ COPY --from=builder --chown=1001 /app/target/quarkus-app/app/ /deployments/app/ COPY --from=builder --chown=1001 /app/target/quarkus-app/quarkus/ /deployments/quarkus/ EXPOSE 8080 -EXPOSE 9999 +EXPOSE 5050 USER 1001 ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java index 7d50b7d5138e59f102a76970c7d8e94d08a61fef..91b6e159d26c86afaf0412af0406657a9c72f8d5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import io.smallrye.config.ConfigMapping; diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java index 045ff44928a52f296ed8290b37eaf385857f52b6..2d8194c6902037b09cf1f707dc8ff9c264e2f2c5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import automation.AutomationService; diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java index 8e98051560d736e1305e6392c033666c40ddebf5..c160387c3e3448f29d01a185afc31127b025c2b6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java @@ -1,9 +1,25 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import automation.Automation; import context.ContextOuterClass; -import eu.teraflow.automation.device.model.DeviceId; -import eu.teraflow.automation.device.model.Uuid; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.model.DeviceRoleId; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; @@ -12,10 +28,12 @@ import javax.inject.Inject; public class AutomationGatewayImpl implements AutomationGateway { private final AutomationService automationService; + private final Serializer serializer; @Inject - public AutomationGatewayImpl(AutomationService automationService) { + public AutomationGatewayImpl(AutomationService automationService, Serializer serializer) { this.automationService = automationService; + this.serializer = serializer; } @Override @@ -32,15 +50,13 @@ public class AutomationGatewayImpl implements AutomationGateway { @Override public Uni ztpAdd(Automation.DeviceRole request) { + final var devRoleId = request.getDevRoleId().getDevRoleId().getUuid(); + final var deviceId = serializer.deserialize(request.getDevRoleId().getDevId()); - automationService.addDevice(getDeviceId(request.getDevRoleId().getDevId())); - - return Uni.createFrom() - .item( - () -> - Automation.DeviceRoleState.newBuilder() - .setDevRoleId(request.getDevRoleId()) - .build()); + return automationService + .addDevice(deviceId) + .onItem() + .transform(device -> transformToDeviceRoleState(device, devRoleId)); } @Override @@ -64,14 +80,20 @@ public class AutomationGatewayImpl implements AutomationGateway { } @Override - public Uni ztpDeleteAll(Automation.Empty empty) { + public Uni ztpDeleteAll(ContextOuterClass.Empty empty) { return Uni.createFrom().item(() -> Automation.DeviceDeletionResult.newBuilder().build()); } - private DeviceId getDeviceId(ContextOuterClass.DeviceId serializedDeviceId) { + // TODO When `DeviceRoleState` domain object will be created, move this method to Serializer class + // and create related tests + private Automation.DeviceRoleState transformToDeviceRoleState(Device device, String devRoleId) { - Uuid uuid = new Uuid(serializedDeviceId.getDeviceUuid().getUuid()); + final var deviceRoleId = new DeviceRoleId(devRoleId, device.getDeviceId()); + final var serializeDeviceRoleId = serializer.serialize(deviceRoleId); - return new DeviceId(uuid); + return Automation.DeviceRoleState.newBuilder() + .setDevRoleId(serializeDeviceRoleId) + .setDevRoleState(Automation.ZtpDeviceState.ZTP_DEV_STATE_CREATED) + .build(); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java index 1c76fc4876bc31a49c639c34560bbd81621d5020..5c8e95a442d7f6134b6817d144ff2ad646d2b5c3 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java @@ -1,10 +1,25 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; -import eu.teraflow.automation.device.Device; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; import io.smallrye.mutiny.Uni; public interface AutomationService { - Uni addDevice(DeviceId deviceId); + Uni addDevice(String deviceId); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java index fc62e77ec436f5274f19c6156eb260db90b270aa..13e56645384938b4eff42aa73ca9e8a5ff73a1bd 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java @@ -1,9 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import eu.teraflow.automation.context.ContextService; -import eu.teraflow.automation.device.Device; +import eu.teraflow.automation.context.model.Device; import eu.teraflow.automation.device.DeviceService; -import eu.teraflow.automation.device.model.*; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; @@ -23,34 +38,46 @@ public class AutomationServiceImpl implements AutomationService { } @Override - public Uni addDevice(DeviceId deviceId) { + public Uni addDevice(String deviceId) { - final var deviceUni = contextService.getDevice(deviceId); + final var deserializedDeviceUni = contextService.getDevice(deviceId); - deviceUni + deserializedDeviceUni + // TODO fix subscribe .subscribe() .with( device -> { - if (!(device - .getDeviceOperationalStatus() - .toString() - .equals(DeviceOperationalStatus.ENABLED.toString()))) { + final var id = deviceId; + + if (!device.isEnabled()) { + LOGGER.infof("Retrieved %s", device); - final var initialConfig = deviceService.getInitialConfiguration(deviceId); + final var initialConfiguration = + deviceService.getInitialConfiguration(device.getDeviceId()); - device.setDeviceOperationalStatus(DeviceOperationalStatus.ENABLED); + device.enableDevice(); + LOGGER.infof("Enabled device [%s]", id); - initialConfig + initialConfiguration .subscribe() .with( deviceConfig -> { device.setDeviceConfiguration(deviceConfig); - deviceService.configureDevice(device); - LOGGER.infof("Received response %s", device); + final var configuredDeviceIdUni = deviceService.configureDevice(device); + + configuredDeviceIdUni + .subscribe() + .with( + configuredDeviceId -> + LOGGER.infof( + "Device [%s] has been enabled and configured successfully with %s.\n", + id, deviceConfig)); }); + } else { + LOGGER.infof("%s has been already enabled. Ignoring...", device); } }); - return deviceUni; + return deserializedDeviceUni; } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java index 195634d00bb17debb623e164d975288488a9a240..df5f14081711a22c3896dfadbe14b659bcb426cf 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +++ b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java @@ -1,9 +1,25 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import eu.teraflow.automation.context.ContextService; -import eu.teraflow.automation.device.model.DeviceEvent; +import eu.teraflow.automation.context.model.Event; +import eu.teraflow.automation.context.model.EventTypeEnum; import io.quarkus.runtime.StartupEvent; -import io.smallrye.mutiny.Multi; import java.time.Duration; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; @@ -31,28 +47,55 @@ public class ContextSubscriber { public void listenForDeviceEvents() { - Multi deviceEventsMulti = - contextService - .getDeviceEvents() - .onFailure() - .retry() - .withBackOff(Duration.ofSeconds(1)) - .withJitter(0.2) - .atMost(10); - - deviceEventsMulti - .onItem() - .transformToUniAndConcatenate( - deviceEvent -> automationService.addDevice(deviceEvent.getDeviceId())); + contextService + .getDeviceEvents() + .onFailure() + .retry() + .withBackOff(Duration.ofSeconds(1)) + .withJitter(0.2) + .atMost(10) + .onFailure() + .recoverWithCompletion() + .subscribe() + .with( + deviceEvent -> { + LOGGER.debugf("Received %s via contextService:getDeviceEvents", deviceEvent); + if (deviceEvent == null || deviceEvent.getEvent() == null) { + LOGGER.warn("Received device event is null, ignoring..."); + return; + } + final var eventType = deviceEvent.getEvent().getEventTypeEnum(); + final var deviceId = deviceEvent.getDeviceId(); + final var event = deviceEvent.getEvent(); + + switch (eventType) { + case CREATE: + LOGGER.infof("Received %s for device [%s]", event, deviceId); + automationService.addDevice(deviceEvent.getDeviceId()); + break; + + case UPDATE: + case REMOVE: + case UNDEFINED: + logWarningMessage(event, deviceId, eventType); + break; + } + }); } void onStart(@Observes StartupEvent ev) { if (automationConfiguration.shouldSubscribeToContextComponent()) { - LOGGER.info("Listening for Device events..."); + LOGGER.info("Subscribing to Context service for device events..."); listenForDeviceEvents(); } else { - LOGGER.info("Not listening for Device events..."); + LOGGER.info("Not subscribing to Context service for device events..."); } } + + private void logWarningMessage(Event event, String deviceId, EventTypeEnum eventType) { + LOGGER.warnf( + "Received %s for device [%s]. [%s] event handling is not yet implemented, ignoring...", + event, deviceId, eventType); + } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java b/src/automation/src/main/java/eu/teraflow/automation/Serializer.java new file mode 100644 index 0000000000000000000000000000000000000000..2b163fdff1a29c26f98380a0c3b19666a86749fe --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/Serializer.java @@ -0,0 +1,930 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; + +import acl.Acl; +import automation.Automation; +import context.ContextOuterClass; +import context.ContextOuterClass.ConfigRule_ACL; +import context.ContextOuterClass.ConfigRule_Custom; +import context.ContextOuterClass.ContextId; +import context.ContextOuterClass.DeviceId; +import context.ContextOuterClass.DeviceOperationalStatusEnum; +import context.ContextOuterClass.Location.LocationCase; +import context.ContextOuterClass.Uuid; +import eu.teraflow.automation.acl.AclAction; +import eu.teraflow.automation.acl.AclEntry; +import eu.teraflow.automation.acl.AclForwardActionEnum; +import eu.teraflow.automation.acl.AclLogActionEnum; +import eu.teraflow.automation.acl.AclMatch; +import eu.teraflow.automation.acl.AclRuleSet; +import eu.teraflow.automation.acl.AclRuleTypeEnum; +import eu.teraflow.automation.context.model.ConfigActionEnum; +import eu.teraflow.automation.context.model.ConfigRule; +import eu.teraflow.automation.context.model.ConfigRuleAcl; +import eu.teraflow.automation.context.model.ConfigRuleCustom; +import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; +import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.automation.context.model.DeviceDriverEnum; +import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.automation.context.model.DeviceOperationalStatus; +import eu.teraflow.automation.context.model.EndPoint; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.Event; +import eu.teraflow.automation.context.model.EventTypeEnum; +import eu.teraflow.automation.context.model.GpsPosition; +import eu.teraflow.automation.context.model.Location; +import eu.teraflow.automation.context.model.LocationTypeGpsPosition; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.automation.context.model.TopologyId; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.automation.model.DeviceRole; +import eu.teraflow.automation.model.DeviceRoleId; +import eu.teraflow.automation.model.DeviceRoleType; +import java.util.stream.Collectors; +import javax.inject.Singleton; +import kpi_sample_types.KpiSampleTypes; + +@Singleton +public class Serializer { + + public DeviceId serializeDeviceId(String expectedDeviceId) { + final var builder = DeviceId.newBuilder(); + final var uuid = serializeUuid(expectedDeviceId); + + builder.setDeviceUuid(uuid); + + return builder.build(); + } + + public String deserialize(DeviceId deviceId) { + return deviceId.getDeviceUuid().getUuid(); + } + + public Automation.DeviceRoleId serialize(DeviceRoleId deviceRoleId) { + final var builder = Automation.DeviceRoleId.newBuilder(); + + final var deviceRoleDevRoleId = deviceRoleId.getId(); + final var deviceRoleDeviceId = deviceRoleId.getDeviceId(); + + final var deviceRoleDevRoleIdUuid = serializeUuid(deviceRoleDevRoleId); + final var deviceRoleDeviceIdUuid = serializeUuid(deviceRoleDeviceId); + + final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceRoleDeviceIdUuid); + + builder.setDevRoleId(deviceRoleDevRoleIdUuid); + builder.setDevId(deviceId); + + return builder.build(); + } + + public DeviceRoleId deserialize(Automation.DeviceRoleId deviceRoleId) { + final var devRoleId = deserialize(deviceRoleId.getDevRoleId()); + final var devId = deserialize(deviceRoleId.getDevId()); + + return new DeviceRoleId(devRoleId, devId); + } + + public Automation.DeviceRoleType serialize(DeviceRoleType deviceRoleType) { + switch (deviceRoleType) { + case NONE: + return Automation.DeviceRoleType.NONE; + case DEV_OPS: + return Automation.DeviceRoleType.DEV_OPS; + case DEV_CONF: + return Automation.DeviceRoleType.DEV_CONF; + case PIPELINE_CONF: + return Automation.DeviceRoleType.PIPELINE_CONF; + default: + return Automation.DeviceRoleType.UNRECOGNIZED; + } + } + + public DeviceRoleType deserialize(Automation.DeviceRoleType serializedDeviceRoleType) { + switch (serializedDeviceRoleType) { + case DEV_OPS: + return DeviceRoleType.DEV_OPS; + case DEV_CONF: + return DeviceRoleType.DEV_CONF; + case PIPELINE_CONF: + return DeviceRoleType.PIPELINE_CONF; + case NONE: + case UNRECOGNIZED: + default: + return DeviceRoleType.NONE; + } + } + + public Automation.DeviceRole serialize(DeviceRole deviceRole) { + final var builder = Automation.DeviceRole.newBuilder(); + final var serializedDeviceRoleId = serialize(deviceRole.getDeviceRoleId()); + final var serializedDeviceRoleType = serialize(deviceRole.getType()); + + builder.setDevRoleId(serializedDeviceRoleId); + builder.setDevRoleType(serializedDeviceRoleType); + + return builder.build(); + } + + public DeviceRole deserialize(Automation.DeviceRole deviceRole) { + final var deviceRoleId = deserialize(deviceRole.getDevRoleId()); + final var deviceRoleType = deserialize(deviceRole.getDevRoleType()); + + return new DeviceRole(deviceRoleId, deviceRoleType); + } + + public ContextOuterClass.EventTypeEnum serialize(EventTypeEnum eventTypeEnum) { + switch (eventTypeEnum) { + case CREATE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE; + case REMOVE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE; + case UPDATE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE; + case UNDEFINED: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED; + default: + return ContextOuterClass.EventTypeEnum.UNRECOGNIZED; + } + } + + public EventTypeEnum deserialize(ContextOuterClass.EventTypeEnum serializedEventType) { + switch (serializedEventType) { + case EVENTTYPE_CREATE: + return EventTypeEnum.CREATE; + case EVENTTYPE_REMOVE: + return EventTypeEnum.REMOVE; + case EVENTTYPE_UPDATE: + return EventTypeEnum.UPDATE; + case EVENTTYPE_UNDEFINED: + case UNRECOGNIZED: + default: + return EventTypeEnum.UNDEFINED; + } + } + + public ContextOuterClass.Timestamp serialize(double timestamp) { + final var builder = ContextOuterClass.Timestamp.newBuilder(); + + builder.setTimestamp(timestamp); + + return builder.build(); + } + + public double deserialize(ContextOuterClass.Timestamp serializedTimeStamp) { + + return serializedTimeStamp.getTimestamp(); + } + + public ContextOuterClass.Event serialize(Event event) { + final var builder = ContextOuterClass.Event.newBuilder(); + + final var eventType = serialize(event.getEventTypeEnum()); + final var timestamp = serialize(event.getTimestamp()); + builder.setEventType(eventType); + builder.setTimestamp(timestamp); + + return builder.build(); + } + + public Event deserialize(ContextOuterClass.Event serializedEvent) { + final var timestamp = deserialize(serializedEvent.getTimestamp()); + final var eventType = deserialize(serializedEvent.getEventType()); + + return new Event(timestamp, eventType); + } + + public ContextOuterClass.DeviceEvent serialize(DeviceEvent deviceEvent) { + final var builder = ContextOuterClass.DeviceEvent.newBuilder(); + final var deviceIdUuid = serializeUuid(deviceEvent.getDeviceId()); + final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceIdUuid); + + builder.setDeviceId(deviceId); + builder.setEvent(serialize(deviceEvent.getEvent())); + + return builder.build(); + } + + public DeviceEvent deserialize(ContextOuterClass.DeviceEvent deviceEvent) { + final var deviceId = deserialize(deviceEvent.getDeviceId()); + final var event = deserialize(deviceEvent.getEvent()); + + return new DeviceEvent(deviceId, event); + } + + public ContextOuterClass.ConfigActionEnum serialize(ConfigActionEnum configAction) { + switch (configAction) { + case SET: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET; + case DELETE: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE; + case UNDEFINED: + default: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED; + } + } + + public ConfigActionEnum deserialize(ContextOuterClass.ConfigActionEnum serializedConfigAction) { + switch (serializedConfigAction) { + case CONFIGACTION_SET: + return ConfigActionEnum.SET; + case CONFIGACTION_DELETE: + return ConfigActionEnum.DELETE; + case UNRECOGNIZED: + case CONFIGACTION_UNDEFINED: + default: + return ConfigActionEnum.UNDEFINED; + } + } + + public ContextId serializeContextId(String expectedContextId) { + final var builder = ContextId.newBuilder(); + final var uuid = serializeUuid(expectedContextId); + + builder.setContextUuid(uuid); + + return builder.build(); + } + + public String deserialize(ContextId contextId) { + return contextId.getContextUuid().getUuid(); + } + + public ContextOuterClass.TopologyId serialize(TopologyId topologyId) { + final var builder = ContextOuterClass.TopologyId.newBuilder(); + + final var topologyIdContextId = topologyId.getContextId(); + final var topologyIdId = topologyId.getId(); + + final var contextId = serializeContextId(topologyIdContextId); + final var topologyIdIdUuid = serializeUuid(topologyIdId); + + builder.setContextId(contextId); + builder.setTopologyUuid(topologyIdIdUuid); + + return builder.build(); + } + + public TopologyId deserialize(ContextOuterClass.TopologyId topologyId) { + final var topologyIdContextId = deserialize(topologyId.getContextId()); + final var topologyIdId = deserialize(topologyId.getTopologyUuid()); + + return new TopologyId(topologyIdContextId, topologyIdId); + } + + public ContextOuterClass.EndPointId serialize(EndPointId endPointId) { + final var builder = ContextOuterClass.EndPointId.newBuilder(); + + final var endPointIdTopologyId = endPointId.getTopologyId(); + final var endPointIdDeviceId = endPointId.getDeviceId(); + final var endPointIdId = endPointId.getId(); + + final var serializedTopologyId = serialize(endPointIdTopologyId); + final var serializedDeviceId = serializeDeviceId(endPointIdDeviceId); + final var serializedEndPointIdId = serializeUuid(endPointIdId); + + builder.setTopologyId(serializedTopologyId); + builder.setDeviceId(serializedDeviceId); + builder.setEndpointUuid(serializedEndPointIdId); + + return builder.build(); + } + + public EndPointId deserialize(ContextOuterClass.EndPointId serializedEndPointId) { + final var serializedTopologyId = serializedEndPointId.getTopologyId(); + final var serializedDeviceId = serializedEndPointId.getDeviceId(); + final var serializedId = serializedEndPointId.getEndpointUuid(); + + final var topologyId = deserialize(serializedTopologyId); + final var deviceId = deserialize(serializedDeviceId); + final var id = deserialize(serializedId); + + return new EndPointId(topologyId, deviceId, id); + } + + public Acl.AclRuleTypeEnum serialize(AclRuleTypeEnum aclRuleTypeEnum) { + switch (aclRuleTypeEnum) { + case IPV4: + return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4; + case IPV6: + return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6; + case L2: + return Acl.AclRuleTypeEnum.ACLRULETYPE_L2; + case MPLS: + return Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS; + case MIXED: + return Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED; + case UNDEFINED: + return Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED; + default: + return Acl.AclRuleTypeEnum.UNRECOGNIZED; + } + } + + public AclRuleTypeEnum deserialize(Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) { + switch (serializedAclRuleTypeEnum) { + case ACLRULETYPE_IPV4: + return AclRuleTypeEnum.IPV4; + case ACLRULETYPE_IPV6: + return AclRuleTypeEnum.IPV6; + case ACLRULETYPE_L2: + return AclRuleTypeEnum.L2; + case ACLRULETYPE_MPLS: + return AclRuleTypeEnum.MPLS; + case ACLRULETYPE_MIXED: + return AclRuleTypeEnum.MIXED; + case UNRECOGNIZED: + default: + return AclRuleTypeEnum.UNDEFINED; + } + } + + public Acl.AclMatch serialize(AclMatch aclMatch) { + final var builder = Acl.AclMatch.newBuilder(); + + final var dscp = aclMatch.getDscp(); + final var protocol = aclMatch.getProtocol(); + final var srcAddress = aclMatch.getSrcAddress(); + final var dstAddress = aclMatch.getDstAddress(); + final var srcPort = aclMatch.getSrcPort(); + final var dstPort = aclMatch.getDstPort(); + final var startMplsLabel = aclMatch.getStartMplsLabel(); + final var endMplsLabel = aclMatch.getEndMplsLabel(); + + builder.setDscp(dscp); + builder.setProtocol(protocol); + builder.setSrcAddress(srcAddress); + builder.setDstAddress(dstAddress); + builder.setSrcPort(srcPort); + builder.setDstPort(dstPort); + builder.setStartMplsLabel(startMplsLabel); + builder.setEndMplsLabel(endMplsLabel); + + return builder.build(); + } + + public AclMatch deserialize(Acl.AclMatch serializedAclMatch) { + final var dscp = serializedAclMatch.getDscp(); + final var protocol = serializedAclMatch.getProtocol(); + final var srcAddress = serializedAclMatch.getSrcAddress(); + final var dstAddress = serializedAclMatch.getDstAddress(); + final var srcPort = serializedAclMatch.getSrcPort(); + final var dstPort = serializedAclMatch.getDstPort(); + final var startMplsLabel = serializedAclMatch.getStartMplsLabel(); + final var endMplsLabel = serializedAclMatch.getEndMplsLabel(); + + return new AclMatch( + dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel); + } + + public Acl.AclForwardActionEnum serialize(AclForwardActionEnum aclForwardActionEnum) { + switch (aclForwardActionEnum) { + case DROP: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP; + case ACCEPT: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT; + case REJECT: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT; + case UNDEFINED: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED; + default: + return Acl.AclForwardActionEnum.UNRECOGNIZED; + } + } + + public AclForwardActionEnum deserialize(Acl.AclForwardActionEnum serializedAclForwardActionEnum) { + switch (serializedAclForwardActionEnum) { + case ACLFORWARDINGACTION_DROP: + return AclForwardActionEnum.DROP; + case ACLFORWARDINGACTION_ACCEPT: + return AclForwardActionEnum.ACCEPT; + case ACLFORWARDINGACTION_REJECT: + return AclForwardActionEnum.REJECT; + case UNRECOGNIZED: + default: + return AclForwardActionEnum.UNDEFINED; + } + } + + public Acl.AclLogActionEnum serialize(AclLogActionEnum aclLogActionEnum) { + switch (aclLogActionEnum) { + case NO_LOG: + return Acl.AclLogActionEnum.ACLLOGACTION_NOLOG; + case SYSLOG: + return Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG; + case UNDEFINED: + return Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED; + default: + return Acl.AclLogActionEnum.UNRECOGNIZED; + } + } + + public AclLogActionEnum deserialize(Acl.AclLogActionEnum serializedAclLogActionEnum) { + switch (serializedAclLogActionEnum) { + case ACLLOGACTION_NOLOG: + return AclLogActionEnum.NO_LOG; + case ACLLOGACTION_SYSLOG: + return AclLogActionEnum.SYSLOG; + case UNRECOGNIZED: + default: + return AclLogActionEnum.UNDEFINED; + } + } + + public Acl.AclAction serialize(AclAction aclAction) { + final var builder = Acl.AclAction.newBuilder(); + + final var aclForwardActionEnum = aclAction.getAclForwardActionEnum(); + final var aclLogActionEnum = aclAction.getAclLogActionEnum(); + + final var serializedAclForwardActionEnum = serialize(aclForwardActionEnum); + final var serializedAclLogActionEnum = serialize(aclLogActionEnum); + + builder.setForwardAction(serializedAclForwardActionEnum); + builder.setLogAction(serializedAclLogActionEnum); + + return builder.build(); + } + + public AclAction deserialize(Acl.AclAction serializedAclAction) { + final var serializedAclForwardActionEnum = serializedAclAction.getForwardAction(); + final var serializedAclLogActionEnum = serializedAclAction.getLogAction(); + + final var aclForwardActionEnum = deserialize(serializedAclForwardActionEnum); + final var aclLogActionEnum = deserialize(serializedAclLogActionEnum); + + return new AclAction(aclForwardActionEnum, aclLogActionEnum); + } + + public Acl.AclEntry serialize(AclEntry aclEntry) { + final var builder = Acl.AclEntry.newBuilder(); + + final var sequenceId = aclEntry.getSequenceId(); + final var description = aclEntry.getDescription(); + final var aclMatch = aclEntry.getMatch(); + final var aclAction = aclEntry.getAction(); + + final var serializedAclMatch = serialize(aclMatch); + final var serializedAclAction = serialize(aclAction); + + builder.setSequenceId(sequenceId); + builder.setDescription(description); + builder.setMatch(serializedAclMatch); + builder.setAction(serializedAclAction); + + return builder.build(); + } + + public AclEntry deserialize(Acl.AclEntry serializedAclEntry) { + final var sequenceId = serializedAclEntry.getSequenceId(); + final var description = serializedAclEntry.getDescription(); + final var serializedAclMatch = serializedAclEntry.getMatch(); + final var serializedAclAction = serializedAclEntry.getAction(); + + final var aclMatch = deserialize(serializedAclMatch); + final var aclAction = deserialize(serializedAclAction); + + return new AclEntry(sequenceId, description, aclMatch, aclAction); + } + + public Acl.AclRuleSet serialize(AclRuleSet aclRuleSet) { + final var builder = Acl.AclRuleSet.newBuilder(); + + final var name = aclRuleSet.getName(); + final var type = aclRuleSet.getType(); + final var description = aclRuleSet.getDescription(); + final var userId = aclRuleSet.getUserId(); + final var entries = aclRuleSet.getEntries(); + + final var serializedType = serialize(type); + final var serializedEntries = + entries.stream().map(this::serialize).collect(Collectors.toList()); + + builder.setName(name); + builder.setType(serializedType); + builder.setDescription(description); + builder.setUserId(userId); + builder.addAllEntries(serializedEntries); + + return builder.build(); + } + + public AclRuleSet deserialize(Acl.AclRuleSet serializedAclRuleSet) { + final var serializedName = serializedAclRuleSet.getName(); + final var serializedType = serializedAclRuleSet.getType(); + final var serializedDescription = serializedAclRuleSet.getDescription(); + final var serializedUserId = serializedAclRuleSet.getUserId(); + final var serializedEntries = serializedAclRuleSet.getEntriesList(); + + final var type = deserialize(serializedType); + final var entries = + serializedEntries.stream().map(this::deserialize).collect(Collectors.toList()); + + return new AclRuleSet(serializedName, type, serializedDescription, serializedUserId, entries); + } + + public ConfigRule_ACL serialize(ConfigRuleAcl configRuleAcl) { + final var builder = ContextOuterClass.ConfigRule_ACL.newBuilder(); + + final var endPointId = configRuleAcl.getEndPointId(); + final var aclRuleSet = configRuleAcl.getRuleSet(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedAclRuleSet = serialize(aclRuleSet); + + builder.setEndpointId(serializedEndPointId); + builder.setRuleSet(serializedAclRuleSet); + + return builder.build(); + } + + public ConfigRuleAcl deserialize(ConfigRule_ACL serializedConfigRuleAcl) { + final var serializedEndPointId = serializedConfigRuleAcl.getEndpointId(); + final var serializedAclRuleSet = serializedConfigRuleAcl.getRuleSet(); + + final var endPointId = deserialize(serializedEndPointId); + final var aclRuleSet = deserialize(serializedAclRuleSet); + + return new ConfigRuleAcl(endPointId, aclRuleSet); + } + + public ConfigRule_Custom serialize(ConfigRuleCustom configRuleCustom) { + final var builder = ConfigRule_Custom.newBuilder(); + + final var resourceKey = configRuleCustom.getResourceKey(); + final var resourceValue = configRuleCustom.getResourceValue(); + + builder.setResourceKey(resourceKey); + builder.setResourceValue(resourceValue); + + return builder.build(); + } + + public ConfigRuleCustom deserialize(ConfigRule_Custom serializedConfigRuleCustom) { + final var serializedResourceKey = serializedConfigRuleCustom.getResourceKey(); + final var serializedResourceValue = serializedConfigRuleCustom.getResourceValue(); + + return new ConfigRuleCustom(serializedResourceKey, serializedResourceValue); + } + + public ContextOuterClass.ConfigRule serialize(ConfigRule configRule) { + final var builder = ContextOuterClass.ConfigRule.newBuilder(); + + final var configActionEnum = configRule.getConfigActionEnum(); + final var configRuleType = configRule.getConfigRuleType(); + final var configRuleTypeSpecificType = configRuleType.getConfigRuleType(); + + if (configRuleTypeSpecificType instanceof ConfigRuleAcl) { + final var endPointId = ((ConfigRuleAcl) configRuleTypeSpecificType).getEndPointId(); + final var aclRuleSet = ((ConfigRuleAcl) configRuleTypeSpecificType).getRuleSet(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedAclRuleSet = serialize(aclRuleSet); + + final var serializedConfigRuleAcl = + ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + builder.setAcl(serializedConfigRuleAcl); + } + + if (configRuleTypeSpecificType instanceof ConfigRuleCustom) { + final var configRuleCustomResourceKey = + ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceKey(); + final var configRuleCustomResourceValue = + ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceValue(); + + final var serializedConfigRuleCustom = + ConfigRule_Custom.newBuilder() + .setResourceKey(configRuleCustomResourceKey) + .setResourceValue(configRuleCustomResourceValue) + .build(); + + builder.setCustom(serializedConfigRuleCustom); + } + + final var serializedConfigActionEnum = serialize(configActionEnum); + + builder.setAction(serializedConfigActionEnum); + + return builder.build(); + } + + public ConfigRule deserialize(ContextOuterClass.ConfigRule serializedConfigRule) { + final var serializedConfigActionEnum = serializedConfigRule.getAction(); + final var typeOfConfigRule = serializedConfigRule.getConfigRuleCase(); + + final var configActionEnum = deserialize(serializedConfigActionEnum); + + switch (typeOfConfigRule) { + case ACL: + final var serializedConfigRuleAcl = serializedConfigRule.getAcl(); + + final var configRuleAcl = deserialize(serializedConfigRuleAcl); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + + return new ConfigRule(configActionEnum, configRuleTypeAcl); + case CUSTOM: + final var serializedConfigRuleCustom = serializedConfigRule.getCustom(); + + final var configRuleCustom = deserialize(serializedConfigRuleCustom); + final var configRuleTypeCustom = new ConfigRuleTypeCustom(configRuleCustom); + + return new ConfigRule(configActionEnum, configRuleTypeCustom); + default: + case CONFIGRULE_NOT_SET: + throw new IllegalStateException("Config Rule not set"); + } + } + + public ContextOuterClass.DeviceConfig serialize(DeviceConfig deviceConfig) { + final var builder = ContextOuterClass.DeviceConfig.newBuilder(); + + final var serializedConfigRules = + deviceConfig.getConfigRules().stream().map(this::serialize).collect(Collectors.toList()); + builder.addAllConfigRules(serializedConfigRules); + + return builder.build(); + } + + public DeviceConfig deserialize(ContextOuterClass.DeviceConfig deviceConfig) { + final var configRules = + deviceConfig.getConfigRulesList().stream() + .map(this::deserialize) + .collect(Collectors.toList()); + + return new DeviceConfig(configRules); + } + + public ContextOuterClass.DeviceOperationalStatusEnum serialize(DeviceOperationalStatus opStatus) { + switch (opStatus) { + case ENABLED: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED; + case DISABLED: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED; + case UNDEFINED: + default: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED; + } + } + + public DeviceOperationalStatus deserialize( + ContextOuterClass.DeviceOperationalStatusEnum opStatus) { + switch (opStatus) { + case DEVICEOPERATIONALSTATUS_ENABLED: + return DeviceOperationalStatus.ENABLED; + case DEVICEOPERATIONALSTATUS_DISABLED: + return DeviceOperationalStatus.DISABLED; + case DEVICEOPERATIONALSTATUS_UNDEFINED: + case UNRECOGNIZED: + default: + return DeviceOperationalStatus.UNDEFINED; + } + } + + public KpiSampleTypes.KpiSampleType serialize(KpiSampleType kpiSampleType) { + switch (kpiSampleType) { + case PACKETS_TRANSMITTED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED; + case PACKETS_RECEIVED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED; + case BYTES_TRANSMITTED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED; + case BYTES_RECEIVED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED; + case UNKNOWN: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN; + default: + return KpiSampleTypes.KpiSampleType.UNRECOGNIZED; + } + } + + public KpiSampleType deserialize(KpiSampleTypes.KpiSampleType serializedKpiSampleType) { + switch (serializedKpiSampleType) { + case KPISAMPLETYPE_PACKETS_TRANSMITTED: + return KpiSampleType.PACKETS_TRANSMITTED; + case KPISAMPLETYPE_PACKETS_RECEIVED: + return KpiSampleType.PACKETS_RECEIVED; + case KPISAMPLETYPE_BYTES_TRANSMITTED: + return KpiSampleType.BYTES_TRANSMITTED; + case KPISAMPLETYPE_BYTES_RECEIVED: + return KpiSampleType.BYTES_RECEIVED; + case KPISAMPLETYPE_UNKNOWN: + default: + return KpiSampleType.UNKNOWN; + } + } + + public ContextOuterClass.Location serialize(Location location) { + final var builder = ContextOuterClass.Location.newBuilder(); + + final var locationType = location.getLocationType(); + final var locationTypeSpecificType = locationType.getLocationType(); + + if (locationTypeSpecificType instanceof GpsPosition) { + final var latitude = ((GpsPosition) locationTypeSpecificType).getLatitude(); + final var longitude = ((GpsPosition) locationTypeSpecificType).getLongitude(); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + builder.setGpsPosition(serializedGpsPosition); + } + + if (locationTypeSpecificType instanceof String) { + final var region = ((String) locationTypeSpecificType); + + builder.setRegion(region); + } + + return builder.build(); + } + + public Location deserialize(ContextOuterClass.Location serializedLocation) { + final var typeOfLocation = serializedLocation.getLocationCase(); + + switch (typeOfLocation) { + case REGION: + final var region = serializedLocation.getRegion(); + final var locationTypeRegion = new LocationTypeRegion(region); + + return new Location(locationTypeRegion); + case GPS_POSITION: + final var serializedGpsPosition = serializedLocation.getGpsPosition(); + final var latitude = serializedGpsPosition.getLatitude(); + final var longitude = serializedGpsPosition.getLongitude(); + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + + return new Location(locationTypeGpsPosition); + default: + case LOCATION_NOT_SET: + throw new IllegalStateException("Location value not set"); + } + } + + public ContextOuterClass.DeviceDriverEnum serialize(DeviceDriverEnum deviceDriverEnum) { + switch (deviceDriverEnum) { + case OPENCONFIG: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG; + case TRANSPORT_API: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API; + case P4: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4; + case IETF_NETWORK_TOPOLOGY: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; + case ONF_TR_352: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352; + case UNDEFINED: + default: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED; + } + } + + public DeviceDriverEnum deserialize( + ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) { + switch (serializedDeviceDriverEnum) { + case DEVICEDRIVER_OPENCONFIG: + return DeviceDriverEnum.OPENCONFIG; + case DEVICEDRIVER_TRANSPORT_API: + return DeviceDriverEnum.TRANSPORT_API; + case DEVICEDRIVER_P4: + return DeviceDriverEnum.P4; + case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY: + return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY; + case DEVICEDRIVER_ONF_TR_352: + return DeviceDriverEnum.ONF_TR_352; + case DEVICEDRIVER_UNDEFINED: + case UNRECOGNIZED: + default: + return DeviceDriverEnum.UNDEFINED; + } + } + + public ContextOuterClass.EndPoint serialize(EndPoint endPoint) { + final var builder = ContextOuterClass.EndPoint.newBuilder(); + + final var endPointId = endPoint.getEndPointId(); + final var endPointType = endPoint.getEndPointType(); + final var kpiSampleTypes = endPoint.getKpiSampleTypes(); + final var endPointLocation = endPoint.getEndPointLocation(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(this::serialize).collect(Collectors.toList()); + if (endPointLocation != null) { + final var serializedEndPointLocation = serialize(endPointLocation); + builder.setEndpointLocation(serializedEndPointLocation); + } + + builder.setEndpointId(serializedEndPointId); + builder.setEndpointType(endPointType); + builder.addAllKpiSampleTypes(serializedKpiSampleTypes); + + return builder.build(); + } + + public EndPoint deserialize(ContextOuterClass.EndPoint serializedEndPoint) { + final var serializedEndPointId = serializedEndPoint.getEndpointId(); + final var endPointType = serializedEndPoint.getEndpointType(); + final var serializedKpiSampleTypes = serializedEndPoint.getKpiSampleTypesList(); + final var serializedEndPointLocation = serializedEndPoint.getEndpointLocation(); + + final var endPointId = deserialize(serializedEndPointId); + final var kpiSampleTypes = + serializedKpiSampleTypes.stream().map(this::deserialize).collect(Collectors.toList()); + + if (serializedEndPointLocation.getLocationCase() != LocationCase.LOCATION_NOT_SET) { + final var endPointLocation = deserialize(serializedEndPointLocation); + return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes) + .location(endPointLocation) + .build(); + } + + return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build(); + } + + public ContextOuterClass.Device serialize(Device device) { + final var builder = ContextOuterClass.Device.newBuilder(); + + final var deviceIdUuid = serializeUuid(device.getDeviceId()); + final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceIdUuid); + final var deviceType = device.getDeviceType(); + final var deviceConfig = device.getDeviceConfig(); + final var deviceOperationalStatus = device.getDeviceOperationalStatus(); + final var deviceDrivers = device.getDeviceDrivers(); + final var deviceEndPoints = device.getEndPoints(); + + final var serializedDeviceConfig = serialize(deviceConfig); + final var serializedDeviceOperationalStatus = serialize(deviceOperationalStatus); + final var serializedDeviceDrivers = + deviceDrivers.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedDeviceEndPoints = + deviceEndPoints.stream().map(this::serialize).collect(Collectors.toList()); + + builder.setDeviceId(deviceId); + builder.setDeviceType(deviceType); + builder.setDeviceConfig(serializedDeviceConfig); + builder.setDeviceOperationalStatus(serializedDeviceOperationalStatus); + builder.addAllDeviceDrivers(serializedDeviceDrivers); + builder.addAllDeviceEndpoints(serializedDeviceEndPoints); + + return builder.build(); + } + + public Device deserialize(ContextOuterClass.Device device) { + + final var serializedDeviceId = device.getDeviceId(); + final var deviceType = device.getDeviceType(); + final var serializedDeviceConfig = device.getDeviceConfig(); + final var serializedDeviceOperationalStatus = device.getDeviceOperationalStatus(); + final var serializedDeviceDrivers = device.getDeviceDriversList(); + final var serializedDeviceEndPoints = device.getDeviceEndpointsList(); + + final var deviceId = deserialize(serializedDeviceId); + final var deviceConfig = deserialize(serializedDeviceConfig); + final var deviceOperationalStatus = deserialize(serializedDeviceOperationalStatus); + final var deviceDrivers = + serializedDeviceDrivers.stream().map(this::deserialize).collect(Collectors.toList()); + final var deviceEndPoints = + serializedDeviceEndPoints.stream().map(this::deserialize).collect(Collectors.toList()); + + return new Device( + deviceId, + deviceType, + deviceConfig, + deviceOperationalStatus, + deviceDrivers, + deviceEndPoints); + } + + public Uuid serializeUuid(String uuid) { + return Uuid.newBuilder().setUuid(uuid).build(); + } + + public String deserialize(Uuid uuid) { + return uuid.getUuid(); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java index 28c896fbd97a63df67d5986a6d1a2fc53b1c62c6..7c3a2ccb5409d8df5ea95d3cd02eda8d97d74496 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java +++ b/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import javax.enterprise.context.ApplicationScoped; diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java index e542a3582855ae4a81273520f4075f9038f61d43..c863a6c285b4abbe9002a0d33c2648d0b1017b45 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java +++ b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import javax.enterprise.context.ApplicationScoped; diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java new file mode 100644 index 0000000000000000000000000000000000000000..7e3621bb45959becc80f03d51ad09471dc310eeb --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public class AclAction { + + private final AclForwardActionEnum aclForwardActionEnum; + private final AclLogActionEnum aclLogActionEnum; + + public AclAction(AclForwardActionEnum aclForwardActionEnum, AclLogActionEnum aclLogActionEnum) { + this.aclForwardActionEnum = aclForwardActionEnum; + this.aclLogActionEnum = aclLogActionEnum; + } + + public AclForwardActionEnum getAclForwardActionEnum() { + return aclForwardActionEnum; + } + + public AclLogActionEnum getAclLogActionEnum() { + return aclLogActionEnum; + } + + @Override + public String toString() { + return String.format( + "%s:{aclForwardActionEnum:\"%s\", aclLogActionEnum:\"%s\"}", + getClass().getSimpleName(), aclForwardActionEnum.toString(), aclLogActionEnum.toString()); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java new file mode 100644 index 0000000000000000000000000000000000000000..3324a55cd0c9d165531b06aee4b3de09cce2506c --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java @@ -0,0 +1,55 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public class AclEntry { + + private final int sequenceId; + private final String description; + private final AclMatch match; + private final AclAction action; + + public AclEntry(int sequenceId, String description, AclMatch match, AclAction action) { + this.sequenceId = sequenceId; + this.description = description; + this.match = match; + this.action = action; + } + + public int getSequenceId() { + return sequenceId; + } + + public String getDescription() { + return description; + } + + public AclMatch getMatch() { + return match; + } + + public AclAction getAction() { + return action; + } + + @Override + public String toString() { + return String.format( + "%s:{sequenceId:\"%d\", description:\"%s\", %s, %s}", + getClass().getSimpleName(), sequenceId, description, match, action); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..9afaabcd945adcbf474499efee930c54f7e12649 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public enum AclForwardActionEnum { + UNDEFINED, + DROP, + ACCEPT, + REJECT, +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..cb9a75b43a67c1445239231c456f49546308b16f --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public enum AclLogActionEnum { + UNDEFINED, + NO_LOG, + SYSLOG +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java new file mode 100644 index 0000000000000000000000000000000000000000..ca679ea3691ce5c05a64caa17bc86cfc3436dfc2 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java @@ -0,0 +1,95 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public class AclMatch { + + private final int dscp; + private final int protocol; + private final String srcAddress; + private final String dstAddress; + private final int srcPort; + private final int dstPort; + private final int startMplsLabel; + private final int endMplsLabel; + + public AclMatch( + int dscp, + int protocol, + String srcAddress, + String dstAddress, + int srcPort, + int dstPort, + int startMplsLabel, + int endMplsLabel) { + this.dscp = dscp; + this.protocol = protocol; + this.srcAddress = srcAddress; + this.dstAddress = dstAddress; + this.srcPort = srcPort; + this.dstPort = dstPort; + this.startMplsLabel = startMplsLabel; + this.endMplsLabel = endMplsLabel; + } + + public int getDscp() { + return dscp; + } + + public int getProtocol() { + return protocol; + } + + public String getSrcAddress() { + return srcAddress; + } + + public String getDstAddress() { + return dstAddress; + } + + public int getSrcPort() { + return srcPort; + } + + public int getDstPort() { + return dstPort; + } + + public int getStartMplsLabel() { + return startMplsLabel; + } + + public int getEndMplsLabel() { + return endMplsLabel; + } + + @Override + public String toString() { + return String.format( + "%s:{dscp:\"%d\", protocol:\"%d\", srcAddress:\"%s\", dstAddress:\"%s\", srcPort:\"%d\", dstPort:\"%d\", startMplsLabel:\"%d\", endMplsLabel:\"%d\"}", + getClass().getSimpleName(), + dscp, + protocol, + srcAddress, + dstAddress, + srcPort, + dstPort, + startMplsLabel, + endMplsLabel); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java new file mode 100644 index 0000000000000000000000000000000000000000..6dacab0480647609b85c9b45504341e6b47600fa --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java @@ -0,0 +1,74 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +import eu.teraflow.automation.common.Util; +import java.util.List; + +public class AclRuleSet { + + private final String name; + private final AclRuleTypeEnum type; + private final String description; + private final String userId; + private final List entries; + + public AclRuleSet( + String name, + AclRuleTypeEnum type, + String description, + String userId, + List entries) { + this.name = name; + this.type = type; + this.description = description; + this.userId = userId; + this.entries = entries; + } + + public String getName() { + return name; + } + + public AclRuleTypeEnum getType() { + return type; + } + + public String getDescription() { + return description; + } + + public String getUserId() { + return userId; + } + + public List getEntries() { + return entries; + } + + @Override + public String toString() { + return String.format( + "%s:{name:\"%s\", type:\"%s\", description:\"%s\", userId:\"%s\", [%s]}", + getClass().getSimpleName(), + name, + type.toString(), + description, + userId, + Util.toString(entries)); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..2361e21c10ab940337503d478798ed1d90075abe --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.acl; + +public enum AclRuleTypeEnum { + UNDEFINED, + IPV4, + IPV6, + L2, + MPLS, + MIXED +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/common/Util.java b/src/automation/src/main/java/eu/teraflow/automation/common/Util.java new file mode 100644 index 0000000000000000000000000000000000000000..aeb5a14f48a2ed9524479bacd6d85e51fc410e7f --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/common/Util.java @@ -0,0 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.common; + +import java.util.List; +import java.util.stream.Collectors; + +public class Util { + + private Util() {} + + public static String toString(List list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java index e08a706edb8fda13ee6300fc55f3ab6a30043572..2b96acecebc7fbf76167931d953af27c46338fe8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java @@ -1,14 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context; -import eu.teraflow.automation.device.Device; -import eu.teraflow.automation.device.model.DeviceEvent; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; public interface ContextGateway { - Uni getDevice(DeviceId deviceId); + Uni getDevice(String deviceId); Multi getDeviceEvents(); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java index 6b0ff132efe595f4ba4c618e5ec1697931c90022..7a50500377399692bd6f1497b8fd4366da55a413 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java @@ -1,108 +1,62 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context; import context.ContextOuterClass; -import context.ContextService; -import eu.teraflow.automation.context.model.Event; -import eu.teraflow.automation.context.model.EventTypeEnum; -import eu.teraflow.automation.device.Device; -import eu.teraflow.automation.device.model.*; +import context.MutinyContextServiceGrpc.MutinyContextServiceStub; +import eu.teraflow.automation.Serializer; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceEvent; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; @ApplicationScoped public class ContextGatewayImpl implements ContextGateway { @GrpcClient("context") - ContextService delegate; - - @Override - public Multi getDeviceEvents() { + MutinyContextServiceStub streamingDelegateContext; - final var serializedEmpty = getSerializedEmpty(); - final var deviceEventsMulti = delegate.getDeviceEvents(serializedEmpty); + private final Serializer serializer; - return deviceEventsMulti.onItem().transform(this::getDeviceEvent); + @Inject + public ContextGatewayImpl(Serializer serializer) { + this.serializer = serializer; } @Override - public Uni getDevice(DeviceId deviceId) { - final var serializedDeviceId = getSerializedDeviceId(deviceId); - final var serializedDeviceUni = delegate.getDevice(serializedDeviceId); - - return serializedDeviceUni.onItem().transform(this::getDevice); - } - - private ContextOuterClass.Empty getSerializedEmpty() { - - return ContextOuterClass.Empty.newBuilder().build(); - } - - private DeviceEvent getDeviceEvent(ContextOuterClass.DeviceEvent deviceEvent) { - - final var serializedDeviceId = deviceEvent.getDeviceId(); - final var deviceId = getDeviceId(serializedDeviceId); - - final var serializedEvent = deviceEvent.getEvent(); - final var event = getEvent(serializedEvent); - - return new DeviceEvent(event, deviceId); - } - - private Event getEvent(ContextOuterClass.Event event) { - return new Event(event.getTimestamp(), getEventType(event.getEventType())); - } - - private EventTypeEnum getEventType(ContextOuterClass.EventTypeEnum eventType) { - - if (eventType == ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) { - return EventTypeEnum.CREATE; - } else if (eventType == ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE) { - return EventTypeEnum.REMOVE; - } else if (eventType == ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE) { - return EventTypeEnum.UPDATE; - } else { - return EventTypeEnum.UNDEFINED; - } - } - - private Device getDevice(ContextOuterClass.Device device) { - - final var deviceId = getDeviceId(device.getDeviceId()); - final var deviceType = getDeviceType(device.getDeviceType()); - final var deviceOperationalStatus = - getDeviceOperationalStatus(device.getDeviceOperationalStatus()); - - return new Device(deviceId, deviceType, deviceOperationalStatus); - } - - private DeviceId getDeviceId(ContextOuterClass.DeviceId deviceId) { - Uuid uuid = new Uuid(deviceId.getDeviceUuid().getUuid()); - return new DeviceId(uuid); - } + public Multi getDeviceEvents() { + final var serializedEmpty = ContextOuterClass.Empty.newBuilder().build(); - private DeviceType getDeviceType(String deviceType) { - return new DeviceType(deviceType); + return streamingDelegateContext + .getDeviceEvents(serializedEmpty) + .onItem() + .transform(serializer::deserialize); } - private DeviceOperationalStatus getDeviceOperationalStatus( - ContextOuterClass.DeviceOperationalStatusEnum deviceOperationalStatusEnum) { - - if (deviceOperationalStatusEnum - == ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED) { - return DeviceOperationalStatus.ENABLED; - } else if (deviceOperationalStatusEnum - == ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED) { - return DeviceOperationalStatus.DISABLED; - } else { - return DeviceOperationalStatus.UNDEFINED; - } - } + @Override + public Uni getDevice(String deviceId) { + final var serializedDeviceId = serializer.serializeDeviceId(deviceId); - private ContextOuterClass.DeviceId getSerializedDeviceId(DeviceId deviceId) { - final var deviceIdUuid = - ContextOuterClass.Uuid.newBuilder().setUuid(deviceId.toString()).build(); - return ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); + return streamingDelegateContext + .getDevice(serializedDeviceId) + .onItem() + .transform(serializer::deserialize); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java index 2a2cd61af345e71a216ef089c2a0ded5cf809bfa..f5316dc4158d514d3b524f52a63f92317b777ddb 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java @@ -1,14 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context; -import eu.teraflow.automation.device.Device; -import eu.teraflow.automation.device.model.DeviceEvent; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; public interface ContextService { - Uni getDevice(DeviceId deviceId); + Uni getDevice(String deviceId); Multi getDeviceEvents(); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java index 3277964e869b382cf1ba392f8d9ac4d9bbc1459a..fc65296b7c39b86567e63169e0a6f7d1b0f43fce 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java @@ -1,8 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context; -import eu.teraflow.automation.device.Device; -import eu.teraflow.automation.device.model.DeviceEvent; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; @@ -19,14 +34,12 @@ public class ContextServiceImpl implements ContextService { } @Override - public Uni getDevice(DeviceId deviceId) { - + public Uni getDevice(String deviceId) { return contextGateway.getDevice(deviceId); } @Override public Multi getDeviceEvents() { - return contextGateway.getDeviceEvents(); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..f79562d0dc69cf1582998c7bd6625634498174d4 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public enum ConfigActionEnum { + UNDEFINED, + SET, + DELETE +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java new file mode 100644 index 0000000000000000000000000000000000000000..334bb8964a917f27c752360e362796389f8b0056 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class ConfigRule { + + private final ConfigActionEnum configActionEnum; + private final ConfigRuleType configRuleType; + + public ConfigRule(ConfigActionEnum configActionEnum, ConfigRuleType configRuleType) { + this.configActionEnum = configActionEnum; + this.configRuleType = configRuleType; + } + + public ConfigActionEnum getConfigActionEnum() { + return configActionEnum; + } + + public ConfigRuleType getConfigRuleType() { + return configRuleType; + } + + @Override + public String toString() { + return String.format( + "%s:{configActionEnum:\"%s\", %s}", + getClass().getSimpleName(), configActionEnum, configRuleType); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java new file mode 100644 index 0000000000000000000000000000000000000000..c749519fdddaf6f5466f81d713bdece51ff7f026 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +import eu.teraflow.automation.acl.AclRuleSet; + +public class ConfigRuleAcl { + + private final EndPointId endPointId; + private final AclRuleSet ruleSet; + + public ConfigRuleAcl(EndPointId endPointId, AclRuleSet ruleSet) { + this.endPointId = endPointId; + this.ruleSet = ruleSet; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public AclRuleSet getRuleSet() { + return ruleSet; + } + + @Override + public String toString() { + return String.format("%s:{%s, %s}", getClass().getSimpleName(), endPointId, ruleSet); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..d60411fb4acc88e73ed840d827ca1d078fd36856 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class ConfigRuleCustom { + + private final String resourceKey; + private final String resourceValue; + + public ConfigRuleCustom(String resourceKey, String resourceValue) { + this.resourceKey = resourceKey; + this.resourceValue = resourceValue; + } + + public String getResourceKey() { + return resourceKey; + } + + public String getResourceValue() { + return resourceValue; + } + + @Override + public String toString() { + return String.format("%s:{%s, %s}", getClass().getSimpleName(), resourceKey, resourceValue); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java new file mode 100644 index 0000000000000000000000000000000000000000..874c633d0f0509381851a728413a1fc909cb380d --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public interface ConfigRuleType { + + public T getConfigRuleType(); +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java new file mode 100644 index 0000000000000000000000000000000000000000..f802549132f0a48973442bbbee6240d1611d2fa1 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class ConfigRuleTypeAcl implements ConfigRuleType { + + private final ConfigRuleAcl configRuleAcl; + + public ConfigRuleTypeAcl(ConfigRuleAcl configRuleAcl) { + this.configRuleAcl = configRuleAcl; + } + + @Override + public ConfigRuleAcl getConfigRuleType() { + return this.configRuleAcl; + } + + @Override + public String toString() { + return String.format("%s:%s}", getClass().getSimpleName(), configRuleAcl); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..86137244d166e254ab27952ecb85611474ae14eb --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class ConfigRuleTypeCustom implements ConfigRuleType { + + private final ConfigRuleCustom configRuleCustom; + + public ConfigRuleTypeCustom(ConfigRuleCustom configRuleCustom) { + this.configRuleCustom = configRuleCustom; + } + + @Override + public ConfigRuleCustom getConfigRuleType() { + return this.configRuleCustom; + } + + @Override + public String toString() { + return String.format("%s:%s}", getClass().getSimpleName(), configRuleCustom); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java new file mode 100644 index 0000000000000000000000000000000000000000..77bd3ca5c861713b43faf178c6450e35e6032b3c --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java @@ -0,0 +1,108 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +import eu.teraflow.automation.common.Util; +import java.util.List; + +public class Device { + + private final String deviceId; + private final String deviceType; + private DeviceConfig deviceConfig; + private DeviceOperationalStatus deviceOperationalStatus; + private List deviceDrivers; + private List endPoints; + + public Device( + String deviceId, + String deviceType, + DeviceConfig deviceConfig, + DeviceOperationalStatus deviceOperationalStatus, + List deviceDrivers, + List endPoints) { + + this.deviceId = deviceId; + this.deviceType = deviceType; + this.deviceConfig = deviceConfig; + this.deviceOperationalStatus = deviceOperationalStatus; + this.deviceDrivers = deviceDrivers; + this.endPoints = endPoints; + } + + public Device( + String deviceId, + String deviceType, + DeviceOperationalStatus deviceOperationalStatus, + List deviceDrivers, + List endPoints) { + this.deviceId = deviceId; + this.deviceType = deviceType; + this.deviceOperationalStatus = deviceOperationalStatus; + this.deviceDrivers = deviceDrivers; + this.endPoints = endPoints; + } + + public boolean isEnabled() { + return deviceOperationalStatus == DeviceOperationalStatus.ENABLED; + } + + public void enableDevice() { + this.deviceOperationalStatus = DeviceOperationalStatus.ENABLED; + } + + public String getDeviceId() { + return deviceId; + } + + public String getDeviceType() { + return deviceType; + } + + public DeviceConfig getDeviceConfig() { + return deviceConfig; + } + + public List getDeviceDrivers() { + return deviceDrivers; + } + + public List getEndPoints() { + return endPoints; + } + + public DeviceOperationalStatus getDeviceOperationalStatus() { + return deviceOperationalStatus; + } + + public void setDeviceConfiguration(DeviceConfig deviceConfig) { + this.deviceConfig = deviceConfig; + } + + @Override + public String toString() { + return String.format( + "%s:{deviceId:\"%s\", deviceType:\"%s\", %s, deviceOperationalStatus=\"%s\", [%s], [%s]}", + getClass().getSimpleName(), + deviceId, + deviceType, + deviceConfig, + deviceOperationalStatus.toString(), + Util.toString(deviceDrivers), + Util.toString(endPoints)); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..edf2dbc6ff96bd26ee45345928b0c6d33b4ec73a --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +import java.util.List; +import java.util.stream.Collectors; + +public class DeviceConfig { + + private final List configRules; + + public DeviceConfig(List configRules) { + + this.configRules = configRules; + } + + public List getConfigRules() { + return configRules; + } + + @Override + public String toString() { + final var configRulesDescription = + configRules.stream().map(ConfigRule::toString).collect(Collectors.joining(", ")); + return String.format("%s[%s]", getClass().getSimpleName(), configRulesDescription); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..8fc767ac2e5d7fed70f0375fcf8c820e30fbb149 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public enum DeviceDriverEnum { + UNDEFINED, + OPENCONFIG, + TRANSPORT_API, + P4, + IETF_NETWORK_TOPOLOGY, + ONF_TR_352 +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..efc0be8308fb9a75132cd604a84fd5b4822f3af7 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class DeviceEvent { + + private final Event event; + private final String deviceId; + + public DeviceEvent(String deviceId, Event event) { + this.event = event; + this.deviceId = deviceId; + } + + public Event getEvent() { + return event; + } + + public String getDeviceId() { + return deviceId; + } + + @Override + public String toString() { + return String.format("%s[%s, %s]", getClass().getSimpleName(), deviceId, event.toString()); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..50486469f1c8e9f8b9f965723b3432dbb7d0d4ca --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public enum DeviceOperationalStatus { + UNDEFINED, + DISABLED, + ENABLED +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java new file mode 100644 index 0000000000000000000000000000000000000000..25b3864c5d367b7767dc8afb52e9edc04bb31817 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java @@ -0,0 +1,105 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +import eu.teraflow.automation.common.Util; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import java.util.List; + +public class EndPoint { + private final EndPointId endPointId; + private final String endPointType; + private final List kpiSampleTypes; + private final Location endPointLocation; + + EndPoint(EndPointBuilder builder) { + this.endPointId = builder.endPointId; + this.endPointType = builder.endPointType; + this.kpiSampleTypes = builder.kpiSampleTypes; + this.endPointLocation = builder.endPointLocation; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public String getEndPointType() { + return endPointType; + } + + public List getKpiSampleTypes() { + return kpiSampleTypes; + } + + public Location getEndPointLocation() { + return endPointLocation; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, endPointType:\"%s\", [%s], %s}", + getClass().getSimpleName(), + endPointId, + endPointType, + Util.toString(kpiSampleTypes), + endPointLocation); + } + + public static class EndPointBuilder { + private final EndPointId endPointId; + private final String endPointType; + private final List kpiSampleTypes; + private Location endPointLocation; + + public EndPointBuilder( + EndPointId endPointId, String endPointType, List kpiSampleTypes) { + this.endPointId = endPointId; + this.endPointType = endPointType; + this.kpiSampleTypes = kpiSampleTypes; + } + + public EndPointBuilder location(Location endPointLocation) { + this.endPointLocation = endPointLocation; + return this; + } + + public EndPoint build() { + EndPoint endPoint = new EndPoint(this); + validateEndPointObject(endPoint); + return endPoint; + } + + private void validateEndPointObject(EndPoint endPoint) { + final var validatedEndPointId = endPoint.getEndPointId(); + final var validatedEndPointType = endPoint.getEndPointType(); + final var validatedKpiSampleTypes = endPoint.getKpiSampleTypes(); + + if (validatedEndPointId == null) { + throw new IllegalStateException("EndPoint ID cannot be null"); + } + + if (validatedEndPointType == null) { + throw new IllegalStateException("EndPoint type cannot be null"); + } + + if (validatedKpiSampleTypes == null) { + throw new IllegalStateException("Kpi sample types cannot be null"); + } + } + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java new file mode 100644 index 0000000000000000000000000000000000000000..c94bcb0b16ecdb638bd37aea468b70e52ee68f99 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class EndPointId { + + private final TopologyId topologyId; + private final String deviceId; + private final String id; + + public EndPointId(TopologyId topologyId, String deviceId, String id) { + this.topologyId = topologyId; + this.deviceId = deviceId; + this.id = id; + } + + public TopologyId getTopologyId() { + return topologyId; + } + + public String getDeviceId() { + return deviceId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, deviceId:\"%s\", id:\"%s\"}", + getClass().getSimpleName(), topologyId, deviceId, id); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java index fa09c7899ab78d149a879ac616a8382a85a4f27d..2b4a4bab6730e5ba18749eb62cecde8811797e87 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java @@ -1,9 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; public class Event { - private double timestamp; - private EventTypeEnum eventType; + // TODO convert double to meaningful timestamp type + private final double timestamp; + private final EventTypeEnum eventType; public Event(double timestamp, EventTypeEnum eventType) { this.timestamp = timestamp; @@ -17,4 +34,11 @@ public class Event { public EventTypeEnum getEventTypeEnum() { return eventType; } + + @Override + public String toString() { + return String.format( + "%s{timestamp=\"%f\", eventType=\"%s\"}", + getClass().getSimpleName(), timestamp, eventType.toString()); + } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java index d29b293715ef7ac4d0a2b7b008c5c7afd106c586..38c2cd3f08eed5140e20983b5614428b5f6218c0 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; public enum EventTypeEnum { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java new file mode 100644 index 0000000000000000000000000000000000000000..9ee65b706bdb84e541b37f59108e6daa4b5fbf16 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java @@ -0,0 +1,42 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class GpsPosition { + + private final float latitude; + private final float longitude; + + public GpsPosition(float latitude, float longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public float getLatitude() { + return latitude; + } + + public float getLongitude() { + return longitude; + } + + @Override + public String toString() { + return String.format( + "%s:{latitude:\"%f\", longitude:\"%f\"}", getClass().getSimpleName(), latitude, longitude); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java new file mode 100644 index 0000000000000000000000000000000000000000..bd056e80c65d1f75621253f3b4021827503ac0ad --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class Location { + + private final LocationType locationType; + + public Location(LocationType locationType) { + this.locationType = locationType; + } + + public LocationType getLocationType() { + return locationType; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), locationType); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java new file mode 100644 index 0000000000000000000000000000000000000000..e5e23ab6278d748766347b61ffb0fa481a16ef68 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public interface LocationType { + + public T getLocationType(); +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java new file mode 100644 index 0000000000000000000000000000000000000000..a9af77dea36948cd80ce2ce9d48c349923127839 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class LocationTypeGpsPosition implements LocationType { + private final GpsPosition gpsPosition; + + public LocationTypeGpsPosition(GpsPosition gpsPosition) { + this.gpsPosition = gpsPosition; + } + + @Override + public GpsPosition getLocationType() { + return this.gpsPosition; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), gpsPosition); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java new file mode 100644 index 0000000000000000000000000000000000000000..5b12ee0169504874a12125ca6cd04db877946646 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class LocationTypeRegion implements LocationType { + private final String region; + + public LocationTypeRegion(String region) { + this.region = region; + } + + @Override + public String getLocationType() { + return this.region; + } + + @Override + public String toString() { + return String.format("%s:{region:\"%s\"}", getClass().getSimpleName(), region); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java b/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java new file mode 100644 index 0000000000000000000000000000000000000000..ce9f7836f6fe9cd2fc6095f43b02875fdcb98e26 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.context.model; + +public class TopologyId { + + private final String contextId; + private final String id; + + public TopologyId(String contextId, String id) { + + this.contextId = contextId; + this.id = id; + } + + public String getContextId() { + return contextId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/Device.java b/src/automation/src/main/java/eu/teraflow/automation/device/Device.java deleted file mode 100644 index d2abfee95e2b68239c6fbebfa4af2e0380c796cd..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/Device.java +++ /dev/null @@ -1,65 +0,0 @@ -package eu.teraflow.automation.device; - -import eu.teraflow.automation.device.model.DeviceConfig; -import eu.teraflow.automation.device.model.DeviceId; -import eu.teraflow.automation.device.model.DeviceOperationalStatus; -import eu.teraflow.automation.device.model.DeviceType; - -public class Device { - - private final DeviceId deviceId; - private final DeviceType deviceType; - private DeviceConfig deviceConfig; - private DeviceOperationalStatus deviceOperationalStatus; - - public Device( - DeviceId deviceId, - DeviceType deviceType, - DeviceConfig deviceConfig, - DeviceOperationalStatus deviceOperationalStatus) { - - this.deviceId = deviceId; - this.deviceType = deviceType; - this.deviceConfig = deviceConfig; - this.deviceOperationalStatus = deviceOperationalStatus; - } - - public Device( - DeviceId deviceId, DeviceType deviceType, DeviceOperationalStatus deviceOperationalStatus) { - - this.deviceId = deviceId; - this.deviceType = deviceType; - this.deviceOperationalStatus = deviceOperationalStatus; - } - - public DeviceId getDeviceId() { - return deviceId; - } - - public DeviceType getDeviceType() { - return deviceType; - } - - public DeviceConfig getDeviceConfig() { - return deviceConfig; - } - - public DeviceOperationalStatus getDeviceOperationalStatus() { - return deviceOperationalStatus; - } - - public void setDeviceOperationalStatus(DeviceOperationalStatus status) { - - this.deviceOperationalStatus = status; - } - - public void setDeviceConfiguration(DeviceConfig deviceConfig) { - - this.deviceConfig = deviceConfig; - } - - public boolean isConfigured() { - - return this.deviceOperationalStatus == DeviceOperationalStatus.ENABLED; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java index ed9a2961c4926aa5dfb66b17bfb1692a0cc37e68..8cbf0885ba6537e7bca31e5bb6efd0494e4fe879 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java @@ -1,11 +1,27 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.device; -import eu.teraflow.automation.device.model.DeviceConfig; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; import io.smallrye.mutiny.Uni; public interface DeviceGateway { - Uni getInitialConfiguration(DeviceId deviceId); + Uni getInitialConfiguration(String deviceId); - Uni configureDevice(Device device); + Uni configureDevice(Device device); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java index 78e72598e681f4f007e541423b0cc64694f7ea3d..7849e36e6965df293381e5bc8a04db552d3f28d4 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java @@ -1,15 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.device; -import context.ContextOuterClass; -import context.ContextOuterClass.DeviceConfig; -import context.ContextOuterClass.Uuid; import device.DeviceService; -import eu.teraflow.automation.device.model.*; +import eu.teraflow.automation.Serializer; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; -import java.util.ArrayList; -import java.util.List; import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; @ApplicationScoped public class DeviceGatewayImpl implements DeviceGateway { @@ -17,122 +31,30 @@ public class DeviceGatewayImpl implements DeviceGateway { @GrpcClient("device") DeviceService deviceDelegate; - @Override - public Uni getInitialConfiguration( - DeviceId deviceId) { - final var serializedId = getSerializedDeviceId(deviceId); - final var serializedDeviceConfigUni = deviceDelegate.getInitialConfig(serializedId); + private final Serializer serializer; - return serializedDeviceConfigUni.onItem().transform(this::getDeviceConfig); + @Inject + public DeviceGatewayImpl(Serializer serializer) { + this.serializer = serializer; } @Override - public Uni configureDevice(Device device) { - final var deviceBuilder = ContextOuterClass.Device.newBuilder(); - - final var serializedId = getSerializedDeviceId(device.getDeviceId()); - deviceBuilder.setDeviceId(serializedId); - - final var serializedConfigUni = getSerializedConfigUni(device.getDeviceConfig()); - final var serializedConfig = serializedConfigUni.await().indefinitely(); - deviceBuilder.setDeviceConfig(serializedConfig); - - final var serializedDevice = deviceBuilder.build(); - final var deviceIdUni = deviceDelegate.configureDevice(serializedDevice); - - return deviceIdUni.onItem().transform(this::getDeviceId); - } - - private List getSerializedConfigRule( - List configRuleList) { + public Uni getInitialConfiguration(String deviceId) { + final var serializedDeviceId = serializer.serializeDeviceId(deviceId); - List serializedConfigRuleList = new ArrayList<>(); - for (ConfigRule item : configRuleList) { - final var configActionEnum = getSerializedConfigActionEnum(item.getConfigActionEnum()); - final var resourceKey = item.getResourceKey(); - final var resourceValue = item.getResourceValue(); - final var serializedConfigRule = - ContextOuterClass.ConfigRule.newBuilder() - .setAction(configActionEnum) - .setResourceKey(resourceKey) - .setResourceValue(resourceValue) - .build(); - serializedConfigRuleList.add(serializedConfigRule); - } - return serializedConfigRuleList; + return deviceDelegate + .getInitialConfig(serializedDeviceId) + .onItem() + .transform(serializer::deserialize); } - private ContextOuterClass.ConfigActionEnum getSerializedConfigActionEnum( - ConfigActionEnum configActionEnum) { - - if (configActionEnum == ConfigActionEnum.SET) { - return ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET; - } else if (configActionEnum == ConfigActionEnum.UNDEFINED) { - return ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED; - } else { - return ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE; - } - } - - private ConfigActionEnum getConfigActionEnum( - ContextOuterClass.ConfigActionEnum configActionEnum) { - - if (configActionEnum == ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) { - return ConfigActionEnum.SET; - } else if (configActionEnum == ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED) { - return ConfigActionEnum.UNDEFINED; - } else { - return ConfigActionEnum.DELETE; - } - } - - private ContextOuterClass.DeviceId getSerializedDeviceId(DeviceId deviceId) { - final var deviceIdUuid = Uuid.newBuilder().setUuid(deviceId.toString()).build(); - return ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); - } - - private DeviceId getDeviceId(ContextOuterClass.DeviceId deviceId) { - eu.teraflow.automation.device.model.Uuid uuid = - new eu.teraflow.automation.device.model.Uuid(deviceId.getDeviceUuid().getUuid()); - return new DeviceId(uuid); - } - - private eu.teraflow.automation.device.model.DeviceConfig getDeviceConfig( - ContextOuterClass.DeviceConfig deviceConfig) { - - final var serializedConfigRuleList = deviceConfig.getConfigRulesList(); - final var configRuleList = getConfigRuleList(serializedConfigRuleList); - return new eu.teraflow.automation.device.model.DeviceConfig(configRuleList); - } - - private List getConfigRuleList( - List serializedConfigRuleList) { - - List configRuleList = new ArrayList<>(); - - for (ContextOuterClass.ConfigRule item : serializedConfigRuleList) { - - ConfigRule configRule = - new ConfigRule( - getConfigActionEnum(item.getAction()), - item.getResourceKey(), - item.getResourceValue()); - configRuleList.add(configRule); - } - return configRuleList; - } - - private Uni getSerializedConfigUni( - eu.teraflow.automation.device.model.DeviceConfig deviceConfig) { - - final var serializedDeviceConfig = DeviceConfig.newBuilder(); - - final var configRuleList = deviceConfig.getConfigRules(); - final var serializedConfigRuleList = getSerializedConfigRule(configRuleList); - for (int i = 0; i < serializedConfigRuleList.size(); i++) { - serializedDeviceConfig.setConfigRules(i, serializedConfigRuleList.get(i)); - } + @Override + public Uni configureDevice(Device device) { + final var serializedDevice = serializer.serialize(device); - return Uni.createFrom().item(serializedDeviceConfig.build()); + return deviceDelegate + .configureDevice(serializedDevice) + .onItem() + .transform(serializer::deserialize); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java index 0ada5cde27c779e13e0f0df745c7ac118576505e..229aea7dfe29a11487d3e61709981300a2ff9600 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java @@ -1,12 +1,28 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.device; -import eu.teraflow.automation.device.model.DeviceConfig; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; import io.smallrye.mutiny.Uni; public interface DeviceService { - Uni getInitialConfiguration(DeviceId deviceId); + Uni getInitialConfiguration(String deviceId); - Uni configureDevice(Device device); + Uni configureDevice(Device device); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java index 57c118255f3850f6f0f860c280fc88ac603a8c61..d5dd6fc2be73b55da9f6d31efbc21bf40c431c20 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java +++ b/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java @@ -1,7 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.device; -import eu.teraflow.automation.device.model.DeviceConfig; -import eu.teraflow.automation.device.model.DeviceId; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; @@ -17,13 +33,13 @@ public class DeviceServiceImpl implements DeviceService { } @Override - public Uni getInitialConfiguration(DeviceId deviceId) { + public Uni getInitialConfiguration(String deviceId) { return deviceGateway.getInitialConfiguration(deviceId); } @Override - public Uni configureDevice(Device device) { + public Uni configureDevice(Device device) { return deviceGateway.configureDevice(device); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java deleted file mode 100644 index 286bae16da5187bdfc09dabdd2a0e1681f46c0d3..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java +++ /dev/null @@ -1,7 +0,0 @@ -package eu.teraflow.automation.device.model; - -public enum ConfigActionEnum { - UNDEFINED, - SET, - DELETE -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java deleted file mode 100644 index 7c9eecd684c40f400df480f7511881da058944e4..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigRule.java +++ /dev/null @@ -1,26 +0,0 @@ -package eu.teraflow.automation.device.model; - -public class ConfigRule { - - private ConfigActionEnum configActionEnum; - private String resourceKey; - private String resourceValue; - - public ConfigRule(ConfigActionEnum configActionEnum, String resourceKey, String resourceValue) { - this.configActionEnum = configActionEnum; - this.resourceKey = resourceKey; - this.resourceValue = resourceValue; - } - - public ConfigActionEnum getConfigActionEnum() { - return configActionEnum; - } - - public String getResourceKey() { - return resourceKey; - } - - public String getResourceValue() { - return resourceValue; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java deleted file mode 100644 index c70e743dcba0a05a4962e5c113115ce0d0bf7c95..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package eu.teraflow.automation.device.model; - -import java.util.List; - -public class DeviceConfig { - - private List configRules; - - public DeviceConfig(List configRules) { - - this.configRules = configRules; - } - - public List getConfigRules() { - return configRules; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java deleted file mode 100644 index ef3f8ae76e5ab57e5077629f36c0c088e4963ba4..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -package eu.teraflow.automation.device.model; - -import eu.teraflow.automation.context.model.Event; - -public class DeviceEvent { - - private Event event; - private DeviceId deviceId; - - public DeviceEvent(Event event, DeviceId deviceId) { - this.event = event; - this.deviceId = deviceId; - } - - public Event getEvent() { - return event; - } - - public DeviceId getDeviceId() { - return deviceId; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceId.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceId.java deleted file mode 100644 index b52672631c764b73266c74b36830c6c2c6a2d713..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceId.java +++ /dev/null @@ -1,13 +0,0 @@ -package eu.teraflow.automation.device.model; - -public class DeviceId { - private Uuid id; - - public DeviceId(Uuid id) { - this.id = id; - } - - public Uuid getId() { - return id; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java deleted file mode 100644 index 11e0c1b7154192b2f1595b23f7b4bf9d259af784..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceOperationalStatus.java +++ /dev/null @@ -1,7 +0,0 @@ -package eu.teraflow.automation.device.model; - -public enum DeviceOperationalStatus { - UNDEFINED, - DISABLED, - ENABLED -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceType.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceType.java deleted file mode 100644 index 2d61875d41ac98fad4aa80147910e4cdd1a869d7..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/DeviceType.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.automation.device.model; - -public class DeviceType { - String deviceType; - - public DeviceType(String deviceType) { - - this.deviceType = deviceType; - } - - public String getDeviceType() { - return deviceType; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/Uuid.java b/src/automation/src/main/java/eu/teraflow/automation/device/model/Uuid.java deleted file mode 100644 index 0a58ee6a8db3696dd14600094ddfa42ac10e3058..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/Uuid.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.automation.device.model; - -public class Uuid { - - private String id; - - public Uuid(String id) { - this.id = id; - } - - public String getId() { - return id; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java b/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java new file mode 100644 index 0000000000000000000000000000000000000000..9a46e8ffde183deb4a23e5fde16ae8a798fb6e4b --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java @@ -0,0 +1,25 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.kpi_sample_types.model; + +public enum KpiSampleType { + UNKNOWN, + PACKETS_TRANSMITTED, + PACKETS_RECEIVED, + BYTES_TRANSMITTED, + BYTES_RECEIVED +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java index 8706cad56b5b6efba6a3d585bb898340af8377ed..6dffcd1c0300672a3e23fc0ee8372b77b1bb55b7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.model; public class DeviceRole { diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java index d795fed4a1b0ae1d7edf12d835c3ae3df9b6bb45..b11f42ad054a3446370e123e37c7c13b025711f3 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java @@ -1,23 +1,36 @@ -package eu.teraflow.automation.model; +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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. +*/ -import eu.teraflow.automation.device.model.DeviceId; -import eu.teraflow.automation.device.model.Uuid; +package eu.teraflow.automation.model; public class DeviceRoleId { - private final Uuid devRoleId; - private final DeviceId deviceId; + private final String id; + private final String deviceId; - public DeviceRoleId(Uuid devRoleId, DeviceId deviceId) { - this.devRoleId = devRoleId; + public DeviceRoleId(String id, String deviceId) { + this.id = id; this.deviceId = deviceId; } - public Uuid getDevRoleId() { - return devRoleId; + public String getId() { + return id; } - public DeviceId getDeviceId() { + public String getDeviceId() { return deviceId; } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleState.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleState.java deleted file mode 100644 index 71c5757d69f94c2d92df2c94fcd2fbf89ba33950..0000000000000000000000000000000000000000 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleState.java +++ /dev/null @@ -1,21 +0,0 @@ -package eu.teraflow.automation.model; - -public class DeviceRoleState { - - private final DeviceRoleId deviceRoleId; - private final DeviceState deviceState; - - public DeviceRoleState(DeviceRoleId deviceRoleId, DeviceState deviceState) { - - this.deviceRoleId = deviceRoleId; - this.deviceState = deviceState; - } - - public DeviceRoleId getDeviceRoleId() { - return deviceRoleId; - } - - public DeviceState getDeviceState() { - return deviceState; - } -} diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java index 411f9eb603ac9f5e4d737e2697755bfc206322d4..8d55e0cb4e231fcc5378ee4304fe5b19c525548c 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.model; public enum DeviceRoleType { diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java index 279faeb5d8bd0d0dcad036883f4107fe871261ae..48bc37ef7797562c48eed16091ea35cdb06eacd6 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java +++ b/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation.model; public enum DeviceState { diff --git a/src/automation/src/main/proto/acl.proto b/src/automation/src/main/proto/acl.proto new file mode 120000 index 0000000000000000000000000000000000000000..158ae78eb5bdea534ba7008114c2b97ed6dffed8 --- /dev/null +++ b/src/automation/src/main/proto/acl.proto @@ -0,0 +1 @@ +../../../../../proto/acl.proto \ No newline at end of file diff --git a/src/automation/src/main/proto/kpi_sample_types.proto b/src/automation/src/main/proto/kpi_sample_types.proto new file mode 120000 index 0000000000000000000000000000000000000000..98e748bbf4fbadbc04c3657f458d733f1bc7bdb8 --- /dev/null +++ b/src/automation/src/main/proto/kpi_sample_types.proto @@ -0,0 +1 @@ +../../../../../proto/kpi_sample_types.proto \ No newline at end of file diff --git a/src/automation/src/main/proto/monitoring.proto b/src/automation/src/main/proto/monitoring.proto new file mode 120000 index 0000000000000000000000000000000000000000..aceaa7328099fe736163be048ee1ad21a61d79a2 --- /dev/null +++ b/src/automation/src/main/proto/monitoring.proto @@ -0,0 +1 @@ +../../../../../proto/monitoring.proto \ No newline at end of file diff --git a/src/automation/src/main/resources/application.yaml b/src/automation/src/main/resources/application.yaml deleted file mode 100644 index 8d5ae6ed513f7d20227b217fd803c809c4f5b2c4..0000000000000000000000000000000000000000 --- a/src/automation/src/main/resources/application.yaml +++ /dev/null @@ -1,42 +0,0 @@ -automation: - should-subscribe-to-context-component: true -quarkus: - grpc: - server: - port: 9999 - enable-reflection-service: true - clients: - context: - host: ${quarkus.kubernetes.env.vars.context-service-host} - device: - host: ${quarkus.kubernetes.env.vars.device-service-host} - http: - port: 8080 - container-image: - group: teraflow-h2020 - name: controller/automation - tag: 0.0.1 - registry: registry.gitlab.com - kubernetes: - name: automationservice - image-pull-policy: Always - service-type: NodePort - labels: - app: automationservice - readiness-probe: - initial-delay: 5s - period: 45s - liveness-probe: - initial-delay: 5s - period: 45s - ports: - http: - host-port: 8080 - container-port: 8080 - grpc-server: - host-port: 9999 - container-port: 9999 - env: - vars: - context-service-host: ContextService - device-service-host: DeviceService \ No newline at end of file diff --git a/src/automation/src/main/resources/application.yml b/src/automation/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..bc89d4348dfdfc5dc3f9159fb167d00509a8e4dc --- /dev/null +++ b/src/automation/src/main/resources/application.yml @@ -0,0 +1,62 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +automation: + should-subscribe-to-context-component: true +quarkus: + banner: + path: teraflow-automation-banner.txt + grpc: + server: + port: 5050 + enable-reflection-service: true + clients: + context: + host: ${quarkus.kubernetes.env.vars.context-service-host} + port: 1010 + device: + host: ${quarkus.kubernetes.env.vars.device-service-host} + port: 2020 + + http: + port: 8080 + + container-image: + group: teraflow-h2020 + name: controller/automation + registry: registry.gitlab.com + + kubernetes: + name: automationservice + image-pull-policy: Always + labels: + app: automationservice + add-version-to-label-selectors: false + readiness-probe: + initial-delay: 2s + period: 10s + liveness-probe: + initial-delay: 2s + period: 10s + ports: + http: + host-port: 8080 + container-port: 8080 + grpc: + host-port: 5050 + container-port: 5050 + env: + vars: + context-service-host: "contextservice" + device-service-host: "deviceservice" diff --git a/src/automation/src/main/resources/teraflow-automation-banner.txt b/src/automation/src/main/resources/teraflow-automation-banner.txt new file mode 100644 index 0000000000000000000000000000000000000000..3792524170f5b74de9add7340ab32940d7f65a64 --- /dev/null +++ b/src/automation/src/main/resources/teraflow-automation-banner.txt @@ -0,0 +1,9 @@ + + _______ ______ _ _ _ _ + |__ __| | ____| | /\ | | | | (_) + | | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ + | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \ + | | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | + |_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_| + + diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java index 81d568f25481272c97e6543841561b7e61789ad5..e250a905c8379c01383c149cc944fdd4a55a81b4 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java +++ b/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; @@ -5,9 +21,21 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import automation.Automation; import context.ContextOuterClass; import eu.teraflow.automation.context.ContextGateway; -import eu.teraflow.automation.device.Device; +import eu.teraflow.automation.context.model.ConfigActionEnum; +import eu.teraflow.automation.context.model.ConfigRule; +import eu.teraflow.automation.context.model.ConfigRuleCustom; +import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.automation.context.model.DeviceDriverEnum; +import eu.teraflow.automation.context.model.DeviceOperationalStatus; +import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.Location; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.automation.context.model.TopologyId; import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.device.model.*; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; import io.smallrye.mutiny.Uni; @@ -21,7 +49,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; @QuarkusTest -public class AutomationFunctionalServiceTest { +class AutomationFunctionalServiceTest { private static final Logger LOGGER = Logger.getLogger(AutomationFunctionalServiceTest.class); @Inject AutomationService automationService; @@ -31,7 +59,6 @@ public class AutomationFunctionalServiceTest { @Test void shouldConfigureDevice() { - final var uuidForDeviceRoleId = ContextOuterClass.Uuid.newBuilder() .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) @@ -51,21 +78,61 @@ public class AutomationFunctionalServiceTest { .setDevId(outDeviceId) .build(); - Uuid uuid = new Uuid(outDeviceRoleId.getDevId().toString()); - DeviceId deviceId = new DeviceId(uuid); - DeviceType deviceType = new DeviceType("cisco"); + String deviceId = outDeviceRoleId.getDevRoleId().toString(); + String deviceType = "cisco"; + + final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA); + ConfigRule configRule1 = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleTypeA); + + final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB"); + final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB); + ConfigRule configRule2 = new ConfigRule(ConfigActionEnum.SET, configRuleTypeB); - ConfigRule configRule1 = new ConfigRule(ConfigActionEnum.UNDEFINED, "1", "1"); - ConfigRule configRule2 = new ConfigRule(ConfigActionEnum.SET, "2", "2"); List configRuleList = new ArrayList<>(); configRuleList.add(configRule1); configRuleList.add(configRule2); DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList); Uni expectedDeviceConfigUni = Uni.createFrom().item(expectedDeviceConfig); - Uni expectedDeviceId = Uni.createFrom().item(deviceId); + Uni expectedDeviceId = Uni.createFrom().item(deviceId); + + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var topologyIdA = new TopologyId("contextIdA", "idA"); + final var deviceIdA = "deviceIdA"; + final var idA = "idA"; + final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); - Device device = new Device(deviceId, deviceType, DeviceOperationalStatus.DISABLED); + final var topologyIdB = new TopologyId("contextIdB", "idB"); + final var deviceIdB = "deviceIdB"; + final var idB = "idB"; + final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB); + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + + Device device = + new Device( + deviceId, deviceType, DeviceOperationalStatus.DISABLED, deviceDrivers, endPoints); Uni deviceUni = Uni.createFrom().item(device); Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni); @@ -82,20 +149,30 @@ public class AutomationFunctionalServiceTest { deviceConfig -> { LOGGER.infof("Received response %s", deviceConfig); - assertThat(deviceConfig.getDeviceOperationalStatus().toString()) - .isEqualTo(device.getDeviceOperationalStatus().toString()); + assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString()); assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull(); final var rulesList = deviceConfig.getDeviceConfig().getConfigRules(); for (int i = 0; i < rulesList.size(); i++) { - assertThat(rulesList.get(i).getResourceKey()).isEqualTo(String.valueOf(i + 1)); - assertThat(rulesList.get(i).getResourceValue()).isEqualTo(String.valueOf(i + 1)); - } - assertThat(deviceConfig.getDeviceId().getId().getId()) - .isEqualTo(deviceId.getId().getId()); + if (rulesList.get(i).getConfigRuleType().getConfigRuleType() + instanceof ConfigRuleCustom) { + assertThat( + ((ConfigRuleCustom) + rulesList.get(i).getConfigRuleType().getConfigRuleType()) + .getResourceKey()) + .isEqualTo(String.valueOf(i + 1)); + assertThat( + ((ConfigRuleCustom) + rulesList.get(i).getConfigRuleType().getConfigRuleType()) + .getResourceValue()) + .isEqualTo(String.valueOf(i + 1)); + } + } + assertThat(deviceConfig.getDeviceType()).isEqualTo("cisco"); + assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId); }); } @@ -121,20 +198,60 @@ public class AutomationFunctionalServiceTest { .setDevId(outDeviceId) .build(); - Uuid uuid = new Uuid(outDeviceRoleId.getDevId().toString()); - DeviceId deviceId = new DeviceId(uuid); - DeviceType deviceType = new DeviceType("ztp"); + String deviceId = outDeviceRoleId.getDevId().toString(); + String deviceType = "ztp"; List configRuleList = new ArrayList<>(); - ConfigRule expectedConfigRule = - new ConfigRule(ConfigActionEnum.UNDEFINED, "001", "already-configured"); + final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue"); + final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom); + + ConfigRule expectedConfigRule = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleType); configRuleList.add(expectedConfigRule); DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList); + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var topologyIdA = new TopologyId("contextIdA", "idA"); + final var deviceIdA = "deviceIdA"; + final var idA = "idA"; + final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); + + final var topologyIdB = new TopologyId("contextIdB", "idB"); + final var deviceIdB = "deviceIdB"; + final var idB = "idB"; + final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB); + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + Device device = - new Device(deviceId, deviceType, expectedDeviceConfig, DeviceOperationalStatus.ENABLED); + new Device( + deviceId, + deviceType, + expectedDeviceConfig, + DeviceOperationalStatus.ENABLED, + deviceDrivers, + endPoints); Uni deviceUni = Uni.createFrom().item(device); @@ -150,22 +267,37 @@ public class AutomationFunctionalServiceTest { deviceConfig -> { LOGGER.infof("Received response %s", deviceConfig); - assertThat(deviceConfig.getDeviceOperationalStatus().toString()) - .isEqualTo(device.getDeviceOperationalStatus().toString()); + assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString()); assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull(); final var rulesList = deviceConfig.getDeviceConfig().getConfigRules(); for (ConfigRule configRule : rulesList) { - assertThat(configRule.getResourceKey()) - .isEqualTo(expectedConfigRule.getResourceKey()); - assertThat(configRule.getResourceValue()) - .isEqualTo(expectedConfigRule.getResourceValue()); + if (configRule.getConfigRuleType().getConfigRuleType() + instanceof ConfigRuleCustom) { + + if (expectedConfigRule.getConfigRuleType().getConfigRuleType() + instanceof ConfigRuleCustom) { + assertThat( + ((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType()) + .getResourceKey()) + .isEqualTo( + ((ConfigRuleCustom) + expectedConfigRule.getConfigRuleType().getConfigRuleType()) + .getResourceKey()); + assertThat( + ((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType()) + .getResourceValue()) + .isEqualTo( + ((ConfigRuleCustom) + expectedConfigRule.getConfigRuleType().getConfigRuleType()) + .getResourceValue()); + } + } } - - assertThat(deviceConfig.getDeviceId().getId().getId()) - .isEqualTo(deviceId.getId().getId()); + assertThat(deviceConfig.getDeviceType()).isEqualTo("ztp"); + assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId); }); } } diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java b/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java index 85e056b87e87f1459d5fe02e902774aa1f1f82c3..b1a70a7e0f0933d9d8aa6049c53d75a40ebf14d8 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java +++ b/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java @@ -1,28 +1,55 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; import static org.assertj.core.api.Assertions.assertThat; import automation.Automation; -import automation.Automation.DeviceRole; -import automation.Automation.DeviceRoleId; import automation.AutomationService; import context.ContextOuterClass; -import context.ContextOuterClass.Uuid; import eu.teraflow.automation.context.ContextGateway; -import eu.teraflow.automation.device.Device; +import eu.teraflow.automation.context.model.ConfigActionEnum; +import eu.teraflow.automation.context.model.ConfigRule; +import eu.teraflow.automation.context.model.ConfigRuleCustom; +import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.automation.context.model.DeviceDriverEnum; +import eu.teraflow.automation.context.model.DeviceOperationalStatus; +import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.Location; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.automation.context.model.TopologyId; import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.device.model.*; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.automation.model.DeviceRole; +import eu.teraflow.automation.model.DeviceRoleId; +import eu.teraflow.automation.model.DeviceRoleType; import io.quarkus.grpc.GrpcClient; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; import io.smallrye.mutiny.Uni; -import java.util.ArrayList; import java.util.List; -import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.inject.Inject; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -32,114 +59,154 @@ class AutomationServiceTest { private static final Logger LOGGER = Logger.getLogger(AutomationServiceTest.class); @GrpcClient AutomationService client; + private final Serializer serializer; @InjectMock DeviceGateway deviceGateway; @InjectMock ContextGateway contextGateway; + @Inject + AutomationServiceTest(Serializer serializer) { + this.serializer = serializer; + } + @Test void shouldAddDeviceRole() throws ExecutionException, InterruptedException, TimeoutException { - CompletableFuture message = new CompletableFuture<>(); - - final var serializedUuid = - Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) - .build(); - final var deviceRoleId = DeviceRoleId.newBuilder().setDevRoleId(serializedUuid).build(); - final var deviceRole = DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); + final var message = new CompletableFuture<>(); + final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b"; + final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a"; + final var DEVICE_TYPE = "ztp"; - eu.teraflow.automation.device.model.Uuid uuid = - new eu.teraflow.automation.device.model.Uuid(deviceRoleId.getDevId().toString()); - DeviceId deviceId = new DeviceId(uuid); - DeviceType deviceType = new DeviceType("ztp"); + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); - List configRuleList = new ArrayList<>(); + final var topologyIdA = new TopologyId("contextIdA", "idA"); + final var deviceIdA = "deviceIdA"; + final var idA = "idA"; + final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA); - ConfigRule configRule1 = - new ConfigRule(ConfigActionEnum.UNDEFINED, "001", "initial-configuration"); - configRuleList.add(configRule1); + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); - DeviceConfig deviceConfig = new DeviceConfig(configRuleList); - // Uni deviceConfigUni = Uni.createFrom().item(deviceConfig); - Uni expectedDeviceId = Uni.createFrom().item(deviceId); + final var topologyIdB = new TopologyId("contextIdB", "idB"); + final var deviceIdB = "deviceIdB"; + final var idB = "idB"; + final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB); + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); - DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList); - Uni expectedDeviceConfigUni = Uni.createFrom().item(expectedDeviceConfig); + final var endPoints = List.of(endPointA, endPointB); - Device device = - new Device(deviceId, deviceType, deviceConfig, DeviceOperationalStatus.DISABLED); - Uni deviceUni = Uni.createFrom().item(device); + final var emptyDeviceConfig = new DeviceConfig(List.of()); + final var disabledDevice = + new Device( + DEVICE_ID, + DEVICE_TYPE, + emptyDeviceConfig, + DeviceOperationalStatus.DISABLED, + deviceDrivers, + endPoints); + Mockito.when(contextGateway.getDevice(Mockito.any())) + .thenReturn(Uni.createFrom().item(disabledDevice)); - Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni); + final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue"); + final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom); + final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleType); + final var initialDeviceConfig = new DeviceConfig(List.of(configRule)); Mockito.when(deviceGateway.getInitialConfiguration(Mockito.any())) - .thenReturn(expectedDeviceConfigUni); - Mockito.when(deviceGateway.configureDevice(Mockito.any())).thenReturn(expectedDeviceId); + .thenReturn(Uni.createFrom().item(initialDeviceConfig)); + + Mockito.when(deviceGateway.configureDevice(Mockito.any())) + .thenReturn(Uni.createFrom().item(DEVICE_ID)); + + final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID); + final var deviceRoleType = DeviceRoleType.DEV_OPS; + final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType); + final var serializedDeviceRole = serializer.serialize(deviceRole); client - .ztpAdd(deviceRole) + .ztpAdd(serializedDeviceRole) .subscribe() .with( deviceRoleState -> { - LOGGER.infof("Received response %s", deviceRoleState); - message.complete(deviceRoleState.getDevRoleId().getDevRoleId().toString()); + LOGGER.infof("Received %s", deviceRoleState); + final var devRoleId = deviceRoleState.getDevRoleId(); + + final var deviceRoleIdUuid = serializer.deserialize(devRoleId); + + assertThat(deviceRoleIdUuid.getId()).isEqualTo(DEVICE_ROLE_ID); + + final var deviceId = serializer.deserialize(devRoleId.getDevId()); + assertThat(deviceId).isEqualTo(DEVICE_ID); + + final var devRoleUuid = serializer.deserialize(devRoleId.getDevRoleId()); + message.complete(devRoleUuid); }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(deviceRoleId.getDevRoleId().toString()); + assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(DEVICE_ROLE_ID); } @Test void shouldUpdateDeviceRole() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); + final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b"; + final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a"; - final var uuid = - Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9605-7862-a9e4-5ed26688389b").toString()) - .build(); - final var deviceRoleId = DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); - final var deviceRole = DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); + final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID); + final var deviceRoleType = DeviceRoleType.DEV_CONF; + final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType); + final var serializedDeviceRole = serializer.serialize(deviceRole); client - .ztpUpdate(deviceRole) + .ztpUpdate(serializedDeviceRole) .subscribe() .with( deviceRoleState -> { LOGGER.infof("Received response %s", deviceRoleState); message.complete(deviceRoleState.getDevRoleId().toString()); }); - assertThat(message.get(5, TimeUnit.SECONDS)).contains("0f14d0ab-9605-7862-a9e4-5ed26688389b"); + assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ID); } @Test void shouldGetDeviceRole() throws ExecutionException, InterruptedException, TimeoutException { - CompletableFuture message = new CompletableFuture<>(); + final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b"; + final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a"; - final var uuid = - Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9605-4a62-a5c4-5ed26688389b").toString()) - .build(); - final var deviceRoleId = DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); + final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID); + final var serializeDeviceRoleId = serializer.serialize(deviceRoleId); client - .ztpGetDeviceRole(deviceRoleId) + .ztpGetDeviceRole(serializeDeviceRoleId) .subscribe() .with( deviceRole -> { LOGGER.infof("Received response %s", deviceRole); + assertThat(deviceRole.getDevRoleId().getDevId().getDeviceUuid().getUuid()) + .isEqualTo(DEVICE_ID); message.complete(deviceRole.getDevRoleId().toString()); }); - assertThat(message.get(5, TimeUnit.SECONDS)).contains("0f14d0ab-9605-4a62-a5c4-5ed26688389b"); + assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ROLE_ID); } @Test void shouldGetAllDeviceRolesByDeviceId() throws ExecutionException, InterruptedException, TimeoutException { - CompletableFuture message = new CompletableFuture<>(); - final var uuid = - Uuid.newBuilder() - .setUuid(UUID.fromString("1b14d0ab-9605-4a62-a9e4-5ed26688389b").toString()) - .build(); - final var deviceId = ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuid).build(); + final var deviceId = serializer.serializeDeviceId("0f14d0ab-9605-7862-a9e4-5ed26688389b"); client .ztpGetDeviceRolesByDeviceId(deviceId) @@ -155,12 +222,11 @@ class AutomationServiceTest { @Test void shouldDeleteDeviceRole() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); - final var uuid = - Uuid.newBuilder() - .setUuid(UUID.fromString("0c15d0ab-9605-4a62-a5c4-5ed26688389b").toString()) - .build(); - final var deviceRoleId = DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); - final var deviceRole = DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); + final var UUID_VALUE = "0f14d0ab-9605-7862-a9e4-5ed26688389b"; + + final var uuid = serializer.serializeUuid(UUID_VALUE); + final var deviceRoleId = Automation.DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); + final var deviceRole = Automation.DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); client .ztpDelete(deviceRole) @@ -170,15 +236,14 @@ class AutomationServiceTest { LOGGER.infof("Received response %s", deviceRoleState); message.complete(deviceRoleState.getDevRoleId().toString()); }); - assertThat(message.get(5, TimeUnit.SECONDS)).contains("0c15d0ab-9605-4a62-a5c4-5ed26688389b"); + assertThat(message.get(5, TimeUnit.SECONDS)).contains(UUID_VALUE); } @Test void shouldDeleteAllDevicesRolesByDeviceId() throws ExecutionException, InterruptedException, TimeoutException { - CompletableFuture message = new CompletableFuture<>(); - final var empty = Automation.Empty.newBuilder().build(); + final var empty = ContextOuterClass.Empty.newBuilder().build(); client .ztpDeleteAll(empty) diff --git a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java b/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..ec1da0ccb4e9bee46d6327f1da2016610494714e --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java @@ -0,0 +1,90 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; + +import static org.assertj.core.api.Assertions.assertThat; + +import eu.teraflow.automation.acl.AclAction; +import eu.teraflow.automation.acl.AclEntry; +import eu.teraflow.automation.acl.AclForwardActionEnum; +import eu.teraflow.automation.acl.AclLogActionEnum; +import eu.teraflow.automation.acl.AclMatch; +import eu.teraflow.automation.acl.AclRuleSet; +import eu.teraflow.automation.acl.AclRuleTypeEnum; +import eu.teraflow.automation.context.model.ConfigRuleAcl; +import eu.teraflow.automation.context.model.ConfigRuleCustom; +import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; +import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.TopologyId; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class ConfigRuleTypeTest { + + private AclMatch createAclMatch() { + + return new AclMatch(1, 2, "192.168.3.52", "192.168.4.192", 3224, 3845, 5, 10); + } + + private AclAction createAclAction() { + + return new AclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + } + + private AclEntry createAclEntry(AclMatch aclMatch, AclAction aclAction) { + + return new AclEntry(1, "aclEntryDescription", aclMatch, aclAction); + } + + @Test + void shouldExtractConfigRuleCustomFromConfigRuleTypeCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + final var configRuleTypeCustom = new ConfigRuleTypeCustom(expectedConfigRuleCustom); + + assertThat(configRuleTypeCustom.getConfigRuleType()).isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldExtractConfigRuleAclFromConfigRuleTypeAcl() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + + final var aclMatch = createAclMatch(); + final var aclAction = createAclAction(); + final var aclEntry = createAclEntry(aclMatch, aclAction); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); + + final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(expectedConfigRuleAcl); + + assertThat(configRuleTypeAcl.getConfigRuleType()).isEqualTo(expectedConfigRuleAcl); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java b/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java new file mode 100644 index 0000000000000000000000000000000000000000..e8a97d7922b49878af533c23918cf7b23aa20c06 --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java @@ -0,0 +1,199 @@ +package eu.teraflow.automation; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import automation.Automation; +import context.ContextOuterClass; +import eu.teraflow.automation.context.ContextGateway; +import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.automation.context.model.Event; +import eu.teraflow.automation.context.model.EventTypeEnum; +import io.quarkus.runtime.StartupEvent; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.mockito.InjectMock; +import io.smallrye.mutiny.Multi; +import java.util.UUID; +import javax.inject.Inject; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +@QuarkusTest +class ContextSubscriberTest { + + private static final String UUID_FOR_DEVICE_ROLE_ID = + UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString(); + private static final String UUID_FOR_DEVICE_ID = + UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString(); + + @Inject ContextSubscriber contextSubscriber; + + @InjectMock ContextGateway contextGateway; + + @InjectMock AutomationService automationService; + + @InjectMock AutomationConfiguration automationConfiguration; + + @Test + void shouldCallAddDeviceUponCreateEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.CREATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(1)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponUpdateEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.UPDATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponRemoveEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.REMOVE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldNotCallAddDeviceUponNullEvent() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + DeviceEvent deviceEvent = new DeviceEvent(deviceId, null); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + + contextSubscriber.listenForDeviceEvents(); + + verify(automationService, times(0)).addDevice(deviceId); + } + + @Test + void shouldCallListenForDeviceEventsUponStart() { + final var uuidForDeviceRoleId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ROLE_ID).build(); + + final var uuidForDeviceId = + ContextOuterClass.Uuid.newBuilder().setUuid(UUID_FOR_DEVICE_ID).build(); + + final var outDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); + + final var outDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(uuidForDeviceRoleId) + .setDevId(outDeviceId) + .build(); + + String deviceId = outDeviceRoleId.getDevId().toString(); + + Event event = new Event(3.4, EventTypeEnum.CREATE); + DeviceEvent deviceEvent = new DeviceEvent(deviceId, event); + final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); + + Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); + Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(true); + + StartupEvent y = new StartupEvent(); + contextSubscriber.onStart(y); + + verify(contextGateway, times(1)).getDeviceEvents(); + verify(automationService, times(1)).addDevice(deviceId); + } + + @Test + void shouldNotCallListenForDeviceEventsUponStart() { + final var automationConfiguration = Mockito.mock(AutomationConfiguration.class); + Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(false); + + StartupEvent y = new StartupEvent(); + contextSubscriber.onStart(y); + + verify(contextGateway, times(0)).getDeviceEvents(); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java b/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..d2094efaf48338c710121eddffc4b5fb1edd3790 --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java @@ -0,0 +1,124 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.automation.context.model.EndPoint; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.Location; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.automation.context.model.TopologyId; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class EndPointCreationTest { + + @Test + void shouldCreateEndPointObjectGivenAllAvailableFields() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedLocationType = new LocationTypeRegion("ATH"); + final var expectedEndPointLocation = new Location(expectedLocationType); + + final var expectedEndPoint = + new EndPoint.EndPointBuilder( + expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes) + .location(expectedEndPointLocation) + .build(); + + assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId); + assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType); + assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes); + assertThat(expectedEndPoint.getEndPointLocation()).isEqualTo(expectedEndPointLocation); + } + + @Test + void shouldCreateEndPointObjectGivenAllFieldsExceptFromLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedEndPoint = + new EndPoint.EndPointBuilder( + expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes) + .build(); + + assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId); + assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType); + assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointId() { + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var endPoint = + new EndPoint.EndPointBuilder(null, expectedEndPointType, expectedKpiSampleTypes); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointType() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var endPoint = + new EndPoint.EndPointBuilder(expectedEndPointId, null, expectedKpiSampleTypes); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingKpiSampleTypes() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + + final var endPoint = + new EndPoint.EndPointBuilder(expectedEndPointId, expectedEndPointType, null); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java b/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..f89830e425feffeac377c9d20c0561221f835ec6 --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; + +import static org.assertj.core.api.Assertions.assertThat; + +import eu.teraflow.automation.context.model.GpsPosition; +import eu.teraflow.automation.context.model.LocationTypeGpsPosition; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import io.quarkus.test.junit.QuarkusTest; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class LocationTypeTest { + + @Test + void shouldExtractRegionFromLocationTypeRegion() { + final var expectedRegion = "ATH"; + + final var locationTypeRegion = new LocationTypeRegion(expectedRegion); + + assertThat(locationTypeRegion.getLocationType()).isEqualTo(expectedRegion); + } + + @Test + void shouldExtractLocationGpsPositionFromLocationTypeGpsPosition() { + final var latitude = 3.99f; + final var longitude = 77.32f; + + final var expectedLocationGpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(expectedLocationGpsPosition); + + assertThat(locationTypeGpsPosition.getLocationType()).isEqualTo(expectedLocationGpsPosition); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java b/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..24c0433e0ed5fb5e3d20ff762f640406d8bf9f1b --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java @@ -0,0 +1,18 @@ +package eu.teraflow.automation; + +import io.smallrye.config.SmallRyeConfig; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.Produces; +import org.eclipse.microprofile.config.Config; + +public class MockAutomationConfiguration { + @Inject Config config; + + @Produces + @ApplicationScoped + @io.quarkus.test.Mock + AutomationConfiguration automationConfiguration() { + return config.unwrap(SmallRyeConfig.class).getConfigMapping(AutomationConfiguration.class); + } +} diff --git a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java b/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..74f8f301ca7d4db904d9092e8f860fc4dc171a51 --- /dev/null +++ b/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java @@ -0,0 +1,1609 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.automation; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import acl.Acl; +import automation.Automation; +import context.ContextOuterClass; +import context.ContextOuterClass.DeviceId; +import context.ContextOuterClass.DeviceOperationalStatusEnum; +import context.ContextOuterClass.Uuid; +import eu.teraflow.automation.acl.AclAction; +import eu.teraflow.automation.acl.AclEntry; +import eu.teraflow.automation.acl.AclForwardActionEnum; +import eu.teraflow.automation.acl.AclLogActionEnum; +import eu.teraflow.automation.acl.AclMatch; +import eu.teraflow.automation.acl.AclRuleSet; +import eu.teraflow.automation.acl.AclRuleTypeEnum; +import eu.teraflow.automation.context.model.ConfigActionEnum; +import eu.teraflow.automation.context.model.ConfigRule; +import eu.teraflow.automation.context.model.ConfigRuleAcl; +import eu.teraflow.automation.context.model.ConfigRuleCustom; +import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; +import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; +import eu.teraflow.automation.context.model.Device; +import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.automation.context.model.DeviceDriverEnum; +import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.automation.context.model.DeviceOperationalStatus; +import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.automation.context.model.EndPointId; +import eu.teraflow.automation.context.model.Event; +import eu.teraflow.automation.context.model.EventTypeEnum; +import eu.teraflow.automation.context.model.GpsPosition; +import eu.teraflow.automation.context.model.Location; +import eu.teraflow.automation.context.model.LocationTypeGpsPosition; +import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.automation.context.model.TopologyId; +import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.automation.model.DeviceRole; +import eu.teraflow.automation.model.DeviceRoleId; +import eu.teraflow.automation.model.DeviceRoleType; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.inject.Inject; +import kpi_sample_types.KpiSampleTypes; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +@QuarkusTest +class SerializerTest { + + @Inject Serializer serializer; + + private AclMatch createAclMatch( + int dscp, + int protocol, + String srcAddress, + String dstAddress, + int srcPort, + int dstPort, + int startMplsLabel, + int endMplsLabel) { + return new AclMatch( + dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel); + } + + private AclAction createAclAction( + AclForwardActionEnum forwardActionEnum, AclLogActionEnum logActionEnum) { + + return new AclAction(forwardActionEnum, logActionEnum); + } + + private AclEntry createAclEntry( + int sequenceId, String description, AclMatch aclMatch, AclAction aclAction) { + + return new AclEntry(sequenceId, description, aclMatch, aclAction); + } + + @Test + void shouldSerializeDeviceId() { + final var expectedDeviceId = "expectedDeviceId"; + + final var deviceIdUuid = serializer.serializeUuid(expectedDeviceId); + final var deviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); + + final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); + + assertThat(serializedDeviceId).usingRecursiveComparison().isEqualTo(deviceId); + } + + @Test + void shouldDeserializeDeviceId() { + final var expectedDeviceId = "expectedDeviceId"; + + final var serializedDeviceIdUuid = serializer.serializeUuid("expectedDeviceId"); + final var serializedDeviceId = + DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build(); + + final var deviceId = serializer.deserialize(serializedDeviceId); + + assertThat(deviceId).isEqualTo(expectedDeviceId); + } + + @Test + void shouldSerializeDeviceRoleId() { + final var expectedDevRoleId = "expectedDevRoleId"; + final var expectedDeviceId = "expectedDeviceId"; + + final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); + final var serializedDeviceRoleIdUuid = serializer.serializeUuid(expectedDevRoleId); + final var serializedDeviceRoleDeviceIdUuid = serializer.serializeUuid(expectedDeviceId); + final var serializedDeviceRoleDeviceId = + ContextOuterClass.DeviceId.newBuilder() + .setDeviceUuid(serializedDeviceRoleDeviceIdUuid) + .build(); + + final var expectedDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(serializedDeviceRoleIdUuid) + .setDevId(serializedDeviceRoleDeviceId) + .build(); + + final var serializedDevRoleId = serializer.serialize(deviceRoleId); + + assertThat(serializedDevRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId); + } + + @Test + void shouldDeserializeDeviceRoleId() { + final var expectedDevRoleId = "expectedDevRoleId"; + final var expectedDeviceId = "expectedDeviceId"; + + final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); + + final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId); + final var deviceRoleId = serializer.deserialize(serializedDeviceRoleId); + + assertThat(deviceRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId); + } + + private static Stream provideDeviceRoleType() { + return Stream.of( + Arguments.of(DeviceRoleType.DEV_OPS, Automation.DeviceRoleType.DEV_OPS), + Arguments.of(DeviceRoleType.DEV_CONF, Automation.DeviceRoleType.DEV_CONF), + Arguments.of(DeviceRoleType.NONE, Automation.DeviceRoleType.NONE), + Arguments.of(DeviceRoleType.PIPELINE_CONF, Automation.DeviceRoleType.PIPELINE_CONF)); + } + + @ParameterizedTest + @MethodSource("provideDeviceRoleType") + void shouldSerializeDeviceRoleType( + DeviceRoleType deviceRoleType, Automation.DeviceRoleType expectedSerializedType) { + final var serializedType = serializer.serialize(deviceRoleType); + assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideDeviceRoleType") + void shouldDeserializeDeviceRoleType( + DeviceRoleType expectedDeviceRoleType, + Automation.DeviceRoleType serializedDeviceRoleTypeType) { + + final var deviceRoleType = serializer.deserialize(serializedDeviceRoleTypeType); + + assertThat(deviceRoleType).isEqualTo(expectedDeviceRoleType); + } + + @Test + void shouldSerializeDeviceRole() { + final var expectedDevRoleId = "expectedDevRoleId"; + final var expectedDeviceId = "expectedDeviceId"; + + final var serializedDeviceRoleDevRoleIdUuid = serializer.serializeUuid(expectedDevRoleId); + final var serializedDeviceRoleDeviceId = serializer.serializeDeviceId(expectedDeviceId); + + final var expectedDeviceRoleId = + Automation.DeviceRoleId.newBuilder() + .setDevRoleId(serializedDeviceRoleDevRoleIdUuid) + .setDevId(serializedDeviceRoleDeviceId) + .build(); + + final var expectedDeviceRoleType = Automation.DeviceRoleType.PIPELINE_CONF; + + final var expectedDeviceRole = + Automation.DeviceRole.newBuilder() + .setDevRoleId(expectedDeviceRoleId) + .setDevRoleType(expectedDeviceRoleType) + .build(); + + final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); + final var deviceRoleType = DeviceRoleType.PIPELINE_CONF; + + final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType); + final var serializedDeviceRole = serializer.serialize(deviceRole); + + assertThat(serializedDeviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole); + } + + @Test + void shouldDeserializeDeviceRole() { + final var expectedDevRoleId = "expectedDevRoleId"; + final var expectedDeviceId = "expectedDeviceId"; + + final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId); + final var expectedDeviceRoleType = DeviceRoleType.NONE; + + final var expectedDeviceRole = new DeviceRole(expectedDeviceRoleId, expectedDeviceRoleType); + + final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId); + final var serializedDeviceRoleType = serializer.serialize(expectedDeviceRoleType); + + final var serializedDeviceRole = + Automation.DeviceRole.newBuilder() + .setDevRoleId(serializedDeviceRoleId) + .setDevRoleType(serializedDeviceRoleType) + .build(); + + final var deviceRole = serializer.deserialize(serializedDeviceRole); + + assertThat(deviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole); + } + + private static Stream provideEventTypeEnum() { + return Stream.of( + Arguments.of(EventTypeEnum.CREATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE), + Arguments.of(EventTypeEnum.REMOVE, ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE), + Arguments.of(EventTypeEnum.UNDEFINED, ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED), + Arguments.of(EventTypeEnum.UPDATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE)); + } + + @ParameterizedTest + @MethodSource("provideEventTypeEnum") + void shouldSerializeEventType( + EventTypeEnum eventType, ContextOuterClass.EventTypeEnum expectedSerializedType) { + final var serializedType = serializer.serialize(eventType); + assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideEventTypeEnum") + void shouldDeserializeEventType( + EventTypeEnum expectedEventType, ContextOuterClass.EventTypeEnum serializedEventType) { + final var eventType = serializer.deserialize(serializedEventType); + assertThat(eventType).isEqualTo(expectedEventType); + } + + @Test + void shouldSerializeEvent() { + final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var expectedEvent = + ContextOuterClass.Event.newBuilder() + .setTimestamp(timestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) + .build(); + + final var event = new Event(1, EventTypeEnum.CREATE); + final var serializedEvent = serializer.serialize(event); + + assertThat(serializedEvent).usingRecursiveComparison().isEqualTo(expectedEvent); + } + + @Test + void shouldDeserializeEvent() { + final var expectedEvent = new Event(1, EventTypeEnum.CREATE); + final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var serializedEvent = + ContextOuterClass.Event.newBuilder() + .setTimestamp(timestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) + .build(); + final var event = serializer.deserialize(serializedEvent); + + assertThat(event).usingRecursiveComparison().isEqualTo(expectedEvent); + } + + @Test + void shouldSerializeDeviceEvent() { + final var expectedUuid = Uuid.newBuilder().setUuid("deviceId"); + final var expectedDeviceId = DeviceId.newBuilder().setDeviceUuid(expectedUuid).build(); + final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var expectedEvent = + ContextOuterClass.Event.newBuilder() + .setTimestamp(expectedTimestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) + .build(); + final var expectedDeviceEvent = + ContextOuterClass.DeviceEvent.newBuilder() + .setDeviceId(expectedDeviceId) + .setEvent(expectedEvent) + .build(); + + final var creationEvent = new Event(1, EventTypeEnum.CREATE); + final var deviceEvent = new DeviceEvent("deviceId", creationEvent); + final var serializedDeviceEvent = serializer.serialize(deviceEvent); + + assertThat(serializedDeviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent); + } + + @Test + void shouldDeserializeDeviceEvent() { + final var dummyDeviceId = "deviceId"; + final var expectedEventType = EventTypeEnum.REMOVE; + final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var creationEvent = new Event(1, expectedEventType); + final var expectedDeviceEvent = new DeviceEvent(dummyDeviceId, creationEvent); + + final var deviceUuid = Uuid.newBuilder().setUuid("deviceId"); + final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceUuid).build(); + final var event = + ContextOuterClass.Event.newBuilder() + .setTimestamp(expectedTimestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE) + .build(); + final var serializedDeviceEvent = + ContextOuterClass.DeviceEvent.newBuilder().setDeviceId(deviceId).setEvent(event).build(); + final var deviceEvent = serializer.deserialize(serializedDeviceEvent); + + assertThat(deviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent); + } + + private static Stream provideConfigActionEnum() { + return Stream.of( + Arguments.of(ConfigActionEnum.SET, ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET), + Arguments.of( + ConfigActionEnum.DELETE, ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE), + Arguments.of( + ConfigActionEnum.UNDEFINED, ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideConfigActionEnum") + void shouldSerializeConfigActionEnum( + ConfigActionEnum configAction, ContextOuterClass.ConfigActionEnum expectedConfigAction) { + final var serializedConfigAction = serializer.serialize(configAction); + assertThat(serializedConfigAction.getNumber()).isEqualTo(expectedConfigAction.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideConfigActionEnum") + void shouldDeserializeConfigActionEnum( + ConfigActionEnum expectedConfigAction, + ContextOuterClass.ConfigActionEnum serializedConfigAction) { + final var configAction = serializer.deserialize(serializedConfigAction); + assertThat(configAction).isEqualTo(expectedConfigAction); + } + + private static Stream provideAclRuleTypeEnum() { + return Stream.of( + Arguments.of(AclRuleTypeEnum.IPV4, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4), + Arguments.of(AclRuleTypeEnum.IPV6, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6), + Arguments.of(AclRuleTypeEnum.L2, Acl.AclRuleTypeEnum.ACLRULETYPE_L2), + Arguments.of(AclRuleTypeEnum.MPLS, Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS), + Arguments.of(AclRuleTypeEnum.MIXED, Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED), + Arguments.of(AclRuleTypeEnum.UNDEFINED, Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclRuleTypeEnum") + void shouldSerializeAclRuleTypeEnum( + AclRuleTypeEnum aclRuleTypeEnum, Acl.AclRuleTypeEnum expectedAclRuleTypeEnum) { + final var serializedAclRuleTypeEnum = serializer.serialize(aclRuleTypeEnum); + assertThat(serializedAclRuleTypeEnum.getNumber()) + .isEqualTo(expectedAclRuleTypeEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideAclRuleTypeEnum") + void shouldDeserializeAclRuleTypeEnum( + AclRuleTypeEnum expectedAclRuleTypeEnum, Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) { + final var aclRuleTypeEnum = serializer.deserialize(serializedAclRuleTypeEnum); + assertThat(aclRuleTypeEnum).isEqualTo(expectedAclRuleTypeEnum); + } + + private static Stream provideAclForwardActionEnum() { + return Stream.of( + Arguments.of(AclForwardActionEnum.DROP, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP), + Arguments.of( + AclForwardActionEnum.ACCEPT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT), + Arguments.of( + AclForwardActionEnum.REJECT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT), + Arguments.of( + AclForwardActionEnum.UNDEFINED, + Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclForwardActionEnum") + void shouldSerializeAclForwardActionEnum( + AclForwardActionEnum aclForwardActionEnum, + Acl.AclForwardActionEnum expectedAclForwardActionEnum) { + final var serializedAclForwardActionEnum = serializer.serialize(aclForwardActionEnum); + assertThat(serializedAclForwardActionEnum.getNumber()) + .isEqualTo(expectedAclForwardActionEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideAclForwardActionEnum") + void shouldDeserializeAclForwardActionEnum( + AclForwardActionEnum expectedAclForwardActionEnum, + Acl.AclForwardActionEnum serializedAclForwardActionEnum) { + final var aclForwardActionEnum = serializer.deserialize(serializedAclForwardActionEnum); + assertThat(aclForwardActionEnum).isEqualTo(expectedAclForwardActionEnum); + } + + private static Stream provideAclLogActionEnum() { + return Stream.of( + Arguments.of(AclLogActionEnum.NO_LOG, Acl.AclLogActionEnum.ACLLOGACTION_NOLOG), + Arguments.of(AclLogActionEnum.SYSLOG, Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG), + Arguments.of(AclLogActionEnum.UNDEFINED, Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclLogActionEnum") + void shouldSerializeAclLogActionEnum( + AclLogActionEnum aclLogActionEnum, Acl.AclLogActionEnum expectedAclLogActionEnum) { + final var serializedAclLogActionEnum = serializer.serialize(aclLogActionEnum); + assertThat(serializedAclLogActionEnum.getNumber()) + .isEqualTo(expectedAclLogActionEnum.getNumber()); + } + + @Test + void shouldSerializeAclAction() { + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + + final var expectedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var serializedAclAction = serializer.serialize(aclAction); + + assertThat(serializedAclAction).usingRecursiveComparison().isEqualTo(expectedAclAction); + } + + @Test + void shouldDeserializeAclAction() { + final var expectedAclAction = + createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + + final var serializedAclAction = serializer.serialize(expectedAclAction); + final var aclAction = serializer.deserialize(serializedAclAction); + + assertThat(aclAction).usingRecursiveComparison().isEqualTo(expectedAclAction); + } + + @Test + void shouldSerializeAclMatch() { + final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2); + + final var expectedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(1) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(1) + .setEndMplsLabel(2) + .build(); + + final var serializedAclMatch = serializer.serialize(aclMatch); + + assertThat(serializedAclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch); + } + + @Test + void shouldDeserializeAclMatch() { + final var expectedAclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + + final var serializedAclMatch = serializer.serialize(expectedAclMatch); + final var aclMatch = serializer.deserialize(serializedAclMatch); + + assertThat(aclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch); + } + + @Test + void shouldSerializeAclEntry() { + final var sequenceId = 1; + final var description = "aclEntryDescription"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction); + + final var serializedAclMatch = serializer.serialize(aclMatch); + final var serializedAclAction = serializer.serialize(aclAction); + + final var expectedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(sequenceId) + .setDescription(description) + .setMatch(serializedAclMatch) + .setAction(serializedAclAction) + .build(); + + final var serializedAclEntry = serializer.serialize(aclEntry); + + assertThat(serializedAclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry); + } + + @Test + void shouldDeserializeAclEntry() { + final var sequenceId = 1; + final var description = "aclEntryDescription"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var expectedAclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction); + + final var serializedAclEntry = serializer.serialize(expectedAclEntry); + final var aclEntry = serializer.deserialize(serializedAclEntry); + + assertThat(aclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry); + } + + @Test + void shouldSerializeAclRuleSet() { + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var serializedAclEntry = serializer.serialize(aclEntry); + final var serializedAclEntries = List.of(serializedAclEntry); + + final var expectedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName(aclRuleSetName) + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED) + .setDescription(aclRuleSetDescription) + .setUserId(aclRuleSetUserId) + .addAllEntries(serializedAclEntries) + .build(); + + final var serializedAclRuleset = serializer.serialize(aclRuleSet); + + assertThat(serializedAclRuleset).usingRecursiveComparison().isEqualTo(expectedAclRuleSet); + } + + @Test + void shouldDeserializeAclRuleSet() { + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var expectedAclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var serializedAclRuleSet = serializer.serialize(expectedAclRuleSet); + final var aclRuleSet = serializer.deserialize(serializedAclRuleSet); + + assertThat(aclRuleSet).usingRecursiveComparison().isEqualTo(expectedAclRuleSet); + } + + @ParameterizedTest + @MethodSource("provideAclLogActionEnum") + void shouldDeserializeAclLogActionEnum( + AclLogActionEnum expectedAclLogActionEnum, Acl.AclLogActionEnum serializedAclLogActionEnum) { + final var aclLogActionEnum = serializer.deserialize(serializedAclLogActionEnum); + assertThat(aclLogActionEnum).isEqualTo(expectedAclLogActionEnum); + } + + @Test + void shouldSerializeTopologyId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + final var topologyId = new TopologyId(expectedContextId, expectedId); + + final var serializedContextId = serializer.serializeContextId(expectedContextId); + final var serializedIdUuid = serializer.serializeUuid(expectedId); + + final var expectedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(serializedContextId) + .setTopologyUuid(serializedIdUuid) + .build(); + + final var serializedTopologyId = serializer.serialize(topologyId); + + assertThat(serializedTopologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId); + } + + @Test + void shouldDeserializeTopologyId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + + final var expectedTopologyId = new TopologyId(expectedContextId, expectedId); + + final var serializedTopologyId = serializer.serialize(expectedTopologyId); + final var topologyId = serializer.deserialize(serializedTopologyId); + + assertThat(topologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId); + } + + @Test + void shouldSerializeEndPointId() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var serializedTopologyId = serializer.serialize(expectedTopologyId); + final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); + final var serializedEndPointUuid = serializer.serializeUuid(expectedId); + + final var expectedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(serializedTopologyId) + .setDeviceId(serializedDeviceId) + .setEndpointUuid(serializedEndPointUuid) + .build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + + assertThat(serializedEndPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId); + } + + @Test + void shouldDeserializeEndPointId() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var serializedEndPointId = serializer.serialize(expectedEndPointId); + final var endPointId = serializer.deserialize(serializedEndPointId); + + assertThat(endPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId); + } + + @Test + void shouldSerializeConfigRuleAcl() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedAclRuleSet = serializer.serialize(aclRuleSet); + + final var expectedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + final var serializedConfigRuleAcl = serializer.serialize(configRuleAcl); + + assertThat(serializedConfigRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl); + } + + @Test + void shouldDeserializeConfigRuleAcl() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var serializedConfigRuleAcl = serializer.serialize(expectedConfigRuleAcl); + final var configRuleAcl = serializer.deserialize(serializedConfigRuleAcl); + + assertThat(configRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl); + } + + @Test + void shouldSerializeConfigRuleCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var configRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + + final var expectedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey(resourceKey) + .setResourceValue(resourceValue) + .build(); + + final var serializedConfigRuleCustom = serializer.serialize(configRuleCustom); + + assertThat(serializedConfigRuleCustom) + .usingRecursiveComparison() + .isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldDeserializeConfigRuleCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + + final var serializedConfigRuleCustom = serializer.serialize(expectedConfigRuleCustom); + final var configRuleCustom = serializer.deserialize(serializedConfigRuleCustom); + + assertThat(configRuleCustom).usingRecursiveComparison().isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldSerializeConfigRule() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var expectedSerializedContextId = serializer.serializeContextId(contextIdUuid); + final var expectedSerializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid); + final var expectedSerializedDeviceId = serializer.serializeDeviceId(deviceIdUuid); + final var expectedSerializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid); + + final var expectedSerializedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(expectedSerializedContextId) + .setTopologyUuid(expectedSerializedTopologyIdUuid) + .build(); + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + + final var expectedSerializedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(expectedSerializedTopologyId) + .setDeviceId(expectedSerializedDeviceId) + .setEndpointUuid(expectedSerializedEndPointIdUuid) + .build(); + + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + + final var expectedSerializedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(1) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(1) + .setEndMplsLabel(2) + .build(); + + final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2); + + final var expectedSerializedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + + final var expectedSerializedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(1) + .setDescription("aclEntryDescription") + .setMatch(expectedSerializedAclMatch) + .setAction(expectedSerializedAclAction) + .build(); + + final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction); + + final var expectedSerializedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName("aclRuleName") + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4) + .setDescription("AclRuleDescription") + .setUserId("userId") + .addEntries(expectedSerializedAclEntry) + .build(); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", + eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4, + "AclRuleDescription", + "userId", + List.of(aclEntry)); + + final var expectedSerializedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(expectedSerializedEndPointId) + .setRuleSet(expectedSerializedAclRuleSet) + .build(); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var expectedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setAcl(expectedSerializedConfigRuleAcl) + .build(); + + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeAcl); + final var serializedConfigRule = serializer.serialize(configRule); + + assertThat(serializedConfigRule).isEqualTo(expectedConfigRule); + } + + @Test + void shouldDeserializeConfigRule() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var serializedContextId = serializer.serializeContextId(contextIdUuid); + final var serializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid); + final var serializedDeviceId = serializer.serializeDeviceId(deviceIdUuid); + final var serializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid); + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + final var serializedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(serializedContextId) + .setTopologyUuid(serializedTopologyIdUuid) + .build(); + + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + final var serializedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(serializedTopologyId) + .setDeviceId(serializedDeviceId) + .setEndpointUuid(serializedEndPointIdUuid) + .build(); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var serializedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(2) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(5) + .setEndMplsLabel(10) + .build(); + + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var serializedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction); + + final var serializedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(1) + .setDescription("aclEntryDescription") + .setMatch(serializedAclMatch) + .setAction(serializedAclAction) + .build(); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", + eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4, + "AclRuleDescription", + "userId", + List.of(aclEntry)); + + final var serializedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName("aclRuleName") + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4) + .setDescription("AclRuleDescription") + .setUserId("userId") + .addEntries(serializedAclEntry) + .build(); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + + final var expectedConfigRule = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeAcl); + + final var serializedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + final var serializedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setAcl(serializedConfigRuleAcl) + .build(); + + final var configRule = serializer.deserialize(serializedConfigRule); + + assertThat(configRule).usingRecursiveComparison().isEqualTo(expectedConfigRule); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedConfigRule() { + final var serializedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedConfigRule)); + } + + private static Stream provideKpiSampleType() { + return Stream.of( + Arguments.of( + KpiSampleType.PACKETS_TRANSMITTED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED), + Arguments.of( + KpiSampleType.PACKETS_RECEIVED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED), + Arguments.of( + KpiSampleType.BYTES_TRANSMITTED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED), + Arguments.of( + KpiSampleType.BYTES_RECEIVED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED), + Arguments.of(KpiSampleType.UNKNOWN, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN)); + } + + @ParameterizedTest + @MethodSource("provideKpiSampleType") + void shouldSerializeKpiSampleType( + KpiSampleType kpiSampleType, KpiSampleTypes.KpiSampleType expectedSerializedType) { + final var serializedKpiSampleType = serializer.serialize(kpiSampleType); + + assertThat(serializedKpiSampleType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideKpiSampleType") + void shouldDeserializeKpiSampleType( + KpiSampleType expectedKpiSampleType, KpiSampleTypes.KpiSampleType serializedKpiSampleType) { + final var kpiSampleType = serializer.deserialize(serializedKpiSampleType); + + assertThat(kpiSampleType).isEqualTo(expectedKpiSampleType); + } + + private static Stream provideDeviceDriverEnum() { + return Stream.of( + Arguments.of( + DeviceDriverEnum.OPENCONFIG, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG), + Arguments.of( + DeviceDriverEnum.TRANSPORT_API, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API), + Arguments.of(DeviceDriverEnum.P4, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4), + Arguments.of( + DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY), + Arguments.of( + DeviceDriverEnum.ONF_TR_352, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352), + Arguments.of( + DeviceDriverEnum.UNDEFINED, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideDeviceDriverEnum") + void shouldSerializeDeviceDriverEnum( + DeviceDriverEnum deviceDriverEnum, + ContextOuterClass.DeviceDriverEnum expectedDeviceDriverEnum) { + final var serializedDeviceDriverEnum = serializer.serialize(deviceDriverEnum); + + assertThat(serializedDeviceDriverEnum.getNumber()) + .isEqualTo(expectedDeviceDriverEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideDeviceDriverEnum") + void shouldDeserializeDeviceDriverEnum( + DeviceDriverEnum expectedDeviceDriverEnum, + ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) { + final var deviceDriverEnum = serializer.deserialize(serializedDeviceDriverEnum); + + assertThat(deviceDriverEnum).isEqualTo(expectedDeviceDriverEnum); + } + + @Test + void shouldSerializeDeviceConfig() { + final var expectedConfigRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + + final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + + final var expectedConfigRuleCustomB = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyB") + .setResourceValue("resourceValueB") + .build(); + + final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB"); + + final var expectedConfigRuleA = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(expectedConfigRuleCustomA) + .build(); + final var expectedConfigRuleB = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(expectedConfigRuleCustomB) + .build(); + + final var expectedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder() + .addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB)) + .build(); + + final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA); + final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB); + + final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA); + final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB); + + final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB)); + final var serializedDeviceConfig = serializer.serialize(deviceConfig); + + assertThat(serializedDeviceConfig).isEqualTo(expectedDeviceConfig); + } + + @Test + void shouldDeserializeDeviceConfig() { + final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB"); + + final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA); + final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB); + + final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA); + final var expectedConfigRuleB = + new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB); + + final var expectedDeviceConfig = + new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB)); + + final var configRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + + final var configRuleCustomB = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyB") + .setResourceValue("resourceValueB") + .build(); + + final var configRuleA = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(configRuleCustomA) + .build(); + final var configRuleB = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(configRuleCustomB) + .build(); + final var serializedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder() + .addAllConfigRules(List.of(configRuleA, configRuleB)) + .build(); + final var deviceConfig = serializer.deserialize(serializedDeviceConfig); + + assertThat(deviceConfig).usingRecursiveComparison().isEqualTo(expectedDeviceConfig); + } + + private static Stream provideOperationalStatusEnum() { + return Stream.of( + Arguments.of( + DeviceOperationalStatus.ENABLED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED), + Arguments.of( + DeviceOperationalStatus.DISABLED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED), + Arguments.of( + DeviceOperationalStatus.UNDEFINED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideOperationalStatusEnum") + void shouldSerializeOperationalStatusEnum( + DeviceOperationalStatus opStatus, + ContextOuterClass.DeviceOperationalStatusEnum expectedOpStatus) { + final var serializedOpStatus = serializer.serialize(opStatus); + assertThat(serializedOpStatus.getNumber()).isEqualTo(expectedOpStatus.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideOperationalStatusEnum") + void shouldDeserializeOperationalStatusEnum( + DeviceOperationalStatus expectedOpStatus, + ContextOuterClass.DeviceOperationalStatusEnum serializedOpStatus) { + final var operationalStatus = serializer.deserialize(serializedOpStatus); + assertThat(operationalStatus).isEqualTo(expectedOpStatus); + } + + @Test + void shouldSerializeLocationOfTypeRegion() { + final var region = "Tokyo"; + + final var locationTypeRegion = new LocationTypeRegion(region); + final var location = new Location(locationTypeRegion); + + final var expectedLocation = ContextOuterClass.Location.newBuilder().setRegion(region).build(); + + final var serializedLocation = serializer.serialize(location); + + assertThat(serializedLocation).isEqualTo(expectedLocation); + } + + @Test + void shouldDeserializeLocationOfTypeRegion() { + final var region = "Tokyo"; + + final var locationTypeRegion = new LocationTypeRegion(region); + final var expectedLocation = new Location(locationTypeRegion); + + final var serializedLocation = + ContextOuterClass.Location.newBuilder().setRegion(region).build(); + + final var location = serializer.deserialize(serializedLocation); + + assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation); + } + + @Test + void shouldSerializeLocationOfTypeGpsPosition() { + final var latitude = 33.3f; + final var longitude = 86.4f; + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + final var location = new Location(locationTypeGpsPosition); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + final var expectedLocation = + ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build(); + + final var serializedLocation = serializer.serialize(location); + + assertThat(serializedLocation).isEqualTo(expectedLocation); + } + + @Test + void shouldDeserializeLocationOfTypeGpsPosition() { + final var latitude = 33.3f; + final var longitude = 86.4f; + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + final var expectedLocation = new Location(locationTypeGpsPosition); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + final var serializedLocation = + ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build(); + + final var location = serializer.deserialize(serializedLocation); + + assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedLocation() { + final var serializedLocation = ContextOuterClass.Location.newBuilder().build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedLocation)); + } + + @Test + void shouldSerializeEndPointWithAllAvailableFields() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var endPointType = "endPointType"; + final var kpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegion = new LocationTypeRegion("ATH"); + final var location = new Location(locationTypeRegion); + + final var endPoint = + new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList()); + final var serializedEndPointLocation = serializer.serialize(location); + + final var expectedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(endPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .setEndpointLocation(serializedEndPointLocation) + .build(); + + final var serializedEndPoint = serializer.serialize(endPoint); + + assertThat(serializedEndPoint).isEqualTo(expectedEndPoint); + } + + @Test + void shouldDeserializeEndPointWithAllAvailableFields() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var endPointType = "endPointType"; + final var kpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegion = new LocationTypeRegion("ATH"); + final var location = new Location(locationTypeRegion); + + final var expectedEndPoint = + new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList()); + final var serializedEndPointLocation = serializer.serialize(location); + + final var serializedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(endPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .setEndpointLocation(serializedEndPointLocation) + .build(); + + final var endPoint = serializer.deserialize(serializedEndPoint); + + assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint); + } + + @Test + void shouldSerializeEndPointWithAllAvailableFieldsMissingLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var endPointType = "endPointType"; + final var kpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var endPoint = new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList()); + + final var expectedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(endPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .build(); + + final var serializedEndPoint = serializer.serialize(endPoint); + + assertThat(serializedEndPoint).isEqualTo(expectedEndPoint); + } + + @Test + void shouldDeserializeEndPointWithAllAvailableFieldsMissingLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var endPointType = "endPointType"; + final var kpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedEndPoint = + new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList()); + + final var serializedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(endPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .build(); + + final var endPoint = serializer.deserialize(serializedEndPoint); + + assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint); + } + + @Test + void shouldSerializeDevice() { + final var expectedConfigRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + + final var expectedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(expectedConfigRuleCustomA) + .build(); + + final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA); + final var deviceConfig = + new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA))); + + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var expectedTopologyIdA = new TopologyId("contextIdA", "idA"); + final var expectedDeviceIdA = "expectedDeviceIdA"; + final var expectedIdA = "expectedIdA"; + final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); + + final var expectedTopologyIdB = new TopologyId("contextIdB", "idB"); + final var expectedDeviceIdB = "expectedDeviceIdB"; + final var expectedIdB = "expectedIdB"; + final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB); + + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + + final var expectedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(expectedConfigRule).build(); + + final var serializedDeviceId = serializer.serializeDeviceId("deviceId"); + final var serializedDrivers = + deviceDrivers.stream() + .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum)) + .collect(Collectors.toList()); + + final var serializedEndPoints = + endPoints.stream() + .map(endPoint -> serializer.serialize(endPoint)) + .collect(Collectors.toList()); + + final var deviceBuilder = ContextOuterClass.Device.newBuilder(); + + deviceBuilder.setDeviceId(serializedDeviceId); + deviceBuilder.setDeviceType("deviceType"); + deviceBuilder.setDeviceConfig(expectedDeviceConfig); + deviceBuilder.setDeviceOperationalStatus(serializer.serialize(DeviceOperationalStatus.ENABLED)); + deviceBuilder.addAllDeviceDrivers(serializedDrivers); + deviceBuilder.addAllDeviceEndpoints(serializedEndPoints); + + final var expectedDevice = deviceBuilder.build(); + + final var device = + new Device( + "deviceId", + "deviceType", + deviceConfig, + DeviceOperationalStatus.ENABLED, + deviceDrivers, + endPoints); + final var serializedDevice = serializer.serialize(device); + + assertThat(serializedDevice).isEqualTo(expectedDevice); + } + + @Test + void shouldDeserializeDevice() { + final var configRuleCustom = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + final var expectedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom); + + final var expectedConfig = + new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.DELETE, configRuleType))); + + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var expectedTopologyIdA = new TopologyId("contextIdA", "idA"); + final var expectedDeviceIdA = "expectedDeviceIdA"; + final var expectedIdA = "expectedIdA"; + final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); + + final var expectedTopologyIdB = new TopologyId("contextIdB", "idB"); + final var expectedDeviceIdB = "expectedDeviceIdB"; + final var expectedIdB = "expectedIdB"; + final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB); + + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + + final var expectedDevice = + new Device( + "deviceId", + "deviceType", + expectedConfig, + DeviceOperationalStatus.ENABLED, + deviceDrivers, + endPoints); + + final var configRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(expectedConfigRuleCustom) + .build(); + final var deviceConfig = + ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(configRule).build(); + + final var serializedDeviceId = serializer.serializeDeviceId("deviceId"); + final var serializedDeviceOperationalStatus = + serializer.serialize(DeviceOperationalStatus.ENABLED); + + final var serializedDrivers = + deviceDrivers.stream() + .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum)) + .collect(Collectors.toList()); + + final var serializedEndPoints = + endPoints.stream() + .map(endPoint -> serializer.serialize(endPoint)) + .collect(Collectors.toList()); + + final var deviceBuilder = ContextOuterClass.Device.newBuilder(); + deviceBuilder.setDeviceId(serializedDeviceId); + deviceBuilder.setDeviceType("deviceType"); + deviceBuilder.setDeviceConfig(deviceConfig); + deviceBuilder.setDeviceOperationalStatus(serializedDeviceOperationalStatus); + deviceBuilder.addAllDeviceDrivers(serializedDrivers); + deviceBuilder.addAllDeviceEndpoints(serializedEndPoints); + + final var serializedDevice = deviceBuilder.build(); + final var device = serializer.deserialize(serializedDevice); + + assertThat(device).usingRecursiveComparison().isEqualTo(expectedDevice); + } + + @Test + void shouldSerializeUuid() { + final var expectedUuid = "uuid"; + + final var serializeUuid = serializer.serializeUuid("uuid"); + + assertThat(serializeUuid.getUuid()).isEqualTo(expectedUuid); + } + + @Test + void shouldDeserializeUuid() { + final var expectedUuid = "uuid"; + + final var uuid = serializer.deserialize(Uuid.newBuilder().setUuid("uuid").build()); + + assertThat(uuid).isEqualTo(expectedUuid); + } +} diff --git a/src/automation/target/generated-sources/grpc/acl/Acl.java b/src/automation/target/generated-sources/grpc/acl/Acl.java new file mode 100644 index 0000000000000000000000000000000000000000..521294eefdec36b373b99aaca5281be28e01d2db --- /dev/null +++ b/src/automation/target/generated-sources/grpc/acl/Acl.java @@ -0,0 +1,4654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acl.proto + +package acl; + +public final class Acl { + private Acl() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code acl.AclRuleTypeEnum} + */ + public enum AclRuleTypeEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLRULETYPE_UNDEFINED = 0; + */ + ACLRULETYPE_UNDEFINED(0), + /** + * ACLRULETYPE_IPV4 = 1; + */ + ACLRULETYPE_IPV4(1), + /** + * ACLRULETYPE_IPV6 = 2; + */ + ACLRULETYPE_IPV6(2), + /** + * ACLRULETYPE_L2 = 3; + */ + ACLRULETYPE_L2(3), + /** + * ACLRULETYPE_MPLS = 4; + */ + ACLRULETYPE_MPLS(4), + /** + * ACLRULETYPE_MIXED = 5; + */ + ACLRULETYPE_MIXED(5), + UNRECOGNIZED(-1), + ; + + /** + * ACLRULETYPE_UNDEFINED = 0; + */ + public static final int ACLRULETYPE_UNDEFINED_VALUE = 0; + /** + * ACLRULETYPE_IPV4 = 1; + */ + public static final int ACLRULETYPE_IPV4_VALUE = 1; + /** + * ACLRULETYPE_IPV6 = 2; + */ + public static final int ACLRULETYPE_IPV6_VALUE = 2; + /** + * ACLRULETYPE_L2 = 3; + */ + public static final int ACLRULETYPE_L2_VALUE = 3; + /** + * ACLRULETYPE_MPLS = 4; + */ + public static final int ACLRULETYPE_MPLS_VALUE = 4; + /** + * ACLRULETYPE_MIXED = 5; + */ + public static final int ACLRULETYPE_MIXED_VALUE = 5; + + + 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 AclRuleTypeEnum 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 AclRuleTypeEnum forNumber(int value) { + switch (value) { + case 0: return ACLRULETYPE_UNDEFINED; + case 1: return ACLRULETYPE_IPV4; + case 2: return ACLRULETYPE_IPV6; + case 3: return ACLRULETYPE_L2; + case 4: return ACLRULETYPE_MPLS; + case 5: return ACLRULETYPE_MIXED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclRuleTypeEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclRuleTypeEnum findValueByNumber(int number) { + return AclRuleTypeEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(0); + } + + private static final AclRuleTypeEnum[] VALUES = values(); + + public static AclRuleTypeEnum 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 AclRuleTypeEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclRuleTypeEnum) + } + + /** + * Protobuf enum {@code acl.AclForwardActionEnum} + */ + public enum AclForwardActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLFORWARDINGACTION_UNDEFINED = 0; + */ + ACLFORWARDINGACTION_UNDEFINED(0), + /** + * ACLFORWARDINGACTION_DROP = 1; + */ + ACLFORWARDINGACTION_DROP(1), + /** + * ACLFORWARDINGACTION_ACCEPT = 2; + */ + ACLFORWARDINGACTION_ACCEPT(2), + /** + * ACLFORWARDINGACTION_REJECT = 3; + */ + ACLFORWARDINGACTION_REJECT(3), + UNRECOGNIZED(-1), + ; + + /** + * ACLFORWARDINGACTION_UNDEFINED = 0; + */ + public static final int ACLFORWARDINGACTION_UNDEFINED_VALUE = 0; + /** + * ACLFORWARDINGACTION_DROP = 1; + */ + public static final int ACLFORWARDINGACTION_DROP_VALUE = 1; + /** + * ACLFORWARDINGACTION_ACCEPT = 2; + */ + public static final int ACLFORWARDINGACTION_ACCEPT_VALUE = 2; + /** + * ACLFORWARDINGACTION_REJECT = 3; + */ + public static final int ACLFORWARDINGACTION_REJECT_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 AclForwardActionEnum 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 AclForwardActionEnum forNumber(int value) { + switch (value) { + case 0: return ACLFORWARDINGACTION_UNDEFINED; + case 1: return ACLFORWARDINGACTION_DROP; + case 2: return ACLFORWARDINGACTION_ACCEPT; + case 3: return ACLFORWARDINGACTION_REJECT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclForwardActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclForwardActionEnum findValueByNumber(int number) { + return AclForwardActionEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(1); + } + + private static final AclForwardActionEnum[] VALUES = values(); + + public static AclForwardActionEnum 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 AclForwardActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclForwardActionEnum) + } + + /** + * Protobuf enum {@code acl.AclLogActionEnum} + */ + public enum AclLogActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLLOGACTION_UNDEFINED = 0; + */ + ACLLOGACTION_UNDEFINED(0), + /** + * ACLLOGACTION_NOLOG = 1; + */ + ACLLOGACTION_NOLOG(1), + /** + * ACLLOGACTION_SYSLOG = 2; + */ + ACLLOGACTION_SYSLOG(2), + UNRECOGNIZED(-1), + ; + + /** + * ACLLOGACTION_UNDEFINED = 0; + */ + public static final int ACLLOGACTION_UNDEFINED_VALUE = 0; + /** + * ACLLOGACTION_NOLOG = 1; + */ + public static final int ACLLOGACTION_NOLOG_VALUE = 1; + /** + * ACLLOGACTION_SYSLOG = 2; + */ + public static final int ACLLOGACTION_SYSLOG_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 AclLogActionEnum 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 AclLogActionEnum forNumber(int value) { + switch (value) { + case 0: return ACLLOGACTION_UNDEFINED; + case 1: return ACLLOGACTION_NOLOG; + case 2: return ACLLOGACTION_SYSLOG; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclLogActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclLogActionEnum findValueByNumber(int number) { + return AclLogActionEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(2); + } + + private static final AclLogActionEnum[] VALUES = values(); + + public static AclLogActionEnum 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 AclLogActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclLogActionEnum) + } + + public interface AclMatchOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclMatch) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 dscp = 1; + * @return The dscp. + */ + int getDscp(); + + /** + * uint32 protocol = 2; + * @return The protocol. + */ + int getProtocol(); + + /** + * string src_address = 3; + * @return The srcAddress. + */ + java.lang.String getSrcAddress(); + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + com.google.protobuf.ByteString + getSrcAddressBytes(); + + /** + * string dst_address = 4; + * @return The dstAddress. + */ + java.lang.String getDstAddress(); + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + com.google.protobuf.ByteString + getDstAddressBytes(); + + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + int getSrcPort(); + + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + int getDstPort(); + + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + int getStartMplsLabel(); + + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + int getEndMplsLabel(); + } + /** + * Protobuf type {@code acl.AclMatch} + */ + public static final class AclMatch extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclMatch) + AclMatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclMatch.newBuilder() to construct. + private AclMatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclMatch() { + srcAddress_ = ""; + dstAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclMatch(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclMatch( + 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: { + + dscp_ = input.readUInt32(); + break; + } + case 16: { + + protocol_ = input.readUInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + srcAddress_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + dstAddress_ = s; + break; + } + case 40: { + + srcPort_ = input.readUInt32(); + break; + } + case 48: { + + dstPort_ = input.readUInt32(); + break; + } + case 56: { + + startMplsLabel_ = input.readUInt32(); + break; + } + case 64: { + + endMplsLabel_ = input.readUInt32(); + 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 acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class); + } + + public static final int DSCP_FIELD_NUMBER = 1; + private int dscp_; + /** + * uint32 dscp = 1; + * @return The dscp. + */ + @java.lang.Override + public int getDscp() { + return dscp_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + private int protocol_; + /** + * uint32 protocol = 2; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + + public static final int SRC_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object srcAddress_; + /** + * string src_address = 3; + * @return The srcAddress. + */ + @java.lang.Override + public java.lang.String getSrcAddress() { + java.lang.Object ref = srcAddress_; + 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(); + srcAddress_ = s; + return s; + } + } + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAddressBytes() { + java.lang.Object ref = srcAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DST_ADDRESS_FIELD_NUMBER = 4; + private volatile java.lang.Object dstAddress_; + /** + * string dst_address = 4; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + java.lang.Object ref = dstAddress_; + 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(); + dstAddress_ = s; + return s; + } + } + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + java.lang.Object ref = dstAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SRC_PORT_FIELD_NUMBER = 5; + private int srcPort_; + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + @java.lang.Override + public int getSrcPort() { + return srcPort_; + } + + public static final int DST_PORT_FIELD_NUMBER = 6; + private int dstPort_; + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + @java.lang.Override + public int getDstPort() { + return dstPort_; + } + + public static final int START_MPLS_LABEL_FIELD_NUMBER = 7; + private int startMplsLabel_; + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + @java.lang.Override + public int getStartMplsLabel() { + return startMplsLabel_; + } + + public static final int END_MPLS_LABEL_FIELD_NUMBER = 8; + private int endMplsLabel_; + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + @java.lang.Override + public int getEndMplsLabel() { + return endMplsLabel_; + } + + 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 (dscp_ != 0) { + output.writeUInt32(1, dscp_); + } + if (protocol_ != 0) { + output.writeUInt32(2, protocol_); + } + if (!getSrcAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, srcAddress_); + } + if (!getDstAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dstAddress_); + } + if (srcPort_ != 0) { + output.writeUInt32(5, srcPort_); + } + if (dstPort_ != 0) { + output.writeUInt32(6, dstPort_); + } + if (startMplsLabel_ != 0) { + output.writeUInt32(7, startMplsLabel_); + } + if (endMplsLabel_ != 0) { + output.writeUInt32(8, endMplsLabel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dscp_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, dscp_); + } + if (protocol_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, protocol_); + } + if (!getSrcAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, srcAddress_); + } + if (!getDstAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dstAddress_); + } + if (srcPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, srcPort_); + } + if (dstPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, dstPort_); + } + if (startMplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, startMplsLabel_); + } + if (endMplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, endMplsLabel_); + } + 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 acl.Acl.AclMatch)) { + return super.equals(obj); + } + acl.Acl.AclMatch other = (acl.Acl.AclMatch) obj; + + if (getDscp() + != other.getDscp()) return false; + if (getProtocol() + != other.getProtocol()) return false; + if (!getSrcAddress() + .equals(other.getSrcAddress())) return false; + if (!getDstAddress() + .equals(other.getDstAddress())) return false; + if (getSrcPort() + != other.getSrcPort()) return false; + if (getDstPort() + != other.getDstPort()) return false; + if (getStartMplsLabel() + != other.getStartMplsLabel()) return false; + if (getEndMplsLabel() + != other.getEndMplsLabel()) 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) + DSCP_FIELD_NUMBER; + hash = (53 * hash) + getDscp(); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol(); + hash = (37 * hash) + SRC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcAddress().hashCode(); + hash = (37 * hash) + DST_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstAddress().hashCode(); + hash = (37 * hash) + SRC_PORT_FIELD_NUMBER; + hash = (53 * hash) + getSrcPort(); + hash = (37 * hash) + DST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getDstPort(); + hash = (37 * hash) + START_MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getStartMplsLabel(); + hash = (37 * hash) + END_MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getEndMplsLabel(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclMatch parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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 acl.Acl.AclMatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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 acl.Acl.AclMatch parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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(acl.Acl.AclMatch 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 acl.AclMatch} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclMatch) + acl.Acl.AclMatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class); + } + + // Construct using acl.Acl.AclMatch.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(); + dscp_ = 0; + + protocol_ = 0; + + srcAddress_ = ""; + + dstAddress_ = ""; + + srcPort_ = 0; + + dstPort_ = 0; + + startMplsLabel_ = 0; + + endMplsLabel_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + public acl.Acl.AclMatch getDefaultInstanceForType() { + return acl.Acl.AclMatch.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclMatch build() { + acl.Acl.AclMatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclMatch buildPartial() { + acl.Acl.AclMatch result = new acl.Acl.AclMatch(this); + result.dscp_ = dscp_; + result.protocol_ = protocol_; + result.srcAddress_ = srcAddress_; + result.dstAddress_ = dstAddress_; + result.srcPort_ = srcPort_; + result.dstPort_ = dstPort_; + result.startMplsLabel_ = startMplsLabel_; + result.endMplsLabel_ = endMplsLabel_; + 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 acl.Acl.AclMatch) { + return mergeFrom((acl.Acl.AclMatch)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclMatch other) { + if (other == acl.Acl.AclMatch.getDefaultInstance()) return this; + if (other.getDscp() != 0) { + setDscp(other.getDscp()); + } + if (other.getProtocol() != 0) { + setProtocol(other.getProtocol()); + } + if (!other.getSrcAddress().isEmpty()) { + srcAddress_ = other.srcAddress_; + onChanged(); + } + if (!other.getDstAddress().isEmpty()) { + dstAddress_ = other.dstAddress_; + onChanged(); + } + if (other.getSrcPort() != 0) { + setSrcPort(other.getSrcPort()); + } + if (other.getDstPort() != 0) { + setDstPort(other.getDstPort()); + } + if (other.getStartMplsLabel() != 0) { + setStartMplsLabel(other.getStartMplsLabel()); + } + if (other.getEndMplsLabel() != 0) { + setEndMplsLabel(other.getEndMplsLabel()); + } + 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 { + acl.Acl.AclMatch parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclMatch) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dscp_ ; + /** + * uint32 dscp = 1; + * @return The dscp. + */ + @java.lang.Override + public int getDscp() { + return dscp_; + } + /** + * uint32 dscp = 1; + * @param value The dscp to set. + * @return This builder for chaining. + */ + public Builder setDscp(int value) { + + dscp_ = value; + onChanged(); + return this; + } + /** + * uint32 dscp = 1; + * @return This builder for chaining. + */ + public Builder clearDscp() { + + dscp_ = 0; + onChanged(); + return this; + } + + private int protocol_ ; + /** + * uint32 protocol = 2; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + /** + * uint32 protocol = 2; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol(int value) { + + protocol_ = value; + onChanged(); + return this; + } + /** + * uint32 protocol = 2; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + + protocol_ = 0; + onChanged(); + return this; + } + + private java.lang.Object srcAddress_ = ""; + /** + * string src_address = 3; + * @return The srcAddress. + */ + public java.lang.String getSrcAddress() { + java.lang.Object ref = srcAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + public com.google.protobuf.ByteString + getSrcAddressBytes() { + java.lang.Object ref = srcAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string src_address = 3; + * @param value The srcAddress to set. + * @return This builder for chaining. + */ + public Builder setSrcAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcAddress_ = value; + onChanged(); + return this; + } + /** + * string src_address = 3; + * @return This builder for chaining. + */ + public Builder clearSrcAddress() { + + srcAddress_ = getDefaultInstance().getSrcAddress(); + onChanged(); + return this; + } + /** + * string src_address = 3; + * @param value The bytes for srcAddress to set. + * @return This builder for chaining. + */ + public Builder setSrcAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object dstAddress_ = ""; + /** + * string dst_address = 4; + * @return The dstAddress. + */ + public java.lang.String getDstAddress() { + java.lang.Object ref = dstAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + public com.google.protobuf.ByteString + getDstAddressBytes() { + java.lang.Object ref = dstAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string dst_address = 4; + * @param value The dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstAddress_ = value; + onChanged(); + return this; + } + /** + * string dst_address = 4; + * @return This builder for chaining. + */ + public Builder clearDstAddress() { + + dstAddress_ = getDefaultInstance().getDstAddress(); + onChanged(); + return this; + } + /** + * string dst_address = 4; + * @param value The bytes for dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstAddress_ = value; + onChanged(); + return this; + } + + private int srcPort_ ; + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + @java.lang.Override + public int getSrcPort() { + return srcPort_; + } + /** + * uint32 src_port = 5; + * @param value The srcPort to set. + * @return This builder for chaining. + */ + public Builder setSrcPort(int value) { + + srcPort_ = value; + onChanged(); + return this; + } + /** + * uint32 src_port = 5; + * @return This builder for chaining. + */ + public Builder clearSrcPort() { + + srcPort_ = 0; + onChanged(); + return this; + } + + private int dstPort_ ; + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + @java.lang.Override + public int getDstPort() { + return dstPort_; + } + /** + * uint32 dst_port = 6; + * @param value The dstPort to set. + * @return This builder for chaining. + */ + public Builder setDstPort(int value) { + + dstPort_ = value; + onChanged(); + return this; + } + /** + * uint32 dst_port = 6; + * @return This builder for chaining. + */ + public Builder clearDstPort() { + + dstPort_ = 0; + onChanged(); + return this; + } + + private int startMplsLabel_ ; + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + @java.lang.Override + public int getStartMplsLabel() { + return startMplsLabel_; + } + /** + * uint32 start_mpls_label = 7; + * @param value The startMplsLabel to set. + * @return This builder for chaining. + */ + public Builder setStartMplsLabel(int value) { + + startMplsLabel_ = value; + onChanged(); + return this; + } + /** + * uint32 start_mpls_label = 7; + * @return This builder for chaining. + */ + public Builder clearStartMplsLabel() { + + startMplsLabel_ = 0; + onChanged(); + return this; + } + + private int endMplsLabel_ ; + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + @java.lang.Override + public int getEndMplsLabel() { + return endMplsLabel_; + } + /** + * uint32 end_mpls_label = 8; + * @param value The endMplsLabel to set. + * @return This builder for chaining. + */ + public Builder setEndMplsLabel(int value) { + + endMplsLabel_ = value; + onChanged(); + return this; + } + /** + * uint32 end_mpls_label = 8; + * @return This builder for chaining. + */ + public Builder clearEndMplsLabel() { + + endMplsLabel_ = 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:acl.AclMatch) + } + + // @@protoc_insertion_point(class_scope:acl.AclMatch) + private static final acl.Acl.AclMatch DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclMatch(); + } + + public static acl.Acl.AclMatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclMatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclMatch(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 acl.Acl.AclMatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclAction) + com.google.protobuf.MessageOrBuilder { + + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + int getForwardActionValue(); + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + acl.Acl.AclForwardActionEnum getForwardAction(); + + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + int getLogActionValue(); + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + acl.Acl.AclLogActionEnum getLogAction(); + } + /** + * Protobuf type {@code acl.AclAction} + */ + public static final class AclAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclAction) + AclActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclAction.newBuilder() to construct. + private AclAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclAction() { + forwardAction_ = 0; + logAction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclAction( + 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(); + + forwardAction_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + logAction_ = 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 acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class); + } + + public static final int FORWARD_ACTION_FIELD_NUMBER = 1; + private int forwardAction_; + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + @java.lang.Override public int getForwardActionValue() { + return forwardAction_; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + @java.lang.Override public acl.Acl.AclForwardActionEnum getForwardAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_); + return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result; + } + + public static final int LOG_ACTION_FIELD_NUMBER = 2; + private int logAction_; + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + @java.lang.Override public int getLogActionValue() { + return logAction_; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + @java.lang.Override public acl.Acl.AclLogActionEnum getLogAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_); + return result == null ? acl.Acl.AclLogActionEnum.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 (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) { + output.writeEnum(1, forwardAction_); + } + if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) { + output.writeEnum(2, logAction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, forwardAction_); + } + if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, logAction_); + } + 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 acl.Acl.AclAction)) { + return super.equals(obj); + } + acl.Acl.AclAction other = (acl.Acl.AclAction) obj; + + if (forwardAction_ != other.forwardAction_) return false; + if (logAction_ != other.logAction_) 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) + FORWARD_ACTION_FIELD_NUMBER; + hash = (53 * hash) + forwardAction_; + hash = (37 * hash) + LOG_ACTION_FIELD_NUMBER; + hash = (53 * hash) + logAction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclAction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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 acl.Acl.AclAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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 acl.Acl.AclAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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(acl.Acl.AclAction 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 acl.AclAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclAction) + acl.Acl.AclActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class); + } + + // Construct using acl.Acl.AclAction.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(); + forwardAction_ = 0; + + logAction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + public acl.Acl.AclAction getDefaultInstanceForType() { + return acl.Acl.AclAction.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclAction build() { + acl.Acl.AclAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclAction buildPartial() { + acl.Acl.AclAction result = new acl.Acl.AclAction(this); + result.forwardAction_ = forwardAction_; + result.logAction_ = logAction_; + 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 acl.Acl.AclAction) { + return mergeFrom((acl.Acl.AclAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclAction other) { + if (other == acl.Acl.AclAction.getDefaultInstance()) return this; + if (other.forwardAction_ != 0) { + setForwardActionValue(other.getForwardActionValue()); + } + if (other.logAction_ != 0) { + setLogActionValue(other.getLogActionValue()); + } + 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 { + acl.Acl.AclAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int forwardAction_ = 0; + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + @java.lang.Override public int getForwardActionValue() { + return forwardAction_; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @param value The enum numeric value on the wire for forwardAction to set. + * @return This builder for chaining. + */ + public Builder setForwardActionValue(int value) { + + forwardAction_ = value; + onChanged(); + return this; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + @java.lang.Override + public acl.Acl.AclForwardActionEnum getForwardAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_); + return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @param value The forwardAction to set. + * @return This builder for chaining. + */ + public Builder setForwardAction(acl.Acl.AclForwardActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + forwardAction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return This builder for chaining. + */ + public Builder clearForwardAction() { + + forwardAction_ = 0; + onChanged(); + return this; + } + + private int logAction_ = 0; + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + @java.lang.Override public int getLogActionValue() { + return logAction_; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @param value The enum numeric value on the wire for logAction to set. + * @return This builder for chaining. + */ + public Builder setLogActionValue(int value) { + + logAction_ = value; + onChanged(); + return this; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + @java.lang.Override + public acl.Acl.AclLogActionEnum getLogAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_); + return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @param value The logAction to set. + * @return This builder for chaining. + */ + public Builder setLogAction(acl.Acl.AclLogActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + logAction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return This builder for chaining. + */ + public Builder clearLogAction() { + + logAction_ = 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:acl.AclAction) + } + + // @@protoc_insertion_point(class_scope:acl.AclAction) + private static final acl.Acl.AclAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclAction(); + } + + public static acl.Acl.AclAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclAction(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 acl.Acl.AclAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + int getSequenceId(); + + /** + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + boolean hasMatch(); + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + acl.Acl.AclMatch getMatch(); + /** + * .acl.AclMatch match = 3; + */ + acl.Acl.AclMatchOrBuilder getMatchOrBuilder(); + + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + boolean hasAction(); + /** + * .acl.AclAction action = 4; + * @return The action. + */ + acl.Acl.AclAction getAction(); + /** + * .acl.AclAction action = 4; + */ + acl.Acl.AclActionOrBuilder getActionOrBuilder(); + } + /** + * Protobuf type {@code acl.AclEntry} + */ + public static final class AclEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclEntry) + AclEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclEntry.newBuilder() to construct. + private AclEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclEntry() { + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclEntry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclEntry( + 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: { + + sequenceId_ = input.readUInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + acl.Acl.AclMatch.Builder subBuilder = null; + if (match_ != null) { + subBuilder = match_.toBuilder(); + } + match_ = input.readMessage(acl.Acl.AclMatch.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(match_); + match_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + acl.Acl.AclAction.Builder subBuilder = null; + if (action_ != null) { + subBuilder = action_.toBuilder(); + } + action_ = input.readMessage(acl.Acl.AclAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(action_); + action_ = 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 acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class); + } + + public static final int SEQUENCE_ID_FIELD_NUMBER = 1; + private int sequenceId_; + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + @java.lang.Override + public int getSequenceId() { + return sequenceId_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATCH_FIELD_NUMBER = 3; + private acl.Acl.AclMatch match_; + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + @java.lang.Override + public boolean hasMatch() { + return match_ != null; + } + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + @java.lang.Override + public acl.Acl.AclMatch getMatch() { + return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_; + } + /** + * .acl.AclMatch match = 3; + */ + @java.lang.Override + public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() { + return getMatch(); + } + + public static final int ACTION_FIELD_NUMBER = 4; + private acl.Acl.AclAction action_; + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + @java.lang.Override + public boolean hasAction() { + return action_ != null; + } + /** + * .acl.AclAction action = 4; + * @return The action. + */ + @java.lang.Override + public acl.Acl.AclAction getAction() { + return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_; + } + /** + * .acl.AclAction action = 4; + */ + @java.lang.Override + public acl.Acl.AclActionOrBuilder getActionOrBuilder() { + return getAction(); + } + + 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 (sequenceId_ != 0) { + output.writeUInt32(1, sequenceId_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (match_ != null) { + output.writeMessage(3, getMatch()); + } + if (action_ != null) { + output.writeMessage(4, getAction()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sequenceId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, sequenceId_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (match_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMatch()); + } + if (action_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAction()); + } + 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 acl.Acl.AclEntry)) { + return super.equals(obj); + } + acl.Acl.AclEntry other = (acl.Acl.AclEntry) obj; + + if (getSequenceId() + != other.getSequenceId()) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (hasMatch() != other.hasMatch()) return false; + if (hasMatch()) { + if (!getMatch() + .equals(other.getMatch())) return false; + } + if (hasAction() != other.hasAction()) return false; + if (hasAction()) { + if (!getAction() + .equals(other.getAction())) 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) + SEQUENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSequenceId(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasMatch()) { + hash = (37 * hash) + MATCH_FIELD_NUMBER; + hash = (53 * hash) + getMatch().hashCode(); + } + if (hasAction()) { + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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 acl.Acl.AclEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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 acl.Acl.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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(acl.Acl.AclEntry 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 acl.AclEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclEntry) + acl.Acl.AclEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class); + } + + // Construct using acl.Acl.AclEntry.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(); + sequenceId_ = 0; + + description_ = ""; + + if (matchBuilder_ == null) { + match_ = null; + } else { + match_ = null; + matchBuilder_ = null; + } + if (actionBuilder_ == null) { + action_ = null; + } else { + action_ = null; + actionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + public acl.Acl.AclEntry getDefaultInstanceForType() { + return acl.Acl.AclEntry.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclEntry build() { + acl.Acl.AclEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclEntry buildPartial() { + acl.Acl.AclEntry result = new acl.Acl.AclEntry(this); + result.sequenceId_ = sequenceId_; + result.description_ = description_; + if (matchBuilder_ == null) { + result.match_ = match_; + } else { + result.match_ = matchBuilder_.build(); + } + if (actionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = actionBuilder_.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 acl.Acl.AclEntry) { + return mergeFrom((acl.Acl.AclEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclEntry other) { + if (other == acl.Acl.AclEntry.getDefaultInstance()) return this; + if (other.getSequenceId() != 0) { + setSequenceId(other.getSequenceId()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasMatch()) { + mergeMatch(other.getMatch()); + } + if (other.hasAction()) { + mergeAction(other.getAction()); + } + 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 { + acl.Acl.AclEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sequenceId_ ; + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + @java.lang.Override + public int getSequenceId() { + return sequenceId_; + } + /** + * uint32 sequence_id = 1; + * @param value The sequenceId to set. + * @return This builder for chaining. + */ + public Builder setSequenceId(int value) { + + sequenceId_ = value; + onChanged(); + return this; + } + /** + * uint32 sequence_id = 1; + * @return This builder for chaining. + */ + public Builder clearSequenceId() { + + sequenceId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private acl.Acl.AclMatch match_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> matchBuilder_; + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + public boolean hasMatch() { + return matchBuilder_ != null || match_ != null; + } + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + public acl.Acl.AclMatch getMatch() { + if (matchBuilder_ == null) { + return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_; + } else { + return matchBuilder_.getMessage(); + } + } + /** + * .acl.AclMatch match = 3; + */ + public Builder setMatch(acl.Acl.AclMatch value) { + if (matchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + match_ = value; + onChanged(); + } else { + matchBuilder_.setMessage(value); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder setMatch( + acl.Acl.AclMatch.Builder builderForValue) { + if (matchBuilder_ == null) { + match_ = builderForValue.build(); + onChanged(); + } else { + matchBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder mergeMatch(acl.Acl.AclMatch value) { + if (matchBuilder_ == null) { + if (match_ != null) { + match_ = + acl.Acl.AclMatch.newBuilder(match_).mergeFrom(value).buildPartial(); + } else { + match_ = value; + } + onChanged(); + } else { + matchBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder clearMatch() { + if (matchBuilder_ == null) { + match_ = null; + onChanged(); + } else { + match_ = null; + matchBuilder_ = null; + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public acl.Acl.AclMatch.Builder getMatchBuilder() { + + onChanged(); + return getMatchFieldBuilder().getBuilder(); + } + /** + * .acl.AclMatch match = 3; + */ + public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() { + if (matchBuilder_ != null) { + return matchBuilder_.getMessageOrBuilder(); + } else { + return match_ == null ? + acl.Acl.AclMatch.getDefaultInstance() : match_; + } + } + /** + * .acl.AclMatch match = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> + getMatchFieldBuilder() { + if (matchBuilder_ == null) { + matchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>( + getMatch(), + getParentForChildren(), + isClean()); + match_ = null; + } + return matchBuilder_; + } + + private acl.Acl.AclAction action_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> actionBuilder_; + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + public boolean hasAction() { + return actionBuilder_ != null || action_ != null; + } + /** + * .acl.AclAction action = 4; + * @return The action. + */ + public acl.Acl.AclAction getAction() { + if (actionBuilder_ == null) { + return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_; + } else { + return actionBuilder_.getMessage(); + } + } + /** + * .acl.AclAction action = 4; + */ + public Builder setAction(acl.Acl.AclAction value) { + if (actionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + actionBuilder_.setMessage(value); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder setAction( + acl.Acl.AclAction.Builder builderForValue) { + if (actionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + actionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder mergeAction(acl.Acl.AclAction value) { + if (actionBuilder_ == null) { + if (action_ != null) { + action_ = + acl.Acl.AclAction.newBuilder(action_).mergeFrom(value).buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + actionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder clearAction() { + if (actionBuilder_ == null) { + action_ = null; + onChanged(); + } else { + action_ = null; + actionBuilder_ = null; + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public acl.Acl.AclAction.Builder getActionBuilder() { + + onChanged(); + return getActionFieldBuilder().getBuilder(); + } + /** + * .acl.AclAction action = 4; + */ + public acl.Acl.AclActionOrBuilder getActionOrBuilder() { + if (actionBuilder_ != null) { + return actionBuilder_.getMessageOrBuilder(); + } else { + return action_ == null ? + acl.Acl.AclAction.getDefaultInstance() : action_; + } + } + /** + * .acl.AclAction action = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> + getActionFieldBuilder() { + if (actionBuilder_ == null) { + actionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>( + getAction(), + getParentForChildren(), + isClean()); + action_ = null; + } + return actionBuilder_; + } + @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:acl.AclEntry) + } + + // @@protoc_insertion_point(class_scope:acl.AclEntry) + private static final acl.Acl.AclEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclEntry(); + } + + public static acl.Acl.AclEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclEntry(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 acl.Acl.AclEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclRuleSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclRuleSet) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + acl.Acl.AclRuleTypeEnum getType(); + + /** + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + * string user_id = 4; + * @return The userId. + */ + java.lang.String getUserId(); + /** + * string user_id = 4; + * @return The bytes for userId. + */ + com.google.protobuf.ByteString + getUserIdBytes(); + + /** + * repeated .acl.AclEntry entries = 5; + */ + java.util.List + getEntriesList(); + /** + * repeated .acl.AclEntry entries = 5; + */ + acl.Acl.AclEntry getEntries(int index); + /** + * repeated .acl.AclEntry entries = 5; + */ + int getEntriesCount(); + /** + * repeated .acl.AclEntry entries = 5; + */ + java.util.List + getEntriesOrBuilderList(); + /** + * repeated .acl.AclEntry entries = 5; + */ + acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index); + } + /** + * Protobuf type {@code acl.AclRuleSet} + */ + public static final class AclRuleSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclRuleSet) + AclRuleSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclRuleSet.newBuilder() to construct. + private AclRuleSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclRuleSet() { + name_ = ""; + type_ = 0; + description_ = ""; + userId_ = ""; + entries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclRuleSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclRuleSet( + 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 16: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + userId_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + entries_.add( + input.readMessage(acl.Acl.AclEntry.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)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * 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; + } + } + /** + * 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 TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + @java.lang.Override public acl.Acl.AclRuleTypeEnum getType() { + @SuppressWarnings("deprecation") + acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_); + return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object userId_; + /** + * string user_id = 4; + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + 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(); + userId_ = s; + return s; + } + } + /** + * string user_id = 4; + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 5; + private java.util.List entries_; + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public acl.Acl.AclEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) { + output.writeEnum(2, type_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!getUserIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userId_); + } + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(5, entries_.get(i)); + } + 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 (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, type_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!getUserIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userId_); + } + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, entries_.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 acl.Acl.AclRuleSet)) { + return super.equals(obj); + } + acl.Acl.AclRuleSet other = (acl.Acl.AclRuleSet) obj; + + if (!getName() + .equals(other.getName())) return false; + if (type_ != other.type_) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUserId() + .equals(other.getUserId())) return false; + if (!getEntriesList() + .equals(other.getEntriesList())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclRuleSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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 acl.Acl.AclRuleSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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 acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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(acl.Acl.AclRuleSet 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 acl.AclRuleSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclRuleSet) + acl.Acl.AclRuleSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class); + } + + // Construct using acl.Acl.AclRuleSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = 0; + + description_ = ""; + + userId_ = ""; + + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entriesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + public acl.Acl.AclRuleSet getDefaultInstanceForType() { + return acl.Acl.AclRuleSet.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclRuleSet build() { + acl.Acl.AclRuleSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclRuleSet buildPartial() { + acl.Acl.AclRuleSet result = new acl.Acl.AclRuleSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.type_ = type_; + result.description_ = description_; + result.userId_ = userId_; + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.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 acl.Acl.AclRuleSet) { + return mergeFrom((acl.Acl.AclRuleSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclRuleSet other) { + if (other == acl.Acl.AclRuleSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + onChanged(); + } + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEntriesFieldBuilder() : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + 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 { + acl.Acl.AclRuleSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclRuleSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * 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 int type_ = 0; + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + @java.lang.Override + public acl.Acl.AclRuleTypeEnum getType() { + @SuppressWarnings("deprecation") + acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_); + return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(acl.Acl.AclRuleTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * string user_id = 4; + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string user_id = 4; + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString + getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string user_id = 4; + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userId_ = value; + onChanged(); + return this; + } + /** + * string user_id = 4; + * @return This builder for chaining. + */ + public Builder clearUserId() { + + userId_ = getDefaultInstance().getUserId(); + onChanged(); + return this; + } + /** + * string user_id = 4; + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userId_ = value; + onChanged(); + return this; + } + + private java.util.List entries_ = + java.util.Collections.emptyList(); + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> entriesBuilder_; + + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder setEntries( + int index, acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder setEntries( + int index, acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries(acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + int index, acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + int index, acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder().addBuilder( + acl.Acl.AclEntry.getDefaultInstance()); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder().addBuilder( + index, acl.Acl.AclEntry.getDefaultInstance()); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>( + entries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + @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:acl.AclRuleSet) + } + + // @@protoc_insertion_point(class_scope:acl.AclRuleSet) + private static final acl.Acl.AclRuleSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclRuleSet(); + } + + public static acl.Acl.AclRuleSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclRuleSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclRuleSet(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 acl.Acl.AclRuleSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclMatch_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclMatch_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclAction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclRuleSet_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclRuleSet_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\tacl.proto\022\003acl\"\252\001\n\010AclMatch\022\014\n\004dscp\030\001 " + + "\001(\r\022\020\n\010protocol\030\002 \001(\r\022\023\n\013src_address\030\003 \001" + + "(\t\022\023\n\013dst_address\030\004 \001(\t\022\020\n\010src_port\030\005 \001(" + + "\r\022\020\n\010dst_port\030\006 \001(\r\022\030\n\020start_mpls_label\030" + + "\007 \001(\r\022\026\n\016end_mpls_label\030\010 \001(\r\"i\n\tAclActi" + + "on\0221\n\016forward_action\030\001 \001(\0162\031.acl.AclForw" + + "ardActionEnum\022)\n\nlog_action\030\002 \001(\0162\025.acl." + + "AclLogActionEnum\"r\n\010AclEntry\022\023\n\013sequence" + + "_id\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\034\n\005match\030" + + "\003 \001(\0132\r.acl.AclMatch\022\036\n\006action\030\004 \001(\0132\016.a" + + "cl.AclAction\"\204\001\n\nAclRuleSet\022\014\n\004name\030\001 \001(" + + "\t\022\"\n\004type\030\002 \001(\0162\024.acl.AclRuleTypeEnum\022\023\n" + + "\013description\030\003 \001(\t\022\017\n\007user_id\030\004 \001(\t\022\036\n\007e" + + "ntries\030\005 \003(\0132\r.acl.AclEntry*\231\001\n\017AclRuleT" + + "ypeEnum\022\031\n\025ACLRULETYPE_UNDEFINED\020\000\022\024\n\020AC" + + "LRULETYPE_IPV4\020\001\022\024\n\020ACLRULETYPE_IPV6\020\002\022\022" + + "\n\016ACLRULETYPE_L2\020\003\022\024\n\020ACLRULETYPE_MPLS\020\004" + + "\022\025\n\021ACLRULETYPE_MIXED\020\005*\227\001\n\024AclForwardAc" + + "tionEnum\022!\n\035ACLFORWARDINGACTION_UNDEFINE" + + "D\020\000\022\034\n\030ACLFORWARDINGACTION_DROP\020\001\022\036\n\032ACL" + + "FORWARDINGACTION_ACCEPT\020\002\022\036\n\032ACLFORWARDI" + + "NGACTION_REJECT\020\003*_\n\020AclLogActionEnum\022\032\n" + + "\026ACLLOGACTION_UNDEFINED\020\000\022\026\n\022ACLLOGACTIO" + + "N_NOLOG\020\001\022\027\n\023ACLLOGACTION_SYSLOG\020\002b\006prot" + + "o3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_acl_AclMatch_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_acl_AclMatch_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclMatch_descriptor, + new java.lang.String[] { "Dscp", "Protocol", "SrcAddress", "DstAddress", "SrcPort", "DstPort", "StartMplsLabel", "EndMplsLabel", }); + internal_static_acl_AclAction_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_acl_AclAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclAction_descriptor, + new java.lang.String[] { "ForwardAction", "LogAction", }); + internal_static_acl_AclEntry_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_acl_AclEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclEntry_descriptor, + new java.lang.String[] { "SequenceId", "Description", "Match", "Action", }); + internal_static_acl_AclRuleSet_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_acl_AclRuleSet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclRuleSet_descriptor, + new java.lang.String[] { "Name", "Type", "Description", "UserId", "Entries", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/automation/target/generated-sources/grpc/automation/Automation.java b/src/automation/target/generated-sources/grpc/automation/Automation.java index a44bc42294078fdba325d9dc9f149eaf1bd2bcbc..f3918e0fc18e6d97b8fd669fb307dcb94964b0e0 100644 --- a/src/automation/target/generated-sources/grpc/automation/Automation.java +++ b/src/automation/target/generated-sources/grpc/automation/Automation.java @@ -3977,424 +3977,6 @@ public final class Automation { } - public interface EmptyOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.Empty) - com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code automation.Empty} - */ - public static final class Empty extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.Empty) - EmptyOrBuilder { - private static final long serialVersionUID = 0L; - // Use Empty.newBuilder() to construct. - private Empty(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Empty() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Empty(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Empty( - 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; - 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 automation.Automation.internal_static_automation_Empty_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - automation.Automation.Empty.class, automation.Automation.Empty.Builder.class); - } - - 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 { - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - 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 automation.Automation.Empty)) { - return super.equals(obj); - } - automation.Automation.Empty other = (automation.Automation.Empty) obj; - - 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 = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static automation.Automation.Empty parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static automation.Automation.Empty parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static automation.Automation.Empty parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static automation.Automation.Empty parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static automation.Automation.Empty parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static automation.Automation.Empty parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static automation.Automation.Empty parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static automation.Automation.Empty 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 automation.Automation.Empty parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static automation.Automation.Empty 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 automation.Automation.Empty parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static automation.Automation.Empty 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(automation.Automation.Empty 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 automation.Empty} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:automation.Empty) - automation.Automation.EmptyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return automation.Automation.internal_static_automation_Empty_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_Empty_fieldAccessorTable - .ensureFieldAccessorsInitialized( - automation.Automation.Empty.class, automation.Automation.Empty.Builder.class); - } - - // Construct using automation.Automation.Empty.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(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return automation.Automation.internal_static_automation_Empty_descriptor; - } - - @java.lang.Override - public automation.Automation.Empty getDefaultInstanceForType() { - return automation.Automation.Empty.getDefaultInstance(); - } - - @java.lang.Override - public automation.Automation.Empty build() { - automation.Automation.Empty result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public automation.Automation.Empty buildPartial() { - automation.Automation.Empty result = new automation.Automation.Empty(this); - 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 automation.Automation.Empty) { - return mergeFrom((automation.Automation.Empty)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(automation.Automation.Empty other) { - if (other == automation.Automation.Empty.getDefaultInstance()) return this; - 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 { - automation.Automation.Empty parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.Empty) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - 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:automation.Empty) - } - - // @@protoc_insertion_point(class_scope:automation.Empty) - private static final automation.Automation.Empty DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new automation.Automation.Empty(); - } - - public static automation.Automation.Empty getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Empty parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Empty(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 automation.Automation.Empty getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_automation_DeviceRoleId_descriptor; private static final @@ -4420,11 +4002,6 @@ public final class Automation { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_automation_DeviceDeletionResult_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_Empty_descriptor; - private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_Empty_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -4445,23 +4022,23 @@ public final class Automation { "evRoleId\030\001 \001(\0132\030.automation.DeviceRoleId" + "\0220\n\014devRoleState\030\002 \001(\0162\032.automation.ZtpD" + "eviceState\"\'\n\024DeviceDeletionResult\022\017\n\007de" + - "leted\030\001 \003(\t\"\007\n\005Empty*H\n\016DeviceRoleType\022\010" + - "\n\004NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010DEV_CONF\020\002\022\021\n\rP" + - "IPELINE_CONF\020\003*~\n\016ZtpDeviceState\022\033\n\027ZTP_" + - "DEV_STATE_UNDEFINED\020\000\022\031\n\025ZTP_DEV_STATE_C" + - "REATED\020\001\022\031\n\025ZTP_DEV_STATE_UPDATED\020\002\022\031\n\025Z" + - "TP_DEV_STATE_DELETED\020\0032\273\003\n\021AutomationSer" + - "vice\022F\n\020ZtpGetDeviceRole\022\030.automation.De" + - "viceRoleId\032\026.automation.DeviceRole\"\000\022N\n\033" + - "ZtpGetDeviceRolesByDeviceId\022\021.context.De" + - "viceId\032\032.automation.DeviceRoleList\"\000\022?\n\006" + - "ZtpAdd\022\026.automation.DeviceRole\032\033.automat" + - "ion.DeviceRoleState\"\000\022B\n\tZtpUpdate\022\026.aut" + - "omation.DeviceRole\032\033.automation.DeviceRo" + - "leState\"\000\022B\n\tZtpDelete\022\026.automation.Devi" + - "ceRole\032\033.automation.DeviceRoleState\"\000\022E\n" + - "\014ZtpDeleteAll\022\021.automation.Empty\032 .autom" + - "ation.DeviceDeletionResult\"\000b\006proto3" + "leted\030\001 \003(\t*H\n\016DeviceRoleType\022\010\n\004NONE\020\000\022" + + "\013\n\007DEV_OPS\020\001\022\014\n\010DEV_CONF\020\002\022\021\n\rPIPELINE_C" + + "ONF\020\003*~\n\016ZtpDeviceState\022\033\n\027ZTP_DEV_STATE" + + "_UNDEFINED\020\000\022\031\n\025ZTP_DEV_STATE_CREATED\020\001\022" + + "\031\n\025ZTP_DEV_STATE_UPDATED\020\002\022\031\n\025ZTP_DEV_ST" + + "ATE_DELETED\020\0032\270\003\n\021AutomationService\022F\n\020Z" + + "tpGetDeviceRole\022\030.automation.DeviceRoleI" + + "d\032\026.automation.DeviceRole\"\000\022N\n\033ZtpGetDev" + + "iceRolesByDeviceId\022\021.context.DeviceId\032\032." + + "automation.DeviceRoleList\"\000\022?\n\006ZtpAdd\022\026." + + "automation.DeviceRole\032\033.automation.Devic" + + "eRoleState\"\000\022B\n\tZtpUpdate\022\026.automation.D" + + "eviceRole\032\033.automation.DeviceRoleState\"\000" + + "\022B\n\tZtpDelete\022\026.automation.DeviceRole\032\033." + + "automation.DeviceRoleState\"\000\022B\n\014ZtpDelet" + + "eAll\022\016.context.Empty\032 .automation.Device" + + "DeletionResult\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -4498,12 +4075,6 @@ public final class Automation { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_automation_DeviceDeletionResult_descriptor, new java.lang.String[] { "Deleted", }); - internal_static_automation_Empty_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_automation_Empty_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_Empty_descriptor, - new java.lang.String[] { }); context.ContextOuterClass.getDescriptor(); } diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationService.java b/src/automation/target/generated-sources/grpc/automation/AutomationService.java index 9b772a499617f341ba742ccfe8ae8ade34366831..4df9e1098d2028bba58da0959512310ed3d2c4ba 100644 --- a/src/automation/target/generated-sources/grpc/automation/AutomationService.java +++ b/src/automation/target/generated-sources/grpc/automation/AutomationService.java @@ -18,7 +18,7 @@ public interface AutomationService extends MutinyService { io.smallrye.mutiny.Uni ztpDelete(automation.Automation.DeviceRole request); - io.smallrye.mutiny.Uni ztpDeleteAll(automation.Automation.Empty request); + io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request); diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java index 52b1425cf6d3c5c59ae99621204689176892d043..74d420a1ee8c3c11f824c30fb96f694ddddc64fe 100644 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java +++ b/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java @@ -56,7 +56,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni ztpDeleteAll(automation.Automation.Empty request) { + public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) { try { return delegate.ztpDeleteAll(request); } catch (UnsupportedOperationException e) { diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java index 5dde73d5bfdbb401ed9fd89e38a6caa3e75cabbe..9dcad532a0238f6f14d8e6ca2aa64b445747e9e6 100644 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java +++ b/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java @@ -41,7 +41,7 @@ public class AutomationServiceClient implements AutomationService, MutinyClient< return stub.ztpDelete(request); } @Override - public io.smallrye.mutiny.Uni ztpDeleteAll(automation.Automation.Empty request) { + public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) { return stub.ztpDeleteAll(request); } diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java index 9f805796624bff8dfbd5f4b428fa21cf066ffb80..25f5feaf327702102d1ec6cd9ca6cc8ab74cf14f 100644 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java @@ -169,27 +169,27 @@ public final class AutomationServiceGrpc { return getZtpDeleteMethod; } - private static volatile io.grpc.MethodDescriptor getZtpDeleteAllMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll", - requestType = automation.Automation.Empty.class, + requestType = context.ContextOuterClass.Empty.class, responseType = automation.Automation.DeviceDeletionResult.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getZtpDeleteAllMethod() { - io.grpc.MethodDescriptor getZtpDeleteAllMethod; + io.grpc.MethodDescriptor getZtpDeleteAllMethod; if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { synchronized (AutomationServiceGrpc.class) { if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { AutomationServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.Empty.getDefaultInstance())) + context.ContextOuterClass.Empty.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( automation.Automation.DeviceDeletionResult.getDefaultInstance())) .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDeleteAll")) @@ -285,7 +285,7 @@ public final class AutomationServiceGrpc { /** */ - public void ztpDeleteAll(automation.Automation.Empty request, + public void ztpDeleteAll(context.ContextOuterClass.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver); } @@ -331,7 +331,7 @@ public final class AutomationServiceGrpc { getZtpDeleteAllMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - automation.Automation.Empty, + context.ContextOuterClass.Empty, automation.Automation.DeviceDeletionResult>( this, METHODID_ZTP_DELETE_ALL))) .build(); @@ -394,7 +394,7 @@ public final class AutomationServiceGrpc { /** */ - public void ztpDeleteAll(automation.Automation.Empty request, + public void ztpDeleteAll(context.ContextOuterClass.Empty request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver); @@ -452,7 +452,7 @@ public final class AutomationServiceGrpc { /** */ - public automation.Automation.DeviceDeletionResult ztpDeleteAll(automation.Automation.Empty request) { + public automation.Automation.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request); } @@ -515,7 +515,7 @@ public final class AutomationServiceGrpc { /** */ public com.google.common.util.concurrent.ListenableFuture ztpDeleteAll( - automation.Automation.Empty request) { + context.ContextOuterClass.Empty request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request); } @@ -566,7 +566,7 @@ public final class AutomationServiceGrpc { (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_ZTP_DELETE_ALL: - serviceImpl.ztpDeleteAll((automation.Automation.Empty) request, + serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver) responseObserver); break; default: diff --git a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java index 0783cbc965e487a020a36d25acca55c5a17c0640..9b641fcdd7733828c58ce563651ac3d46e697287 100644 --- a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java @@ -61,7 +61,7 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim } - public io.smallrye.mutiny.Uni ztpDeleteAll(automation.Automation.Empty request) { + public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDeleteAll); } @@ -108,7 +108,7 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim } - public io.smallrye.mutiny.Uni ztpDeleteAll(automation.Automation.Empty request) { + public io.smallrye.mutiny.Uni ztpDeleteAll(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -153,7 +153,7 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim automation.AutomationServiceGrpc.getZtpDeleteAllMethod(), asyncUnaryCall( new MethodHandlers< - automation.Automation.Empty, + context.ContextOuterClass.Empty, automation.Automation.DeviceDeletionResult>( this, METHODID_ZTP_DELETE_ALL, compression))) .build(); @@ -217,7 +217,7 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim serviceImpl::ztpDelete); break; case METHODID_ZTP_DELETE_ALL: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.Empty) request, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver) responseObserver, compression, serviceImpl::ztpDeleteAll); diff --git a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java index 21d845ecd69f3ec21bdc185dfac5e2cbd171904d..45a64fabb43bab645e97e9d80bc1825242006dce 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java @@ -556,6 +556,10 @@ public final class ContextOuterClass { * SERVICESTATUS_PENDING_REMOVAL = 3; */ SERVICESTATUS_PENDING_REMOVAL(3), + /** + * SERVICESTATUS_SLA_VIOLATED = 4; + */ + SERVICESTATUS_SLA_VIOLATED(4), UNRECOGNIZED(-1), ; @@ -575,6 +579,10 @@ public final class ContextOuterClass { * SERVICESTATUS_PENDING_REMOVAL = 3; */ public static final int SERVICESTATUS_PENDING_REMOVAL_VALUE = 3; + /** + * SERVICESTATUS_SLA_VIOLATED = 4; + */ + public static final int SERVICESTATUS_SLA_VIOLATED_VALUE = 4; public final int getNumber() { @@ -605,6 +613,7 @@ public final class ContextOuterClass { case 1: return SERVICESTATUS_PLANNED; case 2: return SERVICESTATUS_ACTIVE; case 3: return SERVICESTATUS_PENDING_REMOVAL; + case 4: return SERVICESTATUS_SLA_VIOLATED; default: return null; } } @@ -661,6 +670,150 @@ public final class ContextOuterClass { // @@protoc_insertion_point(enum_scope:context.ServiceStatusEnum) } + /** + * Protobuf enum {@code context.SliceStatusEnum} + */ + public enum SliceStatusEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SLICESTATUS_UNDEFINED = 0; + */ + SLICESTATUS_UNDEFINED(0), + /** + * SLICESTATUS_PLANNED = 1; + */ + SLICESTATUS_PLANNED(1), + /** + * SLICESTATUS_INIT = 2; + */ + SLICESTATUS_INIT(2), + /** + * SLICESTATUS_ACTIVE = 3; + */ + SLICESTATUS_ACTIVE(3), + /** + * SLICESTATUS_DEINIT = 4; + */ + SLICESTATUS_DEINIT(4), + /** + * SLICESTATUS_SLA_VIOLATED = 5; + */ + SLICESTATUS_SLA_VIOLATED(5), + UNRECOGNIZED(-1), + ; + + /** + * SLICESTATUS_UNDEFINED = 0; + */ + public static final int SLICESTATUS_UNDEFINED_VALUE = 0; + /** + * SLICESTATUS_PLANNED = 1; + */ + public static final int SLICESTATUS_PLANNED_VALUE = 1; + /** + * SLICESTATUS_INIT = 2; + */ + public static final int SLICESTATUS_INIT_VALUE = 2; + /** + * SLICESTATUS_ACTIVE = 3; + */ + public static final int SLICESTATUS_ACTIVE_VALUE = 3; + /** + * SLICESTATUS_DEINIT = 4; + */ + public static final int SLICESTATUS_DEINIT_VALUE = 4; + /** + * SLICESTATUS_SLA_VIOLATED = 5; + */ + public static final int SLICESTATUS_SLA_VIOLATED_VALUE = 5; + + + 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 SliceStatusEnum 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 SliceStatusEnum forNumber(int value) { + switch (value) { + case 0: return SLICESTATUS_UNDEFINED; + case 1: return SLICESTATUS_PLANNED; + case 2: return SLICESTATUS_INIT; + case 3: return SLICESTATUS_ACTIVE; + case 4: return SLICESTATUS_DEINIT; + case 5: return SLICESTATUS_SLA_VIOLATED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SliceStatusEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SliceStatusEnum findValueByNumber(int number) { + return SliceStatusEnum.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 context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + } + + private static final SliceStatusEnum[] VALUES = values(); + + public static SliceStatusEnum 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 SliceStatusEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:context.SliceStatusEnum) + } + /** *
    * ----- Configuration -------------------------------------------------------------------------------------------------
@@ -756,7 +909,7 @@ public final class ContextOuterClass {
     }
     public static final com.google.protobuf.Descriptors.EnumDescriptor
         getDescriptor() {
-      return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5);
+      return context.ContextOuterClass.getDescriptor().getEnumTypes().get(6);
     }
 
     private static final ConfigActionEnum[] VALUES = values();
@@ -782,6 +935,177 @@ public final class ContextOuterClass {
     // @@protoc_insertion_point(enum_scope:context.ConfigActionEnum)
   }
 
+  /**
+   * Protobuf enum {@code context.IsolationLevelEnum}
+   */
+  public enum IsolationLevelEnum
+      implements com.google.protobuf.ProtocolMessageEnum {
+    /**
+     * NO_ISOLATION = 0;
+     */
+    NO_ISOLATION(0),
+    /**
+     * PHYSICAL_ISOLATION = 1;
+     */
+    PHYSICAL_ISOLATION(1),
+    /**
+     * LOGICAL_ISOLATION = 2;
+     */
+    LOGICAL_ISOLATION(2),
+    /**
+     * PROCESS_ISOLATION = 3;
+     */
+    PROCESS_ISOLATION(3),
+    /**
+     * PHYSICAL_MEMORY_ISOLATION = 4;
+     */
+    PHYSICAL_MEMORY_ISOLATION(4),
+    /**
+     * PHYSICAL_NETWORK_ISOLATION = 5;
+     */
+    PHYSICAL_NETWORK_ISOLATION(5),
+    /**
+     * VIRTUAL_RESOURCE_ISOLATION = 6;
+     */
+    VIRTUAL_RESOURCE_ISOLATION(6),
+    /**
+     * NETWORK_FUNCTIONS_ISOLATION = 7;
+     */
+    NETWORK_FUNCTIONS_ISOLATION(7),
+    /**
+     * SERVICE_ISOLATION = 8;
+     */
+    SERVICE_ISOLATION(8),
+    UNRECOGNIZED(-1),
+    ;
+
+    /**
+     * NO_ISOLATION = 0;
+     */
+    public static final int NO_ISOLATION_VALUE = 0;
+    /**
+     * PHYSICAL_ISOLATION = 1;
+     */
+    public static final int PHYSICAL_ISOLATION_VALUE = 1;
+    /**
+     * LOGICAL_ISOLATION = 2;
+     */
+    public static final int LOGICAL_ISOLATION_VALUE = 2;
+    /**
+     * PROCESS_ISOLATION = 3;
+     */
+    public static final int PROCESS_ISOLATION_VALUE = 3;
+    /**
+     * PHYSICAL_MEMORY_ISOLATION = 4;
+     */
+    public static final int PHYSICAL_MEMORY_ISOLATION_VALUE = 4;
+    /**
+     * PHYSICAL_NETWORK_ISOLATION = 5;
+     */
+    public static final int PHYSICAL_NETWORK_ISOLATION_VALUE = 5;
+    /**
+     * VIRTUAL_RESOURCE_ISOLATION = 6;
+     */
+    public static final int VIRTUAL_RESOURCE_ISOLATION_VALUE = 6;
+    /**
+     * NETWORK_FUNCTIONS_ISOLATION = 7;
+     */
+    public static final int NETWORK_FUNCTIONS_ISOLATION_VALUE = 7;
+    /**
+     * SERVICE_ISOLATION = 8;
+     */
+    public static final int SERVICE_ISOLATION_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 IsolationLevelEnum 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 IsolationLevelEnum forNumber(int value) {
+      switch (value) {
+        case 0: return NO_ISOLATION;
+        case 1: return PHYSICAL_ISOLATION;
+        case 2: return LOGICAL_ISOLATION;
+        case 3: return PROCESS_ISOLATION;
+        case 4: return PHYSICAL_MEMORY_ISOLATION;
+        case 5: return PHYSICAL_NETWORK_ISOLATION;
+        case 6: return VIRTUAL_RESOURCE_ISOLATION;
+        case 7: return NETWORK_FUNCTIONS_ISOLATION;
+        case 8: return SERVICE_ISOLATION;
+        default: return null;
+      }
+    }
+
+    public static com.google.protobuf.Internal.EnumLiteMap
+        internalGetValueMap() {
+      return internalValueMap;
+    }
+    private static final com.google.protobuf.Internal.EnumLiteMap<
+        IsolationLevelEnum> internalValueMap =
+          new com.google.protobuf.Internal.EnumLiteMap() {
+            public IsolationLevelEnum findValueByNumber(int number) {
+              return IsolationLevelEnum.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 context.ContextOuterClass.getDescriptor().getEnumTypes().get(7);
+    }
+
+    private static final IsolationLevelEnum[] VALUES = values();
+
+    public static IsolationLevelEnum 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 IsolationLevelEnum(int value) {
+      this.value = value;
+    }
+
+    // @@protoc_insertion_point(enum_scope:context.IsolationLevelEnum)
+  }
+
   public interface EmptyOrBuilder extends
       // @@protoc_insertion_point(interface_extends:context.Empty)
       com.google.protobuf.MessageOrBuilder {
@@ -1776,8 +2100,8 @@ public final class ContextOuterClass {
 
   }
 
-  public interface EventOrBuilder extends
-      // @@protoc_insertion_point(interface_extends:context.Event)
+  public interface TimestampOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:context.Timestamp)
       com.google.protobuf.MessageOrBuilder {
 
     /**
@@ -1785,39 +2109,27 @@ public final class ContextOuterClass {
      * @return The timestamp.
      */
     double getTimestamp();
-
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The enum numeric value on the wire for eventType.
-     */
-    int getEventTypeValue();
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The eventType.
-     */
-    context.ContextOuterClass.EventTypeEnum getEventType();
   }
   /**
-   * Protobuf type {@code context.Event}
+   * Protobuf type {@code context.Timestamp}
    */
-  public static final class Event extends
+  public static final class Timestamp extends
       com.google.protobuf.GeneratedMessageV3 implements
-      // @@protoc_insertion_point(message_implements:context.Event)
-      EventOrBuilder {
+      // @@protoc_insertion_point(message_implements:context.Timestamp)
+      TimestampOrBuilder {
   private static final long serialVersionUID = 0L;
-    // Use Event.newBuilder() to construct.
-    private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) {
+    // Use Timestamp.newBuilder() to construct.
+    private Timestamp(com.google.protobuf.GeneratedMessageV3.Builder builder) {
       super(builder);
     }
-    private Event() {
-      eventType_ = 0;
+    private Timestamp() {
     }
 
     @java.lang.Override
     @SuppressWarnings({"unused"})
     protected java.lang.Object newInstance(
         UnusedPrivateParameter unused) {
-      return new Event();
+      return new Timestamp();
     }
 
     @java.lang.Override
@@ -1825,7 +2137,7 @@ public final class ContextOuterClass {
     getUnknownFields() {
       return this.unknownFields;
     }
-    private Event(
+    private Timestamp(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1848,12 +2160,6 @@ public final class ContextOuterClass {
               timestamp_ = input.readDouble();
               break;
             }
-            case 16: {
-              int rawValue = input.readEnum();
-
-              eventType_ = rawValue;
-              break;
-            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -1875,15 +2181,15 @@ public final class ContextOuterClass {
     }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return context.ContextOuterClass.internal_static_context_Event_descriptor;
+      return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable
+      return context.ContextOuterClass.internal_static_context_Timestamp_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class);
+              context.ContextOuterClass.Timestamp.class, context.ContextOuterClass.Timestamp.Builder.class);
     }
 
     public static final int TIMESTAMP_FIELD_NUMBER = 1;
@@ -1897,25 +2203,6 @@ public final class ContextOuterClass {
       return timestamp_;
     }
 
-    public static final int EVENT_TYPE_FIELD_NUMBER = 2;
-    private int eventType_;
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The enum numeric value on the wire for eventType.
-     */
-    @java.lang.Override public int getEventTypeValue() {
-      return eventType_;
-    }
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The eventType.
-     */
-    @java.lang.Override public context.ContextOuterClass.EventTypeEnum getEventType() {
-      @SuppressWarnings("deprecation")
-      context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_);
-      return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result;
-    }
-
     private byte memoizedIsInitialized = -1;
     @java.lang.Override
     public final boolean isInitialized() {
@@ -1933,9 +2220,6 @@ public final class ContextOuterClass {
       if (timestamp_ != 0D) {
         output.writeDouble(1, timestamp_);
       }
-      if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) {
-        output.writeEnum(2, eventType_);
-      }
       unknownFields.writeTo(output);
     }
 
@@ -1949,10 +2233,6 @@ public final class ContextOuterClass {
         size += com.google.protobuf.CodedOutputStream
           .computeDoubleSize(1, timestamp_);
       }
-      if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(2, eventType_);
-      }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
       return size;
@@ -1963,15 +2243,14 @@ public final class ContextOuterClass {
       if (obj == this) {
        return true;
       }
-      if (!(obj instanceof context.ContextOuterClass.Event)) {
+      if (!(obj instanceof context.ContextOuterClass.Timestamp)) {
         return super.equals(obj);
       }
-      context.ContextOuterClass.Event other = (context.ContextOuterClass.Event) obj;
+      context.ContextOuterClass.Timestamp other = (context.ContextOuterClass.Timestamp) obj;
 
       if (java.lang.Double.doubleToLongBits(getTimestamp())
           != java.lang.Double.doubleToLongBits(
               other.getTimestamp())) return false;
-      if (eventType_ != other.eventType_) return false;
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
     }
@@ -1986,76 +2265,74 @@ public final class ContextOuterClass {
       hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
       hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
           java.lang.Double.doubleToLongBits(getTimestamp()));
-      hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER;
-      hash = (53 * hash) + eventType_;
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
     }
 
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         java.nio.ByteBuffer data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         java.nio.ByteBuffer data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(byte[] data)
+    public static context.ContextOuterClass.Timestamp parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(java.io.InputStream input)
+    public static context.ContextOuterClass.Timestamp parseFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp 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 context.ContextOuterClass.Event parseDelimitedFrom(java.io.InputStream input)
+    public static context.ContextOuterClass.Timestamp parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseDelimitedWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseDelimitedFrom(
+    public static context.ContextOuterClass.Timestamp 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 context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
@@ -2068,7 +2345,7 @@ public final class ContextOuterClass {
     public static Builder newBuilder() {
       return DEFAULT_INSTANCE.toBuilder();
     }
-    public static Builder newBuilder(context.ContextOuterClass.Event prototype) {
+    public static Builder newBuilder(context.ContextOuterClass.Timestamp prototype) {
       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
     @java.lang.Override
@@ -2084,26 +2361,26 @@ public final class ContextOuterClass {
       return builder;
     }
     /**
-     * Protobuf type {@code context.Event}
+     * Protobuf type {@code context.Timestamp}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageV3.Builder implements
-        // @@protoc_insertion_point(builder_implements:context.Event)
-        context.ContextOuterClass.EventOrBuilder {
+        // @@protoc_insertion_point(builder_implements:context.Timestamp)
+        context.ContextOuterClass.TimestampOrBuilder {
       public static final com.google.protobuf.Descriptors.Descriptor
           getDescriptor() {
-        return context.ContextOuterClass.internal_static_context_Event_descriptor;
+        return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
       }
 
       @java.lang.Override
       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
           internalGetFieldAccessorTable() {
-        return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable
+        return context.ContextOuterClass.internal_static_context_Timestamp_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
-                context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class);
+                context.ContextOuterClass.Timestamp.class, context.ContextOuterClass.Timestamp.Builder.class);
       }
 
-      // Construct using context.ContextOuterClass.Event.newBuilder()
+      // Construct using context.ContextOuterClass.Timestamp.newBuilder()
       private Builder() {
         maybeForceBuilderInitialization();
       }
@@ -2123,25 +2400,23 @@ public final class ContextOuterClass {
         super.clear();
         timestamp_ = 0D;
 
-        eventType_ = 0;
-
         return this;
       }
 
       @java.lang.Override
       public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
-        return context.ContextOuterClass.internal_static_context_Event_descriptor;
+        return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event getDefaultInstanceForType() {
-        return context.ContextOuterClass.Event.getDefaultInstance();
+      public context.ContextOuterClass.Timestamp getDefaultInstanceForType() {
+        return context.ContextOuterClass.Timestamp.getDefaultInstance();
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event build() {
-        context.ContextOuterClass.Event result = buildPartial();
+      public context.ContextOuterClass.Timestamp build() {
+        context.ContextOuterClass.Timestamp result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
@@ -2149,10 +2424,9 @@ public final class ContextOuterClass {
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event buildPartial() {
-        context.ContextOuterClass.Event result = new context.ContextOuterClass.Event(this);
+      public context.ContextOuterClass.Timestamp buildPartial() {
+        context.ContextOuterClass.Timestamp result = new context.ContextOuterClass.Timestamp(this);
         result.timestamp_ = timestamp_;
-        result.eventType_ = eventType_;
         onBuilt();
         return result;
       }
@@ -2191,22 +2465,19 @@ public final class ContextOuterClass {
       }
       @java.lang.Override
       public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof context.ContextOuterClass.Event) {
-          return mergeFrom((context.ContextOuterClass.Event)other);
+        if (other instanceof context.ContextOuterClass.Timestamp) {
+          return mergeFrom((context.ContextOuterClass.Timestamp)other);
         } else {
           super.mergeFrom(other);
           return this;
         }
       }
 
-      public Builder mergeFrom(context.ContextOuterClass.Event other) {
-        if (other == context.ContextOuterClass.Event.getDefaultInstance()) return this;
+      public Builder mergeFrom(context.ContextOuterClass.Timestamp other) {
+        if (other == context.ContextOuterClass.Timestamp.getDefaultInstance()) return this;
         if (other.getTimestamp() != 0D) {
           setTimestamp(other.getTimestamp());
         }
-        if (other.eventType_ != 0) {
-          setEventTypeValue(other.getEventTypeValue());
-        }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
         return this;
@@ -2222,11 +2493,11 @@ public final class ContextOuterClass {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        context.ContextOuterClass.Event parsedMessage = null;
+        context.ContextOuterClass.Timestamp parsedMessage = null;
         try {
           parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (context.ContextOuterClass.Event) e.getUnfinishedMessage();
+          parsedMessage = (context.ContextOuterClass.Timestamp) e.getUnfinishedMessage();
           throw e.unwrapIOException();
         } finally {
           if (parsedMessage != null) {
@@ -2266,60 +2537,6 @@ public final class ContextOuterClass {
         onChanged();
         return this;
       }
-
-      private int eventType_ = 0;
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return The enum numeric value on the wire for eventType.
-       */
-      @java.lang.Override public int getEventTypeValue() {
-        return eventType_;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @param value The enum numeric value on the wire for eventType to set.
-       * @return This builder for chaining.
-       */
-      public Builder setEventTypeValue(int value) {
-        
-        eventType_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return The eventType.
-       */
-      @java.lang.Override
-      public context.ContextOuterClass.EventTypeEnum getEventType() {
-        @SuppressWarnings("deprecation")
-        context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_);
-        return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @param value The eventType to set.
-       * @return This builder for chaining.
-       */
-      public Builder setEventType(context.ContextOuterClass.EventTypeEnum value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        
-        eventType_ = value.getNumber();
-        onChanged();
-        return this;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return This builder for chaining.
-       */
-      public Builder clearEventType() {
-        
-        eventType_ = 0;
-        onChanged();
-        return this;
-      }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -2333,89 +2550,97 @@ public final class ContextOuterClass {
       }
 
 
-      // @@protoc_insertion_point(builder_scope:context.Event)
+      // @@protoc_insertion_point(builder_scope:context.Timestamp)
     }
 
-    // @@protoc_insertion_point(class_scope:context.Event)
-    private static final context.ContextOuterClass.Event DEFAULT_INSTANCE;
+    // @@protoc_insertion_point(class_scope:context.Timestamp)
+    private static final context.ContextOuterClass.Timestamp DEFAULT_INSTANCE;
     static {
-      DEFAULT_INSTANCE = new context.ContextOuterClass.Event();
+      DEFAULT_INSTANCE = new context.ContextOuterClass.Timestamp();
     }
 
-    public static context.ContextOuterClass.Event getDefaultInstance() {
+    public static context.ContextOuterClass.Timestamp getDefaultInstance() {
       return DEFAULT_INSTANCE;
     }
 
-    private static final com.google.protobuf.Parser
-        PARSER = new com.google.protobuf.AbstractParser() {
+    private static final com.google.protobuf.Parser
+        PARSER = new com.google.protobuf.AbstractParser() {
       @java.lang.Override
-      public Event parsePartialFrom(
+      public Timestamp parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Event(input, extensionRegistry);
+        return new Timestamp(input, extensionRegistry);
       }
     };
 
-    public static com.google.protobuf.Parser parser() {
+    public static com.google.protobuf.Parser parser() {
       return PARSER;
     }
 
     @java.lang.Override
-    public com.google.protobuf.Parser getParserForType() {
+    public com.google.protobuf.Parser getParserForType() {
       return PARSER;
     }
 
     @java.lang.Override
-    public context.ContextOuterClass.Event getDefaultInstanceForType() {
+    public context.ContextOuterClass.Timestamp getDefaultInstanceForType() {
       return DEFAULT_INSTANCE;
     }
 
   }
 
-  public interface ContextIdOrBuilder extends
-      // @@protoc_insertion_point(interface_extends:context.ContextId)
+  public interface EventOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:context.Event)
       com.google.protobuf.MessageOrBuilder {
 
     /**
-     * .context.Uuid context_uuid = 1;
-     * @return Whether the contextUuid field is set.
+     * .context.Timestamp timestamp = 1;
+     * @return Whether the timestamp field is set.
      */
-    boolean hasContextUuid();
+    boolean hasTimestamp();
     /**
-     * .context.Uuid context_uuid = 1;
-     * @return The contextUuid.
+     * .context.Timestamp timestamp = 1;
+     * @return The timestamp.
      */
-    context.ContextOuterClass.Uuid getContextUuid();
+    context.ContextOuterClass.Timestamp getTimestamp();
     /**
-     * .context.Uuid context_uuid = 1;
+     * .context.Timestamp timestamp = 1;
      */
-    context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder();
+    context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder();
+
+    /**
+     * .context.EventTypeEnum event_type = 2;
+     * @return The enum numeric value on the wire for eventType.
+     */
+    int getEventTypeValue();
+    /**
+     * .context.EventTypeEnum event_type = 2;
+     * @return The eventType.
+     */
+    context.ContextOuterClass.EventTypeEnum getEventType();
   }
   /**
-   * 
-   * ----- Context -------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.ContextId} + * Protobuf type {@code context.Event} */ - public static final class ContextId extends + public static final class Event extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextId) - ContextIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Event) + EventOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextId.newBuilder() to construct. - private ContextId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextId() { + private Event() { + eventType_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextId(); + return new Event(); } @java.lang.Override @@ -2423,7 +2648,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextId( + private Event( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2442,18 +2667,24 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (contextUuid_ != null) { - subBuilder = contextUuid_.toBuilder(); + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); } - contextUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextUuid_); - contextUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); } break; } + case 16: { + int rawValue = input.readEnum(); + + eventType_ = rawValue; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -2475,41 +2706,60 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); + context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class); } - public static final int CONTEXT_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid contextUuid_; + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private context.ContextOuterClass.Timestamp timestamp_; /** - * .context.Uuid context_uuid = 1; - * @return Whether the contextUuid field is set. + * .context.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. */ @java.lang.Override - public boolean hasContextUuid() { - return contextUuid_ != null; + public boolean hasTimestamp() { + return timestamp_ != null; } /** - * .context.Uuid context_uuid = 1; - * @return The contextUuid. + * .context.Timestamp timestamp = 1; + * @return The timestamp. */ @java.lang.Override - public context.ContextOuterClass.Uuid getContextUuid() { - return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { - return getContextUuid(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 2; + private int eventType_; + /** + * .context.EventTypeEnum event_type = 2; + * @return The enum numeric value on the wire for eventType. + */ + @java.lang.Override public int getEventTypeValue() { + return eventType_; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return The eventType. + */ + @java.lang.Override public context.ContextOuterClass.EventTypeEnum getEventType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_); + return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -2526,8 +2776,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextUuid_ != null) { - output.writeMessage(1, getContextUuid()); + if (timestamp_ != null) { + output.writeMessage(1, getTimestamp()); + } + if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) { + output.writeEnum(2, eventType_); } unknownFields.writeTo(output); } @@ -2538,9 +2791,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextUuid_ != null) { + if (timestamp_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextUuid()); + .computeMessageSize(1, getTimestamp()); + } + if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, eventType_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -2552,16 +2809,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextId)) { + if (!(obj instanceof context.ContextOuterClass.Event)) { return super.equals(obj); } - context.ContextOuterClass.ContextId other = (context.ContextOuterClass.ContextId) obj; + context.ContextOuterClass.Event other = (context.ContextOuterClass.Event) obj; - if (hasContextUuid() != other.hasContextUuid()) return false; - if (hasContextUuid()) { - if (!getContextUuid() - .equals(other.getContextUuid())) return false; + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; } + if (eventType_ != other.eventType_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2573,78 +2831,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextUuid()) { - hash = (37 * hash) + CONTEXT_UUID_FIELD_NUMBER; - hash = (53 * hash) + getContextUuid().hashCode(); + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); } + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom(byte[] data) + public static context.ContextOuterClass.Event parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Event parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event 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 context.ContextOuterClass.ContextId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Event parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseDelimitedFrom( + public static context.ContextOuterClass.Event 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 context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2657,7 +2917,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Event prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2673,30 +2933,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Context -------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.ContextId} + * Protobuf type {@code context.Event} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextId) - context.ContextOuterClass.ContextIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Event) + context.ContextOuterClass.EventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); + context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class); } - // Construct using context.ContextOuterClass.ContextId.newBuilder() + // Construct using context.ContextOuterClass.Event.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2714,29 +2970,31 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (contextUuidBuilder_ == null) { - contextUuid_ = null; + if (timestampBuilder_ == null) { + timestamp_ = null; } else { - contextUuid_ = null; - contextUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } + eventType_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextId getDefaultInstanceForType() { - return context.ContextOuterClass.ContextId.getDefaultInstance(); + public context.ContextOuterClass.Event getDefaultInstanceForType() { + return context.ContextOuterClass.Event.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextId build() { - context.ContextOuterClass.ContextId result = buildPartial(); + public context.ContextOuterClass.Event build() { + context.ContextOuterClass.Event result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2744,13 +3002,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextId buildPartial() { - context.ContextOuterClass.ContextId result = new context.ContextOuterClass.ContextId(this); - if (contextUuidBuilder_ == null) { - result.contextUuid_ = contextUuid_; + public context.ContextOuterClass.Event buildPartial() { + context.ContextOuterClass.Event result = new context.ContextOuterClass.Event(this); + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; } else { - result.contextUuid_ = contextUuidBuilder_.build(); + result.timestamp_ = timestampBuilder_.build(); } + result.eventType_ = eventType_; onBuilt(); return result; } @@ -2789,18 +3048,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextId) { - return mergeFrom((context.ContextOuterClass.ContextId)other); + if (other instanceof context.ContextOuterClass.Event) { + return mergeFrom((context.ContextOuterClass.Event)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextId other) { - if (other == context.ContextOuterClass.ContextId.getDefaultInstance()) return this; - if (other.hasContextUuid()) { - mergeContextUuid(other.getContextUuid()); + public Builder mergeFrom(context.ContextOuterClass.Event other) { + if (other == context.ContextOuterClass.Event.getDefaultInstance()) return this; + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.eventType_ != 0) { + setEventTypeValue(other.getEventTypeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -2817,11 +3079,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextId parsedMessage = null; + context.ContextOuterClass.Event parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Event) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2831,123 +3093,177 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid contextUuid_; + private context.ContextOuterClass.Timestamp timestamp_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> contextUuidBuilder_; + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; /** - * .context.Uuid context_uuid = 1; - * @return Whether the contextUuid field is set. + * .context.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. */ - public boolean hasContextUuid() { - return contextUuidBuilder_ != null || contextUuid_ != null; + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; } /** - * .context.Uuid context_uuid = 1; - * @return The contextUuid. + * .context.Timestamp timestamp = 1; + * @return The timestamp. */ - public context.ContextOuterClass.Uuid getContextUuid() { - if (contextUuidBuilder_ == null) { - return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } else { - return contextUuidBuilder_.getMessage(); + return timestampBuilder_.getMessage(); } } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder setContextUuid(context.ContextOuterClass.Uuid value) { - if (contextUuidBuilder_ == null) { + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextUuid_ = value; + timestamp_ = value; onChanged(); } else { - contextUuidBuilder_.setMessage(value); + timestampBuilder_.setMessage(value); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder setContextUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (contextUuidBuilder_ == null) { - contextUuid_ = builderForValue.build(); + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); onChanged(); } else { - contextUuidBuilder_.setMessage(builderForValue.build()); + timestampBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder mergeContextUuid(context.ContextOuterClass.Uuid value) { - if (contextUuidBuilder_ == null) { - if (contextUuid_ != null) { - contextUuid_ = - context.ContextOuterClass.Uuid.newBuilder(contextUuid_).mergeFrom(value).buildPartial(); + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); } else { - contextUuid_ = value; + timestamp_ = value; } onChanged(); } else { - contextUuidBuilder_.mergeFrom(value); + timestampBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder clearContextUuid() { - if (contextUuidBuilder_ == null) { - contextUuid_ = null; + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; onChanged(); } else { - contextUuid_ = null; - contextUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public context.ContextOuterClass.Uuid.Builder getContextUuidBuilder() { + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { onChanged(); - return getContextUuidFieldBuilder().getBuilder(); + return getTimestampFieldBuilder().getBuilder(); } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { - if (contextUuidBuilder_ != null) { - return contextUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); } else { - return contextUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getContextUuidFieldBuilder() { - if (contextUuidBuilder_ == null) { - contextUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getContextUuid(), + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); - contextUuid_ = null; + timestamp_ = null; } - return contextUuidBuilder_; + return timestampBuilder_; + } + + private int eventType_ = 0; + /** + * .context.EventTypeEnum event_type = 2; + * @return The enum numeric value on the wire for eventType. + */ + @java.lang.Override public int getEventTypeValue() { + return eventType_; + } + /** + * .context.EventTypeEnum event_type = 2; + * @param value The enum numeric value on the wire for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeValue(int value) { + + eventType_ = value; + onChanged(); + return this; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return The eventType. + */ + @java.lang.Override + public context.ContextOuterClass.EventTypeEnum getEventType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_); + return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result; + } + /** + * .context.EventTypeEnum event_type = 2; + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(context.ContextOuterClass.EventTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -2962,150 +3278,89 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextId) + // @@protoc_insertion_point(builder_scope:context.Event) } - // @@protoc_insertion_point(class_scope:context.ContextId) - private static final context.ContextOuterClass.ContextId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Event) + private static final context.ContextOuterClass.Event DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Event(); } - public static context.ContextOuterClass.ContextId getDefaultInstance() { + public static context.ContextOuterClass.Event getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextId parsePartialFrom( + public Event parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextId(input, extensionRegistry); + return new Event(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + public context.ContextOuterClass.Event getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Context) + public interface ContextIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextId) com.google.protobuf.MessageOrBuilder { /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - boolean hasContextId(); - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - context.ContextOuterClass.ContextId getContextId(); - /** - * .context.ContextId context_id = 1; - */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); - - /** - * repeated .context.TopologyId topology_ids = 2; - */ - java.util.List - getTopologyIdsList(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - context.ContextOuterClass.TopologyId getTopologyIds(int index); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - int getTopologyIdsCount(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - java.util.List - getTopologyIdsOrBuilderList(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index); - - /** - * repeated .context.ServiceId service_ids = 3; - */ - java.util.List - getServiceIdsList(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - context.ContextOuterClass.ServiceId getServiceIds(int index); - /** - * repeated .context.ServiceId service_ids = 3; - */ - int getServiceIdsCount(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - java.util.List - getServiceIdsOrBuilderList(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index); - - /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ - boolean hasController(); + boolean hasContextUuid(); /** - * .context.TeraFlowController controller = 4; - * @return The controller. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ - context.ContextOuterClass.TeraFlowController getController(); + context.ContextOuterClass.Uuid getContextUuid(); /** - * .context.TeraFlowController controller = 4; + * .context.Uuid context_uuid = 1; */ - context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder(); + context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder(); } /** - * Protobuf type {@code context.Context} + *
+   * ----- Context -------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ContextId} */ - public static final class Context extends + public static final class ContextId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Context) - ContextOrBuilder { + // @@protoc_insertion_point(message_implements:context.ContextId) + ContextIdOrBuilder { private static final long serialVersionUID = 0L; - // Use Context.newBuilder() to construct. - private Context(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ContextId.newBuilder() to construct. + private ContextId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Context() { - topologyIds_ = java.util.Collections.emptyList(); - serviceIds_ = java.util.Collections.emptyList(); + private ContextId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Context(); + return new ContextId(); } @java.lang.Override @@ -3113,7 +3368,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Context( + private ContextId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3121,7 +3376,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -3133,45 +3387,14 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); - } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - topologyIds_.add( - input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - serviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - serviceIds_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); - break; - } - case 34: { - context.ContextOuterClass.TeraFlowController.Builder subBuilder = null; - if (controller_ != null) { - subBuilder = controller_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (contextUuid_ != null) { + subBuilder = contextUuid_.toBuilder(); } - controller_ = input.readMessage(context.ContextOuterClass.TeraFlowController.parser(), extensionRegistry); + contextUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(controller_); - controller_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(contextUuid_); + contextUuid_ = subBuilder.buildPartial(); } break; @@ -3191,159 +3414,47 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); - } - - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; - } - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; - } - /** - * .context.ContextId context_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); - } - - public static final int TOPOLOGY_IDS_FIELD_NUMBER = 2; - private java.util.List topologyIds_; - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public java.util.List getTopologyIdsList() { - return topologyIds_; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public java.util.List - getTopologyIdsOrBuilderList() { - return topologyIds_; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public int getTopologyIdsCount() { - return topologyIds_.size(); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - return topologyIds_.get(index); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index) { - return topologyIds_.get(index); - } - - public static final int SERVICE_IDS_FIELD_NUMBER = 3; - private java.util.List serviceIds_; - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public java.util.List getServiceIdsList() { - return serviceIds_; - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public java.util.List - getServiceIdsOrBuilderList() { - return serviceIds_; - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public int getServiceIdsCount() { - return serviceIds_.size(); - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - return serviceIds_.get(index); - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - return serviceIds_.get(index); + context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); } - public static final int CONTROLLER_FIELD_NUMBER = 4; - private context.ContextOuterClass.TeraFlowController controller_; + public static final int CONTEXT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid contextUuid_; /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ @java.lang.Override - public boolean hasController() { - return controller_ != null; + public boolean hasContextUuid() { + return contextUuid_ != null; } /** - * .context.TeraFlowController controller = 4; - * @return The controller. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ @java.lang.Override - public context.ContextOuterClass.TeraFlowController getController() { - return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + public context.ContextOuterClass.Uuid getContextUuid() { + return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } /** - * .context.TeraFlowController controller = 4; + * .context.Uuid context_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { - return getController(); + public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { + return getContextUuid(); } private byte memoizedIsInitialized = -1; @@ -3360,17 +3471,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); - } - for (int i = 0; i < topologyIds_.size(); i++) { - output.writeMessage(2, topologyIds_.get(i)); - } - for (int i = 0; i < serviceIds_.size(); i++) { - output.writeMessage(3, serviceIds_.get(i)); - } - if (controller_ != null) { - output.writeMessage(4, getController()); + if (contextUuid_ != null) { + output.writeMessage(1, getContextUuid()); } unknownFields.writeTo(output); } @@ -3381,21 +3483,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); - } - for (int i = 0; i < topologyIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, topologyIds_.get(i)); - } - for (int i = 0; i < serviceIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, serviceIds_.get(i)); - } - if (controller_ != null) { + if (contextUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getController()); + .computeMessageSize(1, getContextUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -3407,24 +3497,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Context)) { + if (!(obj instanceof context.ContextOuterClass.ContextId)) { return super.equals(obj); } - context.ContextOuterClass.Context other = (context.ContextOuterClass.Context) obj; + context.ContextOuterClass.ContextId other = (context.ContextOuterClass.ContextId) obj; - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; - } - if (!getTopologyIdsList() - .equals(other.getTopologyIdsList())) return false; - if (!getServiceIdsList() - .equals(other.getServiceIdsList())) return false; - if (hasController() != other.hasController()) return false; - if (hasController()) { - if (!getController() - .equals(other.getController())) return false; + if (hasContextUuid() != other.hasContextUuid()) return false; + if (hasContextUuid()) { + if (!getContextUuid() + .equals(other.getContextUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -3437,90 +3518,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); - } - if (getTopologyIdsCount() > 0) { - hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTopologyIdsList().hashCode(); - } - if (getServiceIdsCount() > 0) { - hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceIdsList().hashCode(); - } - if (hasController()) { - hash = (37 * hash) + CONTROLLER_FIELD_NUMBER; - hash = (53 * hash) + getController().hashCode(); + if (hasContextUuid()) { + hash = (37 * hash) + CONTEXT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getContextUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom(byte[] data) + public static context.ContextOuterClass.ContextId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ContextId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId 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 context.ContextOuterClass.Context parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ContextId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseDelimitedFrom( + public static context.ContextOuterClass.ContextId 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 context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3533,7 +3602,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Context prototype) { + public static Builder newBuilder(context.ContextOuterClass.ContextId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3549,26 +3618,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Context} + *
+     * ----- Context -------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ContextId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Context) - context.ContextOuterClass.ContextOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ContextId) + context.ContextOuterClass.ContextIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); } - // Construct using context.ContextOuterClass.Context.newBuilder() + // Construct using context.ContextOuterClass.ContextId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3581,36 +3654,16 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologyIdsFieldBuilder(); - getServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; - } else { - contextId_ = null; - contextIdBuilder_ = null; - } - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - topologyIdsBuilder_.clear(); - } - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - serviceIdsBuilder_.clear(); - } - if (controllerBuilder_ == null) { - controller_ = null; + if (contextUuidBuilder_ == null) { + contextUuid_ = null; } else { - controller_ = null; - controllerBuilder_ = null; + contextUuid_ = null; + contextUuidBuilder_ = null; } return this; } @@ -3618,17 +3671,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override - public context.ContextOuterClass.Context getDefaultInstanceForType() { - return context.ContextOuterClass.Context.getDefaultInstance(); + public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + return context.ContextOuterClass.ContextId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Context build() { - context.ContextOuterClass.Context result = buildPartial(); + public context.ContextOuterClass.ContextId build() { + context.ContextOuterClass.ContextId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3636,36 +3689,12 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Context buildPartial() { - context.ContextOuterClass.Context result = new context.ContextOuterClass.Context(this); - int from_bitField0_ = bitField0_; - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; - } else { - result.contextId_ = contextIdBuilder_.build(); - } - if (topologyIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.topologyIds_ = topologyIds_; - } else { - result.topologyIds_ = topologyIdsBuilder_.build(); - } - if (serviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.serviceIds_ = serviceIds_; - } else { - result.serviceIds_ = serviceIdsBuilder_.build(); - } - if (controllerBuilder_ == null) { - result.controller_ = controller_; + public context.ContextOuterClass.ContextId buildPartial() { + context.ContextOuterClass.ContextId result = new context.ContextOuterClass.ContextId(this); + if (contextUuidBuilder_ == null) { + result.contextUuid_ = contextUuid_; } else { - result.controller_ = controllerBuilder_.build(); + result.contextUuid_ = contextUuidBuilder_.build(); } onBuilt(); return result; @@ -3705,73 +3734,18 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Context) { - return mergeFrom((context.ContextOuterClass.Context)other); + if (other instanceof context.ContextOuterClass.ContextId) { + return mergeFrom((context.ContextOuterClass.ContextId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Context other) { - if (other == context.ContextOuterClass.Context.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); - } - if (topologyIdsBuilder_ == null) { - if (!other.topologyIds_.isEmpty()) { - if (topologyIds_.isEmpty()) { - topologyIds_ = other.topologyIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTopologyIdsIsMutable(); - topologyIds_.addAll(other.topologyIds_); - } - onChanged(); - } - } else { - if (!other.topologyIds_.isEmpty()) { - if (topologyIdsBuilder_.isEmpty()) { - topologyIdsBuilder_.dispose(); - topologyIdsBuilder_ = null; - topologyIds_ = other.topologyIds_; - bitField0_ = (bitField0_ & ~0x00000001); - topologyIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologyIdsFieldBuilder() : null; - } else { - topologyIdsBuilder_.addAllMessages(other.topologyIds_); - } - } - } - if (serviceIdsBuilder_ == null) { - if (!other.serviceIds_.isEmpty()) { - if (serviceIds_.isEmpty()) { - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureServiceIdsIsMutable(); - serviceIds_.addAll(other.serviceIds_); - } - onChanged(); - } - } else { - if (!other.serviceIds_.isEmpty()) { - if (serviceIdsBuilder_.isEmpty()) { - serviceIdsBuilder_.dispose(); - serviceIdsBuilder_ = null; - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000002); - serviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceIdsFieldBuilder() : null; - } else { - serviceIdsBuilder_.addAllMessages(other.serviceIds_); - } - } - } - if (other.hasController()) { - mergeController(other.getController()); + public Builder mergeFrom(context.ContextOuterClass.ContextId other) { + if (other == context.ContextOuterClass.ContextId.getDefaultInstance()) return this; + if (other.hasContextUuid()) { + mergeContextUuid(other.getContextUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -3788,11 +3762,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Context parsedMessage = null; + context.ContextOuterClass.ContextId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Context) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ContextId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3801,724 +3775,24154 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.Uuid contextUuid_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> contextUuidBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasContextUuid() { + return contextUuidBuilder_ != null || contextUuid_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.Uuid getContextUuid() { + if (contextUuidBuilder_ == null) { + return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } else { - return contextIdBuilder_.getMessage(); + return contextUuidBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setContextUuid(context.ContextOuterClass.Uuid value) { + if (contextUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + contextUuid_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + contextUuidBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setContextUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (contextUuidBuilder_ == null) { + contextUuid_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + contextUuidBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); - } else { - contextId_ = value; + public Builder mergeContextUuid(context.ContextOuterClass.Uuid value) { + if (contextUuidBuilder_ == null) { + if (contextUuid_ != null) { + contextUuid_ = + context.ContextOuterClass.Uuid.newBuilder(contextUuid_).mergeFrom(value).buildPartial(); + } else { + contextUuid_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + contextUuidBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearContextUuid() { + if (contextUuidBuilder_ == null) { + contextUuid_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + contextUuid_ = null; + contextUuidBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.Uuid.Builder getContextUuidBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getContextUuidFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { + if (contextUuidBuilder_ != null) { + return contextUuidBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return contextUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getContextUuidFieldBuilder() { + if (contextUuidBuilder_ == null) { + contextUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getContextUuid(), getParentForChildren(), isClean()); - contextId_ = null; + contextUuid_ = null; } - return contextIdBuilder_; + return contextUuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - private java.util.List topologyIds_ = - java.util.Collections.emptyList(); - private void ensureTopologyIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(topologyIds_); - bitField0_ |= 0x00000001; - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List getTopologyIdsList() { - if (topologyIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologyIds_); - } else { - return topologyIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public int getTopologyIdsCount() { - if (topologyIdsBuilder_ == null) { - return topologyIds_.size(); - } else { - return topologyIdsBuilder_.getCount(); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); - } else { - return topologyIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, value); - onChanged(); - } else { - topologyIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + // @@protoc_insertion_point(builder_scope:context.ContextId) + } + + // @@protoc_insertion_point(class_scope:context.ContextId) + private static final context.ContextOuterClass.ContextId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextId(); + } + + public static context.ContextOuterClass.ContextId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextId(input, extensionRegistry); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopologyIdsIsMutable(); - topologyIds_.add(value); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(value); - } - return this; + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Context) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * repeated .context.TopologyId topology_ids = 2; + */ + java.util.List + getTopologyIdsList(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + context.ContextOuterClass.TopologyId getTopologyIds(int index); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + int getTopologyIdsCount(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + java.util.List + getTopologyIdsOrBuilderList(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index); + + /** + * repeated .context.ServiceId service_ids = 3; + */ + java.util.List + getServiceIdsList(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + context.ContextOuterClass.ServiceId getServiceIds(int index); + /** + * repeated .context.ServiceId service_ids = 3; + */ + int getServiceIdsCount(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + java.util.List + getServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index); + + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + boolean hasController(); + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + context.ContextOuterClass.TeraFlowController getController(); + /** + * .context.TeraFlowController controller = 4; + */ + context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder(); + } + /** + * Protobuf type {@code context.Context} + */ + public static final class Context extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Context) + ContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use Context.newBuilder() to construct. + private Context(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Context() { + topologyIds_ = java.util.Collections.emptyList(); + serviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Context(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Context( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologyIds_.add( + input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + serviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + serviceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 34: { + context.ContextOuterClass.TeraFlowController.Builder subBuilder = null; + if (controller_ != null) { + subBuilder = controller_.toBuilder(); + } + controller_ = input.readMessage(context.ContextOuterClass.TeraFlowController.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(controller_); + controller_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, value); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addAllTopologyIds( - java.lang.Iterable values) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologyIds_); - onChanged(); - } else { - topologyIdsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder clearTopologyIds() { - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - topologyIdsBuilder_.clear(); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder removeTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.remove(index); - onChanged(); - } else { - topologyIdsBuilder_.remove(index); } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( - int index) { - return getTopologyIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); } else { - return topologyIdsBuilder_.getMessageOrBuilder(index); + } 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)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List - getTopologyIdsOrBuilderList() { - if (topologyIdsBuilder_ != null) { - return topologyIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(topologyIds_); + if (((mutable_bitField0_ & 0x00000002) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { - return getTopologyIdsFieldBuilder().addBuilder( - context.ContextOuterClass.TopologyId.getDefaultInstance()); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( - int index) { - return getTopologyIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.TopologyId.getDefaultInstance()); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List - getTopologyIdsBuilderList() { - return getTopologyIdsFieldBuilder().getBuilderList(); + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int TOPOLOGY_IDS_FIELD_NUMBER = 2; + private java.util.List topologyIds_; + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public java.util.List getTopologyIdsList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public java.util.List + getTopologyIdsOrBuilderList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public int getTopologyIdsCount() { + return topologyIds_.size(); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + return topologyIds_.get(index); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + return topologyIds_.get(index); + } + + public static final int SERVICE_IDS_FIELD_NUMBER = 3; + private java.util.List serviceIds_; + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public java.util.List getServiceIdsList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public java.util.List + getServiceIdsOrBuilderList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public int getServiceIdsCount() { + return serviceIds_.size(); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + return serviceIds_.get(index); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + return serviceIds_.get(index); + } + + public static final int CONTROLLER_FIELD_NUMBER = 4; + private context.ContextOuterClass.TeraFlowController controller_; + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + @java.lang.Override + public boolean hasController() { + return controller_ != null; + } + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + @java.lang.Override + public context.ContextOuterClass.TeraFlowController getController() { + return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } + /** + * .context.TeraFlowController controller = 4; + */ + @java.lang.Override + public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { + return getController(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + for (int i = 0; i < topologyIds_.size(); i++) { + output.writeMessage(2, topologyIds_.get(i)); + } + for (int i = 0; i < serviceIds_.size(); i++) { + output.writeMessage(3, serviceIds_.get(i)); + } + if (controller_ != null) { + output.writeMessage(4, getController()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + for (int i = 0; i < topologyIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, topologyIds_.get(i)); + } + for (int i = 0; i < serviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, serviceIds_.get(i)); + } + if (controller_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getController()); + } + 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 context.ContextOuterClass.Context)) { + return super.equals(obj); + } + context.ContextOuterClass.Context other = (context.ContextOuterClass.Context) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (!getTopologyIdsList() + .equals(other.getTopologyIdsList())) return false; + if (!getServiceIdsList() + .equals(other.getServiceIdsList())) return false; + if (hasController() != other.hasController()) return false; + if (hasController()) { + if (!getController() + .equals(other.getController())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (getTopologyIdsCount() > 0) { + hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTopologyIdsList().hashCode(); + } + if (getServiceIdsCount() > 0) { + hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceIdsList().hashCode(); + } + if (hasController()) { + hash = (37 * hash) + CONTROLLER_FIELD_NUMBER; + hash = (53 * hash) + getController().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Context parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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 context.ContextOuterClass.Context parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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 context.ContextOuterClass.Context parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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(context.ContextOuterClass.Context 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 context.Context} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Context) + context.ContextOuterClass.ContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + } + + // Construct using context.ContextOuterClass.Context.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologyIdsFieldBuilder(); + getServiceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologyIdsBuilder_.clear(); + } + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + serviceIdsBuilder_.clear(); + } + if (controllerBuilder_ == null) { + controller_ = null; + } else { + controller_ = null; + controllerBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Context getDefaultInstanceForType() { + return context.ContextOuterClass.Context.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Context build() { + context.ContextOuterClass.Context result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Context buildPartial() { + context.ContextOuterClass.Context result = new context.ContextOuterClass.Context(this); + int from_bitField0_ = bitField0_; + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (topologyIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologyIds_ = topologyIds_; + } else { + result.topologyIds_ = topologyIdsBuilder_.build(); + } + if (serviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serviceIds_ = serviceIds_; + } else { + result.serviceIds_ = serviceIdsBuilder_.build(); + } + if (controllerBuilder_ == null) { + result.controller_ = controller_; + } else { + result.controller_ = controllerBuilder_.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 context.ContextOuterClass.Context) { + return mergeFrom((context.ContextOuterClass.Context)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Context other) { + if (other == context.ContextOuterClass.Context.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (topologyIdsBuilder_ == null) { + if (!other.topologyIds_.isEmpty()) { + if (topologyIds_.isEmpty()) { + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologyIdsIsMutable(); + topologyIds_.addAll(other.topologyIds_); + } + onChanged(); + } + } else { + if (!other.topologyIds_.isEmpty()) { + if (topologyIdsBuilder_.isEmpty()) { + topologyIdsBuilder_.dispose(); + topologyIdsBuilder_ = null; + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + topologyIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologyIdsFieldBuilder() : null; + } else { + topologyIdsBuilder_.addAllMessages(other.topologyIds_); + } + } + } + if (serviceIdsBuilder_ == null) { + if (!other.serviceIds_.isEmpty()) { + if (serviceIds_.isEmpty()) { + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServiceIdsIsMutable(); + serviceIds_.addAll(other.serviceIds_); + } + onChanged(); + } + } else { + if (!other.serviceIds_.isEmpty()) { + if (serviceIdsBuilder_.isEmpty()) { + serviceIdsBuilder_.dispose(); + serviceIdsBuilder_ = null; + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + serviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceIdsFieldBuilder() : null; + } else { + serviceIdsBuilder_.addAllMessages(other.serviceIds_); + } + } + } + if (other.hasController()) { + mergeController(other.getController()); + } + 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 { + context.ContextOuterClass.Context parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Context) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private java.util.List topologyIds_ = + java.util.Collections.emptyList(); + private void ensureTopologyIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(topologyIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List getTopologyIdsList() { + if (topologyIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologyIds_); + } else { + return topologyIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public int getTopologyIdsCount() { + if (topologyIdsBuilder_ == null) { + return topologyIds_.size(); + } else { + return topologyIdsBuilder_.getCount(); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); + } else { + return topologyIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, value); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addAllTopologyIds( + java.lang.Iterable values) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologyIds_); + onChanged(); + } else { + topologyIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder clearTopologyIds() { + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder removeTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.remove(index); + onChanged(); + } else { + topologyIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); } else { + return topologyIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List + getTopologyIdsOrBuilderList() { + if (topologyIdsBuilder_ != null) { + return topologyIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologyIds_); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { + return getTopologyIdsFieldBuilder().addBuilder( + context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List + getTopologyIdsBuilderList() { + return getTopologyIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdsFieldBuilder() { + if (topologyIdsBuilder_ == null) { + topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + topologyIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologyIds_ = null; + } + return topologyIdsBuilder_; + } + + private java.util.List serviceIds_ = + java.util.Collections.emptyList(); + private void ensureServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serviceIds_ = new java.util.ArrayList(serviceIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List getServiceIdsList() { + if (serviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceIds_); + } else { + return serviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public int getServiceIdsCount() { + if (serviceIdsBuilder_ == null) { + return serviceIds_.size(); + } else { + return serviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); + } else { + return serviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.set(index, value); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(index, value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addAllServiceIds( + java.lang.Iterable values) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceIds_); + onChanged(); + } else { + serviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder clearServiceIds() { + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder removeServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.remove(index); + onChanged(); + } else { + serviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); } else { + return serviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List + getServiceIdsOrBuilderList() { + if (serviceIdsBuilder_ != null) { + return serviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceIds_); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { + return getServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List + getServiceIdsBuilderList() { + return getServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdsFieldBuilder() { + if (serviceIdsBuilder_ == null) { + serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + serviceIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + serviceIds_ = null; + } + return serviceIdsBuilder_; + } + + private context.ContextOuterClass.TeraFlowController controller_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> controllerBuilder_; + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + public boolean hasController() { + return controllerBuilder_ != null || controller_ != null; + } + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + public context.ContextOuterClass.TeraFlowController getController() { + if (controllerBuilder_ == null) { + return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } else { + return controllerBuilder_.getMessage(); + } + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder setController(context.ContextOuterClass.TeraFlowController value) { + if (controllerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + controller_ = value; + onChanged(); + } else { + controllerBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder setController( + context.ContextOuterClass.TeraFlowController.Builder builderForValue) { + if (controllerBuilder_ == null) { + controller_ = builderForValue.build(); + onChanged(); + } else { + controllerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder mergeController(context.ContextOuterClass.TeraFlowController value) { + if (controllerBuilder_ == null) { + if (controller_ != null) { + controller_ = + context.ContextOuterClass.TeraFlowController.newBuilder(controller_).mergeFrom(value).buildPartial(); + } else { + controller_ = value; + } + onChanged(); + } else { + controllerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder clearController() { + if (controllerBuilder_ == null) { + controller_ = null; + onChanged(); + } else { + controller_ = null; + controllerBuilder_ = null; + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public context.ContextOuterClass.TeraFlowController.Builder getControllerBuilder() { + + onChanged(); + return getControllerFieldBuilder().getBuilder(); + } + /** + * .context.TeraFlowController controller = 4; + */ + public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { + if (controllerBuilder_ != null) { + return controllerBuilder_.getMessageOrBuilder(); + } else { + return controller_ == null ? + context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } + } + /** + * .context.TeraFlowController controller = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> + getControllerFieldBuilder() { + if (controllerBuilder_ == null) { + controllerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder>( + getController(), + getParentForChildren(), + isClean()); + controller_ = null; + } + return controllerBuilder_; + } + @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:context.Context) + } + + // @@protoc_insertion_point(class_scope:context.Context) + private static final context.ContextOuterClass.Context DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Context(); + } + + public static context.ContextOuterClass.Context getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Context parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Context(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 context.ContextOuterClass.Context getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ContextId context_ids = 1; + */ + java.util.List + getContextIdsList(); + /** + * repeated .context.ContextId context_ids = 1; + */ + context.ContextOuterClass.ContextId getContextIds(int index); + /** + * repeated .context.ContextId context_ids = 1; + */ + int getContextIdsCount(); + /** + * repeated .context.ContextId context_ids = 1; + */ + java.util.List + getContextIdsOrBuilderList(); + /** + * repeated .context.ContextId context_ids = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ContextIdList} + */ + public static final class ContextIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextIdList) + ContextIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextIdList.newBuilder() to construct. + private ContextIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextIdList() { + contextIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextIdList( + 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)) { + contextIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + contextIds_.add( + input.readMessage(context.ContextOuterClass.ContextId.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)) { + contextIds_ = java.util.Collections.unmodifiableList(contextIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + } + + public static final int CONTEXT_IDS_FIELD_NUMBER = 1; + private java.util.List contextIds_; + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public java.util.List getContextIdsList() { + return contextIds_; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public java.util.List + getContextIdsOrBuilderList() { + return contextIds_; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public int getContextIdsCount() { + return contextIds_.size(); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextIds(int index) { + return contextIds_.get(index); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index) { + return contextIds_.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 < contextIds_.size(); i++) { + output.writeMessage(1, contextIds_.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 < contextIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, contextIds_.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 context.ContextOuterClass.ContextIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextIdList other = (context.ContextOuterClass.ContextIdList) obj; + + if (!getContextIdsList() + .equals(other.getContextIdsList())) 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 (getContextIdsCount() > 0) { + hash = (37 * hash) + CONTEXT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getContextIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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 context.ContextOuterClass.ContextIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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 context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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(context.ContextOuterClass.ContextIdList 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 context.ContextIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextIdList) + context.ContextOuterClass.ContextIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getContextIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextIdsBuilder_ == null) { + contextIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + contextIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ContextIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList build() { + context.ContextOuterClass.ContextIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList buildPartial() { + context.ContextOuterClass.ContextIdList result = new context.ContextOuterClass.ContextIdList(this); + int from_bitField0_ = bitField0_; + if (contextIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + contextIds_ = java.util.Collections.unmodifiableList(contextIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.contextIds_ = contextIds_; + } else { + result.contextIds_ = contextIdsBuilder_.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 context.ContextOuterClass.ContextIdList) { + return mergeFrom((context.ContextOuterClass.ContextIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextIdList other) { + if (other == context.ContextOuterClass.ContextIdList.getDefaultInstance()) return this; + if (contextIdsBuilder_ == null) { + if (!other.contextIds_.isEmpty()) { + if (contextIds_.isEmpty()) { + contextIds_ = other.contextIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureContextIdsIsMutable(); + contextIds_.addAll(other.contextIds_); + } + onChanged(); + } + } else { + if (!other.contextIds_.isEmpty()) { + if (contextIdsBuilder_.isEmpty()) { + contextIdsBuilder_.dispose(); + contextIdsBuilder_ = null; + contextIds_ = other.contextIds_; + bitField0_ = (bitField0_ & ~0x00000001); + contextIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getContextIdsFieldBuilder() : null; + } else { + contextIdsBuilder_.addAllMessages(other.contextIds_); + } + } + } + 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 { + context.ContextOuterClass.ContextIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List contextIds_ = + java.util.Collections.emptyList(); + private void ensureContextIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + contextIds_ = new java.util.ArrayList(contextIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdsBuilder_; + + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List getContextIdsList() { + if (contextIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contextIds_); + } else { + return contextIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public int getContextIdsCount() { + if (contextIdsBuilder_ == null) { + return contextIds_.size(); + } else { + return contextIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId getContextIds(int index) { + if (contextIdsBuilder_ == null) { + return contextIds_.get(index); + } else { + return contextIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder setContextIds( + int index, context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.set(index, value); + onChanged(); + } else { + contextIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder setContextIds( + int index, context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.set(index, builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds(context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.add(value); + onChanged(); + } else { + contextIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + int index, context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.add(index, value); + onChanged(); + } else { + contextIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.add(builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + int index, context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.add(index, builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addAllContextIds( + java.lang.Iterable values) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, contextIds_); + onChanged(); + } else { + contextIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder clearContextIds() { + if (contextIdsBuilder_ == null) { + contextIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + contextIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder removeContextIds(int index) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.remove(index); + onChanged(); + } else { + contextIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdsBuilder( + int index) { + return getContextIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index) { + if (contextIdsBuilder_ == null) { + return contextIds_.get(index); } else { + return contextIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List + getContextIdsOrBuilderList() { + if (contextIdsBuilder_ != null) { + return contextIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contextIds_); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder() { + return getContextIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ContextId.getDefaultInstance()); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder( + int index) { + return getContextIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ContextId.getDefaultInstance()); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List + getContextIdsBuilderList() { + return getContextIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdsFieldBuilder() { + if (contextIdsBuilder_ == null) { + contextIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + contextIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + contextIds_ = null; + } + return contextIdsBuilder_; + } + @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:context.ContextIdList) + } + + // @@protoc_insertion_point(class_scope:context.ContextIdList) + private static final context.ContextOuterClass.ContextIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextIdList(); + } + + public static context.ContextOuterClass.ContextIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextIdList(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 context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Context contexts = 1; + */ + java.util.List + getContextsList(); + /** + * repeated .context.Context contexts = 1; + */ + context.ContextOuterClass.Context getContexts(int index); + /** + * repeated .context.Context contexts = 1; + */ + int getContextsCount(); + /** + * repeated .context.Context contexts = 1; + */ + java.util.List + getContextsOrBuilderList(); + /** + * repeated .context.Context contexts = 1; + */ + context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ContextList} + */ + public static final class ContextList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextList) + ContextListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextList.newBuilder() to construct. + private ContextList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextList() { + contexts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextList( + 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)) { + contexts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + contexts_.add( + input.readMessage(context.ContextOuterClass.Context.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)) { + contexts_ = java.util.Collections.unmodifiableList(contexts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + } + + public static final int CONTEXTS_FIELD_NUMBER = 1; + private java.util.List contexts_; + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public java.util.List getContextsList() { + return contexts_; + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public java.util.List + getContextsOrBuilderList() { + return contexts_; + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public int getContextsCount() { + return contexts_.size(); + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Context getContexts(int index) { + return contexts_.get(index); + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index) { + return contexts_.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 < contexts_.size(); i++) { + output.writeMessage(1, contexts_.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 < contexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, contexts_.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 context.ContextOuterClass.ContextList)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextList other = (context.ContextOuterClass.ContextList) obj; + + if (!getContextsList() + .equals(other.getContextsList())) 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 (getContextsCount() > 0) { + hash = (37 * hash) + CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getContextsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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 context.ContextOuterClass.ContextList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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 context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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(context.ContextOuterClass.ContextList 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 context.ContextList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextList) + context.ContextOuterClass.ContextListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextsBuilder_ == null) { + contexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + contextsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextList getDefaultInstanceForType() { + return context.ContextOuterClass.ContextList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextList build() { + context.ContextOuterClass.ContextList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextList buildPartial() { + context.ContextOuterClass.ContextList result = new context.ContextOuterClass.ContextList(this); + int from_bitField0_ = bitField0_; + if (contextsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + contexts_ = java.util.Collections.unmodifiableList(contexts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.contexts_ = contexts_; + } else { + result.contexts_ = contextsBuilder_.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 context.ContextOuterClass.ContextList) { + return mergeFrom((context.ContextOuterClass.ContextList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextList other) { + if (other == context.ContextOuterClass.ContextList.getDefaultInstance()) return this; + if (contextsBuilder_ == null) { + if (!other.contexts_.isEmpty()) { + if (contexts_.isEmpty()) { + contexts_ = other.contexts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureContextsIsMutable(); + contexts_.addAll(other.contexts_); + } + onChanged(); + } + } else { + if (!other.contexts_.isEmpty()) { + if (contextsBuilder_.isEmpty()) { + contextsBuilder_.dispose(); + contextsBuilder_ = null; + contexts_ = other.contexts_; + bitField0_ = (bitField0_ & ~0x00000001); + contextsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getContextsFieldBuilder() : null; + } else { + contextsBuilder_.addAllMessages(other.contexts_); + } + } + } + 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 { + context.ContextOuterClass.ContextList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List contexts_ = + java.util.Collections.emptyList(); + private void ensureContextsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + contexts_ = new java.util.ArrayList(contexts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> contextsBuilder_; + + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List getContextsList() { + if (contextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contexts_); + } else { + return contextsBuilder_.getMessageList(); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public int getContextsCount() { + if (contextsBuilder_ == null) { + return contexts_.size(); + } else { + return contextsBuilder_.getCount(); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context getContexts(int index) { + if (contextsBuilder_ == null) { + return contexts_.get(index); + } else { + return contextsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder setContexts( + int index, context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.set(index, value); + onChanged(); + } else { + contextsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder setContexts( + int index, context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.set(index, builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts(context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.add(value); + onChanged(); + } else { + contextsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + int index, context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.add(index, value); + onChanged(); + } else { + contextsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.add(builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + int index, context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.add(index, builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addAllContexts( + java.lang.Iterable values) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, contexts_); + onChanged(); + } else { + contextsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder clearContexts() { + if (contextsBuilder_ == null) { + contexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + contextsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder removeContexts(int index) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.remove(index); + onChanged(); + } else { + contextsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder getContextsBuilder( + int index) { + return getContextsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index) { + if (contextsBuilder_ == null) { + return contexts_.get(index); } else { + return contextsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List + getContextsOrBuilderList() { + if (contextsBuilder_ != null) { + return contextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contexts_); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder addContextsBuilder() { + return getContextsFieldBuilder().addBuilder( + context.ContextOuterClass.Context.getDefaultInstance()); + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder addContextsBuilder( + int index) { + return getContextsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Context.getDefaultInstance()); + } + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List + getContextsBuilderList() { + return getContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> + getContextsFieldBuilder() { + if (contextsBuilder_ == null) { + contextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder>( + contexts_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + contexts_ = null; + } + return contextsBuilder_; + } + @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:context.ContextList) + } + + // @@protoc_insertion_point(class_scope:context.ContextList) + private static final context.ContextOuterClass.ContextList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextList(); + } + + public static context.ContextOuterClass.ContextList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextList(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 context.ContextOuterClass.ContextList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 2; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + } + /** + * Protobuf type {@code context.ContextEvent} + */ + public static final class ContextEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextEvent) + ContextEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextEvent.newBuilder() to construct. + private ContextEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = 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 context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (contextId_ != null) { + output.writeMessage(2, getContextId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getContextId()); + } + 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 context.ContextOuterClass.ContextEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextEvent other = (context.ContextOuterClass.ContextEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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 context.ContextOuterClass.ContextEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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 context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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(context.ContextOuterClass.ContextEvent 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 context.ContextEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextEvent) + context.ContextOuterClass.ContextEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ContextEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent build() { + context.ContextOuterClass.ContextEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent buildPartial() { + context.ContextOuterClass.ContextEvent result = new context.ContextOuterClass.ContextEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.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 context.ContextOuterClass.ContextEvent) { + return mergeFrom((context.ContextOuterClass.ContextEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextEvent other) { + if (other == context.ContextOuterClass.ContextEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + 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 { + context.ContextOuterClass.ContextEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 2; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 2; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + @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:context.ContextEvent) + } + + // @@protoc_insertion_point(class_scope:context.ContextEvent) + private static final context.ContextOuterClass.ContextEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextEvent(); + } + + public static context.ContextOuterClass.ContextEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextEvent(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 context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + boolean hasTopologyUuid(); + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + context.ContextOuterClass.Uuid getTopologyUuid(); + /** + * .context.Uuid topology_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder(); + } + /** + *
+   * ----- Topology ------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.TopologyId} + */ + public static final class TopologyId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyId) + TopologyIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyId.newBuilder() to construct. + private TopologyId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyId( + 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (topologyUuid_ != null) { + subBuilder = topologyUuid_.toBuilder(); + } + topologyUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyUuid_); + topologyUuid_ = 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 context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int TOPOLOGY_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid topologyUuid_; + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + @java.lang.Override + public boolean hasTopologyUuid() { + return topologyUuid_ != null; + } + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getTopologyUuid() { + return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } + /** + * .context.Uuid topology_uuid = 2; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { + return getTopologyUuid(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (topologyUuid_ != null) { + output.writeMessage(2, getTopologyUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + if (topologyUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTopologyUuid()); + } + 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 context.ContextOuterClass.TopologyId)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyId other = (context.ContextOuterClass.TopologyId) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasTopologyUuid() != other.hasTopologyUuid()) return false; + if (hasTopologyUuid()) { + if (!getTopologyUuid() + .equals(other.getTopologyUuid())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasTopologyUuid()) { + hash = (37 * hash) + TOPOLOGY_UUID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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(context.ContextOuterClass.TopologyId 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; + } + /** + *
+     * ----- Topology ------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.TopologyId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyId) + context.ContextOuterClass.TopologyIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyId.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 (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (topologyUuidBuilder_ == null) { + topologyUuid_ = null; + } else { + topologyUuid_ = null; + topologyUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId build() { + context.ContextOuterClass.TopologyId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId buildPartial() { + context.ContextOuterClass.TopologyId result = new context.ContextOuterClass.TopologyId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (topologyUuidBuilder_ == null) { + result.topologyUuid_ = topologyUuid_; + } else { + result.topologyUuid_ = topologyUuidBuilder_.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 context.ContextOuterClass.TopologyId) { + return mergeFrom((context.ContextOuterClass.TopologyId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyId other) { + if (other == context.ContextOuterClass.TopologyId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasTopologyUuid()) { + mergeTopologyUuid(other.getTopologyUuid()); + } + 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 { + context.ContextOuterClass.TopologyId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid topologyUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> topologyUuidBuilder_; + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + public boolean hasTopologyUuid() { + return topologyUuidBuilder_ != null || topologyUuid_ != null; + } + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + public context.ContextOuterClass.Uuid getTopologyUuid() { + if (topologyUuidBuilder_ == null) { + return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } else { + return topologyUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder setTopologyUuid(context.ContextOuterClass.Uuid value) { + if (topologyUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyUuid_ = value; + onChanged(); + } else { + topologyUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder setTopologyUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (topologyUuidBuilder_ == null) { + topologyUuid_ = builderForValue.build(); + onChanged(); + } else { + topologyUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder mergeTopologyUuid(context.ContextOuterClass.Uuid value) { + if (topologyUuidBuilder_ == null) { + if (topologyUuid_ != null) { + topologyUuid_ = + context.ContextOuterClass.Uuid.newBuilder(topologyUuid_).mergeFrom(value).buildPartial(); + } else { + topologyUuid_ = value; + } + onChanged(); + } else { + topologyUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder clearTopologyUuid() { + if (topologyUuidBuilder_ == null) { + topologyUuid_ = null; + onChanged(); + } else { + topologyUuid_ = null; + topologyUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public context.ContextOuterClass.Uuid.Builder getTopologyUuidBuilder() { + + onChanged(); + return getTopologyUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid topology_uuid = 2; + */ + public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { + if (topologyUuidBuilder_ != null) { + return topologyUuidBuilder_.getMessageOrBuilder(); + } else { + return topologyUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } + } + /** + * .context.Uuid topology_uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getTopologyUuidFieldBuilder() { + if (topologyUuidBuilder_ == null) { + topologyUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getTopologyUuid(), + getParentForChildren(), + isClean()); + topologyUuid_ = null; + } + return topologyUuidBuilder_; + } + @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:context.TopologyId) + } + + // @@protoc_insertion_point(class_scope:context.TopologyId) + private static final context.ContextOuterClass.TopologyId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyId(); + } + + public static context.ContextOuterClass.TopologyId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyId(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 context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Topology) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + boolean hasTopologyId(); + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + context.ContextOuterClass.TopologyId getTopologyId(); + /** + * .context.TopologyId topology_id = 1; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + + /** + * repeated .context.DeviceId device_ids = 2; + */ + java.util.List + getDeviceIdsList(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + context.ContextOuterClass.DeviceId getDeviceIds(int index); + /** + * repeated .context.DeviceId device_ids = 2; + */ + int getDeviceIdsCount(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + java.util.List + getDeviceIdsOrBuilderList(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index); + + /** + * repeated .context.LinkId link_ids = 3; + */ + java.util.List + getLinkIdsList(); + /** + * repeated .context.LinkId link_ids = 3; + */ + context.ContextOuterClass.LinkId getLinkIds(int index); + /** + * repeated .context.LinkId link_ids = 3; + */ + int getLinkIdsCount(); + /** + * repeated .context.LinkId link_ids = 3; + */ + java.util.List + getLinkIdsOrBuilderList(); + /** + * repeated .context.LinkId link_ids = 3; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Topology} + */ + public static final class Topology extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Topology) + TopologyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Topology.newBuilder() to construct. + private Topology(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Topology() { + deviceIds_ = java.util.Collections.emptyList(); + linkIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Topology(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Topology( + 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: { + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); + } + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyId_); + topologyId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceIds_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + linkIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + linkIds_.add( + input.readMessage(context.ContextOuterClass.LinkId.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)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + } + + public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.TopologyId topologyId_; + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + @java.lang.Override + public boolean hasTopologyId() { + return topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + /** + * .context.TopologyId topology_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); + } + + public static final int DEVICE_IDS_FIELD_NUMBER = 2; + private java.util.List deviceIds_; + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public java.util.List getDeviceIdsList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public java.util.List + getDeviceIdsOrBuilderList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public int getDeviceIdsCount() { + return deviceIds_.size(); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + return deviceIds_.get(index); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + return deviceIds_.get(index); + } + + public static final int LINK_IDS_FIELD_NUMBER = 3; + private java.util.List linkIds_; + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public java.util.List getLinkIdsList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public java.util.List + getLinkIdsOrBuilderList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public int getLinkIdsCount() { + return linkIds_.size(); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkIds(int index) { + return linkIds_.get(index); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + return linkIds_.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 (topologyId_ != null) { + output.writeMessage(1, getTopologyId()); + } + for (int i = 0; i < deviceIds_.size(); i++) { + output.writeMessage(2, deviceIds_.get(i)); + } + for (int i = 0; i < linkIds_.size(); i++) { + output.writeMessage(3, linkIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (topologyId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTopologyId()); + } + for (int i = 0; i < deviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, deviceIds_.get(i)); + } + for (int i = 0; i < linkIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, linkIds_.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 context.ContextOuterClass.Topology)) { + return super.equals(obj); + } + context.ContextOuterClass.Topology other = (context.ContextOuterClass.Topology) obj; + + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) return false; + } + if (!getDeviceIdsList() + .equals(other.getDeviceIdsList())) return false; + if (!getLinkIdsList() + .equals(other.getLinkIdsList())) 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 (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); + } + if (getDeviceIdsCount() > 0) { + hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceIdsList().hashCode(); + } + if (getLinkIdsCount() > 0) { + hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Topology parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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 context.ContextOuterClass.Topology parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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 context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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(context.ContextOuterClass.Topology 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 context.Topology} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Topology) + context.ContextOuterClass.TopologyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + } + + // Construct using context.ContextOuterClass.Topology.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceIdsFieldBuilder(); + getLinkIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologyIdBuilder_ == null) { + topologyId_ = null; + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + deviceIdsBuilder_.clear(); + } + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Topology getDefaultInstanceForType() { + return context.ContextOuterClass.Topology.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Topology build() { + context.ContextOuterClass.Topology result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Topology buildPartial() { + context.ContextOuterClass.Topology result = new context.ContextOuterClass.Topology(this); + int from_bitField0_ = bitField0_; + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; + } else { + result.topologyId_ = topologyIdBuilder_.build(); + } + if (deviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceIds_ = deviceIds_; + } else { + result.deviceIds_ = deviceIdsBuilder_.build(); + } + if (linkIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.linkIds_ = linkIds_; + } else { + result.linkIds_ = linkIdsBuilder_.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 context.ContextOuterClass.Topology) { + return mergeFrom((context.ContextOuterClass.Topology)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Topology other) { + if (other == context.ContextOuterClass.Topology.getDefaultInstance()) return this; + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); + } + if (deviceIdsBuilder_ == null) { + if (!other.deviceIds_.isEmpty()) { + if (deviceIds_.isEmpty()) { + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceIdsIsMutable(); + deviceIds_.addAll(other.deviceIds_); + } + onChanged(); + } + } else { + if (!other.deviceIds_.isEmpty()) { + if (deviceIdsBuilder_.isEmpty()) { + deviceIdsBuilder_.dispose(); + deviceIdsBuilder_ = null; + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceIdsFieldBuilder() : null; + } else { + deviceIdsBuilder_.addAllMessages(other.deviceIds_); + } + } + } + if (linkIdsBuilder_ == null) { + if (!other.linkIds_.isEmpty()) { + if (linkIds_.isEmpty()) { + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLinkIdsIsMutable(); + linkIds_.addAll(other.linkIds_); + } + onChanged(); + } + } else { + if (!other.linkIds_.isEmpty()) { + if (linkIdsBuilder_.isEmpty()) { + linkIdsBuilder_.dispose(); + linkIdsBuilder_ = null; + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000002); + linkIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkIdsFieldBuilder() : null; + } else { + linkIdsBuilder_.addAllMessages(other.linkIds_); + } + } + } + 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 { + context.ContextOuterClass.Topology parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Topology) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.TopologyId topologyId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } else { + return topologyIdBuilder_.getMessage(); + } + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyId_ = value; + onChanged(); + } else { + topologyIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); + onChanged(); + } else { + topologyIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); + } else { + topologyId_ = value; + } + onChanged(); + } else { + topologyIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; + onChanged(); + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { + + onChanged(); + return getTopologyIdFieldBuilder().getBuilder(); + } + /** + * .context.TopologyId topology_id = 1; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); + } else { + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + } + /** + * .context.TopologyId topology_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), + getParentForChildren(), + isClean()); + topologyId_ = null; + } + return topologyIdBuilder_; + } + + private java.util.List deviceIds_ = + java.util.Collections.emptyList(); + private void ensureDeviceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(deviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List getDeviceIdsList() { + if (deviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceIds_); + } else { + return deviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public int getDeviceIdsCount() { + if (deviceIdsBuilder_ == null) { + return deviceIds_.size(); + } else { + return deviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); + } else { + return deviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, value); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addAllDeviceIds( + java.lang.Iterable values) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceIds_); + onChanged(); + } else { + deviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder clearDeviceIds() { + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder removeDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.remove(index); + onChanged(); + } else { + deviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); } else { + return deviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List + getDeviceIdsOrBuilderList() { + if (deviceIdsBuilder_ != null) { + return deviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceIds_); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { + return getDeviceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List + getDeviceIdsBuilderList() { + return getDeviceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdsFieldBuilder() { + if (deviceIdsBuilder_ == null) { + deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceIds_ = null; + } + return deviceIdsBuilder_; + } + + private java.util.List linkIds_ = + java.util.Collections.emptyList(); + private void ensureLinkIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + linkIds_ = new java.util.ArrayList(linkIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List getLinkIdsList() { + if (linkIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkIds_); + } else { + return linkIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public int getLinkIdsCount() { + if (linkIdsBuilder_ == null) { + return linkIds_.size(); + } else { + return linkIdsBuilder_.getCount(); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId getLinkIds(int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); + } else { + return linkIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.set(index, value); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds(context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(index, value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addAllLinkIds( + java.lang.Iterable values) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkIds_); + onChanged(); + } else { + linkIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder clearLinkIds() { + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder removeLinkIds(int index) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.remove(index); + onChanged(); + } else { + linkIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); } else { + return linkIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List + getLinkIdsOrBuilderList() { + if (linkIdsBuilder_ != null) { + return linkIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkIds_); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { + return getLinkIdsFieldBuilder().addBuilder( + context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List + getLinkIdsBuilderList() { + return getLinkIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdsFieldBuilder() { + if (linkIdsBuilder_ == null) { + linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + linkIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + linkIds_ = null; + } + return linkIdsBuilder_; + } + @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:context.Topology) + } + + // @@protoc_insertion_point(class_scope:context.Topology) + private static final context.ContextOuterClass.Topology DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Topology(); + } + + public static context.ContextOuterClass.Topology getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Topology parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Topology(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 context.ContextOuterClass.Topology getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.TopologyId topology_ids = 1; + */ + java.util.List + getTopologyIdsList(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + context.ContextOuterClass.TopologyId getTopologyIds(int index); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + int getTopologyIdsCount(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + java.util.List + getTopologyIdsOrBuilderList(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.TopologyIdList} + */ + public static final class TopologyIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyIdList) + TopologyIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyIdList.newBuilder() to construct. + private TopologyIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyIdList() { + topologyIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyIdList( + 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)) { + topologyIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologyIds_.add( + input.readMessage(context.ContextOuterClass.TopologyId.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)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + } + + public static final int TOPOLOGY_IDS_FIELD_NUMBER = 1; + private java.util.List topologyIds_; + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public java.util.List getTopologyIdsList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public java.util.List + getTopologyIdsOrBuilderList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public int getTopologyIdsCount() { + return topologyIds_.size(); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + return topologyIds_.get(index); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + return topologyIds_.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 < topologyIds_.size(); i++) { + output.writeMessage(1, topologyIds_.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 < topologyIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, topologyIds_.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 context.ContextOuterClass.TopologyIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyIdList other = (context.ContextOuterClass.TopologyIdList) obj; + + if (!getTopologyIdsList() + .equals(other.getTopologyIdsList())) 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 (getTopologyIdsCount() > 0) { + hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTopologyIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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 context.ContextOuterClass.TopologyIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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 context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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(context.ContextOuterClass.TopologyIdList 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 context.TopologyIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyIdList) + context.ContextOuterClass.TopologyIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologyIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList build() { + context.ContextOuterClass.TopologyIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList buildPartial() { + context.ContextOuterClass.TopologyIdList result = new context.ContextOuterClass.TopologyIdList(this); + int from_bitField0_ = bitField0_; + if (topologyIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologyIds_ = topologyIds_; + } else { + result.topologyIds_ = topologyIdsBuilder_.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 context.ContextOuterClass.TopologyIdList) { + return mergeFrom((context.ContextOuterClass.TopologyIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyIdList other) { + if (other == context.ContextOuterClass.TopologyIdList.getDefaultInstance()) return this; + if (topologyIdsBuilder_ == null) { + if (!other.topologyIds_.isEmpty()) { + if (topologyIds_.isEmpty()) { + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologyIdsIsMutable(); + topologyIds_.addAll(other.topologyIds_); + } + onChanged(); + } + } else { + if (!other.topologyIds_.isEmpty()) { + if (topologyIdsBuilder_.isEmpty()) { + topologyIdsBuilder_.dispose(); + topologyIdsBuilder_ = null; + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + topologyIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologyIdsFieldBuilder() : null; + } else { + topologyIdsBuilder_.addAllMessages(other.topologyIds_); + } + } + } + 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 { + context.ContextOuterClass.TopologyIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List topologyIds_ = + java.util.Collections.emptyList(); + private void ensureTopologyIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(topologyIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List getTopologyIdsList() { + if (topologyIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologyIds_); + } else { + return topologyIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public int getTopologyIdsCount() { + if (topologyIdsBuilder_ == null) { + return topologyIds_.size(); + } else { + return topologyIdsBuilder_.getCount(); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); + } else { + return topologyIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, value); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addAllTopologyIds( + java.lang.Iterable values) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologyIds_); + onChanged(); + } else { + topologyIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder clearTopologyIds() { + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder removeTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.remove(index); + onChanged(); + } else { + topologyIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); } else { + return topologyIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List + getTopologyIdsOrBuilderList() { + if (topologyIdsBuilder_ != null) { + return topologyIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologyIds_); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { + return getTopologyIdsFieldBuilder().addBuilder( + context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List + getTopologyIdsBuilderList() { + return getTopologyIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdsFieldBuilder() { + if (topologyIdsBuilder_ == null) { + topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + topologyIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologyIds_ = null; + } + return topologyIdsBuilder_; + } + @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:context.TopologyIdList) + } + + // @@protoc_insertion_point(class_scope:context.TopologyIdList) + private static final context.ContextOuterClass.TopologyIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyIdList(); + } + + public static context.ContextOuterClass.TopologyIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyIdList(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 context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Topology topologies = 1; + */ + java.util.List + getTopologiesList(); + /** + * repeated .context.Topology topologies = 1; + */ + context.ContextOuterClass.Topology getTopologies(int index); + /** + * repeated .context.Topology topologies = 1; + */ + int getTopologiesCount(); + /** + * repeated .context.Topology topologies = 1; + */ + java.util.List + getTopologiesOrBuilderList(); + /** + * repeated .context.Topology topologies = 1; + */ + context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.TopologyList} + */ + public static final class TopologyList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyList) + TopologyListOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyList.newBuilder() to construct. + private TopologyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyList() { + topologies_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyList( + 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)) { + topologies_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologies_.add( + input.readMessage(context.ContextOuterClass.Topology.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)) { + topologies_ = java.util.Collections.unmodifiableList(topologies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + } + + public static final int TOPOLOGIES_FIELD_NUMBER = 1; + private java.util.List topologies_; + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public java.util.List getTopologiesList() { + return topologies_; + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public java.util.List + getTopologiesOrBuilderList() { + return topologies_; + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public int getTopologiesCount() { + return topologies_.size(); + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Topology getTopologies(int index) { + return topologies_.get(index); + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index) { + return topologies_.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 < topologies_.size(); i++) { + output.writeMessage(1, topologies_.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 < topologies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, topologies_.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 context.ContextOuterClass.TopologyList)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyList other = (context.ContextOuterClass.TopologyList) obj; + + if (!getTopologiesList() + .equals(other.getTopologiesList())) 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 (getTopologiesCount() > 0) { + hash = (37 * hash) + TOPOLOGIES_FIELD_NUMBER; + hash = (53 * hash) + getTopologiesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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 context.ContextOuterClass.TopologyList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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 context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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(context.ContextOuterClass.TopologyList 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 context.TopologyList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyList) + context.ContextOuterClass.TopologyListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologiesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologiesBuilder_ == null) { + topologies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologiesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList build() { + context.ContextOuterClass.TopologyList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList buildPartial() { + context.ContextOuterClass.TopologyList result = new context.ContextOuterClass.TopologyList(this); + int from_bitField0_ = bitField0_; + if (topologiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologies_ = java.util.Collections.unmodifiableList(topologies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologies_ = topologies_; + } else { + result.topologies_ = topologiesBuilder_.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 context.ContextOuterClass.TopologyList) { + return mergeFrom((context.ContextOuterClass.TopologyList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyList other) { + if (other == context.ContextOuterClass.TopologyList.getDefaultInstance()) return this; + if (topologiesBuilder_ == null) { + if (!other.topologies_.isEmpty()) { + if (topologies_.isEmpty()) { + topologies_ = other.topologies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologiesIsMutable(); + topologies_.addAll(other.topologies_); + } + onChanged(); + } + } else { + if (!other.topologies_.isEmpty()) { + if (topologiesBuilder_.isEmpty()) { + topologiesBuilder_.dispose(); + topologiesBuilder_ = null; + topologies_ = other.topologies_; + bitField0_ = (bitField0_ & ~0x00000001); + topologiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologiesFieldBuilder() : null; + } else { + topologiesBuilder_.addAllMessages(other.topologies_); + } + } + } + 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 { + context.ContextOuterClass.TopologyList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List topologies_ = + java.util.Collections.emptyList(); + private void ensureTopologiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologies_ = new java.util.ArrayList(topologies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> topologiesBuilder_; + + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List getTopologiesList() { + if (topologiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologies_); + } else { + return topologiesBuilder_.getMessageList(); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public int getTopologiesCount() { + if (topologiesBuilder_ == null) { + return topologies_.size(); + } else { + return topologiesBuilder_.getCount(); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology getTopologies(int index) { + if (topologiesBuilder_ == null) { + return topologies_.get(index); + } else { + return topologiesBuilder_.getMessage(index); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder setTopologies( + int index, context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.set(index, value); + onChanged(); + } else { + topologiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder setTopologies( + int index, context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.set(index, builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies(context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.add(value); + onChanged(); + } else { + topologiesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + int index, context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.add(index, value); + onChanged(); + } else { + topologiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.add(builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + int index, context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.add(index, builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addAllTopologies( + java.lang.Iterable values) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologies_); + onChanged(); + } else { + topologiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder clearTopologies() { + if (topologiesBuilder_ == null) { + topologies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologiesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder removeTopologies(int index) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.remove(index); + onChanged(); + } else { + topologiesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder getTopologiesBuilder( + int index) { + return getTopologiesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index) { + if (topologiesBuilder_ == null) { + return topologies_.get(index); } else { + return topologiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List + getTopologiesOrBuilderList() { + if (topologiesBuilder_ != null) { + return topologiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologies_); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder addTopologiesBuilder() { + return getTopologiesFieldBuilder().addBuilder( + context.ContextOuterClass.Topology.getDefaultInstance()); + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder addTopologiesBuilder( + int index) { + return getTopologiesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Topology.getDefaultInstance()); + } + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List + getTopologiesBuilderList() { + return getTopologiesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> + getTopologiesFieldBuilder() { + if (topologiesBuilder_ == null) { + topologiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder>( + topologies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologies_ = null; + } + return topologiesBuilder_; + } + @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:context.TopologyList) + } + + // @@protoc_insertion_point(class_scope:context.TopologyList) + private static final context.ContextOuterClass.TopologyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyList(); + } + + public static context.ContextOuterClass.TopologyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyList(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 context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + boolean hasTopologyId(); + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + context.ContextOuterClass.TopologyId getTopologyId(); + /** + * .context.TopologyId topology_id = 2; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + } + /** + * Protobuf type {@code context.TopologyEvent} + */ + public static final class TopologyEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyEvent) + TopologyEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyEvent.newBuilder() to construct. + private TopologyEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); + } + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyId_); + topologyId_ = 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 context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int TOPOLOGY_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.TopologyId topologyId_; + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + @java.lang.Override + public boolean hasTopologyId() { + return topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + /** + * .context.TopologyId topology_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (topologyId_ != null) { + output.writeMessage(2, getTopologyId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (topologyId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTopologyId()); + } + 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 context.ContextOuterClass.TopologyEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyEvent other = (context.ContextOuterClass.TopologyEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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 context.ContextOuterClass.TopologyEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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 context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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(context.ContextOuterClass.TopologyEvent 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 context.TopologyEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyEvent) + context.ContextOuterClass.TopologyEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (topologyIdBuilder_ == null) { + topologyId_ = null; + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent build() { + context.ContextOuterClass.TopologyEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent buildPartial() { + context.ContextOuterClass.TopologyEvent result = new context.ContextOuterClass.TopologyEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; + } else { + result.topologyId_ = topologyIdBuilder_.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 context.ContextOuterClass.TopologyEvent) { + return mergeFrom((context.ContextOuterClass.TopologyEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyEvent other) { + if (other == context.ContextOuterClass.TopologyEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); + } + 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 { + context.ContextOuterClass.TopologyEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.TopologyId topologyId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } else { + return topologyIdBuilder_.getMessage(); + } + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyId_ = value; + onChanged(); + } else { + topologyIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); + onChanged(); + } else { + topologyIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); + } else { + topologyId_ = value; + } + onChanged(); + } else { + topologyIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; + onChanged(); + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { + + onChanged(); + return getTopologyIdFieldBuilder().getBuilder(); + } + /** + * .context.TopologyId topology_id = 2; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); + } else { + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + } + /** + * .context.TopologyId topology_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), + getParentForChildren(), + isClean()); + topologyId_ = null; + } + return topologyIdBuilder_; + } + @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:context.TopologyEvent) + } + + // @@protoc_insertion_point(class_scope:context.TopologyEvent) + private static final context.ContextOuterClass.TopologyEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyEvent(); + } + + public static context.ContextOuterClass.TopologyEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyEvent(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 context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + boolean hasDeviceUuid(); + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + context.ContextOuterClass.Uuid getDeviceUuid(); + /** + * .context.Uuid device_uuid = 1; + */ + context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder(); + } + /** + *
+   * ----- Device --------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.DeviceId} + */ + public static final class DeviceId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceId) + DeviceIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceId.newBuilder() to construct. + private DeviceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (deviceUuid_ != null) { + subBuilder = deviceUuid_.toBuilder(); + } + deviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceUuid_); + deviceUuid_ = 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 context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + } + + public static final int DEVICE_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid deviceUuid_; + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + @java.lang.Override + public boolean hasDeviceUuid() { + return deviceUuid_ != null; + } + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getDeviceUuid() { + return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } + /** + * .context.Uuid device_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { + return getDeviceUuid(); + } + + 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 (deviceUuid_ != null) { + output.writeMessage(1, getDeviceUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deviceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDeviceUuid()); + } + 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 context.ContextOuterClass.DeviceId)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceId other = (context.ContextOuterClass.DeviceId) obj; + + if (hasDeviceUuid() != other.hasDeviceUuid()) return false; + if (hasDeviceUuid()) { + if (!getDeviceUuid() + .equals(other.getDeviceUuid())) 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 (hasDeviceUuid()) { + hash = (37 * hash) + DEVICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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 context.ContextOuterClass.DeviceId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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 context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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(context.ContextOuterClass.DeviceId 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; + } + /** + *
+     * ----- Device --------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.DeviceId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceId) + context.ContextOuterClass.DeviceIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceId.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 (deviceUuidBuilder_ == null) { + deviceUuid_ = null; + } else { + deviceUuid_ = null; + deviceUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId build() { + context.ContextOuterClass.DeviceId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId buildPartial() { + context.ContextOuterClass.DeviceId result = new context.ContextOuterClass.DeviceId(this); + if (deviceUuidBuilder_ == null) { + result.deviceUuid_ = deviceUuid_; + } else { + result.deviceUuid_ = deviceUuidBuilder_.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 context.ContextOuterClass.DeviceId) { + return mergeFrom((context.ContextOuterClass.DeviceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceId other) { + if (other == context.ContextOuterClass.DeviceId.getDefaultInstance()) return this; + if (other.hasDeviceUuid()) { + mergeDeviceUuid(other.getDeviceUuid()); + } + 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 { + context.ContextOuterClass.DeviceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid deviceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> deviceUuidBuilder_; + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + public boolean hasDeviceUuid() { + return deviceUuidBuilder_ != null || deviceUuid_ != null; + } + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + public context.ContextOuterClass.Uuid getDeviceUuid() { + if (deviceUuidBuilder_ == null) { + return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } else { + return deviceUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder setDeviceUuid(context.ContextOuterClass.Uuid value) { + if (deviceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceUuid_ = value; + onChanged(); + } else { + deviceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder setDeviceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (deviceUuidBuilder_ == null) { + deviceUuid_ = builderForValue.build(); + onChanged(); + } else { + deviceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder mergeDeviceUuid(context.ContextOuterClass.Uuid value) { + if (deviceUuidBuilder_ == null) { + if (deviceUuid_ != null) { + deviceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(deviceUuid_).mergeFrom(value).buildPartial(); + } else { + deviceUuid_ = value; + } + onChanged(); + } else { + deviceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder clearDeviceUuid() { + if (deviceUuidBuilder_ == null) { + deviceUuid_ = null; + onChanged(); + } else { + deviceUuid_ = null; + deviceUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getDeviceUuidBuilder() { + + onChanged(); + return getDeviceUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid device_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { + if (deviceUuidBuilder_ != null) { + return deviceUuidBuilder_.getMessageOrBuilder(); + } else { + return deviceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } + } + /** + * .context.Uuid device_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getDeviceUuidFieldBuilder() { + if (deviceUuidBuilder_ == null) { + deviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getDeviceUuid(), + getParentForChildren(), + isClean()); + deviceUuid_ = null; + } + return deviceUuidBuilder_; + } + @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:context.DeviceId) + } + + // @@protoc_insertion_point(class_scope:context.DeviceId) + private static final context.ContextOuterClass.DeviceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceId(); + } + + public static context.ContextOuterClass.DeviceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceId(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 context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Device) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 1; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * string device_type = 2; + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString + getDeviceTypeBytes(); + + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + boolean hasDeviceConfig(); + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + context.ContextOuterClass.DeviceConfig getDeviceConfig(); + /** + * .context.DeviceConfig device_config = 3; + */ + context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder(); + + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + int getDeviceOperationalStatusValue(); + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus(); + + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + java.util.List getDeviceDriversList(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + int getDeviceDriversCount(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + java.util.List + getDeviceDriversValueList(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + int getDeviceDriversValue(int index); + + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + java.util.List + getDeviceEndpointsList(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + context.ContextOuterClass.EndPoint getDeviceEndpoints(int index); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + int getDeviceEndpointsCount(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + java.util.List + getDeviceEndpointsOrBuilderList(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Device} + */ + public static final class Device extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Device) + DeviceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Device.newBuilder() to construct. + private Device(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Device() { + deviceType_ = ""; + deviceOperationalStatus_ = 0; + deviceDrivers_ = java.util.Collections.emptyList(); + deviceEndpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Device(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Device( + 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: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + deviceType_ = s; + break; + } + case 26: { + context.ContextOuterClass.DeviceConfig.Builder subBuilder = null; + if (deviceConfig_ != null) { + subBuilder = deviceConfig_.toBuilder(); + } + deviceConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceConfig_); + deviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + deviceOperationalStatus_ = rawValue; + break; + } + case 40: { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceDrivers_.add(rawValue); + break; + } + case 42: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceDrivers_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + deviceEndpoints_.add( + input.readMessage(context.ContextOuterClass.EndPoint.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)) { + deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); + } + + public static final int DEVICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object deviceType_; + /** + * string device_type = 2; + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_CONFIG_FIELD_NUMBER = 3; + private context.ContextOuterClass.DeviceConfig deviceConfig_; + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + @java.lang.Override + public boolean hasDeviceConfig() { + return deviceConfig_ != null; + } + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceConfig getDeviceConfig() { + return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } + /** + * .context.DeviceConfig device_config = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { + return getDeviceConfig(); + } + + public static final int DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER = 4; + private int deviceOperationalStatus_; + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + @java.lang.Override public int getDeviceOperationalStatusValue() { + return deviceOperationalStatus_; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + @java.lang.Override public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); + return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; + } + + public static final int DEVICE_DRIVERS_FIELD_NUMBER = 5; + private java.util.List deviceDrivers_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum> deviceDrivers_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>() { + public context.ContextOuterClass.DeviceDriverEnum convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceDriverEnum result = context.ContextOuterClass.DeviceDriverEnum.valueOf(from); + return result == null ? context.ContextOuterClass.DeviceDriverEnum.UNRECOGNIZED : result; + } + }; + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + @java.lang.Override + public java.util.List getDeviceDriversList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + @java.lang.Override + public int getDeviceDriversCount() { + return deviceDrivers_.size(); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { + return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + @java.lang.Override + public java.util.List + getDeviceDriversValueList() { + return deviceDrivers_; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + @java.lang.Override + public int getDeviceDriversValue(int index) { + return deviceDrivers_.get(index); + } + private int deviceDriversMemoizedSerializedSize; + + public static final int DEVICE_ENDPOINTS_FIELD_NUMBER = 6; + private java.util.List deviceEndpoints_; + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public java.util.List getDeviceEndpointsList() { + return deviceEndpoints_; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public java.util.List + getDeviceEndpointsOrBuilderList() { + return deviceEndpoints_; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public int getDeviceEndpointsCount() { + return deviceEndpoints_.size(); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { + return deviceEndpoints_.get(index); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index) { + return deviceEndpoints_.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 { + getSerializedSize(); + if (deviceId_ != null) { + output.writeMessage(1, getDeviceId()); + } + if (!getDeviceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); + } + if (deviceConfig_ != null) { + output.writeMessage(3, getDeviceConfig()); + } + if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { + output.writeEnum(4, deviceOperationalStatus_); + } + if (getDeviceDriversList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(deviceDriversMemoizedSerializedSize); + } + for (int i = 0; i < deviceDrivers_.size(); i++) { + output.writeEnumNoTag(deviceDrivers_.get(i)); + } + for (int i = 0; i < deviceEndpoints_.size(); i++) { + output.writeMessage(6, deviceEndpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDeviceId()); + } + if (!getDeviceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); + } + if (deviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDeviceConfig()); + } + if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, deviceOperationalStatus_); + } + { + int dataSize = 0; + for (int i = 0; i < deviceDrivers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(deviceDrivers_.get(i)); + } + size += dataSize; + if (!getDeviceDriversList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }deviceDriversMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < deviceEndpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, deviceEndpoints_.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 context.ContextOuterClass.Device)) { + return super.equals(obj); + } + context.ContextOuterClass.Device other = (context.ContextOuterClass.Device) obj; + + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (!getDeviceType() + .equals(other.getDeviceType())) return false; + if (hasDeviceConfig() != other.hasDeviceConfig()) return false; + if (hasDeviceConfig()) { + if (!getDeviceConfig() + .equals(other.getDeviceConfig())) return false; + } + if (deviceOperationalStatus_ != other.deviceOperationalStatus_) return false; + if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; + if (!getDeviceEndpointsList() + .equals(other.getDeviceEndpointsList())) 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 (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + if (hasDeviceConfig()) { + hash = (37 * hash) + DEVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDeviceConfig().hashCode(); + } + hash = (37 * hash) + DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER; + hash = (53 * hash) + deviceOperationalStatus_; + if (getDeviceDriversCount() > 0) { + hash = (37 * hash) + DEVICE_DRIVERS_FIELD_NUMBER; + hash = (53 * hash) + deviceDrivers_.hashCode(); + } + if (getDeviceEndpointsCount() > 0) { + hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceEndpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Device parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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 context.ContextOuterClass.Device parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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 context.ContextOuterClass.Device parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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(context.ContextOuterClass.Device 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 context.Device} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Device) + context.ContextOuterClass.DeviceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); + } + + // Construct using context.ContextOuterClass.Device.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceEndpointsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + deviceType_ = ""; + + if (deviceConfigBuilder_ == null) { + deviceConfig_ = null; + } else { + deviceConfig_ = null; + deviceConfigBuilder_ = null; + } + deviceOperationalStatus_ = 0; + + deviceDrivers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (deviceEndpointsBuilder_ == null) { + deviceEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + deviceEndpointsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Device getDefaultInstanceForType() { + return context.ContextOuterClass.Device.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Device build() { + context.ContextOuterClass.Device result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Device buildPartial() { + context.ContextOuterClass.Device result = new context.ContextOuterClass.Device(this); + int from_bitField0_ = bitField0_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + result.deviceType_ = deviceType_; + if (deviceConfigBuilder_ == null) { + result.deviceConfig_ = deviceConfig_; + } else { + result.deviceConfig_ = deviceConfigBuilder_.build(); + } + result.deviceOperationalStatus_ = deviceOperationalStatus_; + if (((bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceDrivers_ = deviceDrivers_; + if (deviceEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.deviceEndpoints_ = deviceEndpoints_; + } else { + result.deviceEndpoints_ = deviceEndpointsBuilder_.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 context.ContextOuterClass.Device) { + return mergeFrom((context.ContextOuterClass.Device)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Device other) { + if (other == context.ContextOuterClass.Device.getDefaultInstance()) return this; + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + onChanged(); + } + if (other.hasDeviceConfig()) { + mergeDeviceConfig(other.getDeviceConfig()); + } + if (other.deviceOperationalStatus_ != 0) { + setDeviceOperationalStatusValue(other.getDeviceOperationalStatusValue()); + } + if (!other.deviceDrivers_.isEmpty()) { + if (deviceDrivers_.isEmpty()) { + deviceDrivers_ = other.deviceDrivers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceDriversIsMutable(); + deviceDrivers_.addAll(other.deviceDrivers_); + } + onChanged(); + } + if (deviceEndpointsBuilder_ == null) { + if (!other.deviceEndpoints_.isEmpty()) { + if (deviceEndpoints_.isEmpty()) { + deviceEndpoints_ = other.deviceEndpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.addAll(other.deviceEndpoints_); + } + onChanged(); + } + } else { + if (!other.deviceEndpoints_.isEmpty()) { + if (deviceEndpointsBuilder_.isEmpty()) { + deviceEndpointsBuilder_.dispose(); + deviceEndpointsBuilder_ = null; + deviceEndpoints_ = other.deviceEndpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + deviceEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceEndpointsFieldBuilder() : null; + } else { + deviceEndpointsBuilder_.addAllMessages(other.deviceEndpoints_); + } + } + } + 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 { + context.ContextOuterClass.Device parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Device) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 1; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private java.lang.Object deviceType_ = ""; + /** + * string device_type = 2; + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string device_type = 2; + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceType_ = value; + onChanged(); + return this; + } + /** + * string device_type = 2; + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + + deviceType_ = getDefaultInstance().getDeviceType(); + onChanged(); + return this; + } + /** + * string device_type = 2; + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceType_ = value; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceConfig deviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> deviceConfigBuilder_; + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + public boolean hasDeviceConfig() { + return deviceConfigBuilder_ != null || deviceConfig_ != null; + } + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + public context.ContextOuterClass.DeviceConfig getDeviceConfig() { + if (deviceConfigBuilder_ == null) { + return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } else { + return deviceConfigBuilder_.getMessage(); + } + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder setDeviceConfig(context.ContextOuterClass.DeviceConfig value) { + if (deviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceConfig_ = value; + onChanged(); + } else { + deviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder setDeviceConfig( + context.ContextOuterClass.DeviceConfig.Builder builderForValue) { + if (deviceConfigBuilder_ == null) { + deviceConfig_ = builderForValue.build(); + onChanged(); + } else { + deviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder mergeDeviceConfig(context.ContextOuterClass.DeviceConfig value) { + if (deviceConfigBuilder_ == null) { + if (deviceConfig_ != null) { + deviceConfig_ = + context.ContextOuterClass.DeviceConfig.newBuilder(deviceConfig_).mergeFrom(value).buildPartial(); + } else { + deviceConfig_ = value; + } + onChanged(); + } else { + deviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder clearDeviceConfig() { + if (deviceConfigBuilder_ == null) { + deviceConfig_ = null; + onChanged(); + } else { + deviceConfig_ = null; + deviceConfigBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public context.ContextOuterClass.DeviceConfig.Builder getDeviceConfigBuilder() { + + onChanged(); + return getDeviceConfigFieldBuilder().getBuilder(); + } + /** + * .context.DeviceConfig device_config = 3; + */ + public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { + if (deviceConfigBuilder_ != null) { + return deviceConfigBuilder_.getMessageOrBuilder(); + } else { + return deviceConfig_ == null ? + context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } + } + /** + * .context.DeviceConfig device_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> + getDeviceConfigFieldBuilder() { + if (deviceConfigBuilder_ == null) { + deviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>( + getDeviceConfig(), + getParentForChildren(), + isClean()); + deviceConfig_ = null; + } + return deviceConfigBuilder_; + } + + private int deviceOperationalStatus_ = 0; + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + @java.lang.Override public int getDeviceOperationalStatusValue() { + return deviceOperationalStatus_; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @param value The enum numeric value on the wire for deviceOperationalStatus to set. + * @return This builder for chaining. + */ + public Builder setDeviceOperationalStatusValue(int value) { + + deviceOperationalStatus_ = value; + onChanged(); + return this; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); + return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @param value The deviceOperationalStatus to set. + * @return This builder for chaining. + */ + public Builder setDeviceOperationalStatus(context.ContextOuterClass.DeviceOperationalStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceOperationalStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceOperationalStatus() { + + deviceOperationalStatus_ = 0; + onChanged(); + return this; + } + + private java.util.List deviceDrivers_ = + java.util.Collections.emptyList(); + private void ensureDeviceDriversIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(deviceDrivers_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + public java.util.List getDeviceDriversList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + public int getDeviceDriversCount() { + return deviceDrivers_.size(); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { + return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index to set the value at. + * @param value The deviceDrivers to set. + * @return This builder for chaining. + */ + public Builder setDeviceDrivers( + int index, context.ContextOuterClass.DeviceDriverEnum value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceDriversIsMutable(); + deviceDrivers_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param value The deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addDeviceDrivers(context.ContextOuterClass.DeviceDriverEnum value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceDriversIsMutable(); + deviceDrivers_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param values The deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceDrivers( + java.lang.Iterable values) { + ensureDeviceDriversIsMutable(); + for (context.ContextOuterClass.DeviceDriverEnum value : values) { + deviceDrivers_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return This builder for chaining. + */ + public Builder clearDeviceDrivers() { + deviceDrivers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + public java.util.List + getDeviceDriversValueList() { + return java.util.Collections.unmodifiableList(deviceDrivers_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + public int getDeviceDriversValue(int index) { + return deviceDrivers_.get(index); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + * @return This builder for chaining. + */ + public Builder setDeviceDriversValue( + int index, int value) { + ensureDeviceDriversIsMutable(); + deviceDrivers_.set(index, value); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param value The enum numeric value on the wire for deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addDeviceDriversValue(int value) { + ensureDeviceDriversIsMutable(); + deviceDrivers_.add(value); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param values The enum numeric values on the wire for deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceDriversValue( + java.lang.Iterable values) { + ensureDeviceDriversIsMutable(); + for (int value : values) { + deviceDrivers_.add(value); + } + onChanged(); + return this; + } + + private java.util.List deviceEndpoints_ = + java.util.Collections.emptyList(); + private void ensureDeviceEndpointsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = new java.util.ArrayList(deviceEndpoints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> deviceEndpointsBuilder_; + + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List getDeviceEndpointsList() { + if (deviceEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceEndpoints_); + } else { + return deviceEndpointsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public int getDeviceEndpointsCount() { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.size(); + } else { + return deviceEndpointsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.get(index); + } else { + return deviceEndpointsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder setDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.set(index, value); + onChanged(); + } else { + deviceEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder setDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints(context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(value); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(index, value); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addAllDeviceEndpoints( + java.lang.Iterable values) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceEndpoints_); + onChanged(); + } else { + deviceEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder clearDeviceEndpoints() { + if (deviceEndpointsBuilder_ == null) { + deviceEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + deviceEndpointsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder removeDeviceEndpoints(int index) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.remove(index); + onChanged(); + } else { + deviceEndpointsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder getDeviceEndpointsBuilder( + int index) { + return getDeviceEndpointsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index) { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.get(index); } else { + return deviceEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List + getDeviceEndpointsOrBuilderList() { + if (deviceEndpointsBuilder_ != null) { + return deviceEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceEndpoints_); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder() { + return getDeviceEndpointsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPoint.getDefaultInstance()); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder( + int index) { + return getDeviceEndpointsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPoint.getDefaultInstance()); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List + getDeviceEndpointsBuilderList() { + return getDeviceEndpointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> + getDeviceEndpointsFieldBuilder() { + if (deviceEndpointsBuilder_ == null) { + deviceEndpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder>( + deviceEndpoints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + deviceEndpoints_ = null; + } + return deviceEndpointsBuilder_; + } + @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:context.Device) + } + + // @@protoc_insertion_point(class_scope:context.Device) + private static final context.ContextOuterClass.Device DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Device(); + } + + public static context.ContextOuterClass.Device getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Device parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Device(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 context.ContextOuterClass.Device getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRule getConfigRules(int index); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + int getConfigRulesCount(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesOrBuilderList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceConfig} + */ + public static final class DeviceConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceConfig) + DeviceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceConfig.newBuilder() to construct. + private DeviceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceConfig() { + configRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceConfig( + 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)) { + configRules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.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)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + } + + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List getConfigRulesList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public int getConfigRulesCount() { + return configRules_.size(); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + return configRules_.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 < configRules_.size(); i++) { + output.writeMessage(1, configRules_.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 < configRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configRules_.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 context.ContextOuterClass.DeviceConfig)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceConfig other = (context.ContextOuterClass.DeviceConfig) obj; + + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) 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 (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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 context.ContextOuterClass.DeviceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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 context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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(context.ContextOuterClass.DeviceConfig 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 context.DeviceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceConfig) + context.ContextOuterClass.DeviceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getConfigRulesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + configRulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceConfig.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig build() { + context.ContextOuterClass.DeviceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig buildPartial() { + context.ContextOuterClass.DeviceConfig result = new context.ContextOuterClass.DeviceConfig(this); + int from_bitField0_ = bitField0_; + if (configRulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configRules_ = configRules_; + } else { + result.configRules_ = configRulesBuilder_.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 context.ContextOuterClass.DeviceConfig) { + return mergeFrom((context.ContextOuterClass.DeviceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceConfig other) { + if (other == context.ContextOuterClass.DeviceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); + } + onChanged(); + } + } else { + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + configRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfigRulesFieldBuilder() : null; + } else { + configRulesBuilder_.addAllMessages(other.configRules_); + } + } + } + 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 { + context.ContextOuterClass.DeviceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List configRules_ = + java.util.Collections.emptyList(); + private void ensureConfigRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configRules_ = new java.util.ArrayList(configRules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); + } else { + return configRulesBuilder_.getMessageList(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); + } else { + return configRulesBuilder_.getCount(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); + } else { + return configRulesBuilder_.getMessage(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.set(index, value); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(value); + onChanged(); + } else { + configRulesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(index, value); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configRules_); + onChanged(); + } else { + configRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configRulesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); + onChanged(); + } else { + configRulesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configRules_); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configRules_ = null; + } + return configRulesBuilder_; + } + @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:context.DeviceConfig) + } + + // @@protoc_insertion_point(class_scope:context.DeviceConfig) + private static final context.ContextOuterClass.DeviceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceConfig(); + } + + public static context.ContextOuterClass.DeviceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceConfig(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 context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.DeviceId device_ids = 1; + */ + java.util.List + getDeviceIdsList(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + context.ContextOuterClass.DeviceId getDeviceIds(int index); + /** + * repeated .context.DeviceId device_ids = 1; + */ + int getDeviceIdsCount(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + java.util.List + getDeviceIdsOrBuilderList(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceIdList} + */ + public static final class DeviceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceIdList) + DeviceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceIdList.newBuilder() to construct. + private DeviceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceIdList() { + deviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceIdList( + 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)) { + deviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceIds_.add( + input.readMessage(context.ContextOuterClass.DeviceId.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)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + } + + public static final int DEVICE_IDS_FIELD_NUMBER = 1; + private java.util.List deviceIds_; + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public java.util.List getDeviceIdsList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public java.util.List + getDeviceIdsOrBuilderList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public int getDeviceIdsCount() { + return deviceIds_.size(); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + return deviceIds_.get(index); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + return deviceIds_.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 < deviceIds_.size(); i++) { + output.writeMessage(1, deviceIds_.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 < deviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, deviceIds_.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 context.ContextOuterClass.DeviceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceIdList other = (context.ContextOuterClass.DeviceIdList) obj; + + if (!getDeviceIdsList() + .equals(other.getDeviceIdsList())) 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 (getDeviceIdsCount() > 0) { + hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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 context.ContextOuterClass.DeviceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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 context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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(context.ContextOuterClass.DeviceIdList 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 context.DeviceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceIdList) + context.ContextOuterClass.DeviceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList build() { + context.ContextOuterClass.DeviceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList buildPartial() { + context.ContextOuterClass.DeviceIdList result = new context.ContextOuterClass.DeviceIdList(this); + int from_bitField0_ = bitField0_; + if (deviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceIds_ = deviceIds_; + } else { + result.deviceIds_ = deviceIdsBuilder_.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 context.ContextOuterClass.DeviceIdList) { + return mergeFrom((context.ContextOuterClass.DeviceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceIdList other) { + if (other == context.ContextOuterClass.DeviceIdList.getDefaultInstance()) return this; + if (deviceIdsBuilder_ == null) { + if (!other.deviceIds_.isEmpty()) { + if (deviceIds_.isEmpty()) { + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceIdsIsMutable(); + deviceIds_.addAll(other.deviceIds_); + } + onChanged(); + } + } else { + if (!other.deviceIds_.isEmpty()) { + if (deviceIdsBuilder_.isEmpty()) { + deviceIdsBuilder_.dispose(); + deviceIdsBuilder_ = null; + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceIdsFieldBuilder() : null; + } else { + deviceIdsBuilder_.addAllMessages(other.deviceIds_); + } + } + } + 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 { + context.ContextOuterClass.DeviceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List deviceIds_ = + java.util.Collections.emptyList(); + private void ensureDeviceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(deviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List getDeviceIdsList() { + if (deviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceIds_); + } else { + return deviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public int getDeviceIdsCount() { + if (deviceIdsBuilder_ == null) { + return deviceIds_.size(); + } else { + return deviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); + } else { + return deviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, value); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addAllDeviceIds( + java.lang.Iterable values) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceIds_); + onChanged(); + } else { + deviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder clearDeviceIds() { + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder removeDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.remove(index); + onChanged(); + } else { + deviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); } else { + return deviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List + getDeviceIdsOrBuilderList() { + if (deviceIdsBuilder_ != null) { + return deviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceIds_); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { + return getDeviceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List + getDeviceIdsBuilderList() { + return getDeviceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdsFieldBuilder() { + if (deviceIdsBuilder_ == null) { + deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceIds_ = null; + } + return deviceIdsBuilder_; + } + @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:context.DeviceIdList) + } + + // @@protoc_insertion_point(class_scope:context.DeviceIdList) + private static final context.ContextOuterClass.DeviceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceIdList(); + } + + public static context.ContextOuterClass.DeviceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceIdList(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 context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Device devices = 1; + */ + java.util.List + getDevicesList(); + /** + * repeated .context.Device devices = 1; + */ + context.ContextOuterClass.Device getDevices(int index); + /** + * repeated .context.Device devices = 1; + */ + int getDevicesCount(); + /** + * repeated .context.Device devices = 1; + */ + java.util.List + getDevicesOrBuilderList(); + /** + * repeated .context.Device devices = 1; + */ + context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceList} + */ + public static final class DeviceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceList) + DeviceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceList.newBuilder() to construct. + private DeviceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceList() { + devices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceList( + 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)) { + devices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + devices_.add( + input.readMessage(context.ContextOuterClass.Device.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)) { + devices_ = java.util.Collections.unmodifiableList(devices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + } + + public static final int DEVICES_FIELD_NUMBER = 1; + private java.util.List devices_; + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public java.util.List getDevicesList() { + return devices_; + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public java.util.List + getDevicesOrBuilderList() { + return devices_; + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public int getDevicesCount() { + return devices_.size(); + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Device getDevices(int index) { + return devices_.get(index); + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index) { + return devices_.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 < devices_.size(); i++) { + output.writeMessage(1, devices_.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 < devices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, devices_.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 context.ContextOuterClass.DeviceList)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceList other = (context.ContextOuterClass.DeviceList) obj; + + if (!getDevicesList() + .equals(other.getDevicesList())) 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 (getDevicesCount() > 0) { + hash = (37 * hash) + DEVICES_FIELD_NUMBER; + hash = (53 * hash) + getDevicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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 context.ContextOuterClass.DeviceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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 context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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(context.ContextOuterClass.DeviceList 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 context.DeviceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceList) + context.ContextOuterClass.DeviceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDevicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (devicesBuilder_ == null) { + devices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + devicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList build() { + context.ContextOuterClass.DeviceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList buildPartial() { + context.ContextOuterClass.DeviceList result = new context.ContextOuterClass.DeviceList(this); + int from_bitField0_ = bitField0_; + if (devicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + devices_ = java.util.Collections.unmodifiableList(devices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.devices_ = devices_; + } else { + result.devices_ = devicesBuilder_.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 context.ContextOuterClass.DeviceList) { + return mergeFrom((context.ContextOuterClass.DeviceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceList other) { + if (other == context.ContextOuterClass.DeviceList.getDefaultInstance()) return this; + if (devicesBuilder_ == null) { + if (!other.devices_.isEmpty()) { + if (devices_.isEmpty()) { + devices_ = other.devices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDevicesIsMutable(); + devices_.addAll(other.devices_); + } + onChanged(); + } + } else { + if (!other.devices_.isEmpty()) { + if (devicesBuilder_.isEmpty()) { + devicesBuilder_.dispose(); + devicesBuilder_ = null; + devices_ = other.devices_; + bitField0_ = (bitField0_ & ~0x00000001); + devicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDevicesFieldBuilder() : null; + } else { + devicesBuilder_.addAllMessages(other.devices_); + } + } + } + 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 { + context.ContextOuterClass.DeviceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List devices_ = + java.util.Collections.emptyList(); + private void ensureDevicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + devices_ = new java.util.ArrayList(devices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> devicesBuilder_; + + /** + * repeated .context.Device devices = 1; + */ + public java.util.List getDevicesList() { + if (devicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(devices_); + } else { + return devicesBuilder_.getMessageList(); + } + } + /** + * repeated .context.Device devices = 1; + */ + public int getDevicesCount() { + if (devicesBuilder_ == null) { + return devices_.size(); + } else { + return devicesBuilder_.getCount(); + } + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device getDevices(int index) { + if (devicesBuilder_ == null) { + return devices_.get(index); + } else { + return devicesBuilder_.getMessage(index); + } + } + /** + * repeated .context.Device devices = 1; + */ + public Builder setDevices( + int index, context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.set(index, value); + onChanged(); + } else { + devicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder setDevices( + int index, context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.set(index, builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices(context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.add(value); + onChanged(); + } else { + devicesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + int index, context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.add(index, value); + onChanged(); + } else { + devicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.add(builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + int index, context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.add(index, builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addAllDevices( + java.lang.Iterable values) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, devices_); + onChanged(); + } else { + devicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder clearDevices() { + if (devicesBuilder_ == null) { + devices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + devicesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder removeDevices(int index) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.remove(index); + onChanged(); + } else { + devicesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder getDevicesBuilder( + int index) { + return getDevicesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index) { + if (devicesBuilder_ == null) { + return devices_.get(index); } else { + return devicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Device devices = 1; + */ + public java.util.List + getDevicesOrBuilderList() { + if (devicesBuilder_ != null) { + return devicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(devices_); + } + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder addDevicesBuilder() { + return getDevicesFieldBuilder().addBuilder( + context.ContextOuterClass.Device.getDefaultInstance()); + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder addDevicesBuilder( + int index) { + return getDevicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Device.getDefaultInstance()); + } + /** + * repeated .context.Device devices = 1; + */ + public java.util.List + getDevicesBuilderList() { + return getDevicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> + getDevicesFieldBuilder() { + if (devicesBuilder_ == null) { + devicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder>( + devices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + devices_ = null; + } + return devicesBuilder_; + } + @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:context.DeviceList) + } + + // @@protoc_insertion_point(class_scope:context.DeviceList) + private static final context.ContextOuterClass.DeviceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceList(); + } + + public static context.ContextOuterClass.DeviceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceList(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 context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 2; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + } + /** + * Protobuf type {@code context.DeviceEvent} + */ + public static final class DeviceEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceEvent) + DeviceEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceEvent.newBuilder() to construct. + private DeviceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = 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 context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int DEVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (deviceId_ != null) { + output.writeMessage(2, getDeviceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDeviceId()); + } + 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 context.ContextOuterClass.DeviceEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceEvent other = (context.ContextOuterClass.DeviceEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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 context.ContextOuterClass.DeviceEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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 context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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(context.ContextOuterClass.DeviceEvent 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 context.DeviceEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceEvent) + context.ContextOuterClass.DeviceEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent build() { + context.ContextOuterClass.DeviceEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent buildPartial() { + context.ContextOuterClass.DeviceEvent result = new context.ContextOuterClass.DeviceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.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 context.ContextOuterClass.DeviceEvent) { + return mergeFrom((context.ContextOuterClass.DeviceEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceEvent other) { + if (other == context.ContextOuterClass.DeviceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + 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 { + context.ContextOuterClass.DeviceEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + @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:context.DeviceEvent) + } + + // @@protoc_insertion_point(class_scope:context.DeviceEvent) + private static final context.ContextOuterClass.DeviceEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceEvent(); + } + + public static context.ContextOuterClass.DeviceEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceEvent(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 context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + boolean hasLinkUuid(); + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + context.ContextOuterClass.Uuid getLinkUuid(); + /** + * .context.Uuid link_uuid = 1; + */ + context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder(); + } + /** + *
+   * ----- Link ----------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.LinkId} + */ + public static final class LinkId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkId) + LinkIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkId.newBuilder() to construct. + private LinkId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (linkUuid_ != null) { + subBuilder = linkUuid_.toBuilder(); + } + linkUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkUuid_); + linkUuid_ = 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 context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + } + + public static final int LINK_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid linkUuid_; + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + @java.lang.Override + public boolean hasLinkUuid() { + return linkUuid_ != null; + } + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getLinkUuid() { + return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } + /** + * .context.Uuid link_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { + return getLinkUuid(); + } + + 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 (linkUuid_ != null) { + output.writeMessage(1, getLinkUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (linkUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLinkUuid()); + } + 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 context.ContextOuterClass.LinkId)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkId other = (context.ContextOuterClass.LinkId) obj; + + if (hasLinkUuid() != other.hasLinkUuid()) return false; + if (hasLinkUuid()) { + if (!getLinkUuid() + .equals(other.getLinkUuid())) 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 (hasLinkUuid()) { + hash = (37 * hash) + LINK_UUID_FIELD_NUMBER; + hash = (53 * hash) + getLinkUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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 context.ContextOuterClass.LinkId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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 context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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(context.ContextOuterClass.LinkId 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; + } + /** + *
+     * ----- Link ----------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.LinkId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkId) + context.ContextOuterClass.LinkIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkId.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 (linkUuidBuilder_ == null) { + linkUuid_ = null; + } else { + linkUuid_ = null; + linkUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkId getDefaultInstanceForType() { + return context.ContextOuterClass.LinkId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkId build() { + context.ContextOuterClass.LinkId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkId buildPartial() { + context.ContextOuterClass.LinkId result = new context.ContextOuterClass.LinkId(this); + if (linkUuidBuilder_ == null) { + result.linkUuid_ = linkUuid_; + } else { + result.linkUuid_ = linkUuidBuilder_.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 context.ContextOuterClass.LinkId) { + return mergeFrom((context.ContextOuterClass.LinkId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkId other) { + if (other == context.ContextOuterClass.LinkId.getDefaultInstance()) return this; + if (other.hasLinkUuid()) { + mergeLinkUuid(other.getLinkUuid()); + } + 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 { + context.ContextOuterClass.LinkId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid linkUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> linkUuidBuilder_; + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + public boolean hasLinkUuid() { + return linkUuidBuilder_ != null || linkUuid_ != null; + } + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + public context.ContextOuterClass.Uuid getLinkUuid() { + if (linkUuidBuilder_ == null) { + return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } else { + return linkUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder setLinkUuid(context.ContextOuterClass.Uuid value) { + if (linkUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkUuid_ = value; + onChanged(); + } else { + linkUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder setLinkUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (linkUuidBuilder_ == null) { + linkUuid_ = builderForValue.build(); + onChanged(); + } else { + linkUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder mergeLinkUuid(context.ContextOuterClass.Uuid value) { + if (linkUuidBuilder_ == null) { + if (linkUuid_ != null) { + linkUuid_ = + context.ContextOuterClass.Uuid.newBuilder(linkUuid_).mergeFrom(value).buildPartial(); + } else { + linkUuid_ = value; + } + onChanged(); + } else { + linkUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder clearLinkUuid() { + if (linkUuidBuilder_ == null) { + linkUuid_ = null; + onChanged(); + } else { + linkUuid_ = null; + linkUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getLinkUuidBuilder() { + + onChanged(); + return getLinkUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid link_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { + if (linkUuidBuilder_ != null) { + return linkUuidBuilder_.getMessageOrBuilder(); + } else { + return linkUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } + } + /** + * .context.Uuid link_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getLinkUuidFieldBuilder() { + if (linkUuidBuilder_ == null) { + linkUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getLinkUuid(), + getParentForChildren(), + isClean()); + linkUuid_ = null; + } + return linkUuidBuilder_; + } + @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:context.LinkId) + } + + // @@protoc_insertion_point(class_scope:context.LinkId) + private static final context.ContextOuterClass.LinkId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkId(); + } + + public static context.ContextOuterClass.LinkId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkId(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 context.ContextOuterClass.LinkId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Link) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + boolean hasLinkId(); + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + context.ContextOuterClass.LinkId getLinkId(); + /** + * .context.LinkId link_id = 1; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + java.util.List + getLinkEndpointIdsList(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointId getLinkEndpointIds(int index); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + int getLinkEndpointIdsCount(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + java.util.List + getLinkEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Link} + */ + public static final class Link extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Link) + LinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use Link.newBuilder() to construct. + private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Link() { + linkEndpointIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Link(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Link( + 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: { + context.ContextOuterClass.LinkId.Builder subBuilder = null; + if (linkId_ != null) { + subBuilder = linkId_.toBuilder(); + } + linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkId_); + linkId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + linkEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.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)) { + linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + } + + public static final int LINK_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.LinkId linkId_; + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + @java.lang.Override + public boolean hasLinkId() { + return linkId_ != null; + } + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkId() { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + /** + * .context.LinkId link_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + return getLinkId(); + } + + public static final int LINK_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List linkEndpointIds_; + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public java.util.List getLinkEndpointIdsList() { + return linkEndpointIds_; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public java.util.List + getLinkEndpointIdsOrBuilderList() { + return linkEndpointIds_; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public int getLinkEndpointIdsCount() { + return linkEndpointIds_.size(); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { + return linkEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index) { + return linkEndpointIds_.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 (linkId_ != null) { + output.writeMessage(1, getLinkId()); + } + for (int i = 0; i < linkEndpointIds_.size(); i++) { + output.writeMessage(2, linkEndpointIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (linkId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLinkId()); + } + for (int i = 0; i < linkEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, linkEndpointIds_.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 context.ContextOuterClass.Link)) { + return super.equals(obj); + } + context.ContextOuterClass.Link other = (context.ContextOuterClass.Link) obj; + + if (hasLinkId() != other.hasLinkId()) return false; + if (hasLinkId()) { + if (!getLinkId() + .equals(other.getLinkId())) return false; + } + if (!getLinkEndpointIdsList() + .equals(other.getLinkEndpointIdsList())) 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 (hasLinkId()) { + hash = (37 * hash) + LINK_ID_FIELD_NUMBER; + hash = (53 * hash) + getLinkId().hashCode(); + } + if (getLinkEndpointIdsCount() > 0) { + hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Link parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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 context.ContextOuterClass.Link parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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 context.ContextOuterClass.Link parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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(context.ContextOuterClass.Link 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 context.Link} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Link) + context.ContextOuterClass.LinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + } + + // Construct using context.ContextOuterClass.Link.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinkEndpointIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linkIdBuilder_ == null) { + linkId_ = null; + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linkEndpointIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Link getDefaultInstanceForType() { + return context.ContextOuterClass.Link.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Link build() { + context.ContextOuterClass.Link result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Link buildPartial() { + context.ContextOuterClass.Link result = new context.ContextOuterClass.Link(this); + int from_bitField0_ = bitField0_; + if (linkIdBuilder_ == null) { + result.linkId_ = linkId_; + } else { + result.linkId_ = linkIdBuilder_.build(); + } + if (linkEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.linkEndpointIds_ = linkEndpointIds_; + } else { + result.linkEndpointIds_ = linkEndpointIdsBuilder_.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 context.ContextOuterClass.Link) { + return mergeFrom((context.ContextOuterClass.Link)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Link other) { + if (other == context.ContextOuterClass.Link.getDefaultInstance()) return this; + if (other.hasLinkId()) { + mergeLinkId(other.getLinkId()); + } + if (linkEndpointIdsBuilder_ == null) { + if (!other.linkEndpointIds_.isEmpty()) { + if (linkEndpointIds_.isEmpty()) { + linkEndpointIds_ = other.linkEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.addAll(other.linkEndpointIds_); + } + onChanged(); + } + } else { + if (!other.linkEndpointIds_.isEmpty()) { + if (linkEndpointIdsBuilder_.isEmpty()) { + linkEndpointIdsBuilder_.dispose(); + linkEndpointIdsBuilder_ = null; + linkEndpointIds_ = other.linkEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + linkEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkEndpointIdsFieldBuilder() : null; + } else { + linkEndpointIdsBuilder_.addAllMessages(other.linkEndpointIds_); + } + } + } + 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 { + context.ContextOuterClass.Link parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Link) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.LinkId linkId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + public boolean hasLinkId() { + return linkIdBuilder_ != null || linkId_ != null; + } + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + public context.ContextOuterClass.LinkId getLinkId() { + if (linkIdBuilder_ == null) { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } else { + return linkIdBuilder_.getMessage(); + } + } + /** + * .context.LinkId link_id = 1; + */ + public Builder setLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkId_ = value; + onChanged(); + } else { + linkIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder setLinkId( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdBuilder_ == null) { + linkId_ = builderForValue.build(); + onChanged(); + } else { + linkIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (linkId_ != null) { + linkId_ = + context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + } else { + linkId_ = value; + } + onChanged(); + } else { + linkIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder clearLinkId() { + if (linkIdBuilder_ == null) { + linkId_ = null; + onChanged(); + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + + onChanged(); + return getLinkIdFieldBuilder().getBuilder(); + } + /** + * .context.LinkId link_id = 1; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + if (linkIdBuilder_ != null) { + return linkIdBuilder_.getMessageOrBuilder(); + } else { + return linkId_ == null ? + context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + } + /** + * .context.LinkId link_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdFieldBuilder() { + if (linkIdBuilder_ == null) { + linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + getLinkId(), + getParentForChildren(), + isClean()); + linkId_ = null; + } + return linkIdBuilder_; + } + + private java.util.List linkEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureLinkEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = new java.util.ArrayList(linkEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> linkEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List getLinkEndpointIdsList() { + if (linkEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkEndpointIds_); + } else { + return linkEndpointIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public int getLinkEndpointIdsCount() { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.size(); + } else { + return linkEndpointIdsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.get(index); + } else { + return linkEndpointIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder setLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.set(index, value); + onChanged(); + } else { + linkEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder setLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds(context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(value); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(index, value); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addAllLinkEndpointIds( + java.lang.Iterable values) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkEndpointIds_); + onChanged(); + } else { + linkEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder clearLinkEndpointIds() { + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linkEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder removeLinkEndpointIds(int index) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.remove(index); + onChanged(); + } else { + linkEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder getLinkEndpointIdsBuilder( + int index) { + return getLinkEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index) { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.get(index); } else { + return linkEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List + getLinkEndpointIdsOrBuilderList() { + if (linkEndpointIdsBuilder_ != null) { + return linkEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkEndpointIds_); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder() { + return getLinkEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder( + int index) { + return getLinkEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List + getLinkEndpointIdsBuilderList() { + return getLinkEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getLinkEndpointIdsFieldBuilder() { + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + linkEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + linkEndpointIds_ = null; + } + return linkEndpointIdsBuilder_; + } + @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:context.Link) + } + + // @@protoc_insertion_point(class_scope:context.Link) + private static final context.ContextOuterClass.Link DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Link(); + } + + public static context.ContextOuterClass.Link getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Link parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Link(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 context.ContextOuterClass.Link getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.LinkId link_ids = 1; + */ + java.util.List + getLinkIdsList(); + /** + * repeated .context.LinkId link_ids = 1; + */ + context.ContextOuterClass.LinkId getLinkIds(int index); + /** + * repeated .context.LinkId link_ids = 1; + */ + int getLinkIdsCount(); + /** + * repeated .context.LinkId link_ids = 1; + */ + java.util.List + getLinkIdsOrBuilderList(); + /** + * repeated .context.LinkId link_ids = 1; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.LinkIdList} + */ + public static final class LinkIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkIdList) + LinkIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkIdList.newBuilder() to construct. + private LinkIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkIdList() { + linkIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkIdList( + 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)) { + linkIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + linkIds_.add( + input.readMessage(context.ContextOuterClass.LinkId.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)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + } + + public static final int LINK_IDS_FIELD_NUMBER = 1; + private java.util.List linkIds_; + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public java.util.List getLinkIdsList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public java.util.List + getLinkIdsOrBuilderList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public int getLinkIdsCount() { + return linkIds_.size(); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkIds(int index) { + return linkIds_.get(index); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + return linkIds_.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 < linkIds_.size(); i++) { + output.writeMessage(1, linkIds_.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 < linkIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, linkIds_.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 context.ContextOuterClass.LinkIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkIdList other = (context.ContextOuterClass.LinkIdList) obj; + + if (!getLinkIdsList() + .equals(other.getLinkIdsList())) 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 (getLinkIdsCount() > 0) { + hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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 context.ContextOuterClass.LinkIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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 context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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(context.ContextOuterClass.LinkIdList 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 context.LinkIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkIdList) + context.ContextOuterClass.LinkIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinkIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + return context.ContextOuterClass.LinkIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList build() { + context.ContextOuterClass.LinkIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList buildPartial() { + context.ContextOuterClass.LinkIdList result = new context.ContextOuterClass.LinkIdList(this); + int from_bitField0_ = bitField0_; + if (linkIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.linkIds_ = linkIds_; + } else { + result.linkIds_ = linkIdsBuilder_.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 context.ContextOuterClass.LinkIdList) { + return mergeFrom((context.ContextOuterClass.LinkIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkIdList other) { + if (other == context.ContextOuterClass.LinkIdList.getDefaultInstance()) return this; + if (linkIdsBuilder_ == null) { + if (!other.linkIds_.isEmpty()) { + if (linkIds_.isEmpty()) { + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinkIdsIsMutable(); + linkIds_.addAll(other.linkIds_); + } + onChanged(); + } + } else { + if (!other.linkIds_.isEmpty()) { + if (linkIdsBuilder_.isEmpty()) { + linkIdsBuilder_.dispose(); + linkIdsBuilder_ = null; + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000001); + linkIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkIdsFieldBuilder() : null; + } else { + linkIdsBuilder_.addAllMessages(other.linkIds_); + } + } + } + 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 { + context.ContextOuterClass.LinkIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List linkIds_ = + java.util.Collections.emptyList(); + private void ensureLinkIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + linkIds_ = new java.util.ArrayList(linkIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List getLinkIdsList() { + if (linkIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkIds_); + } else { + return linkIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public int getLinkIdsCount() { + if (linkIdsBuilder_ == null) { + return linkIds_.size(); + } else { + return linkIdsBuilder_.getCount(); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId getLinkIds(int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); + } else { + return linkIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.set(index, value); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds(context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(index, value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addAllLinkIds( + java.lang.Iterable values) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkIds_); + onChanged(); + } else { + linkIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder clearLinkIds() { + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder removeLinkIds(int index) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.remove(index); + onChanged(); + } else { + linkIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); } else { + return linkIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List + getLinkIdsOrBuilderList() { + if (linkIdsBuilder_ != null) { + return linkIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkIds_); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { + return getLinkIdsFieldBuilder().addBuilder( + context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List + getLinkIdsBuilderList() { + return getLinkIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdsFieldBuilder() { + if (linkIdsBuilder_ == null) { + linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + linkIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + linkIds_ = null; + } + return linkIdsBuilder_; + } + @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:context.LinkIdList) + } + + // @@protoc_insertion_point(class_scope:context.LinkIdList) + private static final context.ContextOuterClass.LinkIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkIdList(); + } + + public static context.ContextOuterClass.LinkIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkIdList(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 context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Link links = 1; + */ + java.util.List + getLinksList(); + /** + * repeated .context.Link links = 1; + */ + context.ContextOuterClass.Link getLinks(int index); + /** + * repeated .context.Link links = 1; + */ + int getLinksCount(); + /** + * repeated .context.Link links = 1; + */ + java.util.List + getLinksOrBuilderList(); + /** + * repeated .context.Link links = 1; + */ + context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index); + } + /** + * Protobuf type {@code context.LinkList} + */ + public static final class LinkList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkList) + LinkListOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkList.newBuilder() to construct. + private LinkList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkList() { + links_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkList( + 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)) { + links_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + links_.add( + input.readMessage(context.ContextOuterClass.Link.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)) { + links_ = java.util.Collections.unmodifiableList(links_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + } + + public static final int LINKS_FIELD_NUMBER = 1; + private java.util.List links_; + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public java.util.List + getLinksOrBuilderList() { + return links_; + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Link getLinks(int index) { + return links_.get(index); + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index) { + return links_.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 < links_.size(); i++) { + output.writeMessage(1, links_.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 < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, links_.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 context.ContextOuterClass.LinkList)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkList other = (context.ContextOuterClass.LinkList) obj; + + if (!getLinksList() + .equals(other.getLinksList())) 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 (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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 context.ContextOuterClass.LinkList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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 context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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(context.ContextOuterClass.LinkList 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 context.LinkList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkList) + context.ContextOuterClass.LinkListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linksBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkList getDefaultInstanceForType() { + return context.ContextOuterClass.LinkList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkList build() { + context.ContextOuterClass.LinkList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkList buildPartial() { + context.ContextOuterClass.LinkList result = new context.ContextOuterClass.LinkList(this); + int from_bitField0_ = bitField0_; + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.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 context.ContextOuterClass.LinkList) { + return mergeFrom((context.ContextOuterClass.LinkList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkList other) { + if (other == context.ContextOuterClass.LinkList.getDefaultInstance()) return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinksFieldBuilder() : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + 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 { + context.ContextOuterClass.LinkList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List links_ = + java.util.Collections.emptyList(); + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> linksBuilder_; + + /** + * repeated .context.Link links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + /** + * repeated .context.Link links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + /** + * repeated .context.Link links = 1; + */ + public Builder setLinks( + int index, context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder setLinks( + int index, context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks(context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + int index, context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + int index, context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addAllLinks( + java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder getLinksBuilder( + int index) { + return getLinksFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index) { + if (linksBuilder_ == null) { + return links_.get(index); } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Link links = 1; + */ + public java.util.List + getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder addLinksBuilder() { + return getLinksFieldBuilder().addBuilder( + context.ContextOuterClass.Link.getDefaultInstance()); + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder addLinksBuilder( + int index) { + return getLinksFieldBuilder().addBuilder( + index, context.ContextOuterClass.Link.getDefaultInstance()); + } + /** + * repeated .context.Link links = 1; + */ + public java.util.List + getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder>( + links_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + links_ = null; + } + return linksBuilder_; + } + @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:context.LinkList) + } + + // @@protoc_insertion_point(class_scope:context.LinkList) + private static final context.ContextOuterClass.LinkList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkList(); + } + + public static context.ContextOuterClass.LinkList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkList(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 context.ContextOuterClass.LinkList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + boolean hasLinkId(); + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + context.ContextOuterClass.LinkId getLinkId(); + /** + * .context.LinkId link_id = 2; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + } + /** + * Protobuf type {@code context.LinkEvent} + */ + public static final class LinkEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkEvent) + LinkEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkEvent.newBuilder() to construct. + private LinkEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.LinkId.Builder subBuilder = null; + if (linkId_ != null) { + subBuilder = linkId_.toBuilder(); + } + linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkId_); + linkId_ = 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 context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int LINK_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.LinkId linkId_; + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + @java.lang.Override + public boolean hasLinkId() { + return linkId_ != null; + } + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkId() { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + /** + * .context.LinkId link_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + return getLinkId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (linkId_ != null) { + output.writeMessage(2, getLinkId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (linkId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLinkId()); + } + 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 context.ContextOuterClass.LinkEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkEvent other = (context.ContextOuterClass.LinkEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasLinkId() != other.hasLinkId()) return false; + if (hasLinkId()) { + if (!getLinkId() + .equals(other.getLinkId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasLinkId()) { + hash = (37 * hash) + LINK_ID_FIELD_NUMBER; + hash = (53 * hash) + getLinkId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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 context.ContextOuterClass.LinkEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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 context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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(context.ContextOuterClass.LinkEvent 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 context.LinkEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkEvent) + context.ContextOuterClass.LinkEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (linkIdBuilder_ == null) { + linkId_ = null; + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + return context.ContextOuterClass.LinkEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent build() { + context.ContextOuterClass.LinkEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent buildPartial() { + context.ContextOuterClass.LinkEvent result = new context.ContextOuterClass.LinkEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (linkIdBuilder_ == null) { + result.linkId_ = linkId_; + } else { + result.linkId_ = linkIdBuilder_.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 context.ContextOuterClass.LinkEvent) { + return mergeFrom((context.ContextOuterClass.LinkEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkEvent other) { + if (other == context.ContextOuterClass.LinkEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasLinkId()) { + mergeLinkId(other.getLinkId()); + } + 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 { + context.ContextOuterClass.LinkEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.LinkId linkId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + public boolean hasLinkId() { + return linkIdBuilder_ != null || linkId_ != null; + } + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + public context.ContextOuterClass.LinkId getLinkId() { + if (linkIdBuilder_ == null) { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } else { + return linkIdBuilder_.getMessage(); + } + } + /** + * .context.LinkId link_id = 2; + */ + public Builder setLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkId_ = value; + onChanged(); + } else { + linkIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder setLinkId( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdBuilder_ == null) { + linkId_ = builderForValue.build(); + onChanged(); + } else { + linkIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (linkId_ != null) { + linkId_ = + context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + } else { + linkId_ = value; + } + onChanged(); + } else { + linkIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder clearLinkId() { + if (linkIdBuilder_ == null) { + linkId_ = null; + onChanged(); + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + + onChanged(); + return getLinkIdFieldBuilder().getBuilder(); + } + /** + * .context.LinkId link_id = 2; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + if (linkIdBuilder_ != null) { + return linkIdBuilder_.getMessageOrBuilder(); + } else { + return linkId_ == null ? + context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + } + /** + * .context.LinkId link_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdFieldBuilder() { + if (linkIdBuilder_ == null) { + linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + getLinkId(), + getParentForChildren(), + isClean()); + linkId_ = null; + } + return linkIdBuilder_; + } + @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:context.LinkEvent) + } + + // @@protoc_insertion_point(class_scope:context.LinkEvent) + private static final context.ContextOuterClass.LinkEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkEvent(); + } + + public static context.ContextOuterClass.LinkEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkEvent(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 context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + boolean hasServiceUuid(); + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + context.ContextOuterClass.Uuid getServiceUuid(); + /** + * .context.Uuid service_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder(); + } + /** + *
+   * ----- Service -------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ServiceId} + */ + public static final class ServiceId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceId) + ServiceIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceId.newBuilder() to construct. + private ServiceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceId( + 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (serviceUuid_ != null) { + subBuilder = serviceUuid_.toBuilder(); + } + serviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceUuid_); + serviceUuid_ = 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 context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int SERVICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid serviceUuid_; + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + @java.lang.Override + public boolean hasServiceUuid() { + return serviceUuid_ != null; + } + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getServiceUuid() { + return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } + /** + * .context.Uuid service_uuid = 2; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { + return getServiceUuid(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (serviceUuid_ != null) { + output.writeMessage(2, getServiceUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + if (serviceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getServiceUuid()); + } + 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 context.ContextOuterClass.ServiceId)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceId other = (context.ContextOuterClass.ServiceId) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasServiceUuid() != other.hasServiceUuid()) return false; + if (hasServiceUuid()) { + if (!getServiceUuid() + .equals(other.getServiceUuid())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasServiceUuid()) { + hash = (37 * hash) + SERVICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getServiceUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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 context.ContextOuterClass.ServiceId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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 context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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(context.ContextOuterClass.ServiceId 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; + } + /** + *
+     * ----- Service -------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ServiceId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceId) + context.ContextOuterClass.ServiceIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceId.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 (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (serviceUuidBuilder_ == null) { + serviceUuid_ = null; + } else { + serviceUuid_ = null; + serviceUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId build() { + context.ContextOuterClass.ServiceId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId buildPartial() { + context.ContextOuterClass.ServiceId result = new context.ContextOuterClass.ServiceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (serviceUuidBuilder_ == null) { + result.serviceUuid_ = serviceUuid_; + } else { + result.serviceUuid_ = serviceUuidBuilder_.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 context.ContextOuterClass.ServiceId) { + return mergeFrom((context.ContextOuterClass.ServiceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceId other) { + if (other == context.ContextOuterClass.ServiceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasServiceUuid()) { + mergeServiceUuid(other.getServiceUuid()); + } + 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 { + context.ContextOuterClass.ServiceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid serviceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> serviceUuidBuilder_; + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + public boolean hasServiceUuid() { + return serviceUuidBuilder_ != null || serviceUuid_ != null; + } + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + public context.ContextOuterClass.Uuid getServiceUuid() { + if (serviceUuidBuilder_ == null) { + return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } else { + return serviceUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder setServiceUuid(context.ContextOuterClass.Uuid value) { + if (serviceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceUuid_ = value; + onChanged(); + } else { + serviceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder setServiceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (serviceUuidBuilder_ == null) { + serviceUuid_ = builderForValue.build(); + onChanged(); + } else { + serviceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder mergeServiceUuid(context.ContextOuterClass.Uuid value) { + if (serviceUuidBuilder_ == null) { + if (serviceUuid_ != null) { + serviceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(serviceUuid_).mergeFrom(value).buildPartial(); + } else { + serviceUuid_ = value; + } + onChanged(); + } else { + serviceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder clearServiceUuid() { + if (serviceUuidBuilder_ == null) { + serviceUuid_ = null; + onChanged(); + } else { + serviceUuid_ = null; + serviceUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public context.ContextOuterClass.Uuid.Builder getServiceUuidBuilder() { + + onChanged(); + return getServiceUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid service_uuid = 2; + */ + public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { + if (serviceUuidBuilder_ != null) { + return serviceUuidBuilder_.getMessageOrBuilder(); + } else { + return serviceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } + } + /** + * .context.Uuid service_uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getServiceUuidFieldBuilder() { + if (serviceUuidBuilder_ == null) { + serviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getServiceUuid(), + getParentForChildren(), + isClean()); + serviceUuid_ = null; + } + return serviceUuidBuilder_; + } + @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:context.ServiceId) + } + + // @@protoc_insertion_point(class_scope:context.ServiceId) + private static final context.ContextOuterClass.ServiceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceId(); + } + + public static context.ContextOuterClass.ServiceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceId(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 context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Service) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 1; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + int getServiceTypeValue(); + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + context.ContextOuterClass.ServiceTypeEnum getServiceType(); + + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + java.util.List + getServiceEndpointIdsList(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + context.ContextOuterClass.EndPointId getServiceEndpointIds(int index); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + int getServiceEndpointIdsCount(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + java.util.List + getServiceEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.Constraint service_constraints = 4; + */ + java.util.List + getServiceConstraintsList(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + context.ContextOuterClass.Constraint getServiceConstraints(int index); + /** + * repeated .context.Constraint service_constraints = 4; + */ + int getServiceConstraintsCount(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + java.util.List + getServiceConstraintsOrBuilderList(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index); + + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + boolean hasServiceStatus(); + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + context.ContextOuterClass.ServiceStatus getServiceStatus(); + /** + * .context.ServiceStatus service_status = 5; + */ + context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder(); + + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + boolean hasServiceConfig(); + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + context.ContextOuterClass.ServiceConfig getServiceConfig(); + /** + * .context.ServiceConfig service_config = 6; + */ + context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + context.ContextOuterClass.Timestamp getTimestamp(); + /** + * .context.Timestamp timestamp = 7; + */ + context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder(); + } + /** + * Protobuf type {@code context.Service} + */ + public static final class Service extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Service) + ServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Service.newBuilder() to construct. + private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Service() { + serviceType_ = 0; + serviceEndpointIds_ = java.util.Collections.emptyList(); + serviceConstraints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Service(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Service( + 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: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + serviceType_ = rawValue; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + serviceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 42: { + context.ContextOuterClass.ServiceStatus.Builder subBuilder = null; + if (serviceStatus_ != null) { + subBuilder = serviceStatus_.toBuilder(); + } + serviceStatus_ = input.readMessage(context.ContextOuterClass.ServiceStatus.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceStatus_); + serviceStatus_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.ServiceConfig.Builder subBuilder = null; + if (serviceConfig_ != null) { + subBuilder = serviceConfig_.toBuilder(); + } + serviceConfig_ = input.readMessage(context.ContextOuterClass.ServiceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceConfig_); + serviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SERVICE_TYPE_FIELD_NUMBER = 2; + private int serviceType_; + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + @java.lang.Override public int getServiceTypeValue() { + return serviceType_; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + @java.lang.Override public context.ContextOuterClass.ServiceTypeEnum getServiceType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); + return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + } + + public static final int SERVICE_ENDPOINT_IDS_FIELD_NUMBER = 3; + private java.util.List serviceEndpointIds_; + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List getServiceEndpointIdsList() { + return serviceEndpointIds_; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List + getServiceEndpointIdsOrBuilderList() { + return serviceEndpointIds_; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public int getServiceEndpointIdsCount() { + return serviceEndpointIds_.size(); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { + return serviceEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index) { + return serviceEndpointIds_.get(index); + } + + public static final int SERVICE_CONSTRAINTS_FIELD_NUMBER = 4; + private java.util.List serviceConstraints_; + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public java.util.List getServiceConstraintsList() { + return serviceConstraints_; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public java.util.List + getServiceConstraintsOrBuilderList() { + return serviceConstraints_; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public int getServiceConstraintsCount() { + return serviceConstraints_.size(); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getServiceConstraints(int index) { + return serviceConstraints_.get(index); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index) { + return serviceConstraints_.get(index); + } + + public static final int SERVICE_STATUS_FIELD_NUMBER = 5; + private context.ContextOuterClass.ServiceStatus serviceStatus_; + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + @java.lang.Override + public boolean hasServiceStatus() { + return serviceStatus_ != null; + } + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatus getServiceStatus() { + return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } + /** + * .context.ServiceStatus service_status = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { + return getServiceStatus(); + } + + public static final int SERVICE_CONFIG_FIELD_NUMBER = 6; + private context.ContextOuterClass.ServiceConfig serviceConfig_; + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + @java.lang.Override + public boolean hasServiceConfig() { + return serviceConfig_ != null; + } + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceConfig getServiceConfig() { + return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } + /** + * .context.ServiceConfig service_config = 6; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + return getServiceConfig(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 7; + private context.ContextOuterClass.Timestamp timestamp_; + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + @java.lang.Override + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .context.Timestamp timestamp = 7; + */ + @java.lang.Override + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + 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 (serviceId_ != null) { + output.writeMessage(1, getServiceId()); + } + if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { + output.writeEnum(2, serviceType_); + } + for (int i = 0; i < serviceEndpointIds_.size(); i++) { + output.writeMessage(3, serviceEndpointIds_.get(i)); + } + for (int i = 0; i < serviceConstraints_.size(); i++) { + output.writeMessage(4, serviceConstraints_.get(i)); + } + if (serviceStatus_ != null) { + output.writeMessage(5, getServiceStatus()); + } + if (serviceConfig_ != null) { + output.writeMessage(6, getServiceConfig()); + } + if (timestamp_ != null) { + output.writeMessage(7, getTimestamp()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getServiceId()); + } + if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, serviceType_); + } + for (int i = 0; i < serviceEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, serviceEndpointIds_.get(i)); + } + for (int i = 0; i < serviceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, serviceConstraints_.get(i)); + } + if (serviceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getServiceStatus()); + } + if (serviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getServiceConfig()); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getTimestamp()); + } + 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 context.ContextOuterClass.Service)) { + return super.equals(obj); + } + context.ContextOuterClass.Service other = (context.ContextOuterClass.Service) obj; + + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (serviceType_ != other.serviceType_) return false; + if (!getServiceEndpointIdsList() + .equals(other.getServiceEndpointIdsList())) return false; + if (!getServiceConstraintsList() + .equals(other.getServiceConstraintsList())) return false; + if (hasServiceStatus() != other.hasServiceStatus()) return false; + if (hasServiceStatus()) { + if (!getServiceStatus() + .equals(other.getServiceStatus())) return false; + } + if (hasServiceConfig() != other.hasServiceConfig()) return false; + if (hasServiceConfig()) { + if (!getServiceConfig() + .equals(other.getServiceConfig())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) 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 (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + hash = (37 * hash) + SERVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + serviceType_; + if (getServiceEndpointIdsCount() > 0) { + hash = (37 * hash) + SERVICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceEndpointIdsList().hashCode(); + } + if (getServiceConstraintsCount() > 0) { + hash = (37 * hash) + SERVICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getServiceConstraintsList().hashCode(); + } + if (hasServiceStatus()) { + hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getServiceStatus().hashCode(); + } + if (hasServiceConfig()) { + hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfig().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Service parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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 context.ContextOuterClass.Service parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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 context.ContextOuterClass.Service parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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(context.ContextOuterClass.Service 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 context.Service} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Service) + context.ContextOuterClass.ServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + } + + // Construct using context.ContextOuterClass.Service.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServiceEndpointIdsFieldBuilder(); + getServiceConstraintsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + serviceType_ = 0; + + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serviceEndpointIdsBuilder_.clear(); + } + if (serviceConstraintsBuilder_ == null) { + serviceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + serviceConstraintsBuilder_.clear(); + } + if (serviceStatusBuilder_ == null) { + serviceStatus_ = null; + } else { + serviceStatus_ = null; + serviceStatusBuilder_ = null; + } + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Service getDefaultInstanceForType() { + return context.ContextOuterClass.Service.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Service build() { + context.ContextOuterClass.Service result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Service buildPartial() { + context.ContextOuterClass.Service result = new context.ContextOuterClass.Service(this); + int from_bitField0_ = bitField0_; + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + result.serviceType_ = serviceType_; + if (serviceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceEndpointIds_ = serviceEndpointIds_; + } else { + result.serviceEndpointIds_ = serviceEndpointIdsBuilder_.build(); + } + if (serviceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serviceConstraints_ = serviceConstraints_; + } else { + result.serviceConstraints_ = serviceConstraintsBuilder_.build(); + } + if (serviceStatusBuilder_ == null) { + result.serviceStatus_ = serviceStatus_; + } else { + result.serviceStatus_ = serviceStatusBuilder_.build(); + } + if (serviceConfigBuilder_ == null) { + result.serviceConfig_ = serviceConfig_; + } else { + result.serviceConfig_ = serviceConfigBuilder_.build(); + } + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.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 context.ContextOuterClass.Service) { + return mergeFrom((context.ContextOuterClass.Service)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Service other) { + if (other == context.ContextOuterClass.Service.getDefaultInstance()) return this; + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.serviceType_ != 0) { + setServiceTypeValue(other.getServiceTypeValue()); + } + if (serviceEndpointIdsBuilder_ == null) { + if (!other.serviceEndpointIds_.isEmpty()) { + if (serviceEndpointIds_.isEmpty()) { + serviceEndpointIds_ = other.serviceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.addAll(other.serviceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.serviceEndpointIds_.isEmpty()) { + if (serviceEndpointIdsBuilder_.isEmpty()) { + serviceEndpointIdsBuilder_.dispose(); + serviceEndpointIdsBuilder_ = null; + serviceEndpointIds_ = other.serviceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + serviceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceEndpointIdsFieldBuilder() : null; + } else { + serviceEndpointIdsBuilder_.addAllMessages(other.serviceEndpointIds_); + } + } + } + if (serviceConstraintsBuilder_ == null) { + if (!other.serviceConstraints_.isEmpty()) { + if (serviceConstraints_.isEmpty()) { + serviceConstraints_ = other.serviceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.addAll(other.serviceConstraints_); + } + onChanged(); + } + } else { + if (!other.serviceConstraints_.isEmpty()) { + if (serviceConstraintsBuilder_.isEmpty()) { + serviceConstraintsBuilder_.dispose(); + serviceConstraintsBuilder_ = null; + serviceConstraints_ = other.serviceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + serviceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceConstraintsFieldBuilder() : null; + } else { + serviceConstraintsBuilder_.addAllMessages(other.serviceConstraints_); + } + } + } + if (other.hasServiceStatus()) { + mergeServiceStatus(other.getServiceStatus()); + } + if (other.hasServiceConfig()) { + mergeServiceConfig(other.getServiceConfig()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 { + context.ContextOuterClass.Service parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Service) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 1; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private int serviceType_ = 0; + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + @java.lang.Override public int getServiceTypeValue() { + return serviceType_; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @param value The enum numeric value on the wire for serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceTypeValue(int value) { + + serviceType_ = value; + onChanged(); + return this; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceTypeEnum getServiceType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); + return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @param value The serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceType(context.ContextOuterClass.ServiceTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return This builder for chaining. + */ + public Builder clearServiceType() { + + serviceType_ = 0; + onChanged(); + return this; + } + + private java.util.List serviceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureServiceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = new java.util.ArrayList(serviceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> serviceEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List getServiceEndpointIdsList() { + if (serviceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceEndpointIds_); + } else { + return serviceEndpointIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public int getServiceEndpointIdsCount() { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.size(); + } else { + return serviceEndpointIdsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.get(index); + } else { + return serviceEndpointIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder setServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.set(index, value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder setServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(index, value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addAllServiceEndpointIds( + java.lang.Iterable values) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceEndpointIds_); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder clearServiceEndpointIds() { + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serviceEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder removeServiceEndpointIds(int index) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.remove(index); + onChanged(); + } else { + serviceEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder getServiceEndpointIdsBuilder( + int index) { + return getServiceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index) { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.get(index); } else { + return serviceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List + getServiceEndpointIdsOrBuilderList() { + if (serviceEndpointIdsBuilder_ != null) { + return serviceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceEndpointIds_); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder() { + return getServiceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder( + int index) { + return getServiceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List + getServiceEndpointIdsBuilderList() { + return getServiceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getServiceEndpointIdsFieldBuilder() { + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + serviceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serviceEndpointIds_ = null; + } + return serviceEndpointIdsBuilder_; + } + + private java.util.List serviceConstraints_ = + java.util.Collections.emptyList(); + private void ensureServiceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = new java.util.ArrayList(serviceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> serviceConstraintsBuilder_; + + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List getServiceConstraintsList() { + if (serviceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceConstraints_); + } else { + return serviceConstraintsBuilder_.getMessageList(); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public int getServiceConstraintsCount() { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.size(); + } else { + return serviceConstraintsBuilder_.getCount(); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint getServiceConstraints(int index) { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.get(index); + } else { + return serviceConstraintsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder setServiceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.set(index, value); + onChanged(); + } else { + serviceConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder setServiceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints(context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(value); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(index, value); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addAllServiceConstraints( + java.lang.Iterable values) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceConstraints_); + onChanged(); + } else { + serviceConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder clearServiceConstraints() { + if (serviceConstraintsBuilder_ == null) { + serviceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serviceConstraintsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder removeServiceConstraints(int index) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.remove(index); + onChanged(); + } else { + serviceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder getServiceConstraintsBuilder( + int index) { + return getServiceConstraintsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index) { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.get(index); } else { + return serviceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List + getServiceConstraintsOrBuilderList() { + if (serviceConstraintsBuilder_ != null) { + return serviceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceConstraints_); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder() { + return getServiceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder( + int index) { + return getServiceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List + getServiceConstraintsBuilderList() { + return getServiceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getServiceConstraintsFieldBuilder() { + if (serviceConstraintsBuilder_ == null) { + serviceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + serviceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + serviceConstraints_ = null; + } + return serviceConstraintsBuilder_; + } + + private context.ContextOuterClass.ServiceStatus serviceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> serviceStatusBuilder_; + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + public boolean hasServiceStatus() { + return serviceStatusBuilder_ != null || serviceStatus_ != null; + } + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + public context.ContextOuterClass.ServiceStatus getServiceStatus() { + if (serviceStatusBuilder_ == null) { + return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } else { + return serviceStatusBuilder_.getMessage(); + } + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder setServiceStatus(context.ContextOuterClass.ServiceStatus value) { + if (serviceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceStatus_ = value; + onChanged(); + } else { + serviceStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder setServiceStatus( + context.ContextOuterClass.ServiceStatus.Builder builderForValue) { + if (serviceStatusBuilder_ == null) { + serviceStatus_ = builderForValue.build(); + onChanged(); + } else { + serviceStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder mergeServiceStatus(context.ContextOuterClass.ServiceStatus value) { + if (serviceStatusBuilder_ == null) { + if (serviceStatus_ != null) { + serviceStatus_ = + context.ContextOuterClass.ServiceStatus.newBuilder(serviceStatus_).mergeFrom(value).buildPartial(); + } else { + serviceStatus_ = value; + } + onChanged(); + } else { + serviceStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder clearServiceStatus() { + if (serviceStatusBuilder_ == null) { + serviceStatus_ = null; + onChanged(); + } else { + serviceStatus_ = null; + serviceStatusBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public context.ContextOuterClass.ServiceStatus.Builder getServiceStatusBuilder() { + + onChanged(); + return getServiceStatusFieldBuilder().getBuilder(); + } + /** + * .context.ServiceStatus service_status = 5; + */ + public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { + if (serviceStatusBuilder_ != null) { + return serviceStatusBuilder_.getMessageOrBuilder(); + } else { + return serviceStatus_ == null ? + context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } + } + /** + * .context.ServiceStatus service_status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> + getServiceStatusFieldBuilder() { + if (serviceStatusBuilder_ == null) { + serviceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder>( + getServiceStatus(), + getParentForChildren(), + isClean()); + serviceStatus_ = null; + } + return serviceStatusBuilder_; + } + + private context.ContextOuterClass.ServiceConfig serviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> serviceConfigBuilder_; + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + public boolean hasServiceConfig() { + return serviceConfigBuilder_ != null || serviceConfig_ != null; + } + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + public context.ContextOuterClass.ServiceConfig getServiceConfig() { + if (serviceConfigBuilder_ == null) { + return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } else { + return serviceConfigBuilder_.getMessage(); + } + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder setServiceConfig(context.ContextOuterClass.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceConfig_ = value; + onChanged(); + } else { + serviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder setServiceConfig( + context.ContextOuterClass.ServiceConfig.Builder builderForValue) { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = builderForValue.build(); + onChanged(); + } else { + serviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder mergeServiceConfig(context.ContextOuterClass.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (serviceConfig_ != null) { + serviceConfig_ = + context.ContextOuterClass.ServiceConfig.newBuilder(serviceConfig_).mergeFrom(value).buildPartial(); + } else { + serviceConfig_ = value; + } + onChanged(); + } else { + serviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder clearServiceConfig() { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + onChanged(); + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public context.ContextOuterClass.ServiceConfig.Builder getServiceConfigBuilder() { + + onChanged(); + return getServiceConfigFieldBuilder().getBuilder(); + } + /** + * .context.ServiceConfig service_config = 6; + */ + public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + if (serviceConfigBuilder_ != null) { + return serviceConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceConfig_ == null ? + context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } + } + /** + * .context.ServiceConfig service_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> + getServiceConfigFieldBuilder() { + if (serviceConfigBuilder_ == null) { + serviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder>( + getServiceConfig(), + getParentForChildren(), + isClean()); + serviceConfig_ = null; + } + return serviceConfigBuilder_; + } + + private context.ContextOuterClass.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { + + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + * .context.Timestamp timestamp = 7; + */ + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + * .context.Timestamp timestamp = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + @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:context.Service) + } + + // @@protoc_insertion_point(class_scope:context.Service) + private static final context.ContextOuterClass.Service DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Service(); + } + + public static context.ContextOuterClass.Service getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Service parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Service(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 context.ContextOuterClass.Service getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + int getServiceStatusValue(); + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + context.ContextOuterClass.ServiceStatusEnum getServiceStatus(); + } + /** + * Protobuf type {@code context.ServiceStatus} + */ + public static final class ServiceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceStatus) + ServiceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceStatus.newBuilder() to construct. + private ServiceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceStatus() { + serviceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceStatus( + 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(); + + serviceStatus_ = 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 context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + } + + public static final int SERVICE_STATUS_FIELD_NUMBER = 1; + private int serviceStatus_; + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + @java.lang.Override public int getServiceStatusValue() { + return serviceStatus_; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + @java.lang.Override public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); + return result == null ? context.ContextOuterClass.ServiceStatusEnum.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 (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, serviceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, serviceStatus_); + } + 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 context.ContextOuterClass.ServiceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceStatus other = (context.ContextOuterClass.ServiceStatus) obj; + + if (serviceStatus_ != other.serviceStatus_) 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_STATUS_FIELD_NUMBER; + hash = (53 * hash) + serviceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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 context.ContextOuterClass.ServiceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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 context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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(context.ContextOuterClass.ServiceStatus 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 context.ServiceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceStatus) + context.ContextOuterClass.ServiceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceStatus.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(); + serviceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus build() { + context.ContextOuterClass.ServiceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus buildPartial() { + context.ContextOuterClass.ServiceStatus result = new context.ContextOuterClass.ServiceStatus(this); + result.serviceStatus_ = serviceStatus_; + 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 context.ContextOuterClass.ServiceStatus) { + return mergeFrom((context.ContextOuterClass.ServiceStatus)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceStatus other) { + if (other == context.ContextOuterClass.ServiceStatus.getDefaultInstance()) return this; + if (other.serviceStatus_ != 0) { + setServiceStatusValue(other.getServiceStatusValue()); + } + 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 { + context.ContextOuterClass.ServiceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int serviceStatus_ = 0; + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + @java.lang.Override public int getServiceStatusValue() { + return serviceStatus_; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @param value The enum numeric value on the wire for serviceStatus to set. + * @return This builder for chaining. + */ + public Builder setServiceStatusValue(int value) { + + serviceStatus_ = value; + onChanged(); + return this; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); + return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @param value The serviceStatus to set. + * @return This builder for chaining. + */ + public Builder setServiceStatus(context.ContextOuterClass.ServiceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return This builder for chaining. + */ + public Builder clearServiceStatus() { + + serviceStatus_ = 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:context.ServiceStatus) + } + + // @@protoc_insertion_point(class_scope:context.ServiceStatus) + private static final context.ContextOuterClass.ServiceStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceStatus(); + } + + public static context.ContextOuterClass.ServiceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceStatus(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 context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRule getConfigRules(int index); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + int getConfigRulesCount(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesOrBuilderList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceConfig} + */ + public static final class ServiceConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceConfig) + ServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConfig.newBuilder() to construct. + private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceConfig() { + configRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceConfig( + 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)) { + configRules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.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)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + } + + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List getConfigRulesList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public int getConfigRulesCount() { + return configRules_.size(); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + return configRules_.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 < configRules_.size(); i++) { + output.writeMessage(1, configRules_.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 < configRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configRules_.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 context.ContextOuterClass.ServiceConfig)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceConfig other = (context.ContextOuterClass.ServiceConfig) obj; + + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) 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 (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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 context.ContextOuterClass.ServiceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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 context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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(context.ContextOuterClass.ServiceConfig 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 context.ServiceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceConfig) + context.ContextOuterClass.ServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getConfigRulesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + configRulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig build() { + context.ContextOuterClass.ServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig buildPartial() { + context.ContextOuterClass.ServiceConfig result = new context.ContextOuterClass.ServiceConfig(this); + int from_bitField0_ = bitField0_; + if (configRulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configRules_ = configRules_; + } else { + result.configRules_ = configRulesBuilder_.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 context.ContextOuterClass.ServiceConfig) { + return mergeFrom((context.ContextOuterClass.ServiceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceConfig other) { + if (other == context.ContextOuterClass.ServiceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); + } + onChanged(); + } + } else { + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + configRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfigRulesFieldBuilder() : null; + } else { + configRulesBuilder_.addAllMessages(other.configRules_); + } + } + } + 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 { + context.ContextOuterClass.ServiceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List configRules_ = + java.util.Collections.emptyList(); + private void ensureConfigRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configRules_ = new java.util.ArrayList(configRules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); + } else { + return configRulesBuilder_.getMessageList(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); + } else { + return configRulesBuilder_.getCount(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); + } else { + return configRulesBuilder_.getMessage(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.set(index, value); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(value); + onChanged(); + } else { + configRulesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(index, value); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configRules_); + onChanged(); + } else { + configRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configRulesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); + onChanged(); + } else { + configRulesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configRules_); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configRules_ = null; + } + return configRulesBuilder_; + } + @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:context.ServiceConfig) + } + + // @@protoc_insertion_point(class_scope:context.ServiceConfig) + private static final context.ContextOuterClass.ServiceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceConfig(); + } + + public static context.ContextOuterClass.ServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConfig(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 context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ServiceId service_ids = 1; + */ + java.util.List + getServiceIdsList(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + context.ContextOuterClass.ServiceId getServiceIds(int index); + /** + * repeated .context.ServiceId service_ids = 1; + */ + int getServiceIdsCount(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + java.util.List + getServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceIdList} + */ + public static final class ServiceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceIdList) + ServiceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceIdList.newBuilder() to construct. + private ServiceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceIdList() { + serviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceIdList( + 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)) { + serviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.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)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + } + + public static final int SERVICE_IDS_FIELD_NUMBER = 1; + private java.util.List serviceIds_; + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public java.util.List getServiceIdsList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public java.util.List + getServiceIdsOrBuilderList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public int getServiceIdsCount() { + return serviceIds_.size(); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + return serviceIds_.get(index); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + return serviceIds_.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 < serviceIds_.size(); i++) { + output.writeMessage(1, serviceIds_.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 < serviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, serviceIds_.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 context.ContextOuterClass.ServiceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceIdList other = (context.ContextOuterClass.ServiceIdList) obj; + + if (!getServiceIdsList() + .equals(other.getServiceIdsList())) 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 (getServiceIdsCount() > 0) { + hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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 context.ContextOuterClass.ServiceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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 context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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(context.ContextOuterClass.ServiceIdList 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 context.ServiceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceIdList) + context.ContextOuterClass.ServiceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServiceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList build() { + context.ContextOuterClass.ServiceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList buildPartial() { + context.ContextOuterClass.ServiceIdList result = new context.ContextOuterClass.ServiceIdList(this); + int from_bitField0_ = bitField0_; + if (serviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceIds_ = serviceIds_; + } else { + result.serviceIds_ = serviceIdsBuilder_.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 context.ContextOuterClass.ServiceIdList) { + return mergeFrom((context.ContextOuterClass.ServiceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceIdList other) { + if (other == context.ContextOuterClass.ServiceIdList.getDefaultInstance()) return this; + if (serviceIdsBuilder_ == null) { + if (!other.serviceIds_.isEmpty()) { + if (serviceIds_.isEmpty()) { + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceIdsIsMutable(); + serviceIds_.addAll(other.serviceIds_); + } + onChanged(); + } + } else { + if (!other.serviceIds_.isEmpty()) { + if (serviceIdsBuilder_.isEmpty()) { + serviceIdsBuilder_.dispose(); + serviceIdsBuilder_ = null; + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + serviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceIdsFieldBuilder() : null; + } else { + serviceIdsBuilder_.addAllMessages(other.serviceIds_); + } + } + } + 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 { + context.ContextOuterClass.ServiceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List serviceIds_ = + java.util.Collections.emptyList(); + private void ensureServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceIds_ = new java.util.ArrayList(serviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List getServiceIdsList() { + if (serviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceIds_); + } else { + return serviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public int getServiceIdsCount() { + if (serviceIdsBuilder_ == null) { + return serviceIds_.size(); + } else { + return serviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); + } else { + return serviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.set(index, value); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(index, value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addAllServiceIds( + java.lang.Iterable values) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceIds_); + onChanged(); + } else { + serviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder clearServiceIds() { + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder removeServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.remove(index); + onChanged(); + } else { + serviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); } else { + return serviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List + getServiceIdsOrBuilderList() { + if (serviceIdsBuilder_ != null) { + return serviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceIds_); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { + return getServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List + getServiceIdsBuilderList() { + return getServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdsFieldBuilder() { + if (serviceIdsBuilder_ == null) { + serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + serviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serviceIds_ = null; + } + return serviceIdsBuilder_; + } + @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:context.ServiceIdList) + } + + // @@protoc_insertion_point(class_scope:context.ServiceIdList) + private static final context.ContextOuterClass.ServiceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceIdList(); + } + + public static context.ContextOuterClass.ServiceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceIdList(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 context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Service services = 1; + */ + java.util.List + getServicesList(); + /** + * repeated .context.Service services = 1; + */ + context.ContextOuterClass.Service getServices(int index); + /** + * repeated .context.Service services = 1; + */ + int getServicesCount(); + /** + * repeated .context.Service services = 1; + */ + java.util.List + getServicesOrBuilderList(); + /** + * repeated .context.Service services = 1; + */ + context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceList} + */ + public static final class ServiceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceList) + ServiceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceList.newBuilder() to construct. + private ServiceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceList() { + services_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdsFieldBuilder() { - if (topologyIdsBuilder_ == null) { - topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - topologyIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - topologyIds_ = null; + 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)) { + services_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + services_.add( + input.readMessage(context.ContextOuterClass.Service.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } } - return topologyIdsBuilder_; + } 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)) { + services_ = java.util.Collections.unmodifiableList(services_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } - private java.util.List serviceIds_ = + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + } + + public static final int SERVICES_FIELD_NUMBER = 1; + private java.util.List services_; + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public java.util.List getServicesList() { + return services_; + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public java.util.List + getServicesOrBuilderList() { + return services_; + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public int getServicesCount() { + return services_.size(); + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Service getServices(int index) { + return services_.get(index); + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( + int index) { + return services_.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 < services_.size(); i++) { + output.writeMessage(1, services_.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 < services_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, services_.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 context.ContextOuterClass.ServiceList)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceList other = (context.ContextOuterClass.ServiceList) obj; + + if (!getServicesList() + .equals(other.getServicesList())) 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 (getServicesCount() > 0) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getServicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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 context.ContextOuterClass.ServiceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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 context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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(context.ContextOuterClass.ServiceList 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 context.ServiceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceList) + context.ContextOuterClass.ServiceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList build() { + context.ContextOuterClass.ServiceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList buildPartial() { + context.ContextOuterClass.ServiceList result = new context.ContextOuterClass.ServiceList(this); + int from_bitField0_ = bitField0_; + if (servicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.services_ = services_; + } else { + result.services_ = servicesBuilder_.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 context.ContextOuterClass.ServiceList) { + return mergeFrom((context.ContextOuterClass.ServiceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceList other) { + if (other == context.ContextOuterClass.ServiceList.getDefaultInstance()) return this; + if (servicesBuilder_ == null) { + if (!other.services_.isEmpty()) { + if (services_.isEmpty()) { + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServicesIsMutable(); + services_.addAll(other.services_); + } + onChanged(); + } + } else { + if (!other.services_.isEmpty()) { + if (servicesBuilder_.isEmpty()) { + servicesBuilder_.dispose(); + servicesBuilder_ = null; + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + servicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServicesFieldBuilder() : null; + } else { + servicesBuilder_.addAllMessages(other.services_); + } + } + } + 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 { + context.ContextOuterClass.ServiceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List services_ = java.util.Collections.emptyList(); - private void ensureServiceIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - serviceIds_ = new java.util.ArrayList(serviceIds_); - bitField0_ |= 0x00000002; + private void ensureServicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + services_ = new java.util.ArrayList(services_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> servicesBuilder_; /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List getServiceIdsList() { - if (serviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceIds_); + public java.util.List getServicesList() { + if (servicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(services_); } else { - return serviceIdsBuilder_.getMessageList(); + return servicesBuilder_.getMessageList(); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public int getServiceIdsCount() { - if (serviceIdsBuilder_ == null) { - return serviceIds_.size(); + public int getServicesCount() { + if (servicesBuilder_ == null) { + return services_.size(); } else { - return serviceIdsBuilder_.getCount(); + return servicesBuilder_.getCount(); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); + public context.ContextOuterClass.Service getServices(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); } else { - return serviceIdsBuilder_.getMessage(index); + return servicesBuilder_.getMessage(index); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder setServices( + int index, context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.set(index, value); + ensureServicesIsMutable(); + services_.set(index, value); onChanged(); } else { - serviceIdsBuilder_.setMessage(index, value); + servicesBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; - */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.set(index, builderForValue.build()); + * repeated .context.Service services = 1; + */ + public Builder setServices( + int index, context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.set(index, builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.setMessage(index, builderForValue.build()); + servicesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder addServices(context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.add(value); + ensureServicesIsMutable(); + services_.add(value); onChanged(); } else { - serviceIdsBuilder_.addMessage(value); + servicesBuilder_.addMessage(value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder addServices( + int index, context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.add(index, value); + ensureServicesIsMutable(); + services_.add(index, value); onChanged(); } else { - serviceIdsBuilder_.addMessage(index, value); + servicesBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(builderForValue.build()); + public Builder addServices( + context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.addMessage(builderForValue.build()); + servicesBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(index, builderForValue.build()); + public Builder addServices( + int index, context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(index, builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.addMessage(index, builderForValue.build()); + servicesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addAllServiceIds( - java.lang.Iterable values) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); + public Builder addAllServices( + java.lang.Iterable values) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceIds_); + values, services_); onChanged(); } else { - serviceIdsBuilder_.addAllMessages(values); + servicesBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder clearServiceIds() { - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder clearServices() { + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - serviceIdsBuilder_.clear(); + servicesBuilder_.clear(); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder removeServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.remove(index); + public Builder removeServices(int index) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.remove(index); onChanged(); } else { - serviceIdsBuilder_.remove(index); + servicesBuilder_.remove(index); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + public context.ContextOuterClass.Service.Builder getServicesBuilder( int index) { - return getServiceIdsFieldBuilder().getBuilder(index); + return getServicesFieldBuilder().getBuilder(index); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); } else { - return serviceIdsBuilder_.getMessageOrBuilder(index); + if (servicesBuilder_ == null) { + return services_.get(index); } else { + return servicesBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List - getServiceIdsOrBuilderList() { - if (serviceIdsBuilder_ != null) { - return serviceIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getServicesOrBuilderList() { + if (servicesBuilder_ != null) { + return servicesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(serviceIds_); + return java.util.Collections.unmodifiableList(services_); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { - return getServiceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); + public context.ContextOuterClass.Service.Builder addServicesBuilder() { + return getServicesFieldBuilder().addBuilder( + context.ContextOuterClass.Service.getDefaultInstance()); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + public context.ContextOuterClass.Service.Builder addServicesBuilder( int index) { - return getServiceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + return getServicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Service.getDefaultInstance()); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List - getServiceIdsBuilderList() { - return getServiceIdsFieldBuilder().getBuilderList(); + public java.util.List + getServicesBuilderList() { + return getServicesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdsFieldBuilder() { - if (serviceIdsBuilder_ == null) { - serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceIds_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - serviceIds_ = null; - } - return serviceIdsBuilder_; - } - - private context.ContextOuterClass.TeraFlowController controller_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> controllerBuilder_; - /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. - */ - public boolean hasController() { - return controllerBuilder_ != null || controller_ != null; - } - /** - * .context.TeraFlowController controller = 4; - * @return The controller. - */ - public context.ContextOuterClass.TeraFlowController getController() { - if (controllerBuilder_ == null) { - return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; - } else { - return controllerBuilder_.getMessage(); - } - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder setController(context.ContextOuterClass.TeraFlowController value) { - if (controllerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - controller_ = value; - onChanged(); - } else { - controllerBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder setController( - context.ContextOuterClass.TeraFlowController.Builder builderForValue) { - if (controllerBuilder_ == null) { - controller_ = builderForValue.build(); - onChanged(); - } else { - controllerBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder mergeController(context.ContextOuterClass.TeraFlowController value) { - if (controllerBuilder_ == null) { - if (controller_ != null) { - controller_ = - context.ContextOuterClass.TeraFlowController.newBuilder(controller_).mergeFrom(value).buildPartial(); - } else { - controller_ = value; - } - onChanged(); - } else { - controllerBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder clearController() { - if (controllerBuilder_ == null) { - controller_ = null; - onChanged(); - } else { - controller_ = null; - controllerBuilder_ = null; - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public context.ContextOuterClass.TeraFlowController.Builder getControllerBuilder() { - - onChanged(); - return getControllerFieldBuilder().getBuilder(); - } - /** - * .context.TeraFlowController controller = 4; - */ - public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { - if (controllerBuilder_ != null) { - return controllerBuilder_.getMessageOrBuilder(); - } else { - return controller_ == null ? - context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; - } - } - /** - * .context.TeraFlowController controller = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> - getControllerFieldBuilder() { - if (controllerBuilder_ == null) { - controllerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder>( - getController(), + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> + getServicesFieldBuilder() { + if (servicesBuilder_ == null) { + servicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder>( + services_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - controller_ = null; + services_ = null; } - return controllerBuilder_; + return servicesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -4533,95 +27937,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Context) + // @@protoc_insertion_point(builder_scope:context.ServiceList) } - // @@protoc_insertion_point(class_scope:context.Context) - private static final context.ContextOuterClass.Context DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ServiceList) + private static final context.ContextOuterClass.ServiceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Context(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceList(); } - public static context.ContextOuterClass.Context getDefaultInstance() { + public static context.ContextOuterClass.ServiceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Context parsePartialFrom( + public ServiceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Context(input, extensionRegistry); + return new ServiceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Context getDefaultInstanceForType() { + public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextIdList) + public interface ServiceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceEvent) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ - java.util.List - getContextIdsList(); + boolean hasEvent(); /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ - context.ContextOuterClass.ContextId getContextIds(int index); + context.ContextOuterClass.Event getEvent(); /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - int getContextIdsCount(); + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - java.util.List - getContextIdsOrBuilderList(); + boolean hasServiceId(); /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return The serviceId. */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index); + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 2; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); } /** - * Protobuf type {@code context.ContextIdList} + * Protobuf type {@code context.ServiceEvent} */ - public static final class ContextIdList extends + public static final class ServiceEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextIdList) - ContextIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ServiceEvent) + ServiceEventOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextIdList.newBuilder() to construct. - private ContextIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ServiceEvent.newBuilder() to construct. + private ServiceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextIdList() { - contextIds_ = java.util.Collections.emptyList(); + private ServiceEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextIdList(); + return new ServiceEvent(); } @java.lang.Override @@ -4629,7 +28038,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextIdList( + private ServiceEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4637,7 +28046,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4649,12 +28057,29 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - contextIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); } - contextIds_.add( - input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry)); + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + break; } default: { @@ -4672,64 +28097,73 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - contextIds_ = java.util.Collections.unmodifiableList(contextIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); } - public static final int CONTEXT_IDS_FIELD_NUMBER = 1; - private java.util.List contextIds_; + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ @java.lang.Override - public java.util.List getContextIdsList() { - return contextIds_; + public boolean hasEvent() { + return event_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ @java.lang.Override - public java.util.List - getContextIdsOrBuilderList() { - return contextIds_; + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ @java.lang.Override - public int getContextIdsCount() { - return contextIds_.size(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); } + + public static final int SERVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextIds(int index) { - return contextIds_.get(index); + public boolean hasServiceId() { + return serviceId_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return The serviceId. */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index) { - return contextIds_.get(index); + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); } private byte memoizedIsInitialized = -1; @@ -4746,8 +28180,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < contextIds_.size(); i++) { - output.writeMessage(1, contextIds_.get(i)); + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); } unknownFields.writeTo(output); } @@ -4758,9 +28195,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < contextIds_.size(); i++) { + if (event_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, contextIds_.get(i)); + .computeMessageSize(1, getEvent()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getServiceId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -4772,13 +28213,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextIdList)) { + if (!(obj instanceof context.ContextOuterClass.ServiceEvent)) { return super.equals(obj); } - context.ContextOuterClass.ContextIdList other = (context.ContextOuterClass.ContextIdList) obj; + context.ContextOuterClass.ServiceEvent other = (context.ContextOuterClass.ServiceEvent) obj; - if (!getContextIdsList() - .equals(other.getContextIdsList())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -4790,78 +28239,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getContextIdsCount() > 0) { - hash = (37 * hash) + CONTEXT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getContextIdsList().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ServiceEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ServiceEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent 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 context.ContextOuterClass.ContextIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ServiceEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseDelimitedFrom( + public static context.ContextOuterClass.ServiceEvent 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 context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4874,7 +28327,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ServiceEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4890,26 +28343,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextIdList} + * Protobuf type {@code context.ServiceEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextIdList) - context.ContextOuterClass.ContextIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ServiceEvent) + context.ContextOuterClass.ServiceEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); } - // Construct using context.ContextOuterClass.ContextIdList.newBuilder() + // Construct using context.ContextOuterClass.ServiceEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4922,17 +28375,22 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getContextIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextIdsBuilder_ == null) { - contextIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + if (eventBuilder_ == null) { + event_ = null; } else { - contextIdsBuilder_.clear(); + event_ = null; + eventBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; } return this; } @@ -4940,17 +28398,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ContextIdList.getDefaultInstance(); + public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextIdList build() { - context.ContextOuterClass.ContextIdList result = buildPartial(); + public context.ContextOuterClass.ServiceEvent build() { + context.ContextOuterClass.ServiceEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4958,17 +28416,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextIdList buildPartial() { - context.ContextOuterClass.ContextIdList result = new context.ContextOuterClass.ContextIdList(this); - int from_bitField0_ = bitField0_; - if (contextIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - contextIds_ = java.util.Collections.unmodifiableList(contextIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.contextIds_ = contextIds_; + public context.ContextOuterClass.ServiceEvent buildPartial() { + context.ContextOuterClass.ServiceEvent result = new context.ContextOuterClass.ServiceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; } else { - result.contextIds_ = contextIdsBuilder_.build(); + result.event_ = eventBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); } onBuilt(); return result; @@ -5008,41 +28466,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextIdList) { - return mergeFrom((context.ContextOuterClass.ContextIdList)other); + if (other instanceof context.ContextOuterClass.ServiceEvent) { + return mergeFrom((context.ContextOuterClass.ServiceEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextIdList other) { - if (other == context.ContextOuterClass.ContextIdList.getDefaultInstance()) return this; - if (contextIdsBuilder_ == null) { - if (!other.contextIds_.isEmpty()) { - if (contextIds_.isEmpty()) { - contextIds_ = other.contextIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureContextIdsIsMutable(); - contextIds_.addAll(other.contextIds_); - } - onChanged(); - } - } else { - if (!other.contextIds_.isEmpty()) { - if (contextIdsBuilder_.isEmpty()) { - contextIdsBuilder_.dispose(); - contextIdsBuilder_ = null; - contextIds_ = other.contextIds_; - bitField0_ = (bitField0_ & ~0x00000001); - contextIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getContextIdsFieldBuilder() : null; - } else { - contextIdsBuilder_.addAllMessages(other.contextIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ServiceEvent other) { + if (other == context.ContextOuterClass.ServiceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -5059,11 +28497,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextIdList parsedMessage = null; + context.ContextOuterClass.ServiceEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ServiceEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -5072,246 +28510,243 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List contextIds_ = - java.util.Collections.emptyList(); - private void ensureContextIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - contextIds_ = new java.util.ArrayList(contextIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdsBuilder_; + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * repeated .context.ContextId context_ids = 1; - */ - public java.util.List getContextIdsList() { - if (contextIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(contextIds_); - } else { - return contextIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ - public int getContextIdsCount() { - if (contextIdsBuilder_ == null) { - return contextIds_.size(); - } else { - return contextIdsBuilder_.getCount(); - } + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ - public context.ContextOuterClass.ContextId getContextIds(int index) { - if (contextIdsBuilder_ == null) { - return contextIds_.get(index); + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } else { - return contextIdsBuilder_.getMessage(index); + return eventBuilder_.getMessage(); } } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder setContextIds( - int index, context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureContextIdsIsMutable(); - contextIds_.set(index, value); + event_ = value; onChanged(); } else { - contextIdsBuilder_.setMessage(index, value); + eventBuilder_.setMessage(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder setContextIds( - int index, context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.set(index, builderForValue.build()); + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); onChanged(); } else { - contextIdsBuilder_.setMessage(index, builderForValue.build()); + eventBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds(context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; } - ensureContextIdsIsMutable(); - contextIds_.add(value); onChanged(); } else { - contextIdsBuilder_.addMessage(value); + eventBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - int index, context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContextIdsIsMutable(); - contextIds_.add(index, value); + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; onChanged(); } else { - contextIdsBuilder_.addMessage(index, value); + event_ = null; + eventBuilder_ = null; } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); } else { - contextIdsBuilder_.addMessage(builderForValue.build()); + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; } - return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - int index, context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.add(index, builderForValue.build()); - onChanged(); - } else { - contextIdsBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; } - return this; + return eventBuilder_; } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - public Builder addAllContextIds( - java.lang.Iterable values) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, contextIds_); - onChanged(); + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } else { - contextIdsBuilder_.addAllMessages(values); + return serviceIdBuilder_.getMessage(); } - return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public Builder clearContextIds() { - if (contextIdsBuilder_ == null) { - contextIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; onChanged(); } else { - contextIdsBuilder_.clear(); + serviceIdBuilder_.setMessage(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public Builder removeContextIds(int index) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.remove(index); + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); onChanged(); } else { - contextIdsBuilder_.remove(index); + serviceIdBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.ContextId context_ids = 1; - */ - public context.ContextOuterClass.ContextId.Builder getContextIdsBuilder( - int index) { - return getContextIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index) { - if (contextIdsBuilder_ == null) { - return contextIds_.get(index); } else { - return contextIdsBuilder_.getMessageOrBuilder(index); + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); } + + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public java.util.List - getContextIdsOrBuilderList() { - if (contextIdsBuilder_ != null) { - return contextIdsBuilder_.getMessageOrBuilderList(); + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(contextIds_); + serviceId_ = null; + serviceIdBuilder_ = null; } + + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder() { - return getContextIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ContextId.getDefaultInstance()); + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder( - int index) { - return getContextIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ContextId.getDefaultInstance()); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public java.util.List - getContextIdsBuilderList() { - return getContextIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdsFieldBuilder() { - if (contextIdsBuilder_ == null) { - contextIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - contextIds_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), getParentForChildren(), isClean()); - contextIds_ = null; + serviceId_ = null; } - return contextIdsBuilder_; + return serviceIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -5326,95 +28761,104 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextIdList) + // @@protoc_insertion_point(builder_scope:context.ServiceEvent) } - // @@protoc_insertion_point(class_scope:context.ContextIdList) - private static final context.ContextOuterClass.ContextIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ServiceEvent) + private static final context.ContextOuterClass.ServiceEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceEvent(); } - public static context.ContextOuterClass.ContextIdList getDefaultInstance() { + public static context.ContextOuterClass.ServiceEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextIdList parsePartialFrom( + public ServiceEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextIdList(input, extensionRegistry); + return new ServiceEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextList) + public interface SliceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceId) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. */ - java.util.List - getContextsList(); + boolean hasContextId(); /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ - context.ContextOuterClass.Context getContexts(int index); + context.ContextOuterClass.ContextId getContextId(); /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - int getContextsCount(); + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ - java.util.List - getContextsOrBuilderList(); + boolean hasSliceUuid(); /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. */ - context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index); + context.ContextOuterClass.Uuid getSliceUuid(); + /** + * .context.Uuid slice_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder(); } /** - * Protobuf type {@code context.ContextList} + *
+   * ----- Slice ---------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.SliceId} */ - public static final class ContextList extends + public static final class SliceId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextList) - ContextListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceId) + SliceIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextList.newBuilder() to construct. - private ContextList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceId.newBuilder() to construct. + private SliceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextList() { - contexts_ = java.util.Collections.emptyList(); + private SliceId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextList(); + return new SliceId(); } @java.lang.Override @@ -5422,7 +28866,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextList( + private SliceId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5430,7 +28874,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -5442,12 +28885,29 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - contexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); } - contexts_.add( - input.readMessage(context.ContextOuterClass.Context.parser(), extensionRegistry)); + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (sliceUuid_ != null) { + subBuilder = sliceUuid_.toBuilder(); + } + sliceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceUuid_); + sliceUuid_ = subBuilder.buildPartial(); + } + break; } default: { @@ -5465,64 +28925,73 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - contexts_ = java.util.Collections.unmodifiableList(contexts_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + public boolean hasContextId() { + return contextId_ != null; } - - public static final int CONTEXTS_FIELD_NUMBER = 1; - private java.util.List contexts_; /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ @java.lang.Override - public java.util.List getContextsList() { - return contexts_; + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ @java.lang.Override - public java.util.List - getContextsOrBuilderList() { - return contexts_; + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); } + + public static final int SLICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid sliceUuid_; /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ @java.lang.Override - public int getContextsCount() { - return contexts_.size(); + public boolean hasSliceUuid() { + return sliceUuid_ != null; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. */ @java.lang.Override - public context.ContextOuterClass.Context getContexts(int index) { - return contexts_.get(index); + public context.ContextOuterClass.Uuid getSliceUuid() { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index) { - return contexts_.get(index); + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + return getSliceUuid(); } private byte memoizedIsInitialized = -1; @@ -5539,8 +29008,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < contexts_.size(); i++) { - output.writeMessage(1, contexts_.get(i)); + if (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (sliceUuid_ != null) { + output.writeMessage(2, getSliceUuid()); } unknownFields.writeTo(output); } @@ -5551,9 +29023,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < contexts_.size(); i++) { + if (contextId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, contexts_.get(i)); + .computeMessageSize(1, getContextId()); + } + if (sliceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5565,13 +29041,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextList)) { + if (!(obj instanceof context.ContextOuterClass.SliceId)) { return super.equals(obj); } - context.ContextOuterClass.ContextList other = (context.ContextOuterClass.ContextList) obj; + context.ContextOuterClass.SliceId other = (context.ContextOuterClass.SliceId) obj; - if (!getContextsList() - .equals(other.getContextsList())) return false; + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasSliceUuid() != other.hasSliceUuid()) return false; + if (hasSliceUuid()) { + if (!getSliceUuid() + .equals(other.getSliceUuid())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -5583,78 +29067,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getContextsCount() > 0) { - hash = (37 * hash) + CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getContextsList().hashCode(); + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasSliceUuid()) { + hash = (37 * hash) + SLICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getSliceUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId 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 context.ContextOuterClass.ContextList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseDelimitedFrom( + public static context.ContextOuterClass.SliceId 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 context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5667,7 +29155,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -5683,26 +29171,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextList} + *
+     * ----- Slice ---------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.SliceId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextList) - context.ContextOuterClass.ContextListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceId) + context.ContextOuterClass.SliceIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - // Construct using context.ContextOuterClass.ContextList.newBuilder() + // Construct using context.ContextOuterClass.SliceId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -5715,17 +29207,22 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getContextsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextsBuilder_ == null) { - contexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + if (contextIdBuilder_ == null) { + contextId_ = null; } else { - contextsBuilder_.clear(); + contextId_ = null; + contextIdBuilder_ = null; + } + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; } return this; } @@ -5733,17 +29230,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextList getDefaultInstanceForType() { - return context.ContextOuterClass.ContextList.getDefaultInstance(); + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return context.ContextOuterClass.SliceId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextList build() { - context.ContextOuterClass.ContextList result = buildPartial(); + public context.ContextOuterClass.SliceId build() { + context.ContextOuterClass.SliceId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -5751,17 +29248,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextList buildPartial() { - context.ContextOuterClass.ContextList result = new context.ContextOuterClass.ContextList(this); - int from_bitField0_ = bitField0_; - if (contextsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - contexts_ = java.util.Collections.unmodifiableList(contexts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.contexts_ = contexts_; + public context.ContextOuterClass.SliceId buildPartial() { + context.ContextOuterClass.SliceId result = new context.ContextOuterClass.SliceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; } else { - result.contexts_ = contextsBuilder_.build(); + result.contextId_ = contextIdBuilder_.build(); + } + if (sliceUuidBuilder_ == null) { + result.sliceUuid_ = sliceUuid_; + } else { + result.sliceUuid_ = sliceUuidBuilder_.build(); } onBuilt(); return result; @@ -5801,41 +29298,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextList) { - return mergeFrom((context.ContextOuterClass.ContextList)other); + if (other instanceof context.ContextOuterClass.SliceId) { + return mergeFrom((context.ContextOuterClass.SliceId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextList other) { - if (other == context.ContextOuterClass.ContextList.getDefaultInstance()) return this; - if (contextsBuilder_ == null) { - if (!other.contexts_.isEmpty()) { - if (contexts_.isEmpty()) { - contexts_ = other.contexts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureContextsIsMutable(); - contexts_.addAll(other.contexts_); - } - onChanged(); - } - } else { - if (!other.contexts_.isEmpty()) { - if (contextsBuilder_.isEmpty()) { - contextsBuilder_.dispose(); - contextsBuilder_ = null; - contexts_ = other.contexts_; - bitField0_ = (bitField0_ & ~0x00000001); - contextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getContextsFieldBuilder() : null; - } else { - contextsBuilder_.addAllMessages(other.contexts_); - } - } + public Builder mergeFrom(context.ContextOuterClass.SliceId other) { + if (other == context.ContextOuterClass.SliceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasSliceUuid()) { + mergeSliceUuid(other.getSliceUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -5852,11 +29329,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextList parsedMessage = null; + context.ContextOuterClass.SliceId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -5865,246 +29342,243 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List contexts_ = - java.util.Collections.emptyList(); - private void ensureContextsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - contexts_ = new java.util.ArrayList(contexts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> contextsBuilder_; + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; /** - * repeated .context.Context contexts = 1; - */ - public java.util.List getContextsList() { - if (contextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(contexts_); - } else { - return contextsBuilder_.getMessageList(); - } - } - /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. */ - public int getContextsCount() { - if (contextsBuilder_ == null) { - return contexts_.size(); - } else { - return contextsBuilder_.getCount(); - } + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ - public context.ContextOuterClass.Context getContexts(int index) { - if (contextsBuilder_ == null) { - return contexts_.get(index); + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } else { - return contextsBuilder_.getMessage(index); + return contextIdBuilder_.getMessage(); } } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder setContexts( - int index, context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureContextsIsMutable(); - contexts_.set(index, value); + contextId_ = value; onChanged(); } else { - contextsBuilder_.setMessage(index, value); + contextIdBuilder_.setMessage(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder setContexts( - int index, context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.set(index, builderForValue.build()); + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); onChanged(); } else { - contextsBuilder_.setMessage(index, builderForValue.build()); + contextIdBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts(context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; } - ensureContextsIsMutable(); - contexts_.add(value); onChanged(); } else { - contextsBuilder_.addMessage(value); + contextIdBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - int index, context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContextsIsMutable(); - contexts_.add(index, value); + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; onChanged(); } else { - contextsBuilder_.addMessage(index, value); + contextId_ = null; + contextIdBuilder_ = null; } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); } else { - contextsBuilder_.addMessage(builderForValue.build()); + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } - return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - int index, context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.add(index, builderForValue.build()); - onChanged(); - } else { - contextsBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; } - return this; + return contextIdBuilder_; } + + private context.ContextOuterClass.Uuid sliceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> sliceUuidBuilder_; /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ - public Builder addAllContexts( - java.lang.Iterable values) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, contexts_); - onChanged(); + public boolean hasSliceUuid() { + return sliceUuidBuilder_ != null || sliceUuid_ != null; + } + /** + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. + */ + public context.ContextOuterClass.Uuid getSliceUuid() { + if (sliceUuidBuilder_ == null) { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; } else { - contextsBuilder_.addAllMessages(values); + return sliceUuidBuilder_.getMessage(); } - return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public Builder clearContexts() { - if (contextsBuilder_ == null) { - contexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceUuid_ = value; onChanged(); } else { - contextsBuilder_.clear(); + sliceUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public Builder removeContexts(int index) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.remove(index); + public Builder setSliceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = builderForValue.build(); onChanged(); } else { - contextsBuilder_.remove(index); + sliceUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.Context contexts = 1; - */ - public context.ContextOuterClass.Context.Builder getContextsBuilder( - int index) { - return getContextsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index) { - if (contextsBuilder_ == null) { - return contexts_.get(index); } else { - return contextsBuilder_.getMessageOrBuilder(index); + public Builder mergeSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (sliceUuid_ != null) { + sliceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(sliceUuid_).mergeFrom(value).buildPartial(); + } else { + sliceUuid_ = value; + } + onChanged(); + } else { + sliceUuidBuilder_.mergeFrom(value); } + + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public java.util.List - getContextsOrBuilderList() { - if (contextsBuilder_ != null) { - return contextsBuilder_.getMessageOrBuilderList(); + public Builder clearSliceUuid() { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(contexts_); + sliceUuid_ = null; + sliceUuidBuilder_ = null; } + + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.Context.Builder addContextsBuilder() { - return getContextsFieldBuilder().addBuilder( - context.ContextOuterClass.Context.getDefaultInstance()); + public context.ContextOuterClass.Uuid.Builder getSliceUuidBuilder() { + + onChanged(); + return getSliceUuidFieldBuilder().getBuilder(); } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.Context.Builder addContextsBuilder( - int index) { - return getContextsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Context.getDefaultInstance()); + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + if (sliceUuidBuilder_ != null) { + return sliceUuidBuilder_.getMessageOrBuilder(); + } else { + return sliceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public java.util.List - getContextsBuilderList() { - return getContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> - getContextsFieldBuilder() { - if (contextsBuilder_ == null) { - contextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder>( - contexts_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSliceUuidFieldBuilder() { + if (sliceUuidBuilder_ == null) { + sliceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSliceUuid(), getParentForChildren(), isClean()); - contexts_ = null; + sliceUuid_ = null; } - return contextsBuilder_; + return sliceUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -6119,100 +29593,245 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextList) + // @@protoc_insertion_point(builder_scope:context.SliceId) } - // @@protoc_insertion_point(class_scope:context.ContextList) - private static final context.ContextOuterClass.ContextList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceId) + private static final context.ContextOuterClass.SliceId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceId(); } - public static context.ContextOuterClass.ContextList getDefaultInstance() { + public static context.ContextOuterClass.SliceId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextList parsePartialFrom( + public SliceId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextList(input, extensionRegistry); + return new SliceId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextEvent) + public interface SliceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Slice) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. */ - boolean hasEvent(); + boolean hasSliceId(); /** - * .context.Event event = 1; - * @return The event. + * .context.SliceId slice_id = 1; + * @return The sliceId. */ - context.ContextOuterClass.Event getEvent(); + context.ContextOuterClass.SliceId getSliceId(); /** - * .context.Event event = 1; + * .context.SliceId slice_id = 1; */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - boolean hasContextId(); + java.util.List + getSliceEndpointIdsList(); /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - context.ContextOuterClass.ContextId getContextId(); + context.ContextOuterClass.EndPointId getSliceEndpointIds(int index); /** - * .context.ContextId context_id = 2; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + int getSliceEndpointIdsCount(); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + java.util.List + getSliceEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.Constraint slice_constraints = 3; + */ + java.util.List + getSliceConstraintsList(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + context.ContextOuterClass.Constraint getSliceConstraints(int index); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + int getSliceConstraintsCount(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + java.util.List + getSliceConstraintsOrBuilderList(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index); + + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + java.util.List + getSliceServiceIdsList(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + context.ContextOuterClass.ServiceId getSliceServiceIds(int index); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + int getSliceServiceIdsCount(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + java.util.List + getSliceServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index); + + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + java.util.List + getSliceSubsliceIdsList(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + context.ContextOuterClass.SliceId getSliceSubsliceIds(int index); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + int getSliceSubsliceIdsCount(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + java.util.List + getSliceSubsliceIdsOrBuilderList(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index); + + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + boolean hasSliceStatus(); + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatus getSliceStatus(); + /** + * .context.SliceStatus slice_status = 6; + */ + context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder(); + + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + boolean hasSliceConfig(); + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + context.ContextOuterClass.SliceConfig getSliceConfig(); + /** + * .context.SliceConfig slice_config = 7; + */ + context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder(); + + /** + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. + */ + boolean hasSliceOwner(); + /** + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. + */ + context.ContextOuterClass.SliceOwner getSliceOwner(); + /** + * .context.SliceOwner slice_owner = 8; + */ + context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder(); + + /** + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .context.Timestamp timestamp = 9; + * @return The timestamp. + */ + context.ContextOuterClass.Timestamp getTimestamp(); + /** + * .context.Timestamp timestamp = 9; + */ + context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder(); } /** - * Protobuf type {@code context.ContextEvent} + * Protobuf type {@code context.Slice} */ - public static final class ContextEvent extends + public static final class Slice extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextEvent) - ContextEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.Slice) + SliceOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextEvent.newBuilder() to construct. - private ContextEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Slice.newBuilder() to construct. + private Slice(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextEvent() { + private Slice() { + sliceEndpointIds_ = java.util.Collections.emptyList(); + sliceConstraints_ = java.util.Collections.emptyList(); + sliceServiceIds_ = java.util.Collections.emptyList(); + sliceSubsliceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextEvent(); + return new Slice(); } @java.lang.Override @@ -6220,7 +29839,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextEvent( + private Slice( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6228,6 +29847,7 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -6239,27 +29859,102 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); } break; } case 18: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + sliceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + sliceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + sliceServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + sliceSubsliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + case 50: { + context.ContextOuterClass.SliceStatus.Builder subBuilder = null; + if (sliceStatus_ != null) { + subBuilder = sliceStatus_.toBuilder(); + } + sliceStatus_ = input.readMessage(context.ContextOuterClass.SliceStatus.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceStatus_); + sliceStatus_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.SliceConfig.Builder subBuilder = null; + if (sliceConfig_ != null) { + subBuilder = sliceConfig_.toBuilder(); + } + sliceConfig_ = input.readMessage(context.ContextOuterClass.SliceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceConfig_); + sliceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + context.ContextOuterClass.SliceOwner.Builder subBuilder = null; + if (sliceOwner_ != null) { + subBuilder = sliceOwner_.toBuilder(); + } + sliceOwner_ = input.readMessage(context.ContextOuterClass.SliceOwner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceOwner_); + sliceOwner_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); } break; @@ -6279,73 +29974,323 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; + public static final int SLICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.SliceId sliceId_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. */ @java.lang.Override - public boolean hasEvent() { - return event_ != null; + public boolean hasSliceId() { + return sliceId_ != null; } /** - * .context.Event event = 1; - * @return The event. + * .context.SliceId slice_id = 1; + * @return The sliceId. */ @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; } /** - * .context.Event event = 1; + * .context.SliceId slice_id = 1; */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); } - public static final int CONTEXT_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ContextId contextId_; + public static final int SLICE_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List sliceEndpointIds_; /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; + public java.util.List getSliceEndpointIdsList() { + return sliceEndpointIds_; } /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public java.util.List + getSliceEndpointIdsOrBuilderList() { + return sliceEndpointIds_; } /** - * .context.ContextId context_id = 2; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); + public int getSliceEndpointIdsCount() { + return sliceEndpointIds_.size(); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + return sliceEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + return sliceEndpointIds_.get(index); + } + + public static final int SLICE_CONSTRAINTS_FIELD_NUMBER = 3; + private java.util.List sliceConstraints_; + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public java.util.List getSliceConstraintsList() { + return sliceConstraints_; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public java.util.List + getSliceConstraintsOrBuilderList() { + return sliceConstraints_; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public int getSliceConstraintsCount() { + return sliceConstraints_.size(); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + return sliceConstraints_.get(index); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + return sliceConstraints_.get(index); + } + + public static final int SLICE_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List sliceServiceIds_; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public java.util.List getSliceServiceIdsList() { + return sliceServiceIds_; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public java.util.List + getSliceServiceIdsOrBuilderList() { + return sliceServiceIds_; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public int getSliceServiceIdsCount() { + return sliceServiceIds_.size(); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + return sliceServiceIds_.get(index); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + return sliceServiceIds_.get(index); + } + + public static final int SLICE_SUBSLICE_IDS_FIELD_NUMBER = 5; + private java.util.List sliceSubsliceIds_; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public java.util.List getSliceSubsliceIdsList() { + return sliceSubsliceIds_; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public java.util.List + getSliceSubsliceIdsOrBuilderList() { + return sliceSubsliceIds_; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public int getSliceSubsliceIdsCount() { + return sliceSubsliceIds_.size(); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + return sliceSubsliceIds_.get(index); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + return sliceSubsliceIds_.get(index); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceStatus sliceStatus_; + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + @java.lang.Override + public boolean hasSliceStatus() { + return sliceStatus_ != null; + } + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatus getSliceStatus() { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + /** + * .context.SliceStatus slice_status = 6; + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + return getSliceStatus(); + } + + public static final int SLICE_CONFIG_FIELD_NUMBER = 7; + private context.ContextOuterClass.SliceConfig sliceConfig_; + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + @java.lang.Override + public boolean hasSliceConfig() { + return sliceConfig_ != null; + } + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.SliceConfig getSliceConfig() { + return sliceConfig_ == null ? context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; + } + /** + * .context.SliceConfig slice_config = 7; + */ + @java.lang.Override + public context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder() { + return getSliceConfig(); + } + + public static final int SLICE_OWNER_FIELD_NUMBER = 8; + private context.ContextOuterClass.SliceOwner sliceOwner_; + /** + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. + */ + @java.lang.Override + public boolean hasSliceOwner() { + return sliceOwner_ != null; + } + /** + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. + */ + @java.lang.Override + public context.ContextOuterClass.SliceOwner getSliceOwner() { + return sliceOwner_ == null ? context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; + } + /** + * .context.SliceOwner slice_owner = 8; + */ + @java.lang.Override + public context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder() { + return getSliceOwner(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private context.ContextOuterClass.Timestamp timestamp_; + /** + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 9; + * @return The timestamp. + */ + @java.lang.Override + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .context.Timestamp timestamp = 9; + */ + @java.lang.Override + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); } private byte memoizedIsInitialized = -1; @@ -6362,11 +30307,32 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (sliceId_ != null) { + output.writeMessage(1, getSliceId()); } - if (contextId_ != null) { - output.writeMessage(2, getContextId()); + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + output.writeMessage(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + output.writeMessage(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + output.writeMessage(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + output.writeMessage(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + output.writeMessage(6, getSliceStatus()); + } + if (sliceConfig_ != null) { + output.writeMessage(7, getSliceConfig()); + } + if (sliceOwner_ != null) { + output.writeMessage(8, getSliceOwner()); + } + if (timestamp_ != null) { + output.writeMessage(9, getTimestamp()); } unknownFields.writeTo(output); } @@ -6377,13 +30343,41 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (sliceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeMessageSize(1, getSliceId()); } - if (contextId_ != null) { + for (int i = 0; i < sliceEndpointIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getContextId()); + .computeMessageSize(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceStatus()); + } + if (sliceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSliceConfig()); + } + if (sliceOwner_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSliceOwner()); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getTimestamp()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -6395,20 +30389,43 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextEvent)) { + if (!(obj instanceof context.ContextOuterClass.Slice)) { return super.equals(obj); } - context.ContextOuterClass.ContextEvent other = (context.ContextOuterClass.ContextEvent) obj; - - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + context.ContextOuterClass.Slice other = (context.ContextOuterClass.Slice) obj; + + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!getSliceEndpointIdsList() + .equals(other.getSliceEndpointIdsList())) return false; + if (!getSliceConstraintsList() + .equals(other.getSliceConstraintsList())) return false; + if (!getSliceServiceIdsList() + .equals(other.getSliceServiceIdsList())) return false; + if (!getSliceSubsliceIdsList() + .equals(other.getSliceSubsliceIdsList())) return false; + if (hasSliceStatus() != other.hasSliceStatus()) return false; + if (hasSliceStatus()) { + if (!getSliceStatus() + .equals(other.getSliceStatus())) return false; + } + if (hasSliceConfig() != other.hasSliceConfig()) return false; + if (hasSliceConfig()) { + if (!getSliceConfig() + .equals(other.getSliceConfig())) return false; + } + if (hasSliceOwner() != other.hasSliceOwner()) return false; + if (hasSliceOwner()) { + if (!getSliceOwner() + .equals(other.getSliceOwner())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -6421,82 +30438,110 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); } - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + if (getSliceEndpointIdsCount() > 0) { + hash = (37 * hash) + SLICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceEndpointIdsList().hashCode(); + } + if (getSliceConstraintsCount() > 0) { + hash = (37 * hash) + SLICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getSliceConstraintsList().hashCode(); + } + if (getSliceServiceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceServiceIdsList().hashCode(); + } + if (getSliceSubsliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SUBSLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceSubsliceIdsList().hashCode(); + } + if (hasSliceStatus()) { + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getSliceStatus().hashCode(); + } + if (hasSliceConfig()) { + hash = (37 * hash) + SLICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSliceConfig().hashCode(); + } + if (hasSliceOwner()) { + hash = (37 * hash) + SLICE_OWNER_FIELD_NUMBER; + hash = (53 * hash) + getSliceOwner().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom(byte[] data) + public static context.ContextOuterClass.Slice parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Slice parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice 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 context.ContextOuterClass.ContextEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Slice parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseDelimitedFrom( + public static context.ContextOuterClass.Slice 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 context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6509,7 +30554,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.Slice prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -6525,26 +30570,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextEvent} + * Protobuf type {@code context.Slice} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextEvent) - context.ContextOuterClass.ContextEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Slice) + context.ContextOuterClass.SliceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); } - // Construct using context.ContextOuterClass.ContextEvent.newBuilder() + // Construct using context.ContextOuterClass.Slice.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6557,22 +30602,68 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getSliceEndpointIdsFieldBuilder(); + getSliceConstraintsFieldBuilder(); + getSliceServiceIdsFieldBuilder(); + getSliceSubsliceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; + if (sliceIdBuilder_ == null) { + sliceId_ = null; } else { - event_ = null; - eventBuilder_ = null; + sliceId_ = null; + sliceIdBuilder_ = null; } - if (contextIdBuilder_ == null) { - contextId_ = null; + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceEndpointIdsBuilder_.clear(); + } + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + sliceConstraintsBuilder_.clear(); + } + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + sliceServiceIdsBuilder_.clear(); + } + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + if (sliceConfigBuilder_ == null) { + sliceConfig_ = null; + } else { + sliceConfig_ = null; + sliceConfigBuilder_ = null; + } + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = null; + } else { + sliceOwner_ = null; + sliceOwnerBuilder_ = null; + } + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; } return this; } @@ -6580,17 +30671,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { - return context.ContextOuterClass.ContextEvent.getDefaultInstance(); + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return context.ContextOuterClass.Slice.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextEvent build() { - context.ContextOuterClass.ContextEvent result = buildPartial(); + public context.ContextOuterClass.Slice build() { + context.ContextOuterClass.Slice result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6598,17 +30689,69 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextEvent buildPartial() { - context.ContextOuterClass.ContextEvent result = new context.ContextOuterClass.ContextEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; + public context.ContextOuterClass.Slice buildPartial() { + context.ContextOuterClass.Slice result = new context.ContextOuterClass.Slice(this); + int from_bitField0_ = bitField0_; + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; } else { - result.event_ = eventBuilder_.build(); + result.sliceId_ = sliceIdBuilder_.build(); } - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + if (sliceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceEndpointIds_ = sliceEndpointIds_; } else { - result.contextId_ = contextIdBuilder_.build(); + result.sliceEndpointIds_ = sliceEndpointIdsBuilder_.build(); + } + if (sliceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.sliceConstraints_ = sliceConstraints_; + } else { + result.sliceConstraints_ = sliceConstraintsBuilder_.build(); + } + if (sliceServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.sliceServiceIds_ = sliceServiceIds_; + } else { + result.sliceServiceIds_ = sliceServiceIdsBuilder_.build(); + } + if (sliceSubsliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.sliceSubsliceIds_ = sliceSubsliceIds_; + } else { + result.sliceSubsliceIds_ = sliceSubsliceIdsBuilder_.build(); + } + if (sliceStatusBuilder_ == null) { + result.sliceStatus_ = sliceStatus_; + } else { + result.sliceStatus_ = sliceStatusBuilder_.build(); + } + if (sliceConfigBuilder_ == null) { + result.sliceConfig_ = sliceConfig_; + } else { + result.sliceConfig_ = sliceConfigBuilder_.build(); + } + if (sliceOwnerBuilder_ == null) { + result.sliceOwner_ = sliceOwner_; + } else { + result.sliceOwner_ = sliceOwnerBuilder_.build(); + } + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); } onBuilt(); return result; @@ -6648,1119 +30791,1718 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextEvent) { - return mergeFrom((context.ContextOuterClass.ContextEvent)other); + if (other instanceof context.ContextOuterClass.Slice) { + return mergeFrom((context.ContextOuterClass.Slice)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextEvent other) { - if (other == context.ContextOuterClass.ContextEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.Slice other) { + if (other == context.ContextOuterClass.Slice.getDefaultInstance()) return this; + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + if (sliceEndpointIdsBuilder_ == null) { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIds_.isEmpty()) { + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.addAll(other.sliceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIdsBuilder_.isEmpty()) { + sliceEndpointIdsBuilder_.dispose(); + sliceEndpointIdsBuilder_ = null; + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceEndpointIdsFieldBuilder() : null; + } else { + sliceEndpointIdsBuilder_.addAllMessages(other.sliceEndpointIds_); + } + } + } + if (sliceConstraintsBuilder_ == null) { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraints_.isEmpty()) { + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.addAll(other.sliceConstraints_); + } + onChanged(); + } + } else { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraintsBuilder_.isEmpty()) { + sliceConstraintsBuilder_.dispose(); + sliceConstraintsBuilder_ = null; + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + sliceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceConstraintsFieldBuilder() : null; + } else { + sliceConstraintsBuilder_.addAllMessages(other.sliceConstraints_); + } + } + } + if (sliceServiceIdsBuilder_ == null) { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIds_.isEmpty()) { + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.addAll(other.sliceServiceIds_); + } + onChanged(); + } + } else { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIdsBuilder_.isEmpty()) { + sliceServiceIdsBuilder_.dispose(); + sliceServiceIdsBuilder_ = null; + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + sliceServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceServiceIdsFieldBuilder() : null; + } else { + sliceServiceIdsBuilder_.addAllMessages(other.sliceServiceIds_); + } + } + } + if (sliceSubsliceIdsBuilder_ == null) { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIds_.isEmpty()) { + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.addAll(other.sliceSubsliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIdsBuilder_.isEmpty()) { + sliceSubsliceIdsBuilder_.dispose(); + sliceSubsliceIdsBuilder_ = null; + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + sliceSubsliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceSubsliceIdsFieldBuilder() : null; + } else { + sliceSubsliceIdsBuilder_.addAllMessages(other.sliceSubsliceIds_); + } + } + } + if (other.hasSliceStatus()) { + mergeSliceStatus(other.getSliceStatus()); + } + if (other.hasSliceConfig()) { + mergeSliceConfig(other.getSliceConfig()); + } + if (other.hasSliceOwner()) { + mergeSliceOwner(other.getSliceOwner()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 { + context.ContextOuterClass.Slice parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Slice) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 1; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 1; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + + private java.util.List sliceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureSliceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList(sliceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> sliceEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List getSliceEndpointIdsList() { + if (sliceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } else { + return sliceEndpointIdsBuilder_.getMessageList(); } - if (other.hasContextId()) { - mergeContextId(other.getContextId()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public int getSliceEndpointIdsCount() { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.size(); + } else { + return sliceEndpointIdsBuilder_.getCount(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); + } else { + return sliceEndpointIdsBuilder_.getMessage(index); + } } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.ContextEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, value); } return this; } - - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; } /** - * .context.Event event = 1; - * @return The event. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public Builder addSliceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(value); + onChanged(); } else { - return eventBuilder_.getMessage(); + sliceEndpointIdsBuilder_.addMessage(value); } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - event_ = value; + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, value); onChanged(); } else { - eventBuilder_.setMessage(value); + sliceEndpointIdsBuilder_.addMessage(index, value); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); + public Builder addSliceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(builderForValue.build()); onChanged(); } else { - eventBuilder_.setMessage(builderForValue.build()); + sliceEndpointIdsBuilder_.addMessage(builderForValue.build()); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, builderForValue.build()); onChanged(); } else { - eventBuilder_.mergeFrom(value); + sliceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; + public Builder addAllSliceEndpointIds( + java.lang.Iterable values) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceEndpointIds_); onChanged(); } else { - event_ = null; - eventBuilder_ = null; + sliceEndpointIdsBuilder_.addAllMessages(values); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); + public Builder clearSliceEndpointIds() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceEndpointIdsBuilder_.clear(); + } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); + public Builder removeSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.remove(index); + onChanged(); } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; + sliceEndpointIdsBuilder_.remove(index); } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), + public context.ContextOuterClass.EndPointId.Builder getSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); } else { + return sliceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List + getSliceEndpointIdsOrBuilderList() { + if (sliceEndpointIdsBuilder_ != null) { + return sliceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder() { + return getSliceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List + getSliceEndpointIdsBuilderList() { + return getSliceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsFieldBuilder() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + sliceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - event_ = null; + sliceEndpointIds_ = null; } - return eventBuilder_; + return sliceEndpointIdsBuilder_; } - private context.ContextOuterClass.ContextId contextId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + private java.util.List sliceConstraints_ = + java.util.Collections.emptyList(); + private void ensureSliceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList(sliceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> sliceConstraintsBuilder_; + /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.Constraint slice_constraints = 3; */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public java.util.List getSliceConstraintsList() { + if (sliceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } else { + return sliceConstraintsBuilder_.getMessageList(); + } } /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public int getSliceConstraintsCount() { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.size(); } else { - return contextIdBuilder_.getMessage(); + return sliceConstraintsBuilder_.getCount(); } } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); + } else { + return sliceConstraintsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, value); onChanged(); } else { - contextIdBuilder_.setMessage(value); + sliceConstraintsBuilder_.setMessage(index, value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, builderForValue.build()); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + sliceConstraintsBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); - } else { - contextId_ = value; + public Builder addSliceConstraints(context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(value); onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + sliceConstraintsBuilder_.addMessage(value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, value); onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceConstraintsBuilder_.addMessage(index, value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { - - onChanged(); - return getContextIdFieldBuilder().getBuilder(); + public Builder addSliceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, builderForValue.build()); + onChanged(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + sliceConstraintsBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), - getParentForChildren(), - isClean()); - contextId_ = null; + public Builder addAllSliceConstraints( + java.lang.Iterable values) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceConstraints_); + onChanged(); + } else { + sliceConstraintsBuilder_.addAllMessages(values); } - return contextIdBuilder_; - } - @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:context.ContextEvent) - } - - // @@protoc_insertion_point(class_scope:context.ContextEvent) - private static final context.ContextOuterClass.ContextEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextEvent(); - } - - public static context.ContextOuterClass.ContextEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ContextEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextEvent(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 context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface TopologyIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyId) - com.google.protobuf.MessageOrBuilder { - - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - boolean hasContextId(); - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - context.ContextOuterClass.ContextId getContextId(); - /** - * .context.ContextId context_id = 1; - */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); - - /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. - */ - boolean hasTopologyUuid(); - /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. - */ - context.ContextOuterClass.Uuid getTopologyUuid(); - /** - * .context.Uuid topology_uuid = 2; - */ - context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder(); - } - /** - *
-   * ----- Topology ------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.TopologyId} - */ - public static final class TopologyId extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyId) - TopologyIdOrBuilder { - private static final long serialVersionUID = 0L; - // Use TopologyId.newBuilder() to construct. - private TopologyId(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TopologyId() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TopologyId(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TopologyId( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + return this; } - 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: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); - } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (topologyUuid_ != null) { - subBuilder = topologyUuid_.toBuilder(); - } - topologyUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyUuid_); - topologyUuid_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder clearSliceConstraints() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + sliceConstraintsBuilder_.clear(); } - } 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(); + return this; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder removeSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.remove(index); + onChanged(); + } else { + sliceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder getSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); } else { + return sliceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public java.util.List + getSliceConstraintsOrBuilderList() { + if (sliceConstraintsBuilder_ != null) { + return sliceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder() { + return getSliceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public java.util.List + getSliceConstraintsBuilderList() { + return getSliceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsFieldBuilder() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + sliceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + sliceConstraints_ = null; + } + return sliceConstraintsBuilder_; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); - } - - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; - } - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; - } - /** - * .context.ContextId context_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); - } - - public static final int TOPOLOGY_UUID_FIELD_NUMBER = 2; - private context.ContextOuterClass.Uuid topologyUuid_; - /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. - */ - @java.lang.Override - public boolean hasTopologyUuid() { - return topologyUuid_ != null; - } - /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getTopologyUuid() { - return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; - } - /** - * .context.Uuid topology_uuid = 2; - */ - @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { - return getTopologyUuid(); - } - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private java.util.List sliceServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList(sliceServiceIds_); + bitField0_ |= 0x00000004; + } + } - memoizedIsInitialized = 1; - return true; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> sliceServiceIdsBuilder_; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List getSliceServiceIdsList() { + if (sliceServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } else { + return sliceServiceIdsBuilder_.getMessageList(); + } } - if (topologyUuid_ != null) { - output.writeMessage(2, getTopologyUuid()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public int getSliceServiceIdsCount() { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.size(); + } else { + return sliceServiceIdsBuilder_.getCount(); + } } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (contextId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); + } else { + return sliceServiceIdsBuilder_.getMessage(index); + } } - if (topologyUuid_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTopologyUuid()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, value); + } + return this; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; } - if (!(obj instanceof context.ContextOuterClass.TopologyId)) { - return super.equals(obj); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds(context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(value); + } + return this; } - context.ContextOuterClass.TopologyId other = (context.ContextOuterClass.TopologyId) obj; - - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, value); + } + return this; } - if (hasTopologyUuid() != other.hasTopologyUuid()) return false; - if (hasTopologyUuid()) { - if (!getTopologyUuid() - .equals(other.getTopologyUuid())) return false; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addAllSliceServiceIds( + java.lang.Iterable values) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceServiceIds_); + onChanged(); + } else { + sliceServiceIdsBuilder_.addAllMessages(values); + } + return this; } - if (hasTopologyUuid()) { - hash = (37 * hash) + TOPOLOGY_UUID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyUuid().hashCode(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder clearSliceServiceIds() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + sliceServiceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder removeSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.remove(index); + onChanged(); + } else { + sliceServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder getSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); } else { + return sliceServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List + getSliceServiceIdsOrBuilderList() { + if (sliceServiceIdsBuilder_ != null) { + return sliceServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder() { + return getSliceServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List + getSliceServiceIdsBuilderList() { + return getSliceServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsFieldBuilder() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + sliceServiceIds_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + sliceServiceIds_ = null; + } + return sliceServiceIdsBuilder_; } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - public static context.ContextOuterClass.TopologyId parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } + private java.util.List sliceSubsliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceSubsliceIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList(sliceSubsliceIds_); + bitField0_ |= 0x00000008; + } + } - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(context.ContextOuterClass.TopologyId prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceSubsliceIdsBuilder_; - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * ----- Topology ------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.TopologyId} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyId) - context.ContextOuterClass.TopologyIdOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List getSliceSubsliceIdsList() { + if (sliceSubsliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } else { + return sliceSubsliceIdsBuilder_.getMessageList(); + } } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public int getSliceSubsliceIdsCount() { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.size(); + } else { + return sliceSubsliceIdsBuilder_.getCount(); + } } - - // Construct using context.ContextOuterClass.TopologyId.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); + } else { + return sliceSubsliceIdsBuilder_.getMessage(index); + } } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, value); + } + return this; } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, builderForValue.build()); } + return this; } - @java.lang.Override - public Builder clear() { - super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds(context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(value); + onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceSubsliceIdsBuilder_.addMessage(value); } - if (topologyUuidBuilder_ == null) { - topologyUuid_ = null; + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, value); + onChanged(); } else { - topologyUuid_ = null; - topologyUuidBuilder_ = null; + sliceSubsliceIdsBuilder_.addMessage(index, value); } return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; } - - @java.lang.Override - public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyId.getDefaultInstance(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addAllSliceSubsliceIds( + java.lang.Iterable values) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceSubsliceIds_); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder clearSliceSubsliceIds() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder removeSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.remove(index); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder getSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); } else { + return sliceSubsliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List + getSliceSubsliceIdsOrBuilderList() { + if (sliceSubsliceIdsBuilder_ != null) { + return sliceSubsliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder() { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List + getSliceSubsliceIdsBuilderList() { + return getSliceSubsliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsFieldBuilder() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceSubsliceIds_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + sliceSubsliceIds_ = null; + } + return sliceSubsliceIdsBuilder_; } - @java.lang.Override - public context.ContextOuterClass.TopologyId build() { - context.ContextOuterClass.TopologyId result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + private context.ContextOuterClass.SliceStatus sliceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> sliceStatusBuilder_; + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + public boolean hasSliceStatus() { + return sliceStatusBuilder_ != null || sliceStatus_ != null; + } + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + public context.ContextOuterClass.SliceStatus getSliceStatus() { + if (sliceStatusBuilder_ == null) { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } else { + return sliceStatusBuilder_.getMessage(); } - return result; } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceStatus_ = value; + onChanged(); + } else { + sliceStatusBuilder_.setMessage(value); + } - @java.lang.Override - public context.ContextOuterClass.TopologyId buildPartial() { - context.ContextOuterClass.TopologyId result = new context.ContextOuterClass.TopologyId(this); - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + return this; + } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder setSliceStatus( + context.ContextOuterClass.SliceStatus.Builder builderForValue) { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = builderForValue.build(); + onChanged(); } else { - result.contextId_ = contextIdBuilder_.build(); + sliceStatusBuilder_.setMessage(builderForValue.build()); } - if (topologyUuidBuilder_ == null) { - result.topologyUuid_ = topologyUuid_; + + return this; + } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder mergeSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (sliceStatus_ != null) { + sliceStatus_ = + context.ContextOuterClass.SliceStatus.newBuilder(sliceStatus_).mergeFrom(value).buildPartial(); + } else { + sliceStatus_ = value; + } + onChanged(); } else { - result.topologyUuid_ = topologyUuidBuilder_.build(); + sliceStatusBuilder_.mergeFrom(value); } - onBuilt(); - return result; - } - @java.lang.Override - public Builder clone() { - return super.clone(); + return this; } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder clearSliceStatus() { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + onChanged(); + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + + return this; } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * .context.SliceStatus slice_status = 6; + */ + public context.ContextOuterClass.SliceStatus.Builder getSliceStatusBuilder() { + + onChanged(); + return getSliceStatusFieldBuilder().getBuilder(); } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * .context.SliceStatus slice_status = 6; + */ + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + if (sliceStatusBuilder_ != null) { + return sliceStatusBuilder_.getMessageOrBuilder(); + } else { + return sliceStatus_ == null ? + context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * .context.SliceStatus slice_status = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> + getSliceStatusFieldBuilder() { + if (sliceStatusBuilder_ == null) { + sliceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder>( + getSliceStatus(), + getParentForChildren(), + isClean()); + sliceStatus_ = null; + } + return sliceStatusBuilder_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + + private context.ContextOuterClass.SliceConfig sliceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder> sliceConfigBuilder_; + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + public boolean hasSliceConfig() { + return sliceConfigBuilder_ != null || sliceConfig_ != null; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyId) { - return mergeFrom((context.ContextOuterClass.TopologyId)other); + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + public context.ContextOuterClass.SliceConfig getSliceConfig() { + if (sliceConfigBuilder_ == null) { + return sliceConfig_ == null ? context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; } else { - super.mergeFrom(other); - return this; + return sliceConfigBuilder_.getMessage(); } } - - public Builder mergeFrom(context.ContextOuterClass.TopologyId other) { - if (other == context.ContextOuterClass.TopologyId.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); - } - if (other.hasTopologyUuid()) { - mergeTopologyUuid(other.getTopologyUuid()); + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder setSliceConfig(context.ContextOuterClass.SliceConfig value) { + if (sliceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceConfig_ = value; + onChanged(); + } else { + sliceConfigBuilder_.setMessage(value); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + return this; } + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder setSliceConfig( + context.ContextOuterClass.SliceConfig.Builder builderForValue) { + if (sliceConfigBuilder_ == null) { + sliceConfig_ = builderForValue.build(); + onChanged(); + } else { + sliceConfigBuilder_.setMessage(builderForValue.build()); + } - @java.lang.Override - public final boolean isInitialized() { - return true; + return this; } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.TopologyId parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyId) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder mergeSliceConfig(context.ContextOuterClass.SliceConfig value) { + if (sliceConfigBuilder_ == null) { + if (sliceConfig_ != null) { + sliceConfig_ = + context.ContextOuterClass.SliceConfig.newBuilder(sliceConfig_).mergeFrom(value).buildPartial(); + } else { + sliceConfig_ = value; } + onChanged(); + } else { + sliceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder clearSliceConfig() { + if (sliceConfigBuilder_ == null) { + sliceConfig_ = null; + onChanged(); + } else { + sliceConfig_ = null; + sliceConfigBuilder_ = null; } + return this; } + /** + * .context.SliceConfig slice_config = 7; + */ + public context.ContextOuterClass.SliceConfig.Builder getSliceConfigBuilder() { + + onChanged(); + return getSliceConfigFieldBuilder().getBuilder(); + } + /** + * .context.SliceConfig slice_config = 7; + */ + public context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder() { + if (sliceConfigBuilder_ != null) { + return sliceConfigBuilder_.getMessageOrBuilder(); + } else { + return sliceConfig_ == null ? + context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; + } + } + /** + * .context.SliceConfig slice_config = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder> + getSliceConfigFieldBuilder() { + if (sliceConfigBuilder_ == null) { + sliceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder>( + getSliceConfig(), + getParentForChildren(), + isClean()); + sliceConfig_ = null; + } + return sliceConfigBuilder_; + } - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.SliceOwner sliceOwner_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder> sliceOwnerBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasSliceOwner() { + return sliceOwnerBuilder_ != null || sliceOwner_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.SliceOwner getSliceOwner() { + if (sliceOwnerBuilder_ == null) { + return sliceOwner_ == null ? context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; } else { - return contextIdBuilder_.getMessage(); + return sliceOwnerBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setSliceOwner(context.ContextOuterClass.SliceOwner value) { + if (sliceOwnerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + sliceOwner_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + sliceOwnerBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setSliceOwner( + context.ContextOuterClass.SliceOwner.Builder builderForValue) { + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + sliceOwnerBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + public Builder mergeSliceOwner(context.ContextOuterClass.SliceOwner value) { + if (sliceOwnerBuilder_ == null) { + if (sliceOwner_ != null) { + sliceOwner_ = + context.ContextOuterClass.SliceOwner.newBuilder(sliceOwner_).mergeFrom(value).buildPartial(); } else { - contextId_ = value; + sliceOwner_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + sliceOwnerBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearSliceOwner() { + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceOwner_ = null; + sliceOwnerBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.SliceOwner.Builder getSliceOwnerBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getSliceOwnerFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder() { + if (sliceOwnerBuilder_ != null) { + return sliceOwnerBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return sliceOwner_ == null ? + context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; } } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder> + getSliceOwnerFieldBuilder() { + if (sliceOwnerBuilder_ == null) { + sliceOwnerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder>( + getSliceOwner(), getParentForChildren(), isClean()); - contextId_ = null; + sliceOwner_ = null; } - return contextIdBuilder_; + return sliceOwnerBuilder_; } - private context.ContextOuterClass.Uuid topologyUuid_; + private context.ContextOuterClass.Timestamp timestamp_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> topologyUuidBuilder_; + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. */ - public boolean hasTopologyUuid() { - return topologyUuidBuilder_ != null || topologyUuid_ != null; + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; } /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. + * .context.Timestamp timestamp = 9; + * @return The timestamp. */ - public context.ContextOuterClass.Uuid getTopologyUuid() { - if (topologyUuidBuilder_ == null) { - return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } else { - return topologyUuidBuilder_.getMessage(); + return timestampBuilder_.getMessage(); } } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder setTopologyUuid(context.ContextOuterClass.Uuid value) { - if (topologyUuidBuilder_ == null) { + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - topologyUuid_ = value; + timestamp_ = value; onChanged(); } else { - topologyUuidBuilder_.setMessage(value); + timestampBuilder_.setMessage(value); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder setTopologyUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (topologyUuidBuilder_ == null) { - topologyUuid_ = builderForValue.build(); + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); onChanged(); } else { - topologyUuidBuilder_.setMessage(builderForValue.build()); + timestampBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder mergeTopologyUuid(context.ContextOuterClass.Uuid value) { - if (topologyUuidBuilder_ == null) { - if (topologyUuid_ != null) { - topologyUuid_ = - context.ContextOuterClass.Uuid.newBuilder(topologyUuid_).mergeFrom(value).buildPartial(); + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); } else { - topologyUuid_ = value; + timestamp_ = value; } onChanged(); } else { - topologyUuidBuilder_.mergeFrom(value); + timestampBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder clearTopologyUuid() { - if (topologyUuidBuilder_ == null) { - topologyUuid_ = null; + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; onChanged(); } else { - topologyUuid_ = null; - topologyUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public context.ContextOuterClass.Uuid.Builder getTopologyUuidBuilder() { + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { onChanged(); - return getTopologyUuidFieldBuilder().getBuilder(); + return getTimestampFieldBuilder().getBuilder(); } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { - if (topologyUuidBuilder_ != null) { - return topologyUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); } else { - return topologyUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getTopologyUuidFieldBuilder() { - if (topologyUuidBuilder_ == null) { - topologyUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getTopologyUuid(), + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); - topologyUuid_ = null; + timestamp_ = null; } - return topologyUuidBuilder_; + return timestampBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -7775,135 +32517,98 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyId) + // @@protoc_insertion_point(builder_scope:context.Slice) } - // @@protoc_insertion_point(class_scope:context.TopologyId) - private static final context.ContextOuterClass.TopologyId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Slice) + private static final context.ContextOuterClass.Slice DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Slice(); } - public static context.ContextOuterClass.TopologyId getDefaultInstance() { + public static context.ContextOuterClass.Slice getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyId parsePartialFrom( + public Slice parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyId(input, extensionRegistry); + return new Slice(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + public context.ContextOuterClass.Slice getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Topology) + public interface SliceOwnerOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceOwner) com.google.protobuf.MessageOrBuilder { /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - boolean hasTopologyId(); - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - context.ContextOuterClass.TopologyId getTopologyId(); - /** - * .context.TopologyId topology_id = 1; - */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); - - /** - * repeated .context.DeviceId device_ids = 2; - */ - java.util.List - getDeviceIdsList(); - /** - * repeated .context.DeviceId device_ids = 2; - */ - context.ContextOuterClass.DeviceId getDeviceIds(int index); - /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ - int getDeviceIdsCount(); + boolean hasOwnerUuid(); /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ - java.util.List - getDeviceIdsOrBuilderList(); + context.ContextOuterClass.Uuid getOwnerUuid(); /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index); + context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder(); /** - * repeated .context.LinkId link_ids = 3; - */ - java.util.List - getLinkIdsList(); - /** - * repeated .context.LinkId link_ids = 3; - */ - context.ContextOuterClass.LinkId getLinkIds(int index); - /** - * repeated .context.LinkId link_ids = 3; - */ - int getLinkIdsCount(); - /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The ownerString. */ - java.util.List - getLinkIdsOrBuilderList(); + java.lang.String getOwnerString(); /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index); + com.google.protobuf.ByteString + getOwnerStringBytes(); } /** - * Protobuf type {@code context.Topology} + * Protobuf type {@code context.SliceOwner} */ - public static final class Topology extends + public static final class SliceOwner extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Topology) - TopologyOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceOwner) + SliceOwnerOrBuilder { private static final long serialVersionUID = 0L; - // Use Topology.newBuilder() to construct. - private Topology(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceOwner.newBuilder() to construct. + private SliceOwner(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Topology() { - deviceIds_ = java.util.Collections.emptyList(); - linkIds_ = java.util.Collections.emptyList(); + private SliceOwner() { + ownerString_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Topology(); + return new SliceOwner(); } @java.lang.Override @@ -7911,7 +32616,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Topology( + private SliceOwner( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7919,7 +32624,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -7931,34 +32635,22 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (ownerUuid_ != null) { + subBuilder = ownerUuid_.toBuilder(); } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + ownerUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(ownerUuid_); + ownerUuid_ = subBuilder.buildPartial(); } break; } case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceIds_.add( - input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - linkIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - linkIds_.add( - input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + ownerString_ = s; break; } default: { @@ -7976,133 +32668,85 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceOwner_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); - } - - public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.TopologyId topologyId_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - /** - * .context.TopologyId topology_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + context.ContextOuterClass.SliceOwner.class, context.ContextOuterClass.SliceOwner.Builder.class); } - public static final int DEVICE_IDS_FIELD_NUMBER = 2; - private java.util.List deviceIds_; + public static final int OWNER_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid ownerUuid_; /** - * repeated .context.DeviceId device_ids = 2; - */ - @java.lang.Override - public java.util.List getDeviceIdsList() { - return deviceIds_; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - @java.lang.Override - public java.util.List - getDeviceIdsOrBuilderList() { - return deviceIds_; - } - /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ @java.lang.Override - public int getDeviceIdsCount() { - return deviceIds_.size(); + public boolean hasOwnerUuid() { + return ownerUuid_ != null; } /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - return deviceIds_.get(index); + public context.ContextOuterClass.Uuid getOwnerUuid() { + return ownerUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - return deviceIds_.get(index); + public context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder() { + return getOwnerUuid(); } - public static final int LINK_IDS_FIELD_NUMBER = 3; - private java.util.List linkIds_; - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public java.util.List getLinkIdsList() { - return linkIds_; - } - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public java.util.List - getLinkIdsOrBuilderList() { - return linkIds_; - } - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public int getLinkIdsCount() { - return linkIds_.size(); - } + public static final int OWNER_STRING_FIELD_NUMBER = 2; + private volatile java.lang.Object ownerString_; /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The ownerString. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkIds(int index) { - return linkIds_.get(index); + public java.lang.String getOwnerString() { + java.lang.Object ref = ownerString_; + 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(); + ownerString_ = s; + return s; + } } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index) { - return linkIds_.get(index); + public com.google.protobuf.ByteString + getOwnerStringBytes() { + java.lang.Object ref = ownerString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ownerString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -8119,14 +32763,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (topologyId_ != null) { - output.writeMessage(1, getTopologyId()); - } - for (int i = 0; i < deviceIds_.size(); i++) { - output.writeMessage(2, deviceIds_.get(i)); + if (ownerUuid_ != null) { + output.writeMessage(1, getOwnerUuid()); } - for (int i = 0; i < linkIds_.size(); i++) { - output.writeMessage(3, linkIds_.get(i)); + if (!getOwnerStringBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ownerString_); } unknownFields.writeTo(output); } @@ -8137,17 +32778,12 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (topologyId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTopologyId()); - } - for (int i = 0; i < deviceIds_.size(); i++) { + if (ownerUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, deviceIds_.get(i)); + .computeMessageSize(1, getOwnerUuid()); } - for (int i = 0; i < linkIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, linkIds_.get(i)); + if (!getOwnerStringBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ownerString_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -8159,20 +32795,18 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Topology)) { + if (!(obj instanceof context.ContextOuterClass.SliceOwner)) { return super.equals(obj); } - context.ContextOuterClass.Topology other = (context.ContextOuterClass.Topology) obj; + context.ContextOuterClass.SliceOwner other = (context.ContextOuterClass.SliceOwner) obj; - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; + if (hasOwnerUuid() != other.hasOwnerUuid()) return false; + if (hasOwnerUuid()) { + if (!getOwnerUuid() + .equals(other.getOwnerUuid())) return false; } - if (!getDeviceIdsList() - .equals(other.getDeviceIdsList())) return false; - if (!getLinkIdsList() - .equals(other.getLinkIdsList())) return false; + if (!getOwnerString() + .equals(other.getOwnerString())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -8184,86 +32818,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); - } - if (getDeviceIdsCount() > 0) { - hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceIdsList().hashCode(); - } - if (getLinkIdsCount() > 0) { - hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkIdsList().hashCode(); + if (hasOwnerUuid()) { + hash = (37 * hash) + OWNER_UUID_FIELD_NUMBER; + hash = (53 * hash) + getOwnerUuid().hashCode(); } + hash = (37 * hash) + OWNER_STRING_FIELD_NUMBER; + hash = (53 * hash) + getOwnerString().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom(byte[] data) + public static context.ContextOuterClass.SliceOwner parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceOwner parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner 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 context.ContextOuterClass.Topology parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceOwner parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseDelimitedFrom( + public static context.ContextOuterClass.SliceOwner 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 context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -8276,7 +32904,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Topology prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceOwner prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -8292,26 +32920,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Topology} + * Protobuf type {@code context.SliceOwner} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Topology) - context.ContextOuterClass.TopologyOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceOwner) + context.ContextOuterClass.SliceOwnerOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceOwner_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + context.ContextOuterClass.SliceOwner.class, context.ContextOuterClass.SliceOwner.Builder.class); } - // Construct using context.ContextOuterClass.Topology.newBuilder() + // Construct using context.ContextOuterClass.SliceOwner.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -8324,48 +32952,36 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDeviceIdsFieldBuilder(); - getLinkIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdBuilder_ == null) { - topologyId_ = null; - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - deviceIdsBuilder_.clear(); - } - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + if (ownerUuidBuilder_ == null) { + ownerUuid_ = null; } else { - linkIdsBuilder_.clear(); + ownerUuid_ = null; + ownerUuidBuilder_ = null; } + ownerString_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override - public context.ContextOuterClass.Topology getDefaultInstanceForType() { - return context.ContextOuterClass.Topology.getDefaultInstance(); + public context.ContextOuterClass.SliceOwner getDefaultInstanceForType() { + return context.ContextOuterClass.SliceOwner.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Topology build() { - context.ContextOuterClass.Topology result = buildPartial(); + public context.ContextOuterClass.SliceOwner build() { + context.ContextOuterClass.SliceOwner result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -8373,32 +32989,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Topology buildPartial() { - context.ContextOuterClass.Topology result = new context.ContextOuterClass.Topology(this); - int from_bitField0_ = bitField0_; - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; - } else { - result.topologyId_ = topologyIdBuilder_.build(); - } - if (deviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceIds_ = deviceIds_; - } else { - result.deviceIds_ = deviceIdsBuilder_.build(); - } - if (linkIdsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.linkIds_ = linkIds_; + public context.ContextOuterClass.SliceOwner buildPartial() { + context.ContextOuterClass.SliceOwner result = new context.ContextOuterClass.SliceOwner(this); + if (ownerUuidBuilder_ == null) { + result.ownerUuid_ = ownerUuid_; } else { - result.linkIds_ = linkIdsBuilder_.build(); + result.ownerUuid_ = ownerUuidBuilder_.build(); } + result.ownerString_ = ownerString_; onBuilt(); return result; } @@ -8437,70 +33035,22 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Topology) { - return mergeFrom((context.ContextOuterClass.Topology)other); + if (other instanceof context.ContextOuterClass.SliceOwner) { + return mergeFrom((context.ContextOuterClass.SliceOwner)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Topology other) { - if (other == context.ContextOuterClass.Topology.getDefaultInstance()) return this; - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); - } - if (deviceIdsBuilder_ == null) { - if (!other.deviceIds_.isEmpty()) { - if (deviceIds_.isEmpty()) { - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceIdsIsMutable(); - deviceIds_.addAll(other.deviceIds_); - } - onChanged(); - } - } else { - if (!other.deviceIds_.isEmpty()) { - if (deviceIdsBuilder_.isEmpty()) { - deviceIdsBuilder_.dispose(); - deviceIdsBuilder_ = null; - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - deviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceIdsFieldBuilder() : null; - } else { - deviceIdsBuilder_.addAllMessages(other.deviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.SliceOwner other) { + if (other == context.ContextOuterClass.SliceOwner.getDefaultInstance()) return this; + if (other.hasOwnerUuid()) { + mergeOwnerUuid(other.getOwnerUuid()); } - if (linkIdsBuilder_ == null) { - if (!other.linkIds_.isEmpty()) { - if (linkIds_.isEmpty()) { - linkIds_ = other.linkIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureLinkIdsIsMutable(); - linkIds_.addAll(other.linkIds_); - } - onChanged(); - } - } else { - if (!other.linkIds_.isEmpty()) { - if (linkIdsBuilder_.isEmpty()) { - linkIdsBuilder_.dispose(); - linkIdsBuilder_ = null; - linkIds_ = other.linkIds_; - bitField0_ = (bitField0_ & ~0x00000002); - linkIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkIdsFieldBuilder() : null; - } else { - linkIdsBuilder_.addAllMessages(other.linkIds_); - } - } + if (!other.getOwnerString().isEmpty()) { + ownerString_ = other.ownerString_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -8512,623 +33062,743 @@ public final class ContextOuterClass { return true; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.Topology parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Topology) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } else { - return topologyIdBuilder_.getMessage(); - } - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; - onChanged(); - } else { - topologyIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); - onChanged(); - } else { - topologyIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } - onChanged(); - } else { - topologyIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; - onChanged(); - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); - } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - } - /** - * .context.TopologyId topology_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), - getParentForChildren(), - isClean()); - topologyId_ = null; - } - return topologyIdBuilder_; - } - - private java.util.List deviceIds_ = - java.util.Collections.emptyList(); - private void ensureDeviceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(deviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; - - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List getDeviceIdsList() { - if (deviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceIds_); - } else { - return deviceIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public int getDeviceIdsCount() { - if (deviceIdsBuilder_ == null) { - return deviceIds_.size(); - } else { - return deviceIdsBuilder_.getCount(); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); - } else { - return deviceIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, value); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(value); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, value); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addAllDeviceIds( - java.lang.Iterable values) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceIds_); - onChanged(); - } else { - deviceIdsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder clearDeviceIds() { - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - deviceIdsBuilder_.clear(); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder removeDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.remove(index); - onChanged(); - } else { - deviceIdsBuilder_.remove(index); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); } else { - return deviceIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List - getDeviceIdsOrBuilderList() { - if (deviceIdsBuilder_ != null) { - return deviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(deviceIds_); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { - return getDeviceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List - getDeviceIdsBuilderList() { - return getDeviceIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdsFieldBuilder() { - if (deviceIdsBuilder_ == null) { - deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - deviceIds_ = null; - } - return deviceIdsBuilder_; - } - - private java.util.List linkIds_ = - java.util.Collections.emptyList(); - private void ensureLinkIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - linkIds_ = new java.util.ArrayList(linkIds_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; - - /** - * repeated .context.LinkId link_ids = 3; - */ - public java.util.List getLinkIdsList() { - if (linkIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkIds_); - } else { - return linkIdsBuilder_.getMessageList(); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceOwner parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceOwner) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private context.ContextOuterClass.Uuid ownerUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> ownerUuidBuilder_; /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ - public int getLinkIdsCount() { - if (linkIdsBuilder_ == null) { - return linkIds_.size(); - } else { - return linkIdsBuilder_.getCount(); - } + public boolean hasOwnerUuid() { + return ownerUuidBuilder_ != null || ownerUuid_ != null; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ - public context.ContextOuterClass.LinkId getLinkIds(int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); + public context.ContextOuterClass.Uuid getOwnerUuid() { + if (ownerUuidBuilder_ == null) { + return ownerUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } else { - return linkIdsBuilder_.getMessage(index); + return ownerUuidBuilder_.getMessage(); } } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder setOwnerUuid(context.ContextOuterClass.Uuid value) { + if (ownerUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.set(index, value); + ownerUuid_ = value; onChanged(); } else { - linkIdsBuilder_.setMessage(index, value); + ownerUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.set(index, builderForValue.build()); + public Builder setOwnerUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (ownerUuidBuilder_ == null) { + ownerUuid_ = builderForValue.build(); onChanged(); } else { - linkIdsBuilder_.setMessage(index, builderForValue.build()); + ownerUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds(context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeOwnerUuid(context.ContextOuterClass.Uuid value) { + if (ownerUuidBuilder_ == null) { + if (ownerUuid_ != null) { + ownerUuid_ = + context.ContextOuterClass.Uuid.newBuilder(ownerUuid_).mergeFrom(value).buildPartial(); + } else { + ownerUuid_ = value; } - ensureLinkIdsIsMutable(); - linkIds_.add(value); onChanged(); } else { - linkIdsBuilder_.addMessage(value); + ownerUuidBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinkIdsIsMutable(); - linkIds_.add(index, value); + public Builder clearOwnerUuid() { + if (ownerUuidBuilder_ == null) { + ownerUuid_ = null; onChanged(); } else { - linkIdsBuilder_.addMessage(index, value); + ownerUuid_ = null; + ownerUuidBuilder_ = null; } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.Uuid.Builder getOwnerUuidBuilder() { + + onChanged(); + return getOwnerUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid owner_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder() { + if (ownerUuidBuilder_ != null) { + return ownerUuidBuilder_.getMessageOrBuilder(); } else { - linkIdsBuilder_.addMessage(builderForValue.build()); + return ownerUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } - return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(index, builderForValue.build()); - onChanged(); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getOwnerUuidFieldBuilder() { + if (ownerUuidBuilder_ == null) { + ownerUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getOwnerUuid(), + getParentForChildren(), + isClean()); + ownerUuid_ = null; + } + return ownerUuidBuilder_; + } + + private java.lang.Object ownerString_ = ""; + /** + * string owner_string = 2; + * @return The ownerString. + */ + public java.lang.String getOwnerString() { + java.lang.Object ref = ownerString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ownerString_ = s; + return s; } else { - linkIdsBuilder_.addMessage(index, builderForValue.build()); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ - public Builder addAllLinkIds( - java.lang.Iterable values) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkIds_); - onChanged(); + public com.google.protobuf.ByteString + getOwnerStringBytes() { + java.lang.Object ref = ownerString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ownerString_ = b; + return b; } else { - linkIdsBuilder_.addAllMessages(values); + return (com.google.protobuf.ByteString) ref; } + } + /** + * string owner_string = 2; + * @param value The ownerString to set. + * @return This builder for chaining. + */ + public Builder setOwnerString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ownerString_ = value; + onChanged(); return this; } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return This builder for chaining. */ - public Builder clearLinkIds() { - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); + public Builder clearOwnerString() { + + ownerString_ = getDefaultInstance().getOwnerString(); + onChanged(); + return this; + } + /** + * string owner_string = 2; + * @param value The bytes for ownerString to set. + * @return This builder for chaining. + */ + public Builder setOwnerStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ownerString_ = 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:context.SliceOwner) + } + + // @@protoc_insertion_point(class_scope:context.SliceOwner) + private static final context.ContextOuterClass.SliceOwner DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceOwner(); + } + + public static context.ContextOuterClass.SliceOwner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SliceOwner parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceOwner(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 context.ContextOuterClass.SliceOwner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. + */ + int getSliceStatusValue(); + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatusEnum getSliceStatus(); + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class SliceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceStatus) + SliceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceStatus.newBuilder() to construct. + private SliceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SliceStatus() { + sliceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceStatus( + 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(); + + sliceStatus_ = 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 context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 1; + private int sliceStatus_; + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. + */ + @java.lang.Override public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.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 (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, sliceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, sliceStatus_); + } + 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 context.ContextOuterClass.SliceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceStatus other = (context.ContextOuterClass.SliceStatus) obj; + + if (sliceStatus_ != other.sliceStatus_) 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) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + sliceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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 context.ContextOuterClass.SliceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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 context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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(context.ContextOuterClass.SliceStatus 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 context.SliceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.SliceStatus) + context.ContextOuterClass.SliceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceStatus.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(); + sliceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.SliceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus build() { + context.ContextOuterClass.SliceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus buildPartial() { + context.ContextOuterClass.SliceStatus result = new context.ContextOuterClass.SliceStatus(this); + result.sliceStatus_ = sliceStatus_; + 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 context.ContextOuterClass.SliceStatus) { + return mergeFrom((context.ContextOuterClass.SliceStatus)other); } else { - linkIdsBuilder_.clear(); + super.mergeFrom(other); + return this; } - return this; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public Builder removeLinkIds(int index) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.remove(index); - onChanged(); - } else { - linkIdsBuilder_.remove(index); + + public Builder mergeFrom(context.ContextOuterClass.SliceStatus other) { + if (other == context.ContextOuterClass.SliceStatus.getDefaultInstance()) return this; + if (other.sliceStatus_ != 0) { + setSliceStatusValue(other.getSliceStatusValue()); } + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( - int index) { - return getLinkIdsFieldBuilder().getBuilder(index); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); } else { - return linkIdsBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private int sliceStatus_ = 0; /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. */ - public java.util.List - getLinkIdsOrBuilderList() { - if (linkIdsBuilder_ != null) { - return linkIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(linkIds_); - } + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @param value The enum numeric value on the wire for sliceStatus to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { - return getLinkIdsFieldBuilder().addBuilder( - context.ContextOuterClass.LinkId.getDefaultInstance()); + public Builder setSliceStatusValue(int value) { + + sliceStatus_ = value; + onChanged(); + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( - int index) { - return getLinkIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.LinkId.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @param value The sliceStatus to set. + * @return This builder for chaining. */ - public java.util.List - getLinkIdsBuilderList() { - return getLinkIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdsFieldBuilder() { - if (linkIdsBuilder_ == null) { - linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - linkIds_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - linkIds_ = null; + public Builder setSliceStatus(context.ContextOuterClass.SliceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); } - return linkIdsBuilder_; + + sliceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.SliceStatusEnum slice_status = 1; + * @return This builder for chaining. + */ + public Builder clearSliceStatus() { + + sliceStatus_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -9143,95 +33813,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Topology) + // @@protoc_insertion_point(builder_scope:context.SliceStatus) } - // @@protoc_insertion_point(class_scope:context.Topology) - private static final context.ContextOuterClass.Topology DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceStatus) + private static final context.ContextOuterClass.SliceStatus DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Topology(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceStatus(); } - public static context.ContextOuterClass.Topology getDefaultInstance() { + public static context.ContextOuterClass.SliceStatus getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Topology parsePartialFrom( + public SliceStatus parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Topology(input, extensionRegistry); + return new SliceStatus(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Topology getDefaultInstanceForType() { + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyIdList) + public interface SliceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceConfig) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - java.util.List - getTopologyIdsList(); + java.util.List + getConfigRulesList(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - context.ContextOuterClass.TopologyId getTopologyIds(int index); + context.ContextOuterClass.ConfigRule getConfigRules(int index); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - int getTopologyIdsCount(); + int getConfigRulesCount(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - java.util.List - getTopologyIdsOrBuilderList(); + java.util.List + getConfigRulesOrBuilderList(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index); } /** - * Protobuf type {@code context.TopologyIdList} + * Protobuf type {@code context.SliceConfig} */ - public static final class TopologyIdList extends + public static final class SliceConfig extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyIdList) - TopologyIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceConfig) + SliceConfigOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyIdList.newBuilder() to construct. - private TopologyIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceConfig.newBuilder() to construct. + private SliceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyIdList() { - topologyIds_ = java.util.Collections.emptyList(); + private SliceConfig() { + configRules_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyIdList(); + return new SliceConfig(); } @java.lang.Override @@ -9239,7 +33909,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyIdList( + private SliceConfig( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9260,11 +33930,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(); + configRules_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - topologyIds_.add( - input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); break; } default: { @@ -9283,7 +33953,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + configRules_ = java.util.Collections.unmodifiableList(configRules_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -9291,55 +33961,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + context.ContextOuterClass.SliceConfig.class, context.ContextOuterClass.SliceConfig.Builder.class); } - public static final int TOPOLOGY_IDS_FIELD_NUMBER = 1; - private java.util.List topologyIds_; + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public java.util.List getTopologyIdsList() { - return topologyIds_; + public java.util.List getConfigRulesList() { + return configRules_; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public java.util.List - getTopologyIdsOrBuilderList() { - return topologyIds_; + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public int getTopologyIdsCount() { - return topologyIds_.size(); + public int getConfigRulesCount() { + return configRules_.size(); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - return topologyIds_.get(index); + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index) { - return topologyIds_.get(index); + return configRules_.get(index); } private byte memoizedIsInitialized = -1; @@ -9356,8 +34026,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < topologyIds_.size(); i++) { - output.writeMessage(1, topologyIds_.get(i)); + for (int i = 0; i < configRules_.size(); i++) { + output.writeMessage(1, configRules_.get(i)); } unknownFields.writeTo(output); } @@ -9368,9 +34038,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < topologyIds_.size(); i++) { + for (int i = 0; i < configRules_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, topologyIds_.get(i)); + .computeMessageSize(1, configRules_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -9382,13 +34052,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyIdList)) { + if (!(obj instanceof context.ContextOuterClass.SliceConfig)) { return super.equals(obj); } - context.ContextOuterClass.TopologyIdList other = (context.ContextOuterClass.TopologyIdList) obj; + context.ContextOuterClass.SliceConfig other = (context.ContextOuterClass.SliceConfig) obj; - if (!getTopologyIdsList() - .equals(other.getTopologyIdsList())) return false; + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -9400,78 +34070,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getTopologyIdsCount() > 0) { - hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTopologyIdsList().hashCode(); + if (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig 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 context.ContextOuterClass.TopologyIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseDelimitedFrom( + public static context.ContextOuterClass.SliceConfig 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 context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -9484,7 +34154,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -9500,26 +34170,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyIdList} + * Protobuf type {@code context.SliceConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyIdList) - context.ContextOuterClass.TopologyIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceConfig) + context.ContextOuterClass.SliceConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + context.ContextOuterClass.SliceConfig.class, context.ContextOuterClass.SliceConfig.Builder.class); } - // Construct using context.ContextOuterClass.TopologyIdList.newBuilder() + // Construct using context.ContextOuterClass.SliceConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -9532,17 +34202,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologyIdsFieldBuilder(); + getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - topologyIdsBuilder_.clear(); + configRulesBuilder_.clear(); } return this; } @@ -9550,17 +34220,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyIdList.getDefaultInstance(); + public context.ContextOuterClass.SliceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.SliceConfig.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyIdList build() { - context.ContextOuterClass.TopologyIdList result = buildPartial(); + public context.ContextOuterClass.SliceConfig build() { + context.ContextOuterClass.SliceConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -9568,17 +34238,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyIdList buildPartial() { - context.ContextOuterClass.TopologyIdList result = new context.ContextOuterClass.TopologyIdList(this); + public context.ContextOuterClass.SliceConfig buildPartial() { + context.ContextOuterClass.SliceConfig result = new context.ContextOuterClass.SliceConfig(this); int from_bitField0_ = bitField0_; - if (topologyIdsBuilder_ == null) { + if (configRulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + configRules_ = java.util.Collections.unmodifiableList(configRules_); bitField0_ = (bitField0_ & ~0x00000001); } - result.topologyIds_ = topologyIds_; + result.configRules_ = configRules_; } else { - result.topologyIds_ = topologyIdsBuilder_.build(); + result.configRules_ = configRulesBuilder_.build(); } onBuilt(); return result; @@ -9618,39 +34288,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyIdList) { - return mergeFrom((context.ContextOuterClass.TopologyIdList)other); + if (other instanceof context.ContextOuterClass.SliceConfig) { + return mergeFrom((context.ContextOuterClass.SliceConfig)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyIdList other) { - if (other == context.ContextOuterClass.TopologyIdList.getDefaultInstance()) return this; - if (topologyIdsBuilder_ == null) { - if (!other.topologyIds_.isEmpty()) { - if (topologyIds_.isEmpty()) { - topologyIds_ = other.topologyIds_; + public Builder mergeFrom(context.ContextOuterClass.SliceConfig other) { + if (other == context.ContextOuterClass.SliceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureTopologyIdsIsMutable(); - topologyIds_.addAll(other.topologyIds_); + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); } onChanged(); } } else { - if (!other.topologyIds_.isEmpty()) { - if (topologyIdsBuilder_.isEmpty()) { - topologyIdsBuilder_.dispose(); - topologyIdsBuilder_ = null; - topologyIds_ = other.topologyIds_; + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; bitField0_ = (bitField0_ & ~0x00000001); - topologyIdsBuilder_ = + configRulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologyIdsFieldBuilder() : null; + getConfigRulesFieldBuilder() : null; } else { - topologyIdsBuilder_.addAllMessages(other.topologyIds_); + configRulesBuilder_.addAllMessages(other.configRules_); } } } @@ -9669,11 +34339,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyIdList parsedMessage = null; + context.ContextOuterClass.SliceConfig parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -9684,244 +34354,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List topologyIds_ = + private java.util.List configRules_ = java.util.Collections.emptyList(); - private void ensureTopologyIdsIsMutable() { + private void ensureConfigRulesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(topologyIds_); + configRules_ = new java.util.ArrayList(configRules_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List getTopologyIdsList() { - if (topologyIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologyIds_); + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); } else { - return topologyIdsBuilder_.getMessageList(); + return configRulesBuilder_.getMessageList(); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public int getTopologyIdsCount() { - if (topologyIdsBuilder_ == null) { - return topologyIds_.size(); + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); } else { - return topologyIdsBuilder_.getCount(); + return configRulesBuilder_.getCount(); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { - return topologyIdsBuilder_.getMessage(index); + return configRulesBuilder_.getMessage(index); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, value); + ensureConfigRulesIsMutable(); + configRules_.set(index, value); onChanged(); } else { - topologyIdsBuilder_.setMessage(index, value); + configRulesBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, builderForValue.build()); + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.setMessage(index, builderForValue.build()); + configRulesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.add(value); + ensureConfigRulesIsMutable(); + configRules_.add(value); onChanged(); } else { - topologyIdsBuilder_.addMessage(value); + configRulesBuilder_.addMessage(value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, value); + ensureConfigRulesIsMutable(); + configRules_.add(index, value); onChanged(); } else { - topologyIdsBuilder_.addMessage(index, value); + configRulesBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(builderForValue.build()); + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.addMessage(builderForValue.build()); + configRulesBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, builderForValue.build()); + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.addMessage(index, builderForValue.build()); + configRulesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addAllTopologyIds( - java.lang.Iterable values) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologyIds_); + values, configRules_); onChanged(); } else { - topologyIdsBuilder_.addAllMessages(values); + configRulesBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder clearTopologyIds() { - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologyIdsBuilder_.clear(); + configRulesBuilder_.clear(); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder removeTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.remove(index); + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); onChanged(); } else { - topologyIdsBuilder_.remove(index); + configRulesBuilder_.remove(index); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( int index) { - return getTopologyIdsFieldBuilder().getBuilder(index); + return getConfigRulesFieldBuilder().getBuilder(index); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); } else { - return topologyIdsBuilder_.getMessageOrBuilder(index); + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List - getTopologyIdsOrBuilderList() { - if (topologyIdsBuilder_ != null) { - return topologyIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(topologyIds_); + return java.util.Collections.unmodifiableList(configRules_); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { - return getTopologyIdsFieldBuilder().addBuilder( - context.ContextOuterClass.TopologyId.getDefaultInstance()); + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( int index) { - return getTopologyIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List - getTopologyIdsBuilderList() { - return getTopologyIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdsFieldBuilder() { - if (topologyIdsBuilder_ == null) { - topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - topologyIds_, + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologyIds_ = null; + configRules_ = null; } - return topologyIdsBuilder_; + return configRulesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -9936,95 +34606,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyIdList) + // @@protoc_insertion_point(builder_scope:context.SliceConfig) } - // @@protoc_insertion_point(class_scope:context.TopologyIdList) - private static final context.ContextOuterClass.TopologyIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceConfig) + private static final context.ContextOuterClass.SliceConfig DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceConfig(); } - public static context.ContextOuterClass.TopologyIdList getDefaultInstance() { + public static context.ContextOuterClass.SliceConfig getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyIdList parsePartialFrom( + public SliceConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyIdList(input, extensionRegistry); + return new SliceConfig(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyList) + public interface SliceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceIdList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - java.util.List - getTopologiesList(); + java.util.List + getSliceIdsList(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - context.ContextOuterClass.Topology getTopologies(int index); + context.ContextOuterClass.SliceId getSliceIds(int index); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - int getTopologiesCount(); + int getSliceIdsCount(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - java.util.List - getTopologiesOrBuilderList(); + java.util.List + getSliceIdsOrBuilderList(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index); } /** - * Protobuf type {@code context.TopologyList} + * Protobuf type {@code context.SliceIdList} */ - public static final class TopologyList extends + public static final class SliceIdList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyList) - TopologyListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceIdList) + SliceIdListOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyList.newBuilder() to construct. - private TopologyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceIdList.newBuilder() to construct. + private SliceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyList() { - topologies_ = java.util.Collections.emptyList(); + private SliceIdList() { + sliceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyList(); + return new SliceIdList(); } @java.lang.Override @@ -10032,7 +34702,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyList( + private SliceIdList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10053,11 +34723,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologies_ = new java.util.ArrayList(); + sliceIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - topologies_.add( - input.readMessage(context.ContextOuterClass.Topology.parser(), extensionRegistry)); + sliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); break; } default: { @@ -10076,7 +34746,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologies_ = java.util.Collections.unmodifiableList(topologies_); + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -10084,55 +34754,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); } - public static final int TOPOLOGIES_FIELD_NUMBER = 1; - private java.util.List topologies_; + public static final int SLICE_IDS_FIELD_NUMBER = 1; + private java.util.List sliceIds_; /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public java.util.List getTopologiesList() { - return topologies_; + public java.util.List getSliceIdsList() { + return sliceIds_; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public java.util.List - getTopologiesOrBuilderList() { - return topologies_; + public java.util.List + getSliceIdsOrBuilderList() { + return sliceIds_; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public int getTopologiesCount() { - return topologies_.size(); + public int getSliceIdsCount() { + return sliceIds_.size(); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.Topology getTopologies(int index) { - return topologies_.get(index); + public context.ContextOuterClass.SliceId getSliceIds(int index) { + return sliceIds_.get(index); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index) { - return topologies_.get(index); + return sliceIds_.get(index); } private byte memoizedIsInitialized = -1; @@ -10149,8 +34819,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < topologies_.size(); i++) { - output.writeMessage(1, topologies_.get(i)); + for (int i = 0; i < sliceIds_.size(); i++) { + output.writeMessage(1, sliceIds_.get(i)); } unknownFields.writeTo(output); } @@ -10161,9 +34831,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < topologies_.size(); i++) { + for (int i = 0; i < sliceIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, topologies_.get(i)); + .computeMessageSize(1, sliceIds_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -10175,13 +34845,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyList)) { + if (!(obj instanceof context.ContextOuterClass.SliceIdList)) { return super.equals(obj); } - context.ContextOuterClass.TopologyList other = (context.ContextOuterClass.TopologyList) obj; + context.ContextOuterClass.SliceIdList other = (context.ContextOuterClass.SliceIdList) obj; - if (!getTopologiesList() - .equals(other.getTopologiesList())) return false; + if (!getSliceIdsList() + .equals(other.getSliceIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -10193,78 +34863,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getTopologiesCount() > 0) { - hash = (37 * hash) + TOPOLOGIES_FIELD_NUMBER; - hash = (53 * hash) + getTopologiesList().hashCode(); + if (getSliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceIdList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceIdList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList 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 context.ContextOuterClass.TopologyList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseDelimitedFrom( + public static context.ContextOuterClass.SliceIdList 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 context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -10277,7 +34947,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceIdList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -10293,26 +34963,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyList} + * Protobuf type {@code context.SliceIdList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyList) - context.ContextOuterClass.TopologyListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceIdList) + context.ContextOuterClass.SliceIdListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); } - // Construct using context.ContextOuterClass.TopologyList.newBuilder() + // Construct using context.ContextOuterClass.SliceIdList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -10325,17 +34995,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologiesFieldBuilder(); + getSliceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologiesBuilder_ == null) { - topologies_ = java.util.Collections.emptyList(); + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - topologiesBuilder_.clear(); + sliceIdsBuilder_.clear(); } return this; } @@ -10343,17 +35013,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyList.getDefaultInstance(); + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceIdList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyList build() { - context.ContextOuterClass.TopologyList result = buildPartial(); + public context.ContextOuterClass.SliceIdList build() { + context.ContextOuterClass.SliceIdList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -10361,17 +35031,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyList buildPartial() { - context.ContextOuterClass.TopologyList result = new context.ContextOuterClass.TopologyList(this); + public context.ContextOuterClass.SliceIdList buildPartial() { + context.ContextOuterClass.SliceIdList result = new context.ContextOuterClass.SliceIdList(this); int from_bitField0_ = bitField0_; - if (topologiesBuilder_ == null) { + if (sliceIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - topologies_ = java.util.Collections.unmodifiableList(topologies_); + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.topologies_ = topologies_; + result.sliceIds_ = sliceIds_; } else { - result.topologies_ = topologiesBuilder_.build(); + result.sliceIds_ = sliceIdsBuilder_.build(); } onBuilt(); return result; @@ -10411,39 +35081,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyList) { - return mergeFrom((context.ContextOuterClass.TopologyList)other); + if (other instanceof context.ContextOuterClass.SliceIdList) { + return mergeFrom((context.ContextOuterClass.SliceIdList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyList other) { - if (other == context.ContextOuterClass.TopologyList.getDefaultInstance()) return this; - if (topologiesBuilder_ == null) { - if (!other.topologies_.isEmpty()) { - if (topologies_.isEmpty()) { - topologies_ = other.topologies_; + public Builder mergeFrom(context.ContextOuterClass.SliceIdList other) { + if (other == context.ContextOuterClass.SliceIdList.getDefaultInstance()) return this; + if (sliceIdsBuilder_ == null) { + if (!other.sliceIds_.isEmpty()) { + if (sliceIds_.isEmpty()) { + sliceIds_ = other.sliceIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureTopologiesIsMutable(); - topologies_.addAll(other.topologies_); + ensureSliceIdsIsMutable(); + sliceIds_.addAll(other.sliceIds_); } onChanged(); } } else { - if (!other.topologies_.isEmpty()) { - if (topologiesBuilder_.isEmpty()) { - topologiesBuilder_.dispose(); - topologiesBuilder_ = null; - topologies_ = other.topologies_; + if (!other.sliceIds_.isEmpty()) { + if (sliceIdsBuilder_.isEmpty()) { + sliceIdsBuilder_.dispose(); + sliceIdsBuilder_ = null; + sliceIds_ = other.sliceIds_; bitField0_ = (bitField0_ & ~0x00000001); - topologiesBuilder_ = + sliceIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologiesFieldBuilder() : null; + getSliceIdsFieldBuilder() : null; } else { - topologiesBuilder_.addAllMessages(other.topologies_); + sliceIdsBuilder_.addAllMessages(other.sliceIds_); } } } @@ -10462,11 +35132,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyList parsedMessage = null; + context.ContextOuterClass.SliceIdList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceIdList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -10477,244 +35147,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List topologies_ = + private java.util.List sliceIds_ = java.util.Collections.emptyList(); - private void ensureTopologiesIsMutable() { + private void ensureSliceIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - topologies_ = new java.util.ArrayList(topologies_); + sliceIds_ = new java.util.ArrayList(sliceIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> topologiesBuilder_; + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdsBuilder_; /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List getTopologiesList() { - if (topologiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologies_); + public java.util.List getSliceIdsList() { + if (sliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceIds_); } else { - return topologiesBuilder_.getMessageList(); + return sliceIdsBuilder_.getMessageList(); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public int getTopologiesCount() { - if (topologiesBuilder_ == null) { - return topologies_.size(); + public int getSliceIdsCount() { + if (sliceIdsBuilder_ == null) { + return sliceIds_.size(); } else { - return topologiesBuilder_.getCount(); + return sliceIdsBuilder_.getCount(); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology getTopologies(int index) { - if (topologiesBuilder_ == null) { - return topologies_.get(index); + public context.ContextOuterClass.SliceId getSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { - return topologiesBuilder_.getMessage(index); + return sliceIdsBuilder_.getMessage(index); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder setTopologies( - int index, context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.set(index, value); + ensureSliceIdsIsMutable(); + sliceIds_.set(index, value); onChanged(); } else { - topologiesBuilder_.setMessage(index, value); + sliceIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder setTopologies( - int index, context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.set(index, builderForValue.build()); + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.set(index, builderForValue.build()); onChanged(); } else { - topologiesBuilder_.setMessage(index, builderForValue.build()); + sliceIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies(context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder addSliceIds(context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.add(value); + ensureSliceIdsIsMutable(); + sliceIds_.add(value); onChanged(); } else { - topologiesBuilder_.addMessage(value); + sliceIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - int index, context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.add(index, value); + ensureSliceIdsIsMutable(); + sliceIds_.add(index, value); onChanged(); } else { - topologiesBuilder_.addMessage(index, value); + sliceIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.add(builderForValue.build()); + public Builder addSliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(builderForValue.build()); onChanged(); } else { - topologiesBuilder_.addMessage(builderForValue.build()); + sliceIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - int index, context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.add(index, builderForValue.build()); + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(index, builderForValue.build()); onChanged(); } else { - topologiesBuilder_.addMessage(index, builderForValue.build()); + sliceIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addAllTopologies( - java.lang.Iterable values) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); + public Builder addAllSliceIds( + java.lang.Iterable values) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologies_); + values, sliceIds_); onChanged(); } else { - topologiesBuilder_.addAllMessages(values); + sliceIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder clearTopologies() { - if (topologiesBuilder_ == null) { - topologies_ = java.util.Collections.emptyList(); + public Builder clearSliceIds() { + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologiesBuilder_.clear(); + sliceIdsBuilder_.clear(); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder removeTopologies(int index) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.remove(index); + public Builder removeSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.remove(index); onChanged(); } else { - topologiesBuilder_.remove(index); + sliceIdsBuilder_.remove(index); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder getTopologiesBuilder( + public context.ContextOuterClass.SliceId.Builder getSliceIdsBuilder( int index) { - return getTopologiesFieldBuilder().getBuilder(index); + return getSliceIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index) { - if (topologiesBuilder_ == null) { - return topologies_.get(index); } else { - return topologiesBuilder_.getMessageOrBuilder(index); + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { + return sliceIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List - getTopologiesOrBuilderList() { - if (topologiesBuilder_ != null) { - return topologiesBuilder_.getMessageOrBuilderList(); + public java.util.List + getSliceIdsOrBuilderList() { + if (sliceIdsBuilder_ != null) { + return sliceIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(topologies_); + return java.util.Collections.unmodifiableList(sliceIds_); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder addTopologiesBuilder() { - return getTopologiesFieldBuilder().addBuilder( - context.ContextOuterClass.Topology.getDefaultInstance()); + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder() { + return getSliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder addTopologiesBuilder( + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder( int index) { - return getTopologiesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Topology.getDefaultInstance()); + return getSliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List - getTopologiesBuilderList() { - return getTopologiesFieldBuilder().getBuilderList(); + public java.util.List + getSliceIdsBuilderList() { + return getSliceIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> - getTopologiesFieldBuilder() { - if (topologiesBuilder_ == null) { - topologiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder>( - topologies_, + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsFieldBuilder() { + if (sliceIdsBuilder_ == null) { + sliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologies_ = null; + sliceIds_ = null; } - return topologiesBuilder_; + return sliceIdsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -10729,100 +35399,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyList) + // @@protoc_insertion_point(builder_scope:context.SliceIdList) } - // @@protoc_insertion_point(class_scope:context.TopologyList) - private static final context.ContextOuterClass.TopologyList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceIdList) + private static final context.ContextOuterClass.SliceIdList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceIdList(); } - public static context.ContextOuterClass.TopologyList getDefaultInstance() { + public static context.ContextOuterClass.SliceIdList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyList parsePartialFrom( + public SliceIdList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyList(input, extensionRegistry); + return new SliceIdList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyEvent) + public interface SliceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceList) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.Event getEvent(); + java.util.List + getSlicesList(); /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); - + context.ContextOuterClass.Slice getSlices(int index); /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. + * repeated .context.Slice slices = 1; */ - boolean hasTopologyId(); + int getSlicesCount(); /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.TopologyId getTopologyId(); + java.util.List + getSlicesOrBuilderList(); /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index); } /** - * Protobuf type {@code context.TopologyEvent} + * Protobuf type {@code context.SliceList} */ - public static final class TopologyEvent extends + public static final class SliceList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyEvent) - TopologyEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceList) + SliceListOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyEvent.newBuilder() to construct. - private TopologyEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceList.newBuilder() to construct. + private SliceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyEvent() { + private SliceList() { + slices_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyEvent(); + return new SliceList(); } @java.lang.Override @@ -10830,7 +35495,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyEvent( + private SliceList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10838,6 +35503,7 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -10849,29 +35515,12 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); - } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - + slices_.add( + input.readMessage(context.ContextOuterClass.Slice.parser(), extensionRegistry)); break; } default: { @@ -10889,73 +35538,64 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } + public static final int SLICES_FIELD_NUMBER = 1; + private java.util.List slices_; /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public java.util.List getSlicesList() { + return slices_; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public java.util.List + getSlicesOrBuilderList() { + return slices_; } - - public static final int TOPOLOGY_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.TopologyId topologyId_; /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; + public int getSlicesCount() { + return slices_.size(); } /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + public context.ContextOuterClass.Slice getSlices(int index) { + return slices_.get(index); } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + return slices_.get(index); } private byte memoizedIsInitialized = -1; @@ -10972,11 +35612,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); - } - if (topologyId_ != null) { - output.writeMessage(2, getTopologyId()); + for (int i = 0; i < slices_.size(); i++) { + output.writeMessage(1, slices_.get(i)); } unknownFields.writeTo(output); } @@ -10987,13 +35624,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); - } - if (topologyId_ != null) { + for (int i = 0; i < slices_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTopologyId()); + .computeMessageSize(1, slices_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -11005,21 +35638,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyEvent)) { + if (!(obj instanceof context.ContextOuterClass.SliceList)) { return super.equals(obj); } - context.ContextOuterClass.TopologyEvent other = (context.ContextOuterClass.TopologyEvent) obj; + context.ContextOuterClass.SliceList other = (context.ContextOuterClass.SliceList) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; - } + if (!getSlicesList() + .equals(other.getSlicesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -11031,82 +35656,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); + if (getSlicesCount() > 0) { + hash = (37 * hash) + SLICES_FIELD_NUMBER; + hash = (53 * hash) + getSlicesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom(byte[] data) + public static context.ContextOuterClass.SliceList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList 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 context.ContextOuterClass.TopologyEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseDelimitedFrom( + public static context.ContextOuterClass.SliceList 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 context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -11119,7 +35740,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -11135,26 +35756,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyEvent} + * Protobuf type {@code context.SliceList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyEvent) - context.ContextOuterClass.TopologyEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceList) + context.ContextOuterClass.SliceListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); } - // Construct using context.ContextOuterClass.TopologyEvent.newBuilder() + // Construct using context.ContextOuterClass.SliceList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -11167,22 +35788,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getSlicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (topologyIdBuilder_ == null) { - topologyId_ = null; + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - topologyId_ = null; - topologyIdBuilder_ = null; + slicesBuilder_.clear(); } return this; } @@ -11190,17 +35806,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyEvent.getDefaultInstance(); + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyEvent build() { - context.ContextOuterClass.TopologyEvent result = buildPartial(); + public context.ContextOuterClass.SliceList build() { + context.ContextOuterClass.SliceList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -11208,17 +35824,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyEvent buildPartial() { - context.ContextOuterClass.TopologyEvent result = new context.ContextOuterClass.TopologyEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; + public context.ContextOuterClass.SliceList buildPartial() { + context.ContextOuterClass.SliceList result = new context.ContextOuterClass.SliceList(this); + int from_bitField0_ = bitField0_; + if (slicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.slices_ = slices_; } else { - result.topologyId_ = topologyIdBuilder_.build(); + result.slices_ = slicesBuilder_.build(); } onBuilt(); return result; @@ -11258,21 +35874,41 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyEvent) { - return mergeFrom((context.ContextOuterClass.TopologyEvent)other); + if (other instanceof context.ContextOuterClass.SliceList) { + return mergeFrom((context.ContextOuterClass.SliceList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyEvent other) { - if (other == context.ContextOuterClass.TopologyEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); - } - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); + public Builder mergeFrom(context.ContextOuterClass.SliceList other) { + if (other == context.ContextOuterClass.SliceList.getDefaultInstance()) return this; + if (slicesBuilder_ == null) { + if (!other.slices_.isEmpty()) { + if (slices_.isEmpty()) { + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSlicesIsMutable(); + slices_.addAll(other.slices_); + } + onChanged(); + } + } else { + if (!other.slices_.isEmpty()) { + if (slicesBuilder_.isEmpty()) { + slicesBuilder_.dispose(); + slicesBuilder_ = null; + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + slicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSlicesFieldBuilder() : null; + } else { + slicesBuilder_.addAllMessages(other.slices_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -11289,11 +35925,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyEvent parsedMessage = null; + context.ContextOuterClass.SliceList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -11302,243 +35938,246 @@ public final class ContextOuterClass { } return this; } + private int bitField0_; - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + private java.util.List slices_ = + java.util.Collections.emptyList(); + private void ensureSlicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList(slices_); + bitField0_ |= 0x00000001; + } } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> slicesBuilder_; + /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public java.util.List getSlicesList() { + if (slicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slices_); } else { - return eventBuilder_.getMessage(); + return slicesBuilder_.getMessageList(); } } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); + public int getSlicesCount() { + if (slicesBuilder_ == null) { + return slices_.size(); } else { - eventBuilder_.setMessage(value); + return slicesBuilder_.getCount(); } - - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); + public context.ContextOuterClass.Slice getSlices(int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { - eventBuilder_.setMessage(builderForValue.build()); + return slicesBuilder_.getMessage(index); } - - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; + public Builder setSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSlicesIsMutable(); + slices_.set(index, value); onChanged(); } else { - eventBuilder_.mergeFrom(value); + slicesBuilder_.setMessage(index, value); } - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; + public Builder setSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.set(index, builderForValue.build()); onChanged(); } else { - event_ = null; - eventBuilder_ = null; + slicesBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); + public Builder addSlices(context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(value); + onChanged(); } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; + slicesBuilder_.addMessage(value); } + return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; + public Builder addSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(index, value); + onChanged(); + } else { + slicesBuilder_.addMessage(index, value); } - return eventBuilder_; - } - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; + return this; } /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + public Builder addSlices( + context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(builderForValue.build()); + onChanged(); } else { - return topologyIdBuilder_.getMessage(); + slicesBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; + public Builder addSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(index, builderForValue.build()); onChanged(); } else { - topologyIdBuilder_.setMessage(value); + slicesBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); + public Builder addAllSlices( + java.lang.Iterable values) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slices_); onChanged(); } else { - topologyIdBuilder_.setMessage(builderForValue.build()); + slicesBuilder_.addAllMessages(values); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } + public Builder clearSlices() { + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologyIdBuilder_.mergeFrom(value); + slicesBuilder_.clear(); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; + public Builder removeSlices(int index) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.remove(index); onChanged(); } else { - topologyId_ = null; - topologyIdBuilder_ = null; + slicesBuilder_.remove(index); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); + public context.ContextOuterClass.Slice.Builder getSlicesBuilder( + int index) { + return getSlicesFieldBuilder().getBuilder(index); } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { + return slicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Slice slices = 1; + */ + public java.util.List + getSlicesOrBuilderList() { + if (slicesBuilder_ != null) { + return slicesBuilder_.getMessageOrBuilderList(); } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + return java.util.Collections.unmodifiableList(slices_); } } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), + public context.ContextOuterClass.Slice.Builder addSlicesBuilder() { + return getSlicesFieldBuilder().addBuilder( + context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * repeated .context.Slice slices = 1; + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder( + int index) { + return getSlicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * repeated .context.Slice slices = 1; + */ + public java.util.List + getSlicesBuilderList() { + return getSlicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> + getSlicesFieldBuilder() { + if (slicesBuilder_ == null) { + slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder>( + slices_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologyId_ = null; + slices_ = null; } - return topologyIdBuilder_; + return slicesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -11553,89 +36192,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyEvent) + // @@protoc_insertion_point(builder_scope:context.SliceList) } - // @@protoc_insertion_point(class_scope:context.TopologyEvent) - private static final context.ContextOuterClass.TopologyEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceList) + private static final context.ContextOuterClass.SliceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceList(); } - public static context.ContextOuterClass.TopologyEvent getDefaultInstance() { + public static context.ContextOuterClass.SliceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyEvent parsePartialFrom( + public SliceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyEvent(input, extensionRegistry); + return new SliceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceId) + public interface SliceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceEvent) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ - boolean hasDeviceUuid(); + boolean hasEvent(); /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ - context.ContextOuterClass.Uuid getDeviceUuid(); + context.ContextOuterClass.Event getEvent(); /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder(); + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 2; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); } /** - *
-   * ----- Device --------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.DeviceId} + * Protobuf type {@code context.SliceEvent} */ - public static final class DeviceId extends + public static final class SliceEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceId) - DeviceIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceEvent) + SliceEventOrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceId.newBuilder() to construct. - private DeviceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceEvent.newBuilder() to construct. + private SliceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceId() { + private SliceEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceId(); + return new SliceEvent(); } @java.lang.Override @@ -11643,7 +36293,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceId( + private SliceEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -11662,14 +36312,27 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (deviceUuid_ != null) { - subBuilder = deviceUuid_.toBuilder(); + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); } - deviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(deviceUuid_); - deviceUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); } break; @@ -11695,41 +36358,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); } - public static final int DEVICE_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid deviceUuid_; + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ @java.lang.Override - public boolean hasDeviceUuid() { - return deviceUuid_ != null; + public boolean hasEvent() { + return event_ != null; } /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ @java.lang.Override - public context.ContextOuterClass.Uuid getDeviceUuid() { - return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { - return getDeviceUuid(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); } private byte memoizedIsInitialized = -1; @@ -11746,8 +36435,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (deviceUuid_ != null) { - output.writeMessage(1, getDeviceUuid()); + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (sliceId_ != null) { + output.writeMessage(2, getSliceId()); } unknownFields.writeTo(output); } @@ -11758,9 +36450,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (deviceUuid_ != null) { + if (event_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getDeviceUuid()); + .computeMessageSize(1, getEvent()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -11772,15 +36468,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceId)) { + if (!(obj instanceof context.ContextOuterClass.SliceEvent)) { return super.equals(obj); } - context.ContextOuterClass.DeviceId other = (context.ContextOuterClass.DeviceId) obj; + context.ContextOuterClass.SliceEvent other = (context.ContextOuterClass.SliceEvent) obj; - if (hasDeviceUuid() != other.hasDeviceUuid()) return false; - if (hasDeviceUuid()) { - if (!getDeviceUuid() - .equals(other.getDeviceUuid())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -11793,78 +36494,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDeviceUuid()) { - hash = (37 * hash) + DEVICE_UUID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceUuid().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom(byte[] data) + public static context.ContextOuterClass.SliceEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent 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 context.ContextOuterClass.DeviceId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseDelimitedFrom( + public static context.ContextOuterClass.SliceEvent 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 context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -11877,7 +36582,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceId prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -11893,30 +36598,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Device --------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.DeviceId} + * Protobuf type {@code context.SliceEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceId) - context.ContextOuterClass.DeviceIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceEvent) + context.ContextOuterClass.SliceEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); } - // Construct using context.ContextOuterClass.DeviceId.newBuilder() + // Construct using context.ContextOuterClass.SliceEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -11934,11 +36635,17 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (deviceUuidBuilder_ == null) { - deviceUuid_ = null; + if (eventBuilder_ == null) { + event_ = null; } else { - deviceUuid_ = null; - deviceUuidBuilder_ = null; + event_ = null; + eventBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; } return this; } @@ -11946,17 +36653,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceId.getDefaultInstance(); + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.SliceEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceId build() { - context.ContextOuterClass.DeviceId result = buildPartial(); + public context.ContextOuterClass.SliceEvent build() { + context.ContextOuterClass.SliceEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -11964,12 +36671,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceId buildPartial() { - context.ContextOuterClass.DeviceId result = new context.ContextOuterClass.DeviceId(this); - if (deviceUuidBuilder_ == null) { - result.deviceUuid_ = deviceUuid_; + public context.ContextOuterClass.SliceEvent buildPartial() { + context.ContextOuterClass.SliceEvent result = new context.ContextOuterClass.SliceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; } else { - result.deviceUuid_ = deviceUuidBuilder_.build(); + result.event_ = eventBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); } onBuilt(); return result; @@ -12009,18 +36721,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceId) { - return mergeFrom((context.ContextOuterClass.DeviceId)other); + if (other instanceof context.ContextOuterClass.SliceEvent) { + return mergeFrom((context.ContextOuterClass.SliceEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceId other) { - if (other == context.ContextOuterClass.DeviceId.getDefaultInstance()) return this; - if (other.hasDeviceUuid()) { - mergeDeviceUuid(other.getDeviceUuid()); + public Builder mergeFrom(context.ContextOuterClass.SliceEvent other) { + if (other == context.ContextOuterClass.SliceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -12037,11 +36752,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceId parsedMessage = null; + context.ContextOuterClass.SliceEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -12051,123 +36766,242 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid deviceUuid_; + private context.ContextOuterClass.Event event_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> deviceUuidBuilder_; + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ - public boolean hasDeviceUuid() { - return deviceUuidBuilder_ != null || deviceUuid_ != null; + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; } /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ - public context.ContextOuterClass.Uuid getDeviceUuid() { - if (deviceUuidBuilder_ == null) { - return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } else { - return deviceUuidBuilder_.getMessage(); + return eventBuilder_.getMessage(); } } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder setDeviceUuid(context.ContextOuterClass.Uuid value) { - if (deviceUuidBuilder_ == null) { + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - deviceUuid_ = value; + event_ = value; onChanged(); } else { - deviceUuidBuilder_.setMessage(value); + eventBuilder_.setMessage(value); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder setDeviceUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (deviceUuidBuilder_ == null) { - deviceUuid_ = builderForValue.build(); + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); onChanged(); } else { - deviceUuidBuilder_.setMessage(builderForValue.build()); + eventBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder mergeDeviceUuid(context.ContextOuterClass.Uuid value) { - if (deviceUuidBuilder_ == null) { - if (deviceUuid_ != null) { - deviceUuid_ = - context.ContextOuterClass.Uuid.newBuilder(deviceUuid_).mergeFrom(value).buildPartial(); + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); } else { - deviceUuid_ = value; + event_ = value; } onChanged(); } else { - deviceUuidBuilder_.mergeFrom(value); + eventBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder clearDeviceUuid() { - if (deviceUuidBuilder_ == null) { - deviceUuid_ = null; + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; onChanged(); } else { - deviceUuid_ = null; - deviceUuidBuilder_ = null; + event_ = null; + eventBuilder_ = null; } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public context.ContextOuterClass.Uuid.Builder getDeviceUuidBuilder() { + public context.ContextOuterClass.Event.Builder getEventBuilder() { onChanged(); - return getDeviceUuidFieldBuilder().getBuilder(); + return getEventFieldBuilder().getBuilder(); } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { - if (deviceUuidBuilder_ != null) { - return deviceUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); } else { - return deviceUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; } } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getDeviceUuidFieldBuilder() { - if (deviceUuidBuilder_ == null) { - deviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getDeviceUuid(), + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), getParentForChildren(), isClean()); - deviceUuid_ = null; + event_ = null; } - return deviceUuidBuilder_; + return eventBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 2; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -12182,180 +37016,89 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceId) + // @@protoc_insertion_point(builder_scope:context.SliceEvent) } - // @@protoc_insertion_point(class_scope:context.DeviceId) - private static final context.ContextOuterClass.DeviceId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceEvent) + private static final context.ContextOuterClass.SliceEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceEvent(); } - public static context.ContextOuterClass.DeviceId getDefaultInstance() { + public static context.ContextOuterClass.SliceEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceId parsePartialFrom( + public SliceEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceId(input, extensionRegistry); + return new SliceEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Device) + public interface ConnectionIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionId) com.google.protobuf.MessageOrBuilder { /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - boolean hasDeviceId(); - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - context.ContextOuterClass.DeviceId getDeviceId(); - /** - * .context.DeviceId device_id = 1; - */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); - - /** - * string device_type = 2; - * @return The deviceType. - */ - java.lang.String getDeviceType(); - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - com.google.protobuf.ByteString - getDeviceTypeBytes(); - - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - boolean hasDeviceConfig(); - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - context.ContextOuterClass.DeviceConfig getDeviceConfig(); - /** - * .context.DeviceConfig device_config = 3; - */ - context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder(); - - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - int getDeviceOperationalStatusValue(); - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ - context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus(); - - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - java.util.List getDeviceDriversList(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - int getDeviceDriversCount(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - java.util.List - getDeviceDriversValueList(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - int getDeviceDriversValue(int index); - - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - java.util.List - getDeviceEndpointsList(); - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - context.ContextOuterClass.EndPoint getDeviceEndpoints(int index); - /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ - int getDeviceEndpointsCount(); + boolean hasConnectionUuid(); /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ - java.util.List - getDeviceEndpointsOrBuilderList(); + context.ContextOuterClass.Uuid getConnectionUuid(); /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index); + context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); } /** - * Protobuf type {@code context.Device} + *
+   * ----- Connection ----------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ConnectionId} */ - public static final class Device extends + public static final class ConnectionId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Device) - DeviceOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionId) + ConnectionIdOrBuilder { private static final long serialVersionUID = 0L; - // Use Device.newBuilder() to construct. - private Device(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionId.newBuilder() to construct. + private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Device() { - deviceType_ = ""; - deviceOperationalStatus_ = 0; - deviceDrivers_ = java.util.Collections.emptyList(); - deviceEndpoints_ = java.util.Collections.emptyList(); + private ConnectionId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Device(); + return new ConnectionId(); } @java.lang.Override @@ -12363,7 +37106,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Device( + private ConnectionId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -12371,7 +37114,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -12383,75 +37125,18 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceType_ = s; - break; - } - case 26: { - context.ContextOuterClass.DeviceConfig.Builder subBuilder = null; - if (deviceConfig_ != null) { - subBuilder = deviceConfig_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (connectionUuid_ != null) { + subBuilder = connectionUuid_.toBuilder(); } - deviceConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry); + connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(deviceConfig_); - deviceConfig_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionUuid_); + connectionUuid_ = subBuilder.buildPartial(); } break; } - case 32: { - int rawValue = input.readEnum(); - - deviceOperationalStatus_ = rawValue; - break; - } - case 40: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceDrivers_.add(rawValue); - break; - } - case 42: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceDrivers_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - deviceEndpoints_.add( - input.readMessage(context.ContextOuterClass.EndPoint.parser(), extensionRegistry)); - break; - } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -12467,234 +37152,47 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); - } - - public static final int DEVICE_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.DeviceId deviceId_; - /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; - } - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - /** - * .context.DeviceId device_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); - } - - public static final int DEVICE_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object deviceType_; - /** - * string device_type = 2; - * @return The deviceType. - */ - @java.lang.Override - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - 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(); - deviceType_ = s; - return s; - } - } - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_CONFIG_FIELD_NUMBER = 3; - private context.ContextOuterClass.DeviceConfig deviceConfig_; - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - @java.lang.Override - public boolean hasDeviceConfig() { - return deviceConfig_ != null; - } - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDeviceConfig() { - return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } - /** - * .context.DeviceConfig device_config = 3; - */ - @java.lang.Override - public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { - return getDeviceConfig(); - } - - public static final int DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER = 4; - private int deviceOperationalStatus_; - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - @java.lang.Override public int getDeviceOperationalStatusValue() { - return deviceOperationalStatus_; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ - @java.lang.Override public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); - return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; - } - - public static final int DEVICE_DRIVERS_FIELD_NUMBER = 5; - private java.util.List deviceDrivers_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum> deviceDrivers_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>() { - public context.ContextOuterClass.DeviceDriverEnum convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceDriverEnum result = context.ContextOuterClass.DeviceDriverEnum.valueOf(from); - return result == null ? context.ContextOuterClass.DeviceDriverEnum.UNRECOGNIZED : result; - } - }; - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - @java.lang.Override - public java.util.List getDeviceDriversList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - @java.lang.Override - public int getDeviceDriversCount() { - return deviceDrivers_.size(); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { - return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - @java.lang.Override - public java.util.List - getDeviceDriversValueList() { - return deviceDrivers_; - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - @java.lang.Override - public int getDeviceDriversValue(int index) { - return deviceDrivers_.get(index); + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); } - private int deviceDriversMemoizedSerializedSize; - public static final int DEVICE_ENDPOINTS_FIELD_NUMBER = 6; - private java.util.List deviceEndpoints_; - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - @java.lang.Override - public java.util.List getDeviceEndpointsList() { - return deviceEndpoints_; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - @java.lang.Override - public java.util.List - getDeviceEndpointsOrBuilderList() { - return deviceEndpoints_; - } + public static final int CONNECTION_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid connectionUuid_; /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ @java.lang.Override - public int getDeviceEndpointsCount() { - return deviceEndpoints_.size(); + public boolean hasConnectionUuid() { + return connectionUuid_ != null; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ @java.lang.Override - public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { - return deviceEndpoints_.get(index); + public context.ContextOuterClass.Uuid getConnectionUuid() { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index) { - return deviceEndpoints_.get(index); + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + return getConnectionUuid(); } private byte memoizedIsInitialized = -1; @@ -12711,28 +37209,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (deviceId_ != null) { - output.writeMessage(1, getDeviceId()); - } - if (!getDeviceTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); - } - if (deviceConfig_ != null) { - output.writeMessage(3, getDeviceConfig()); - } - if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { - output.writeEnum(4, deviceOperationalStatus_); - } - if (getDeviceDriversList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(deviceDriversMemoizedSerializedSize); - } - for (int i = 0; i < deviceDrivers_.size(); i++) { - output.writeEnumNoTag(deviceDrivers_.get(i)); - } - for (int i = 0; i < deviceEndpoints_.size(); i++) { - output.writeMessage(6, deviceEndpoints_.get(i)); + if (connectionUuid_ != null) { + output.writeMessage(1, getConnectionUuid()); } unknownFields.writeTo(output); } @@ -12743,36 +37221,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (deviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getDeviceId()); - } - if (!getDeviceTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); - } - if (deviceConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDeviceConfig()); - } - if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, deviceOperationalStatus_); - } - { - int dataSize = 0; - for (int i = 0; i < deviceDrivers_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(deviceDrivers_.get(i)); - } - size += dataSize; - if (!getDeviceDriversList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }deviceDriversMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < deviceEndpoints_.size(); i++) { + if (connectionUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, deviceEndpoints_.get(i)); + .computeMessageSize(1, getConnectionUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -12784,27 +37235,16 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Device)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { return super.equals(obj); } - context.ContextOuterClass.Device other = (context.ContextOuterClass.Device) obj; + context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } - if (!getDeviceType() - .equals(other.getDeviceType())) return false; - if (hasDeviceConfig() != other.hasDeviceConfig()) return false; - if (hasDeviceConfig()) { - if (!getDeviceConfig() - .equals(other.getDeviceConfig())) return false; + if (hasConnectionUuid() != other.hasConnectionUuid()) return false; + if (hasConnectionUuid()) { + if (!getConnectionUuid() + .equals(other.getConnectionUuid())) return false; } - if (deviceOperationalStatus_ != other.deviceOperationalStatus_) return false; - if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; - if (!getDeviceEndpointsList() - .equals(other.getDeviceEndpointsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -12816,94 +37256,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } - hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getDeviceType().hashCode(); - if (hasDeviceConfig()) { - hash = (37 * hash) + DEVICE_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDeviceConfig().hashCode(); - } - hash = (37 * hash) + DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER; - hash = (53 * hash) + deviceOperationalStatus_; - if (getDeviceDriversCount() > 0) { - hash = (37 * hash) + DEVICE_DRIVERS_FIELD_NUMBER; - hash = (53 * hash) + deviceDrivers_.hashCode(); - } - if (getDeviceEndpointsCount() > 0) { - hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceEndpointsList().hashCode(); + if (hasConnectionUuid()) { + hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId 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 context.ContextOuterClass.Device parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionId 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 context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -12916,7 +37340,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Device prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -12932,994 +37356,281 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Device} + *
+     * ----- Connection ----------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ConnectionId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Device) - context.ContextOuterClass.DeviceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); - } - - // Construct using context.ContextOuterClass.Device.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDeviceEndpointsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - deviceType_ = ""; - - if (deviceConfigBuilder_ == null) { - deviceConfig_ = null; - } else { - deviceConfig_ = null; - deviceConfigBuilder_ = null; - } - deviceOperationalStatus_ = 0; - - deviceDrivers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - if (deviceEndpointsBuilder_ == null) { - deviceEndpoints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - deviceEndpointsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; - } - - @java.lang.Override - public context.ContextOuterClass.Device getDefaultInstanceForType() { - return context.ContextOuterClass.Device.getDefaultInstance(); - } - - @java.lang.Override - public context.ContextOuterClass.Device build() { - context.ContextOuterClass.Device result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public context.ContextOuterClass.Device buildPartial() { - context.ContextOuterClass.Device result = new context.ContextOuterClass.Device(this); - int from_bitField0_ = bitField0_; - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); - } - result.deviceType_ = deviceType_; - if (deviceConfigBuilder_ == null) { - result.deviceConfig_ = deviceConfig_; - } else { - result.deviceConfig_ = deviceConfigBuilder_.build(); - } - result.deviceOperationalStatus_ = deviceOperationalStatus_; - if (((bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceDrivers_ = deviceDrivers_; - if (deviceEndpointsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.deviceEndpoints_ = deviceEndpoints_; - } else { - result.deviceEndpoints_ = deviceEndpointsBuilder_.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 context.ContextOuterClass.Device) { - return mergeFrom((context.ContextOuterClass.Device)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(context.ContextOuterClass.Device other) { - if (other == context.ContextOuterClass.Device.getDefaultInstance()) return this; - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); - } - if (!other.getDeviceType().isEmpty()) { - deviceType_ = other.deviceType_; - onChanged(); - } - if (other.hasDeviceConfig()) { - mergeDeviceConfig(other.getDeviceConfig()); - } - if (other.deviceOperationalStatus_ != 0) { - setDeviceOperationalStatusValue(other.getDeviceOperationalStatusValue()); - } - if (!other.deviceDrivers_.isEmpty()) { - if (deviceDrivers_.isEmpty()) { - deviceDrivers_ = other.deviceDrivers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceDriversIsMutable(); - deviceDrivers_.addAll(other.deviceDrivers_); - } - onChanged(); - } - if (deviceEndpointsBuilder_ == null) { - if (!other.deviceEndpoints_.isEmpty()) { - if (deviceEndpoints_.isEmpty()) { - deviceEndpoints_ = other.deviceEndpoints_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.addAll(other.deviceEndpoints_); - } - onChanged(); - } - } else { - if (!other.deviceEndpoints_.isEmpty()) { - if (deviceEndpointsBuilder_.isEmpty()) { - deviceEndpointsBuilder_.dispose(); - deviceEndpointsBuilder_ = null; - deviceEndpoints_ = other.deviceEndpoints_; - bitField0_ = (bitField0_ & ~0x00000002); - deviceEndpointsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceEndpointsFieldBuilder() : null; - } else { - deviceEndpointsBuilder_.addAllMessages(other.deviceEndpoints_); - } - } - } - 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 { - context.ContextOuterClass.Device parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Device) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; - /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; - } - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); - } - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceId_ = value; - onChanged(); - } else { - deviceIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); - } else { - deviceIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; - onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { - - onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); - } - /** - * .context.DeviceId device_id = 1; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - } - /** - * .context.DeviceId device_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; - } - - private java.lang.Object deviceType_ = ""; - /** - * string device_type = 2; - * @return The deviceType. - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string device_type = 2; - * @param value The deviceType to set. - * @return This builder for chaining. - */ - public Builder setDeviceType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceType_ = value; - onChanged(); - return this; - } - /** - * string device_type = 2; - * @return This builder for chaining. - */ - public Builder clearDeviceType() { - - deviceType_ = getDefaultInstance().getDeviceType(); - onChanged(); - return this; - } - /** - * string device_type = 2; - * @param value The bytes for deviceType to set. - * @return This builder for chaining. - */ - public Builder setDeviceTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceType_ = value; - onChanged(); - return this; - } - - private context.ContextOuterClass.DeviceConfig deviceConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> deviceConfigBuilder_; - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - public boolean hasDeviceConfig() { - return deviceConfigBuilder_ != null || deviceConfig_ != null; - } - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - public context.ContextOuterClass.DeviceConfig getDeviceConfig() { - if (deviceConfigBuilder_ == null) { - return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } else { - return deviceConfigBuilder_.getMessage(); - } + // @@protoc_insertion_point(builder_implements:context.ConnectionId) + context.ContextOuterClass.ConnectionIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder setDeviceConfig(context.ContextOuterClass.DeviceConfig value) { - if (deviceConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceConfig_ = value; - onChanged(); - } else { - deviceConfigBuilder_.setMessage(value); - } - return this; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder setDeviceConfig( - context.ContextOuterClass.DeviceConfig.Builder builderForValue) { - if (deviceConfigBuilder_ == null) { - deviceConfig_ = builderForValue.build(); - onChanged(); - } else { - deviceConfigBuilder_.setMessage(builderForValue.build()); - } - return this; + // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder mergeDeviceConfig(context.ContextOuterClass.DeviceConfig value) { - if (deviceConfigBuilder_ == null) { - if (deviceConfig_ != null) { - deviceConfig_ = - context.ContextOuterClass.DeviceConfig.newBuilder(deviceConfig_).mergeFrom(value).buildPartial(); - } else { - deviceConfig_ = value; - } - onChanged(); - } else { - deviceConfigBuilder_.mergeFrom(value); - } - return this; + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder clearDeviceConfig() { - if (deviceConfigBuilder_ == null) { - deviceConfig_ = null; - onChanged(); - } else { - deviceConfig_ = null; - deviceConfigBuilder_ = null; + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } - - return this; - } - /** - * .context.DeviceConfig device_config = 3; - */ - public context.ContextOuterClass.DeviceConfig.Builder getDeviceConfigBuilder() { - - onChanged(); - return getDeviceConfigFieldBuilder().getBuilder(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { - if (deviceConfigBuilder_ != null) { - return deviceConfigBuilder_.getMessageOrBuilder(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; } else { - return deviceConfig_ == null ? - context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } - } - /** - * .context.DeviceConfig device_config = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> - getDeviceConfigFieldBuilder() { - if (deviceConfigBuilder_ == null) { - deviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>( - getDeviceConfig(), - getParentForChildren(), - isClean()); - deviceConfig_ = null; + connectionUuid_ = null; + connectionUuidBuilder_ = null; } - return deviceConfigBuilder_; - } - - private int deviceOperationalStatus_ = 0; - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - @java.lang.Override public int getDeviceOperationalStatusValue() { - return deviceOperationalStatus_; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @param value The enum numeric value on the wire for deviceOperationalStatus to set. - * @return This builder for chaining. - */ - public Builder setDeviceOperationalStatusValue(int value) { - - deviceOperationalStatus_ = value; - onChanged(); return this; } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ + @java.lang.Override - public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); - return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @param value The deviceOperationalStatus to set. - * @return This builder for chaining. - */ - public Builder setDeviceOperationalStatus(context.ContextOuterClass.DeviceOperationalStatusEnum value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceOperationalStatus_ = value.getNumber(); - onChanged(); - return this; + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return This builder for chaining. - */ - public Builder clearDeviceOperationalStatus() { - - deviceOperationalStatus_ = 0; - onChanged(); - return this; + + @java.lang.Override + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionId.getDefaultInstance(); } - private java.util.List deviceDrivers_ = - java.util.Collections.emptyList(); - private void ensureDeviceDriversIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(deviceDrivers_); - bitField0_ |= 0x00000001; + @java.lang.Override + public context.ContextOuterClass.ConnectionId build() { + context.ContextOuterClass.ConnectionId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - public java.util.List getDeviceDriversList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - public int getDeviceDriversCount() { - return deviceDrivers_.size(); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { - return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index to set the value at. - * @param value The deviceDrivers to set. - * @return This builder for chaining. - */ - public Builder setDeviceDrivers( - int index, context.ContextOuterClass.DeviceDriverEnum value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public context.ContextOuterClass.ConnectionId buildPartial() { + context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); + if (connectionUuidBuilder_ == null) { + result.connectionUuid_ = connectionUuid_; + } else { + result.connectionUuid_ = connectionUuidBuilder_.build(); } - ensureDeviceDriversIsMutable(); - deviceDrivers_.set(index, value.getNumber()); - onChanged(); - return this; + onBuilt(); + return result; } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param value The deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addDeviceDrivers(context.ContextOuterClass.DeviceDriverEnum value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceDriversIsMutable(); - deviceDrivers_.add(value.getNumber()); - onChanged(); - return this; + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param values The deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addAllDeviceDrivers( - java.lang.Iterable values) { - ensureDeviceDriversIsMutable(); - for (context.ContextOuterClass.DeviceDriverEnum value : values) { - deviceDrivers_.add(value.getNumber()); - } - onChanged(); - return this; + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return This builder for chaining. - */ - public Builder clearDeviceDrivers() { - deviceDrivers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - public java.util.List - getDeviceDriversValueList() { - return java.util.Collections.unmodifiableList(deviceDrivers_); + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - public int getDeviceDriversValue(int index) { - return deviceDrivers_.get(index); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - * @return This builder for chaining. - */ - public Builder setDeviceDriversValue( - int index, int value) { - ensureDeviceDriversIsMutable(); - deviceDrivers_.set(index, value); - onChanged(); - return this; + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param value The enum numeric value on the wire for deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addDeviceDriversValue(int value) { - ensureDeviceDriversIsMutable(); - deviceDrivers_.add(value); - onChanged(); - return this; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.ConnectionId) { + return mergeFrom((context.ContextOuterClass.ConnectionId)other); + } else { + super.mergeFrom(other); + return this; + } } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param values The enum numeric values on the wire for deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addAllDeviceDriversValue( - java.lang.Iterable values) { - ensureDeviceDriversIsMutable(); - for (int value : values) { - deviceDrivers_.add(value); + + public Builder mergeFrom(context.ContextOuterClass.ConnectionId other) { + if (other == context.ContextOuterClass.ConnectionId.getDefaultInstance()) return this; + if (other.hasConnectionUuid()) { + mergeConnectionUuid(other.getConnectionUuid()); } + this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } - private java.util.List deviceEndpoints_ = - java.util.Collections.emptyList(); - private void ensureDeviceEndpointsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = new java.util.ArrayList(deviceEndpoints_); - bitField0_ |= 0x00000002; - } + @java.lang.Override + public final boolean isInitialized() { + return true; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> deviceEndpointsBuilder_; - - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public java.util.List getDeviceEndpointsList() { - if (deviceEndpointsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceEndpoints_); - } else { - return deviceEndpointsBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public int getDeviceEndpointsCount() { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.size(); - } else { - return deviceEndpointsBuilder_.getCount(); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.get(index); - } else { - return deviceEndpointsBuilder_.getMessage(index); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder setDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.ConnectionId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ConnectionId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.set(index, value); - onChanged(); - } else { - deviceEndpointsBuilder_.setMessage(index, value); } return this; } + + private context.ContextOuterClass.Uuid connectionUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> connectionUuidBuilder_; /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ - public Builder setDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + public boolean hasConnectionUuid() { + return connectionUuidBuilder_ != null || connectionUuid_ != null; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ - public Builder addDeviceEndpoints(context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(value); - onChanged(); + public context.ContextOuterClass.Uuid getConnectionUuid() { + if (connectionUuidBuilder_ == null) { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; } else { - deviceEndpointsBuilder_.addMessage(value); + return connectionUuidBuilder_.getMessage(); } - return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder addDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { + public Builder setConnectionUuid(context.ContextOuterClass.Uuid value) { + if (connectionUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(index, value); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addDeviceEndpoints( - context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addAllDeviceEndpoints( - java.lang.Iterable values) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceEndpoints_); + connectionUuid_ = value; onChanged(); } else { - deviceEndpointsBuilder_.addAllMessages(values); + connectionUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder clearDeviceEndpoints() { - if (deviceEndpointsBuilder_ == null) { - deviceEndpoints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder setConnectionUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (connectionUuidBuilder_ == null) { + connectionUuid_ = builderForValue.build(); onChanged(); } else { - deviceEndpointsBuilder_.clear(); + connectionUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder removeDeviceEndpoints(int index) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.remove(index); + public Builder mergeConnectionUuid(context.ContextOuterClass.Uuid value) { + if (connectionUuidBuilder_ == null) { + if (connectionUuid_ != null) { + connectionUuid_ = + context.ContextOuterClass.Uuid.newBuilder(connectionUuid_).mergeFrom(value).buildPartial(); + } else { + connectionUuid_ = value; + } onChanged(); } else { - deviceEndpointsBuilder_.remove(index); + connectionUuidBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPoint.Builder getDeviceEndpointsBuilder( - int index) { - return getDeviceEndpointsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index) { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.get(index); } else { - return deviceEndpointsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public java.util.List - getDeviceEndpointsOrBuilderList() { - if (deviceEndpointsBuilder_ != null) { - return deviceEndpointsBuilder_.getMessageOrBuilderList(); + public Builder clearConnectionUuid() { + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(deviceEndpoints_); + connectionUuid_ = null; + connectionUuidBuilder_ = null; } + + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder() { - return getDeviceEndpointsFieldBuilder().addBuilder( - context.ContextOuterClass.EndPoint.getDefaultInstance()); + public context.ContextOuterClass.Uuid.Builder getConnectionUuidBuilder() { + + onChanged(); + return getConnectionUuidFieldBuilder().getBuilder(); } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder( - int index) { - return getDeviceEndpointsFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPoint.getDefaultInstance()); + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + if (connectionUuidBuilder_ != null) { + return connectionUuidBuilder_.getMessageOrBuilder(); + } else { + return connectionUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + } } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public java.util.List - getDeviceEndpointsBuilderList() { - return getDeviceEndpointsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> - getDeviceEndpointsFieldBuilder() { - if (deviceEndpointsBuilder_ == null) { - deviceEndpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder>( - deviceEndpoints_, - ((bitField0_ & 0x00000002) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getConnectionUuidFieldBuilder() { + if (connectionUuidBuilder_ == null) { + connectionUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getConnectionUuid(), getParentForChildren(), isClean()); - deviceEndpoints_ = null; + connectionUuid_ = null; } - return deviceEndpointsBuilder_; + return connectionUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -13934,95 +37645,83 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Device) + // @@protoc_insertion_point(builder_scope:context.ConnectionId) } - // @@protoc_insertion_point(class_scope:context.Device) - private static final context.ContextOuterClass.Device DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionId) + private static final context.ContextOuterClass.ConnectionId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Device(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionId(); } - public static context.ContextOuterClass.Device getDefaultInstance() { + public static context.ContextOuterClass.ConnectionId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Device parsePartialFrom( + public ConnectionId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Device(input, extensionRegistry); + return new ConnectionId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Device getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceConfig) + public interface ConnectionSettings_L0OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L0) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConfigRule config_rules = 1; - */ - java.util.List - getConfigRulesList(); - /** - * repeated .context.ConfigRule config_rules = 1; - */ - context.ContextOuterClass.ConfigRule getConfigRules(int index); - /** - * repeated .context.ConfigRule config_rules = 1; - */ - int getConfigRulesCount(); - /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ - java.util.List - getConfigRulesOrBuilderList(); + java.lang.String getLspSymbolicName(); /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ - context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index); + com.google.protobuf.ByteString + getLspSymbolicNameBytes(); } /** - * Protobuf type {@code context.DeviceConfig} + * Protobuf type {@code context.ConnectionSettings_L0} */ - public static final class DeviceConfig extends + public static final class ConnectionSettings_L0 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceConfig) - DeviceConfigOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L0) + ConnectionSettings_L0OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceConfig.newBuilder() to construct. - private DeviceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L0.newBuilder() to construct. + private ConnectionSettings_L0(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceConfig() { - configRules_ = java.util.Collections.emptyList(); + private ConnectionSettings_L0() { + lspSymbolicName_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceConfig(); + return new ConnectionSettings_L0(); } @java.lang.Override @@ -14030,7 +37729,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceConfig( + private ConnectionSettings_L0( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -14038,7 +37737,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -14050,12 +37748,9 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - configRules_.add( - input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + lspSymbolicName_ = s; break; } default: { @@ -14073,64 +37768,59 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + context.ContextOuterClass.ConnectionSettings_L0.class, context.ContextOuterClass.ConnectionSettings_L0.Builder.class); } - public static final int CONFIG_RULES_FIELD_NUMBER = 1; - private java.util.List configRules_; - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public java.util.List getConfigRulesList() { - return configRules_; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public java.util.List - getConfigRulesOrBuilderList() { - return configRules_; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public int getConfigRulesCount() { - return configRules_.size(); - } + public static final int LSP_SYMBOLIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object lspSymbolicName_; /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ @java.lang.Override - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - return configRules_.get(index); + public java.lang.String getLspSymbolicName() { + java.lang.Object ref = lspSymbolicName_; + 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(); + lspSymbolicName_ = s; + return s; + } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ @java.lang.Override - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - return configRules_.get(index); + public com.google.protobuf.ByteString + getLspSymbolicNameBytes() { + java.lang.Object ref = lspSymbolicName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lspSymbolicName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -14147,8 +37837,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < configRules_.size(); i++) { - output.writeMessage(1, configRules_.get(i)); + if (!getLspSymbolicNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, lspSymbolicName_); } unknownFields.writeTo(output); } @@ -14159,9 +37849,8 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < configRules_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, configRules_.get(i)); + if (!getLspSymbolicNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, lspSymbolicName_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -14173,13 +37862,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceConfig)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L0)) { return super.equals(obj); } - context.ContextOuterClass.DeviceConfig other = (context.ContextOuterClass.DeviceConfig) obj; + context.ContextOuterClass.ConnectionSettings_L0 other = (context.ContextOuterClass.ConnectionSettings_L0) obj; - if (!getConfigRulesList() - .equals(other.getConfigRulesList())) return false; + if (!getLspSymbolicName() + .equals(other.getLspSymbolicName())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -14191,78 +37880,76 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConfigRulesCount() > 0) { - hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; - hash = (53 * hash) + getConfigRulesList().hashCode(); - } + hash = (37 * hash) + LSP_SYMBOLIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLspSymbolicName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 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 context.ContextOuterClass.DeviceConfig parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L0 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 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 context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -14275,7 +37962,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceConfig prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L0 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -14291,26 +37978,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceConfig} + * Protobuf type {@code context.ConnectionSettings_L0} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceConfig) - context.ContextOuterClass.DeviceConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L0) + context.ContextOuterClass.ConnectionSettings_L0OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + context.ContextOuterClass.ConnectionSettings_L0.class, context.ContextOuterClass.ConnectionSettings_L0.Builder.class); } - // Construct using context.ContextOuterClass.DeviceConfig.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L0.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -14323,35 +38010,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - configRulesBuilder_.clear(); - } + lspSymbolicName_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceConfig.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceConfig build() { - context.ContextOuterClass.DeviceConfig result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L0 build() { + context.ContextOuterClass.ConnectionSettings_L0 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -14359,18 +38041,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceConfig buildPartial() { - context.ContextOuterClass.DeviceConfig result = new context.ContextOuterClass.DeviceConfig(this); - int from_bitField0_ = bitField0_; - if (configRulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.configRules_ = configRules_; - } else { - result.configRules_ = configRulesBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L0 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L0 result = new context.ContextOuterClass.ConnectionSettings_L0(this); + result.lspSymbolicName_ = lspSymbolicName_; onBuilt(); return result; } @@ -14409,41 +38082,19 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceConfig) { - return mergeFrom((context.ContextOuterClass.DeviceConfig)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L0) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L0)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceConfig other) { - if (other == context.ContextOuterClass.DeviceConfig.getDefaultInstance()) return this; - if (configRulesBuilder_ == null) { - if (!other.configRules_.isEmpty()) { - if (configRules_.isEmpty()) { - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConfigRulesIsMutable(); - configRules_.addAll(other.configRules_); - } - onChanged(); - } - } else { - if (!other.configRules_.isEmpty()) { - if (configRulesBuilder_.isEmpty()) { - configRulesBuilder_.dispose(); - configRulesBuilder_ = null; - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - configRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConfigRulesFieldBuilder() : null; - } else { - configRulesBuilder_.addAllMessages(other.configRules_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L0 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance()) return this; + if (!other.getLspSymbolicName().isEmpty()) { + lspSymbolicName_ = other.lspSymbolicName_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -14460,11 +38111,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceConfig parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L0 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceConfig) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L0) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -14473,246 +38124,81 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List configRules_ = - java.util.Collections.emptyList(); - private void ensureConfigRulesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(configRules_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + private java.lang.Object lspSymbolicName_ = ""; /** - * repeated .context.ConfigRule config_rules = 1; - */ - public java.util.List getConfigRulesList() { - if (configRulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(configRules_); - } else { - return configRulesBuilder_.getMessageList(); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public int getConfigRulesCount() { - if (configRulesBuilder_ == null) { - return configRules_.size(); - } else { - return configRulesBuilder_.getCount(); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); - } else { - return configRulesBuilder_.getMessage(index); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.set(index, value); - onChanged(); - } else { - configRulesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.set(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.add(value); - onChanged(); - } else { - configRulesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.add(index, value); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addAllConfigRules( - java.lang.Iterable values) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, configRules_); - onChanged(); - } else { - configRulesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder clearConfigRules() { - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - configRulesBuilder_.clear(); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder removeConfigRules(int index) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.remove(index); - onChanged(); - } else { - configRulesBuilder_.remove(index); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); } else { - return configRulesBuilder_.getMessageOrBuilder(index); + public java.lang.String getLspSymbolicName() { + java.lang.Object ref = lspSymbolicName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lspSymbolicName_ = s; + return s; + } else { + return (java.lang.String) ref; } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ - public java.util.List - getConfigRulesOrBuilderList() { - if (configRulesBuilder_ != null) { - return configRulesBuilder_.getMessageOrBuilderList(); + public com.google.protobuf.ByteString + getLspSymbolicNameBytes() { + java.lang.Object ref = lspSymbolicName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lspSymbolicName_ = b; + return b; } else { - return java.util.Collections.unmodifiableList(configRules_); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @param value The lspSymbolicName to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { - return getConfigRulesFieldBuilder().addBuilder( - context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public Builder setLspSymbolicName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lspSymbolicName_ = value; + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public Builder clearLspSymbolicName() { + + lspSymbolicName_ = getDefaultInstance().getLspSymbolicName(); + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @param value The bytes for lspSymbolicName to set. + * @return This builder for chaining. */ - public java.util.List - getConfigRulesBuilderList() { - return getConfigRulesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> - getConfigRulesFieldBuilder() { - if (configRulesBuilder_ == null) { - configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( - configRules_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - configRules_ = null; - } - return configRulesBuilder_; + public Builder setLspSymbolicNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lspSymbolicName_ = value; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -14727,95 +38213,120 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceConfig) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L0) } - // @@protoc_insertion_point(class_scope:context.DeviceConfig) - private static final context.ContextOuterClass.DeviceConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L0) + private static final context.ContextOuterClass.ConnectionSettings_L0 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceConfig(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L0(); } - public static context.ContextOuterClass.DeviceConfig getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceConfig parsePartialFrom( + public ConnectionSettings_L0 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceConfig(input, extensionRegistry); + return new ConnectionSettings_L0(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceIdList) + public interface ConnectionSettings_L2OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L2) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ - java.util.List - getDeviceIdsList(); + java.lang.String getSrcMacAddress(); /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ - context.ContextOuterClass.DeviceId getDeviceIds(int index); + com.google.protobuf.ByteString + getSrcMacAddressBytes(); + /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ - int getDeviceIdsCount(); + java.lang.String getDstMacAddress(); /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ - java.util.List - getDeviceIdsOrBuilderList(); + com.google.protobuf.ByteString + getDstMacAddressBytes(); + /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index); + int getEtherType(); + + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + int getVlanId(); + + /** + * uint32 mpls_label = 5; + * @return The mplsLabel. + */ + int getMplsLabel(); + + /** + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. + */ + int getMplsTrafficClass(); } /** - * Protobuf type {@code context.DeviceIdList} + * Protobuf type {@code context.ConnectionSettings_L2} */ - public static final class DeviceIdList extends + public static final class ConnectionSettings_L2 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceIdList) - DeviceIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L2) + ConnectionSettings_L2OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceIdList.newBuilder() to construct. - private DeviceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L2.newBuilder() to construct. + private ConnectionSettings_L2(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceIdList() { - deviceIds_ = java.util.Collections.emptyList(); + private ConnectionSettings_L2() { + srcMacAddress_ = ""; + dstMacAddress_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceIdList(); + return new ConnectionSettings_L2(); } @java.lang.Override @@ -14823,7 +38334,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceIdList( + private ConnectionSettings_L2( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -14831,7 +38342,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -14843,12 +38353,35 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceIds_.add( - input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + srcMacAddress_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + dstMacAddress_ = s; + break; + } + case 24: { + + etherType_ = input.readUInt32(); + break; + } + case 32: { + + vlanId_ = input.readUInt32(); + break; + } + case 40: { + + mplsLabel_ = input.readUInt32(); + break; + } + case 48: { + + mplsTrafficClass_ = input.readUInt32(); break; } default: { @@ -14866,64 +38399,141 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L2.class, context.ContextOuterClass.ConnectionSettings_L2.Builder.class); } - public static final int DEVICE_IDS_FIELD_NUMBER = 1; - private java.util.List deviceIds_; + public static final int SRC_MAC_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object srcMacAddress_; /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ @java.lang.Override - public java.util.List getDeviceIdsList() { - return deviceIds_; + public java.lang.String getSrcMacAddress() { + java.lang.Object ref = srcMacAddress_; + 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(); + srcMacAddress_ = s; + return s; + } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ @java.lang.Override - public java.util.List - getDeviceIdsOrBuilderList() { - return deviceIds_; + public com.google.protobuf.ByteString + getSrcMacAddressBytes() { + java.lang.Object ref = srcMacAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcMacAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DST_MAC_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object dstMacAddress_; /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ @java.lang.Override - public int getDeviceIdsCount() { - return deviceIds_.size(); + public java.lang.String getDstMacAddress() { + java.lang.Object ref = dstMacAddress_; + 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(); + dstMacAddress_ = s; + return s; + } } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - return deviceIds_.get(index); + public com.google.protobuf.ByteString + getDstMacAddressBytes() { + java.lang.Object ref = dstMacAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstMacAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int ETHER_TYPE_FIELD_NUMBER = 3; + private int etherType_; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - return deviceIds_.get(index); + public int getEtherType() { + return etherType_; + } + + public static final int VLAN_ID_FIELD_NUMBER = 4; + private int vlanId_; + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } + + public static final int MPLS_LABEL_FIELD_NUMBER = 5; + private int mplsLabel_; + /** + * uint32 mpls_label = 5; + * @return The mplsLabel. + */ + @java.lang.Override + public int getMplsLabel() { + return mplsLabel_; + } + + public static final int MPLS_TRAFFIC_CLASS_FIELD_NUMBER = 6; + private int mplsTrafficClass_; + /** + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. + */ + @java.lang.Override + public int getMplsTrafficClass() { + return mplsTrafficClass_; } private byte memoizedIsInitialized = -1; @@ -14940,8 +38550,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < deviceIds_.size(); i++) { - output.writeMessage(1, deviceIds_.get(i)); + if (!getSrcMacAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, srcMacAddress_); + } + if (!getDstMacAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dstMacAddress_); + } + if (etherType_ != 0) { + output.writeUInt32(3, etherType_); + } + if (vlanId_ != 0) { + output.writeUInt32(4, vlanId_); + } + if (mplsLabel_ != 0) { + output.writeUInt32(5, mplsLabel_); + } + if (mplsTrafficClass_ != 0) { + output.writeUInt32(6, mplsTrafficClass_); } unknownFields.writeTo(output); } @@ -14952,9 +38577,27 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < deviceIds_.size(); i++) { + if (!getSrcMacAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, srcMacAddress_); + } + if (!getDstMacAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dstMacAddress_); + } + if (etherType_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, deviceIds_.get(i)); + .computeUInt32Size(3, etherType_); + } + if (vlanId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, vlanId_); + } + if (mplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, mplsLabel_); + } + if (mplsTrafficClass_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, mplsTrafficClass_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -14966,13 +38609,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceIdList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L2)) { return super.equals(obj); } - context.ContextOuterClass.DeviceIdList other = (context.ContextOuterClass.DeviceIdList) obj; - - if (!getDeviceIdsList() - .equals(other.getDeviceIdsList())) return false; + context.ContextOuterClass.ConnectionSettings_L2 other = (context.ContextOuterClass.ConnectionSettings_L2) obj; + + if (!getSrcMacAddress() + .equals(other.getSrcMacAddress())) return false; + if (!getDstMacAddress() + .equals(other.getDstMacAddress())) return false; + if (getEtherType() + != other.getEtherType()) return false; + if (getVlanId() + != other.getVlanId()) return false; + if (getMplsLabel() + != other.getMplsLabel()) return false; + if (getMplsTrafficClass() + != other.getMplsTrafficClass()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -14984,78 +38637,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getDeviceIdsCount() > 0) { - hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceIdsList().hashCode(); - } + hash = (37 * hash) + SRC_MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcMacAddress().hashCode(); + hash = (37 * hash) + DST_MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstMacAddress().hashCode(); + hash = (37 * hash) + ETHER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEtherType(); + hash = (37 * hash) + VLAN_ID_FIELD_NUMBER; + hash = (53 * hash) + getVlanId(); + hash = (37 * hash) + MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getMplsLabel(); + hash = (37 * hash) + MPLS_TRAFFIC_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getMplsTrafficClass(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 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 context.ContextOuterClass.DeviceIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L2 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 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 context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -15068,7 +38729,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L2 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -15084,26 +38745,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceIdList} + * Protobuf type {@code context.ConnectionSettings_L2} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceIdList) - context.ContextOuterClass.DeviceIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L2) + context.ContextOuterClass.ConnectionSettings_L2OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L2.class, context.ContextOuterClass.ConnectionSettings_L2.Builder.class); } - // Construct using context.ContextOuterClass.DeviceIdList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L2.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -15116,35 +38777,40 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDeviceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - deviceIdsBuilder_.clear(); - } + srcMacAddress_ = ""; + + dstMacAddress_ = ""; + + etherType_ = 0; + + vlanId_ = 0; + + mplsLabel_ = 0; + + mplsTrafficClass_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceIdList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceIdList build() { - context.ContextOuterClass.DeviceIdList result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L2 build() { + context.ContextOuterClass.ConnectionSettings_L2 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -15152,18 +38818,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceIdList buildPartial() { - context.ContextOuterClass.DeviceIdList result = new context.ContextOuterClass.DeviceIdList(this); - int from_bitField0_ = bitField0_; - if (deviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceIds_ = deviceIds_; - } else { - result.deviceIds_ = deviceIdsBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L2 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L2 result = new context.ContextOuterClass.ConnectionSettings_L2(this); + result.srcMacAddress_ = srcMacAddress_; + result.dstMacAddress_ = dstMacAddress_; + result.etherType_ = etherType_; + result.vlanId_ = vlanId_; + result.mplsLabel_ = mplsLabel_; + result.mplsTrafficClass_ = mplsTrafficClass_; onBuilt(); return result; } @@ -15202,41 +38864,35 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceIdList) { - return mergeFrom((context.ContextOuterClass.DeviceIdList)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L2) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L2)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceIdList other) { - if (other == context.ContextOuterClass.DeviceIdList.getDefaultInstance()) return this; - if (deviceIdsBuilder_ == null) { - if (!other.deviceIds_.isEmpty()) { - if (deviceIds_.isEmpty()) { - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceIdsIsMutable(); - deviceIds_.addAll(other.deviceIds_); - } - onChanged(); - } - } else { - if (!other.deviceIds_.isEmpty()) { - if (deviceIdsBuilder_.isEmpty()) { - deviceIdsBuilder_.dispose(); - deviceIdsBuilder_ = null; - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - deviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceIdsFieldBuilder() : null; - } else { - deviceIdsBuilder_.addAllMessages(other.deviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L2 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance()) return this; + if (!other.getSrcMacAddress().isEmpty()) { + srcMacAddress_ = other.srcMacAddress_; + onChanged(); + } + if (!other.getDstMacAddress().isEmpty()) { + dstMacAddress_ = other.dstMacAddress_; + onChanged(); + } + if (other.getEtherType() != 0) { + setEtherType(other.getEtherType()); + } + if (other.getVlanId() != 0) { + setVlanId(other.getVlanId()); + } + if (other.getMplsLabel() != 0) { + setMplsLabel(other.getMplsLabel()); + } + if (other.getMplsTrafficClass() != 0) { + setMplsTrafficClass(other.getMplsTrafficClass()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -15253,11 +38909,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceIdList parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L2 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L2) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -15266,246 +38922,281 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List deviceIds_ = - java.util.Collections.emptyList(); - private void ensureDeviceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(deviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + private java.lang.Object srcMacAddress_ = ""; /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ - public java.util.List getDeviceIdsList() { - if (deviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceIds_); + public java.lang.String getSrcMacAddress() { + java.lang.Object ref = srcMacAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcMacAddress_ = s; + return s; } else { - return deviceIdsBuilder_.getMessageList(); + return (java.lang.String) ref; } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ - public int getDeviceIdsCount() { - if (deviceIdsBuilder_ == null) { - return deviceIds_.size(); + public com.google.protobuf.ByteString + getSrcMacAddressBytes() { + java.lang.Object ref = srcMacAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcMacAddress_ = b; + return b; } else { - return deviceIdsBuilder_.getCount(); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @param value The srcMacAddress to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); - } else { - return deviceIdsBuilder_.getMessage(index); - } + public Builder setSrcMacAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcMacAddress_ = value; + onChanged(); + return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return This builder for chaining. */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, value); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, value); - } + public Builder clearSrcMacAddress() { + + srcMacAddress_ = getDefaultInstance().getSrcMacAddress(); + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @param value The bytes for srcMacAddress to set. + * @return This builder for chaining. */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, builderForValue.build()); - } + public Builder setSrcMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcMacAddress_ = value; + onChanged(); return this; } + + private java.lang.Object dstMacAddress_ = ""; /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ - public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(value); - onChanged(); + public java.lang.String getDstMacAddress() { + java.lang.Object ref = dstMacAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstMacAddress_ = s; + return s; } else { - deviceIdsBuilder_.addMessage(value); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, value); - onChanged(); + public com.google.protobuf.ByteString + getDstMacAddressBytes() { + java.lang.Object ref = dstMacAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstMacAddress_ = b; + return b; } else { - deviceIdsBuilder_.addMessage(index, value); + return (com.google.protobuf.ByteString) ref; } + } + /** + * string dst_mac_address = 2; + * @param value The dstMacAddress to set. + * @return This builder for chaining. + */ + public Builder setDstMacAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstMacAddress_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return This builder for chaining. */ - public Builder addDeviceIds( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder clearDstMacAddress() { + + dstMacAddress_ = getDefaultInstance().getDstMacAddress(); + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @param value The bytes for dstMacAddress to set. + * @return This builder for chaining. */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, builderForValue.build()); - } + public Builder setDstMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstMacAddress_ = value; + onChanged(); return this; } + + private int etherType_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ - public Builder addAllDeviceIds( - java.lang.Iterable values) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceIds_); - onChanged(); - } else { - deviceIdsBuilder_.addAllMessages(values); - } + @java.lang.Override + public int getEtherType() { + return etherType_; + } + /** + * uint32 ether_type = 3; + * @param value The etherType to set. + * @return This builder for chaining. + */ + public Builder setEtherType(int value) { + + etherType_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return This builder for chaining. */ - public Builder clearDeviceIds() { - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - deviceIdsBuilder_.clear(); - } + public Builder clearEtherType() { + + etherType_ = 0; + onChanged(); return this; } + + private int vlanId_ ; + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 vlan_id = 4; + * @param value The vlanId to set. + * @return This builder for chaining. */ - public Builder removeDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.remove(index); - onChanged(); - } else { - deviceIdsBuilder_.remove(index); - } + public Builder setVlanId(int value) { + + vlanId_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 vlan_id = 4; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().getBuilder(index); + public Builder clearVlanId() { + + vlanId_ = 0; + onChanged(); + return this; } + + private int mplsLabel_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @return The mplsLabel. */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); } else { - return deviceIdsBuilder_.getMessageOrBuilder(index); - } + @java.lang.Override + public int getMplsLabel() { + return mplsLabel_; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @param value The mplsLabel to set. + * @return This builder for chaining. */ - public java.util.List - getDeviceIdsOrBuilderList() { - if (deviceIdsBuilder_ != null) { - return deviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(deviceIds_); - } + public Builder setMplsLabel(int value) { + + mplsLabel_ = value; + onChanged(); + return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { - return getDeviceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); + public Builder clearMplsLabel() { + + mplsLabel_ = 0; + onChanged(); + return this; } + + private int mplsTrafficClass_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + @java.lang.Override + public int getMplsTrafficClass() { + return mplsTrafficClass_; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_traffic_class = 6; + * @param value The mplsTrafficClass to set. + * @return This builder for chaining. */ - public java.util.List - getDeviceIdsBuilderList() { - return getDeviceIdsFieldBuilder().getBuilderList(); + public Builder setMplsTrafficClass(int value) { + + mplsTrafficClass_ = value; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdsFieldBuilder() { - if (deviceIdsBuilder_ == null) { - deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - deviceIds_ = null; - } - return deviceIdsBuilder_; + /** + * uint32 mpls_traffic_class = 6; + * @return This builder for chaining. + */ + public Builder clearMplsTrafficClass() { + + mplsTrafficClass_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -15520,95 +39211,114 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceIdList) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L2) } - // @@protoc_insertion_point(class_scope:context.DeviceIdList) - private static final context.ContextOuterClass.DeviceIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L2) + private static final context.ContextOuterClass.ConnectionSettings_L2 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L2(); } - public static context.ContextOuterClass.DeviceIdList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceIdList parsePartialFrom( + public ConnectionSettings_L2 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceIdList(input, extensionRegistry); + return new ConnectionSettings_L2(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceList) + public interface ConnectionSettings_L3OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L3) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ - java.util.List - getDevicesList(); + java.lang.String getSrcIpAddress(); /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ - context.ContextOuterClass.Device getDevices(int index); + com.google.protobuf.ByteString + getSrcIpAddressBytes(); + /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ - int getDevicesCount(); + java.lang.String getDstIpAddress(); /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ - java.util.List - getDevicesOrBuilderList(); + com.google.protobuf.ByteString + getDstIpAddressBytes(); + /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ - context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index); + int getDscp(); + + /** + * uint32 protocol = 4; + * @return The protocol. + */ + int getProtocol(); + + /** + * uint32 ttl = 5; + * @return The ttl. + */ + int getTtl(); } /** - * Protobuf type {@code context.DeviceList} + * Protobuf type {@code context.ConnectionSettings_L3} */ - public static final class DeviceList extends + public static final class ConnectionSettings_L3 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceList) - DeviceListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L3) + ConnectionSettings_L3OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceList.newBuilder() to construct. - private DeviceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L3.newBuilder() to construct. + private ConnectionSettings_L3(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceList() { - devices_ = java.util.Collections.emptyList(); + private ConnectionSettings_L3() { + srcIpAddress_ = ""; + dstIpAddress_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceList(); + return new ConnectionSettings_L3(); } @java.lang.Override @@ -15616,7 +39326,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceList( + private ConnectionSettings_L3( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -15624,7 +39334,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -15636,12 +39345,30 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - devices_.add( - input.readMessage(context.ContextOuterClass.Device.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + srcIpAddress_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + dstIpAddress_ = s; + break; + } + case 24: { + + dscp_ = input.readUInt32(); + break; + } + case 32: { + + protocol_ = input.readUInt32(); + break; + } + case 40: { + + ttl_ = input.readUInt32(); break; } default: { @@ -15659,64 +39386,130 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = java.util.Collections.unmodifiableList(devices_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L3.class, context.ContextOuterClass.ConnectionSettings_L3.Builder.class); } - public static final int DEVICES_FIELD_NUMBER = 1; - private java.util.List devices_; + public static final int SRC_IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object srcIpAddress_; /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ @java.lang.Override - public java.util.List getDevicesList() { - return devices_; + public java.lang.String getSrcIpAddress() { + java.lang.Object ref = srcIpAddress_; + 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(); + srcIpAddress_ = s; + return s; + } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ @java.lang.Override - public java.util.List - getDevicesOrBuilderList() { - return devices_; + public com.google.protobuf.ByteString + getSrcIpAddressBytes() { + java.lang.Object ref = srcIpAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DST_IP_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object dstIpAddress_; /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ @java.lang.Override - public int getDevicesCount() { - return devices_.size(); + public java.lang.String getDstIpAddress() { + java.lang.Object ref = dstIpAddress_; + 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(); + dstIpAddress_ = s; + return s; + } } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ @java.lang.Override - public context.ContextOuterClass.Device getDevices(int index) { - return devices_.get(index); + public com.google.protobuf.ByteString + getDstIpAddressBytes() { + java.lang.Object ref = dstIpAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DSCP_FIELD_NUMBER = 3; + private int dscp_; /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ @java.lang.Override - public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index) { - return devices_.get(index); + public int getDscp() { + return dscp_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 4; + private int protocol_; + /** + * uint32 protocol = 4; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + + public static final int TTL_FIELD_NUMBER = 5; + private int ttl_; + /** + * uint32 ttl = 5; + * @return The ttl. + */ + @java.lang.Override + public int getTtl() { + return ttl_; } private byte memoizedIsInitialized = -1; @@ -15733,8 +39526,20 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < devices_.size(); i++) { - output.writeMessage(1, devices_.get(i)); + if (!getSrcIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, srcIpAddress_); + } + if (!getDstIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dstIpAddress_); + } + if (dscp_ != 0) { + output.writeUInt32(3, dscp_); + } + if (protocol_ != 0) { + output.writeUInt32(4, protocol_); + } + if (ttl_ != 0) { + output.writeUInt32(5, ttl_); } unknownFields.writeTo(output); } @@ -15745,9 +39550,23 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < devices_.size(); i++) { + if (!getSrcIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, srcIpAddress_); + } + if (!getDstIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dstIpAddress_); + } + if (dscp_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, devices_.get(i)); + .computeUInt32Size(3, dscp_); + } + if (protocol_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, protocol_); + } + if (ttl_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, ttl_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -15759,13 +39578,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L3)) { return super.equals(obj); } - context.ContextOuterClass.DeviceList other = (context.ContextOuterClass.DeviceList) obj; - - if (!getDevicesList() - .equals(other.getDevicesList())) return false; + context.ContextOuterClass.ConnectionSettings_L3 other = (context.ContextOuterClass.ConnectionSettings_L3) obj; + + if (!getSrcIpAddress() + .equals(other.getSrcIpAddress())) return false; + if (!getDstIpAddress() + .equals(other.getDstIpAddress())) return false; + if (getDscp() + != other.getDscp()) return false; + if (getProtocol() + != other.getProtocol()) return false; + if (getTtl() + != other.getTtl()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -15777,78 +39604,84 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getDevicesCount() > 0) { - hash = (37 * hash) + DEVICES_FIELD_NUMBER; - hash = (53 * hash) + getDevicesList().hashCode(); - } + hash = (37 * hash) + SRC_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcIpAddress().hashCode(); + hash = (37 * hash) + DST_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstIpAddress().hashCode(); + hash = (37 * hash) + DSCP_FIELD_NUMBER; + hash = (53 * hash) + getDscp(); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol(); + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 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 context.ContextOuterClass.DeviceList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L3 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 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 context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -15861,7 +39694,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L3 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -15877,26 +39710,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceList} + * Protobuf type {@code context.ConnectionSettings_L3} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceList) - context.ContextOuterClass.DeviceListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L3) + context.ContextOuterClass.ConnectionSettings_L3OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L3.class, context.ContextOuterClass.ConnectionSettings_L3.Builder.class); } - // Construct using context.ContextOuterClass.DeviceList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L3.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -15909,35 +39742,38 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDevicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (devicesBuilder_ == null) { - devices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - devicesBuilder_.clear(); - } + srcIpAddress_ = ""; + + dstIpAddress_ = ""; + + dscp_ = 0; + + protocol_ = 0; + + ttl_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceList build() { - context.ContextOuterClass.DeviceList result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L3 build() { + context.ContextOuterClass.ConnectionSettings_L3 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -15945,18 +39781,13 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceList buildPartial() { - context.ContextOuterClass.DeviceList result = new context.ContextOuterClass.DeviceList(this); - int from_bitField0_ = bitField0_; - if (devicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - devices_ = java.util.Collections.unmodifiableList(devices_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.devices_ = devices_; - } else { - result.devices_ = devicesBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L3 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L3 result = new context.ContextOuterClass.ConnectionSettings_L3(this); + result.srcIpAddress_ = srcIpAddress_; + result.dstIpAddress_ = dstIpAddress_; + result.dscp_ = dscp_; + result.protocol_ = protocol_; + result.ttl_ = ttl_; onBuilt(); return result; } @@ -15995,41 +39826,32 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceList) { - return mergeFrom((context.ContextOuterClass.DeviceList)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L3) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L3)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceList other) { - if (other == context.ContextOuterClass.DeviceList.getDefaultInstance()) return this; - if (devicesBuilder_ == null) { - if (!other.devices_.isEmpty()) { - if (devices_.isEmpty()) { - devices_ = other.devices_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDevicesIsMutable(); - devices_.addAll(other.devices_); - } - onChanged(); - } - } else { - if (!other.devices_.isEmpty()) { - if (devicesBuilder_.isEmpty()) { - devicesBuilder_.dispose(); - devicesBuilder_ = null; - devices_ = other.devices_; - bitField0_ = (bitField0_ & ~0x00000001); - devicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDevicesFieldBuilder() : null; - } else { - devicesBuilder_.addAllMessages(other.devices_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L3 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance()) return this; + if (!other.getSrcIpAddress().isEmpty()) { + srcIpAddress_ = other.srcIpAddress_; + onChanged(); + } + if (!other.getDstIpAddress().isEmpty()) { + dstIpAddress_ = other.dstIpAddress_; + onChanged(); + } + if (other.getDscp() != 0) { + setDscp(other.getDscp()); + } + if (other.getProtocol() != 0) { + setProtocol(other.getProtocol()); + } + if (other.getTtl() != 0) { + setTtl(other.getTtl()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -16046,11 +39868,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceList parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L3 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L3) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -16059,246 +39881,250 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List devices_ = - java.util.Collections.emptyList(); - private void ensureDevicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - devices_ = new java.util.ArrayList(devices_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> devicesBuilder_; + private java.lang.Object srcIpAddress_ = ""; /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ - public java.util.List getDevicesList() { - if (devicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(devices_); + public java.lang.String getSrcIpAddress() { + java.lang.Object ref = srcIpAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcIpAddress_ = s; + return s; } else { - return devicesBuilder_.getMessageList(); + return (java.lang.String) ref; } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ - public int getDevicesCount() { - if (devicesBuilder_ == null) { - return devices_.size(); + public com.google.protobuf.ByteString + getSrcIpAddressBytes() { + java.lang.Object ref = srcIpAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcIpAddress_ = b; + return b; } else { - return devicesBuilder_.getCount(); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @param value The srcIpAddress to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Device getDevices(int index) { - if (devicesBuilder_ == null) { - return devices_.get(index); - } else { - return devicesBuilder_.getMessage(index); - } + public Builder setSrcIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcIpAddress_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return This builder for chaining. */ - public Builder setDevices( - int index, context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.set(index, value); - onChanged(); - } else { - devicesBuilder_.setMessage(index, value); - } + public Builder clearSrcIpAddress() { + + srcIpAddress_ = getDefaultInstance().getSrcIpAddress(); + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @param value The bytes for srcIpAddress to set. + * @return This builder for chaining. */ - public Builder setDevices( - int index, context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.set(index, builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.setMessage(index, builderForValue.build()); - } + public Builder setSrcIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcIpAddress_ = value; + onChanged(); return this; } + + private java.lang.Object dstIpAddress_ = ""; /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ - public Builder addDevices(context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.add(value); - onChanged(); + public java.lang.String getDstIpAddress() { + java.lang.Object ref = dstIpAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstIpAddress_ = s; + return s; } else { - devicesBuilder_.addMessage(value); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ - public Builder addDevices( - int index, context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.add(index, value); - onChanged(); + public com.google.protobuf.ByteString + getDstIpAddressBytes() { + java.lang.Object ref = dstIpAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstIpAddress_ = b; + return b; } else { - devicesBuilder_.addMessage(index, value); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @param value The dstIpAddress to set. + * @return This builder for chaining. */ - public Builder addDevices( - context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.add(builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.addMessage(builderForValue.build()); - } + public Builder setDstIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstIpAddress_ = value; + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return This builder for chaining. */ - public Builder addDevices( - int index, context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.add(index, builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.addMessage(index, builderForValue.build()); - } + public Builder clearDstIpAddress() { + + dstIpAddress_ = getDefaultInstance().getDstIpAddress(); + onChanged(); + return this; + } + /** + * string dst_ip_address = 2; + * @param value The bytes for dstIpAddress to set. + * @return This builder for chaining. + */ + public Builder setDstIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstIpAddress_ = value; + onChanged(); return this; } + + private int dscp_ ; /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ - public Builder addAllDevices( - java.lang.Iterable values) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, devices_); - onChanged(); - } else { - devicesBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public int getDscp() { + return dscp_; } /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @param value The dscp to set. + * @return This builder for chaining. */ - public Builder clearDevices() { - if (devicesBuilder_ == null) { - devices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - devicesBuilder_.clear(); - } + public Builder setDscp(int value) { + + dscp_ = value; + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return This builder for chaining. */ - public Builder removeDevices(int index) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.remove(index); - onChanged(); - } else { - devicesBuilder_.remove(index); - } + public Builder clearDscp() { + + dscp_ = 0; + onChanged(); return this; } + + private int protocol_ ; /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @return The protocol. */ - public context.ContextOuterClass.Device.Builder getDevicesBuilder( - int index) { - return getDevicesFieldBuilder().getBuilder(index); + @java.lang.Override + public int getProtocol() { + return protocol_; } /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @param value The protocol to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index) { - if (devicesBuilder_ == null) { - return devices_.get(index); } else { - return devicesBuilder_.getMessageOrBuilder(index); - } + public Builder setProtocol(int value) { + + protocol_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @return This builder for chaining. */ - public java.util.List - getDevicesOrBuilderList() { - if (devicesBuilder_ != null) { - return devicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(devices_); - } + public Builder clearProtocol() { + + protocol_ = 0; + onChanged(); + return this; } + + private int ttl_ ; /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @return The ttl. */ - public context.ContextOuterClass.Device.Builder addDevicesBuilder() { - return getDevicesFieldBuilder().addBuilder( - context.ContextOuterClass.Device.getDefaultInstance()); + @java.lang.Override + public int getTtl() { + return ttl_; } /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @param value The ttl to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Device.Builder addDevicesBuilder( - int index) { - return getDevicesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Device.getDefaultInstance()); + public Builder setTtl(int value) { + + ttl_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @return This builder for chaining. */ - public java.util.List - getDevicesBuilderList() { - return getDevicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> - getDevicesFieldBuilder() { - if (devicesBuilder_ == null) { - devicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder>( - devices_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - devices_ = null; - } - return devicesBuilder_; + public Builder clearTtl() { + + ttl_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -16313,100 +40139,94 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceList) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L3) } - // @@protoc_insertion_point(class_scope:context.DeviceList) - private static final context.ContextOuterClass.DeviceList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L3) + private static final context.ContextOuterClass.ConnectionSettings_L3 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L3(); } - public static context.ContextOuterClass.DeviceList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceList parsePartialFrom( + public ConnectionSettings_L3 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceList(input, extensionRegistry); + return new ConnectionSettings_L3(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceEvent) + public interface ConnectionSettings_L4OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L4) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. - */ - context.ContextOuterClass.Event getEvent(); - /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return The srcPort. */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + int getSrcPort(); /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * uint32 dst_port = 2; + * @return The dstPort. */ - boolean hasDeviceId(); + int getDstPort(); + /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ - context.ContextOuterClass.DeviceId getDeviceId(); + int getTcpFlags(); + /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + int getTtl(); } /** - * Protobuf type {@code context.DeviceEvent} + * Protobuf type {@code context.ConnectionSettings_L4} */ - public static final class DeviceEvent extends + public static final class ConnectionSettings_L4 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceEvent) - DeviceEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L4) + ConnectionSettings_L4OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceEvent.newBuilder() to construct. - private DeviceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L4.newBuilder() to construct. + private ConnectionSettings_L4(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceEvent() { + private ConnectionSettings_L4() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceEvent(); + return new ConnectionSettings_L4(); } @java.lang.Override @@ -16414,7 +40234,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceEvent( + private ConnectionSettings_L4( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -16432,30 +40252,24 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } + case 8: { + srcPort_ = input.readUInt32(); break; } - case 18: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); - } + case 16: { + + dstPort_ = input.readUInt32(); + break; + } + case 24: { + + tcpFlags_ = input.readUInt32(); + break; + } + case 32: { + ttl_ = input.readUInt32(); break; } default: { @@ -16479,67 +40293,59 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + context.ContextOuterClass.ConnectionSettings_L4.class, context.ContextOuterClass.ConnectionSettings_L4.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; + public static final int SRC_PORT_FIELD_NUMBER = 1; + private int srcPort_; /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return The srcPort. */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public int getSrcPort() { + return srcPort_; } - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.DeviceId deviceId_; + public static final int DST_PORT_FIELD_NUMBER = 2; + private int dstPort_; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * uint32 dst_port = 2; + * @return The dstPort. */ @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; + public int getDstPort() { + return dstPort_; } + + public static final int TCP_FLAGS_FIELD_NUMBER = 3; + private int tcpFlags_; /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + public int getTcpFlags() { + return tcpFlags_; } + + public static final int TTL_FIELD_NUMBER = 4; + private int ttl_; /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); + public int getTtl() { + return ttl_; } private byte memoizedIsInitialized = -1; @@ -16556,11 +40362,17 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (srcPort_ != 0) { + output.writeUInt32(1, srcPort_); } - if (deviceId_ != null) { - output.writeMessage(2, getDeviceId()); + if (dstPort_ != 0) { + output.writeUInt32(2, dstPort_); + } + if (tcpFlags_ != 0) { + output.writeUInt32(3, tcpFlags_); + } + if (ttl_ != 0) { + output.writeUInt32(4, ttl_); } unknownFields.writeTo(output); } @@ -16571,13 +40383,21 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (srcPort_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeUInt32Size(1, srcPort_); } - if (deviceId_ != null) { + if (dstPort_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDeviceId()); + .computeUInt32Size(2, dstPort_); + } + if (tcpFlags_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, tcpFlags_); + } + if (ttl_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, ttl_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -16589,21 +40409,19 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceEvent)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L4)) { return super.equals(obj); } - context.ContextOuterClass.DeviceEvent other = (context.ContextOuterClass.DeviceEvent) obj; + context.ContextOuterClass.ConnectionSettings_L4 other = (context.ContextOuterClass.ConnectionSettings_L4) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } + if (getSrcPort() + != other.getSrcPort()) return false; + if (getDstPort() + != other.getDstPort()) return false; + if (getTcpFlags() + != other.getTcpFlags()) return false; + if (getTtl() + != other.getTtl()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -16615,82 +40433,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } + hash = (37 * hash) + SRC_PORT_FIELD_NUMBER; + hash = (53 * hash) + getSrcPort(); + hash = (37 * hash) + DST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getDstPort(); + hash = (37 * hash) + TCP_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getTcpFlags(); + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 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 context.ContextOuterClass.DeviceEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L4 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 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 context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -16703,7 +40521,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L4 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -16719,26 +40537,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceEvent} + * Protobuf type {@code context.ConnectionSettings_L4} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceEvent) - context.ContextOuterClass.DeviceEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L4) + context.ContextOuterClass.ConnectionSettings_L4OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + context.ContextOuterClass.ConnectionSettings_L4.class, context.ContextOuterClass.ConnectionSettings_L4.Builder.class); } - // Construct using context.ContextOuterClass.DeviceEvent.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L4.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -16756,35 +40574,31 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } + srcPort_ = 0; + + dstPort_ = 0; + + tcpFlags_ = 0; + + ttl_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceEvent.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceEvent build() { - context.ContextOuterClass.DeviceEvent result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L4 build() { + context.ContextOuterClass.ConnectionSettings_L4 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -16792,18 +40606,12 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceEvent buildPartial() { - context.ContextOuterClass.DeviceEvent result = new context.ContextOuterClass.DeviceEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L4 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L4 result = new context.ContextOuterClass.ConnectionSettings_L4(this); + result.srcPort_ = srcPort_; + result.dstPort_ = dstPort_; + result.tcpFlags_ = tcpFlags_; + result.ttl_ = ttl_; onBuilt(); return result; } @@ -16842,21 +40650,27 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceEvent) { - return mergeFrom((context.ContextOuterClass.DeviceEvent)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L4) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L4)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceEvent other) { - if (other == context.ContextOuterClass.DeviceEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L4 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance()) return this; + if (other.getSrcPort() != 0) { + setSrcPort(other.getSrcPort()); } - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); + if (other.getDstPort() != 0) { + setDstPort(other.getDstPort()); + } + if (other.getTcpFlags() != 0) { + setTcpFlags(other.getTcpFlags()); + } + if (other.getTtl() != 0) { + setTtl(other.getTtl()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -16873,11 +40687,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceEvent parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L4 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L4) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -16887,242 +40701,128 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + private int srcPort_ ; /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. + * uint32 src_port = 1; + * @return The srcPort. */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } + @java.lang.Override + public int getSrcPort() { + return srcPort_; } /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @param value The srcPort to set. + * @return This builder for chaining. */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } - + public Builder setSrcPort(int value) { + + srcPort_ = value; + onChanged(); return this; } /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return This builder for chaining. */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearSrcPort() { + + srcPort_ = 0; + onChanged(); return this; } - /** - * .context.Event event = 1; - */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } - return this; - } + private int dstPort_ ; /** - * .context.Event event = 1; + * uint32 dst_port = 2; + * @return The dstPort. */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } - - return this; + @java.lang.Override + public int getDstPort() { + return dstPort_; } /** - * .context.Event event = 1; + * uint32 dst_port = 2; + * @param value The dstPort to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { + public Builder setDstPort(int value) { + dstPort_ = value; onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - } - /** - * .context.Event event = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; - /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. - */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; - } - /** - * .context.DeviceId device_id = 2; - * @return The deviceId. - */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); - } - } - /** - * .context.DeviceId device_id = 2; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceId_ = value; - onChanged(); - } else { - deviceIdBuilder_.setMessage(value); - } - return this; } /** - * .context.DeviceId device_id = 2; + * uint32 dst_port = 2; + * @return This builder for chaining. */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); - } else { - deviceIdBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearDstPort() { + + dstPort_ = 0; + onChanged(); return this; } + + private int tcpFlags_ ; /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public int getTcpFlags() { + return tcpFlags_; } /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @param value The tcpFlags to set. + * @return This builder for chaining. */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; - onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - + public Builder setTcpFlags(int value) { + + tcpFlags_ = value; + onChanged(); return this; } /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + public Builder clearTcpFlags() { + tcpFlags_ = 0; onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); + return this; } + + private int ttl_ ; /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } + @java.lang.Override + public int getTtl() { + return ttl_; } /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @param value The ttl to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; + public Builder setTtl(int value) { + + ttl_ = value; + onChanged(); + return this; + } + /** + * uint32 ttl = 4; + * @return This builder for chaining. + */ + public Builder clearTtl() { + + ttl_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -17137,89 +40837,130 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceEvent) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L4) } - // @@protoc_insertion_point(class_scope:context.DeviceEvent) - private static final context.ContextOuterClass.DeviceEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L4) + private static final context.ContextOuterClass.ConnectionSettings_L4 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L4(); } - public static context.ContextOuterClass.DeviceEvent getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceEvent parsePartialFrom( + public ConnectionSettings_L4 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceEvent(input, extensionRegistry); + return new ConnectionSettings_L4(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkId) + public interface ConnectionSettingsOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ - boolean hasLinkUuid(); + boolean hasL0(); /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ - context.ContextOuterClass.Uuid getLinkUuid(); + context.ContextOuterClass.ConnectionSettings_L0 getL0(); /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder(); + context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder(); + + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + boolean hasL2(); + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + context.ContextOuterClass.ConnectionSettings_L2 getL2(); + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder(); + + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + boolean hasL3(); + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + context.ContextOuterClass.ConnectionSettings_L3 getL3(); + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder(); + + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + boolean hasL4(); + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + context.ContextOuterClass.ConnectionSettings_L4 getL4(); + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder(); } /** - *
-   * ----- Link ----------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.LinkId} + * Protobuf type {@code context.ConnectionSettings} */ - public static final class LinkId extends + public static final class ConnectionSettings extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkId) - LinkIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings) + ConnectionSettingsOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkId.newBuilder() to construct. - private LinkId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings.newBuilder() to construct. + private ConnectionSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkId() { + private ConnectionSettings() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkId(); + return new ConnectionSettings(); } @java.lang.Override @@ -17227,7 +40968,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkId( + private ConnectionSettings( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -17246,14 +40987,53 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (linkUuid_ != null) { - subBuilder = linkUuid_.toBuilder(); + context.ContextOuterClass.ConnectionSettings_L0.Builder subBuilder = null; + if (l0_ != null) { + subBuilder = l0_.toBuilder(); } - linkUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + l0_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L0.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkUuid_); - linkUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(l0_); + l0_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ConnectionSettings_L2.Builder subBuilder = null; + if (l2_ != null) { + subBuilder = l2_.toBuilder(); + } + l2_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L2.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l2_); + l2_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + context.ContextOuterClass.ConnectionSettings_L3.Builder subBuilder = null; + if (l3_ != null) { + subBuilder = l3_.toBuilder(); + } + l3_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L3.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l3_); + l3_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + context.ContextOuterClass.ConnectionSettings_L4.Builder subBuilder = null; + if (l4_ != null) { + subBuilder = l4_.toBuilder(); + } + l4_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L4.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l4_); + l4_ = subBuilder.buildPartial(); } break; @@ -17279,41 +41059,119 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + context.ContextOuterClass.ConnectionSettings.class, context.ContextOuterClass.ConnectionSettings.Builder.class); } - public static final int LINK_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid linkUuid_; + public static final int L0_FIELD_NUMBER = 1; + private context.ContextOuterClass.ConnectionSettings_L0 l0_; /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ @java.lang.Override - public boolean hasLinkUuid() { - return linkUuid_ != null; + public boolean hasL0() { + return l0_ != null; } /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ @java.lang.Override - public context.ContextOuterClass.Uuid getLinkUuid() { - return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + public context.ContextOuterClass.ConnectionSettings_L0 getL0() { + return l0_ == null ? context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { - return getLinkUuid(); + public context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder() { + return getL0(); + } + + public static final int L2_FIELD_NUMBER = 2; + private context.ContextOuterClass.ConnectionSettings_L2 l2_; + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + @java.lang.Override + public boolean hasL2() { + return l2_ != null; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L2 getL2() { + return l2_ == null ? context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder() { + return getL2(); + } + + public static final int L3_FIELD_NUMBER = 3; + private context.ContextOuterClass.ConnectionSettings_L3 l3_; + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + @java.lang.Override + public boolean hasL3() { + return l3_ != null; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L3 getL3() { + return l3_ == null ? context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder() { + return getL3(); + } + + public static final int L4_FIELD_NUMBER = 4; + private context.ContextOuterClass.ConnectionSettings_L4 l4_; + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + @java.lang.Override + public boolean hasL4() { + return l4_ != null; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L4 getL4() { + return l4_ == null ? context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder() { + return getL4(); } private byte memoizedIsInitialized = -1; @@ -17330,8 +41188,17 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (linkUuid_ != null) { - output.writeMessage(1, getLinkUuid()); + if (l0_ != null) { + output.writeMessage(1, getL0()); + } + if (l2_ != null) { + output.writeMessage(2, getL2()); + } + if (l3_ != null) { + output.writeMessage(3, getL3()); + } + if (l4_ != null) { + output.writeMessage(4, getL4()); } unknownFields.writeTo(output); } @@ -17342,9 +41209,21 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (linkUuid_ != null) { + if (l0_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getLinkUuid()); + .computeMessageSize(1, getL0()); + } + if (l2_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getL2()); + } + if (l3_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getL3()); + } + if (l4_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getL4()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -17356,15 +41235,30 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkId)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings)) { return super.equals(obj); } - context.ContextOuterClass.LinkId other = (context.ContextOuterClass.LinkId) obj; + context.ContextOuterClass.ConnectionSettings other = (context.ContextOuterClass.ConnectionSettings) obj; - if (hasLinkUuid() != other.hasLinkUuid()) return false; - if (hasLinkUuid()) { - if (!getLinkUuid() - .equals(other.getLinkUuid())) return false; + if (hasL0() != other.hasL0()) return false; + if (hasL0()) { + if (!getL0() + .equals(other.getL0())) return false; + } + if (hasL2() != other.hasL2()) return false; + if (hasL2()) { + if (!getL2() + .equals(other.getL2())) return false; + } + if (hasL3() != other.hasL3()) return false; + if (hasL3()) { + if (!getL3() + .equals(other.getL3())) return false; + } + if (hasL4() != other.hasL4()) return false; + if (hasL4()) { + if (!getL4() + .equals(other.getL4())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -17377,78 +41271,90 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasLinkUuid()) { - hash = (37 * hash) + LINK_UUID_FIELD_NUMBER; - hash = (53 * hash) + getLinkUuid().hashCode(); + if (hasL0()) { + hash = (37 * hash) + L0_FIELD_NUMBER; + hash = (53 * hash) + getL0().hashCode(); + } + if (hasL2()) { + hash = (37 * hash) + L2_FIELD_NUMBER; + hash = (53 * hash) + getL2().hashCode(); + } + if (hasL3()) { + hash = (37 * hash) + L3_FIELD_NUMBER; + hash = (53 * hash) + getL3().hashCode(); + } + if (hasL4()) { + hash = (37 * hash) + L4_FIELD_NUMBER; + hash = (53 * hash) + getL4().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings 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 context.ContextOuterClass.LinkId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings 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 context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -17461,7 +41367,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkId prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -17477,30 +41383,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Link ----------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.LinkId} + * Protobuf type {@code context.ConnectionSettings} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkId) - context.ContextOuterClass.LinkIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings) + context.ContextOuterClass.ConnectionSettingsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + context.ContextOuterClass.ConnectionSettings.class, context.ContextOuterClass.ConnectionSettings.Builder.class); } - // Construct using context.ContextOuterClass.LinkId.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -17518,11 +41420,29 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (linkUuidBuilder_ == null) { - linkUuid_ = null; + if (l0Builder_ == null) { + l0_ = null; } else { - linkUuid_ = null; - linkUuidBuilder_ = null; + l0_ = null; + l0Builder_ = null; + } + if (l2Builder_ == null) { + l2_ = null; + } else { + l2_ = null; + l2Builder_ = null; + } + if (l3Builder_ == null) { + l3_ = null; + } else { + l3_ = null; + l3Builder_ = null; + } + if (l4Builder_ == null) { + l4_ = null; + } else { + l4_ = null; + l4Builder_ = null; } return this; } @@ -17530,17 +41450,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkId getDefaultInstanceForType() { - return context.ContextOuterClass.LinkId.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkId build() { - context.ContextOuterClass.LinkId result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings build() { + context.ContextOuterClass.ConnectionSettings result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -17548,12 +41468,27 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkId buildPartial() { - context.ContextOuterClass.LinkId result = new context.ContextOuterClass.LinkId(this); - if (linkUuidBuilder_ == null) { - result.linkUuid_ = linkUuid_; + public context.ContextOuterClass.ConnectionSettings buildPartial() { + context.ContextOuterClass.ConnectionSettings result = new context.ContextOuterClass.ConnectionSettings(this); + if (l0Builder_ == null) { + result.l0_ = l0_; } else { - result.linkUuid_ = linkUuidBuilder_.build(); + result.l0_ = l0Builder_.build(); + } + if (l2Builder_ == null) { + result.l2_ = l2_; + } else { + result.l2_ = l2Builder_.build(); + } + if (l3Builder_ == null) { + result.l3_ = l3_; + } else { + result.l3_ = l3Builder_.build(); + } + if (l4Builder_ == null) { + result.l4_ = l4_; + } else { + result.l4_ = l4Builder_.build(); } onBuilt(); return result; @@ -17593,18 +41528,27 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkId) { - return mergeFrom((context.ContextOuterClass.LinkId)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkId other) { - if (other == context.ContextOuterClass.LinkId.getDefaultInstance()) return this; - if (other.hasLinkUuid()) { - mergeLinkUuid(other.getLinkUuid()); + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings other) { + if (other == context.ContextOuterClass.ConnectionSettings.getDefaultInstance()) return this; + if (other.hasL0()) { + mergeL0(other.getL0()); + } + if (other.hasL2()) { + mergeL2(other.getL2()); + } + if (other.hasL3()) { + mergeL3(other.getL3()); + } + if (other.hasL4()) { + mergeL4(other.getL4()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -17621,11 +41565,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkId parsedMessage = null; + context.ContextOuterClass.ConnectionSettings parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -17635,123 +41579,480 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid linkUuid_; + private context.ContextOuterClass.ConnectionSettings_L0 l0_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> linkUuidBuilder_; + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder> l0Builder_; /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ - public boolean hasLinkUuid() { - return linkUuidBuilder_ != null || linkUuid_ != null; + public boolean hasL0() { + return l0Builder_ != null || l0_ != null; } /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ - public context.ContextOuterClass.Uuid getLinkUuid() { - if (linkUuidBuilder_ == null) { - return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + public context.ContextOuterClass.ConnectionSettings_L0 getL0() { + if (l0Builder_ == null) { + return l0_ == null ? context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } else { - return linkUuidBuilder_.getMessage(); + return l0Builder_.getMessage(); } } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder setLinkUuid(context.ContextOuterClass.Uuid value) { - if (linkUuidBuilder_ == null) { + public Builder setL0(context.ContextOuterClass.ConnectionSettings_L0 value) { + if (l0Builder_ == null) { if (value == null) { throw new NullPointerException(); } - linkUuid_ = value; + l0_ = value; onChanged(); } else { - linkUuidBuilder_.setMessage(value); + l0Builder_.setMessage(value); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder setLinkUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (linkUuidBuilder_ == null) { - linkUuid_ = builderForValue.build(); + public Builder setL0( + context.ContextOuterClass.ConnectionSettings_L0.Builder builderForValue) { + if (l0Builder_ == null) { + l0_ = builderForValue.build(); onChanged(); } else { - linkUuidBuilder_.setMessage(builderForValue.build()); + l0Builder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder mergeLinkUuid(context.ContextOuterClass.Uuid value) { - if (linkUuidBuilder_ == null) { - if (linkUuid_ != null) { - linkUuid_ = - context.ContextOuterClass.Uuid.newBuilder(linkUuid_).mergeFrom(value).buildPartial(); + public Builder mergeL0(context.ContextOuterClass.ConnectionSettings_L0 value) { + if (l0Builder_ == null) { + if (l0_ != null) { + l0_ = + context.ContextOuterClass.ConnectionSettings_L0.newBuilder(l0_).mergeFrom(value).buildPartial(); } else { - linkUuid_ = value; + l0_ = value; } onChanged(); } else { - linkUuidBuilder_.mergeFrom(value); + l0Builder_.mergeFrom(value); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder clearLinkUuid() { - if (linkUuidBuilder_ == null) { - linkUuid_ = null; + public Builder clearL0() { + if (l0Builder_ == null) { + l0_ = null; onChanged(); } else { - linkUuid_ = null; - linkUuidBuilder_ = null; + l0_ = null; + l0Builder_ = null; } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public context.ContextOuterClass.Uuid.Builder getLinkUuidBuilder() { + public context.ContextOuterClass.ConnectionSettings_L0.Builder getL0Builder() { onChanged(); - return getLinkUuidFieldBuilder().getBuilder(); + return getL0FieldBuilder().getBuilder(); } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { - if (linkUuidBuilder_ != null) { - return linkUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder() { + if (l0Builder_ != null) { + return l0Builder_.getMessageOrBuilder(); } else { - return linkUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + return l0_ == null ? + context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getLinkUuidFieldBuilder() { - if (linkUuidBuilder_ == null) { - linkUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getLinkUuid(), + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder> + getL0FieldBuilder() { + if (l0Builder_ == null) { + l0Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder>( + getL0(), getParentForChildren(), isClean()); - linkUuid_ = null; + l0_ = null; + } + return l0Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L2 l2_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder> l2Builder_; + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + public boolean hasL2() { + return l2Builder_ != null || l2_ != null; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + public context.ContextOuterClass.ConnectionSettings_L2 getL2() { + if (l2Builder_ == null) { + return l2_ == null ? context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } else { + return l2Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder setL2(context.ContextOuterClass.ConnectionSettings_L2 value) { + if (l2Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l2_ = value; + onChanged(); + } else { + l2Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder setL2( + context.ContextOuterClass.ConnectionSettings_L2.Builder builderForValue) { + if (l2Builder_ == null) { + l2_ = builderForValue.build(); + onChanged(); + } else { + l2Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder mergeL2(context.ContextOuterClass.ConnectionSettings_L2 value) { + if (l2Builder_ == null) { + if (l2_ != null) { + l2_ = + context.ContextOuterClass.ConnectionSettings_L2.newBuilder(l2_).mergeFrom(value).buildPartial(); + } else { + l2_ = value; + } + onChanged(); + } else { + l2Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder clearL2() { + if (l2Builder_ == null) { + l2_ = null; + onChanged(); + } else { + l2_ = null; + l2Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public context.ContextOuterClass.ConnectionSettings_L2.Builder getL2Builder() { + + onChanged(); + return getL2FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder() { + if (l2Builder_ != null) { + return l2Builder_.getMessageOrBuilder(); + } else { + return l2_ == null ? + context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder> + getL2FieldBuilder() { + if (l2Builder_ == null) { + l2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder>( + getL2(), + getParentForChildren(), + isClean()); + l2_ = null; + } + return l2Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L3 l3_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder> l3Builder_; + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + public boolean hasL3() { + return l3Builder_ != null || l3_ != null; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + public context.ContextOuterClass.ConnectionSettings_L3 getL3() { + if (l3Builder_ == null) { + return l3_ == null ? context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } else { + return l3Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder setL3(context.ContextOuterClass.ConnectionSettings_L3 value) { + if (l3Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l3_ = value; + onChanged(); + } else { + l3Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder setL3( + context.ContextOuterClass.ConnectionSettings_L3.Builder builderForValue) { + if (l3Builder_ == null) { + l3_ = builderForValue.build(); + onChanged(); + } else { + l3Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder mergeL3(context.ContextOuterClass.ConnectionSettings_L3 value) { + if (l3Builder_ == null) { + if (l3_ != null) { + l3_ = + context.ContextOuterClass.ConnectionSettings_L3.newBuilder(l3_).mergeFrom(value).buildPartial(); + } else { + l3_ = value; + } + onChanged(); + } else { + l3Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder clearL3() { + if (l3Builder_ == null) { + l3_ = null; + onChanged(); + } else { + l3_ = null; + l3Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public context.ContextOuterClass.ConnectionSettings_L3.Builder getL3Builder() { + + onChanged(); + return getL3FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder() { + if (l3Builder_ != null) { + return l3Builder_.getMessageOrBuilder(); + } else { + return l3_ == null ? + context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder> + getL3FieldBuilder() { + if (l3Builder_ == null) { + l3Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder>( + getL3(), + getParentForChildren(), + isClean()); + l3_ = null; + } + return l3Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L4 l4_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder> l4Builder_; + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + public boolean hasL4() { + return l4Builder_ != null || l4_ != null; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + public context.ContextOuterClass.ConnectionSettings_L4 getL4() { + if (l4Builder_ == null) { + return l4_ == null ? context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } else { + return l4Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder setL4(context.ContextOuterClass.ConnectionSettings_L4 value) { + if (l4Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l4_ = value; + onChanged(); + } else { + l4Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder setL4( + context.ContextOuterClass.ConnectionSettings_L4.Builder builderForValue) { + if (l4Builder_ == null) { + l4_ = builderForValue.build(); + onChanged(); + } else { + l4Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder mergeL4(context.ContextOuterClass.ConnectionSettings_L4 value) { + if (l4Builder_ == null) { + if (l4_ != null) { + l4_ = + context.ContextOuterClass.ConnectionSettings_L4.newBuilder(l4_).mergeFrom(value).buildPartial(); + } else { + l4_ = value; + } + onChanged(); + } else { + l4Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder clearL4() { + if (l4Builder_ == null) { + l4_ = null; + onChanged(); + } else { + l4_ = null; + l4Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public context.ContextOuterClass.ConnectionSettings_L4.Builder getL4Builder() { + + onChanged(); + return getL4FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder() { + if (l4Builder_ != null) { + return l4Builder_.getMessageOrBuilder(); + } else { + return l4_ == null ? + context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder> + getL4FieldBuilder() { + if (l4Builder_ == null) { + l4Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder>( + getL4(), + getParentForChildren(), + isClean()); + l4_ = null; } - return linkUuidBuilder_; + return l4Builder_; } @java.lang.Override public final Builder setUnknownFields( @@ -17766,110 +42067,165 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkId) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings) } - // @@protoc_insertion_point(class_scope:context.LinkId) - private static final context.ContextOuterClass.LinkId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings) + private static final context.ContextOuterClass.ConnectionSettings DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings(); } - public static context.ContextOuterClass.LinkId getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkId parsePartialFrom( + public ConnectionSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkId(input, extensionRegistry); + return new ConnectionSettings(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkId getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Link) + public interface ConnectionOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Connection) com.google.protobuf.MessageOrBuilder { /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. */ - boolean hasLinkId(); + boolean hasConnectionId(); /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ConnectionId connection_id = 1; + * @return The connectionId. */ - context.ContextOuterClass.LinkId getLinkId(); + context.ContextOuterClass.ConnectionId getConnectionId(); /** - * .context.LinkId link_id = 1; + * .context.ConnectionId connection_id = 1; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 2; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ java.util.List - getLinkEndpointIdsList(); + getPathHopsEndpointIdsList(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - context.ContextOuterClass.EndPointId getLinkEndpointIds(int index); + context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - int getLinkEndpointIdsCount(); + int getPathHopsEndpointIdsCount(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ java.util.List - getLinkEndpointIdsOrBuilderList(); + getPathHopsEndpointIdsOrBuilderList(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + java.util.List + getSubServiceIdsList(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + context.ContextOuterClass.ServiceId getSubServiceIds(int index); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + int getSubServiceIdsCount(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + java.util.List + getSubServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( int index); + + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + boolean hasSettings(); + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + context.ContextOuterClass.ConnectionSettings getSettings(); + /** + * .context.ConnectionSettings settings = 5; + */ + context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder(); } /** - * Protobuf type {@code context.Link} + * Protobuf type {@code context.Connection} */ - public static final class Link extends + public static final class Connection extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Link) - LinkOrBuilder { + // @@protoc_insertion_point(message_implements:context.Connection) + ConnectionOrBuilder { private static final long serialVersionUID = 0L; - // Use Link.newBuilder() to construct. - private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Connection.newBuilder() to construct. + private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Link() { - linkEndpointIds_ = java.util.Collections.emptyList(); + private Connection() { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); + subServiceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Link(); + return new Connection(); } @java.lang.Override @@ -17877,7 +42233,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Link( + private Connection( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -17897,27 +42253,62 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.LinkId.Builder subBuilder = null; - if (linkId_ != null) { - subBuilder = linkId_.toBuilder(); + context.ContextOuterClass.ConnectionId.Builder subBuilder = null; + if (connectionId_ != null) { + subBuilder = connectionId_.toBuilder(); } - linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkId_); - linkId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionId_); + connectionId_ = subBuilder.buildPartial(); } break; } case 18: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = new java.util.ArrayList(); + pathHopsEndpointIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - linkEndpointIds_.add( + pathHopsEndpointIds_.add( input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); break; } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + subServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + context.ContextOuterClass.ConnectionSettings.Builder subBuilder = null; + if (settings_ != null) { + subBuilder = settings_.toBuilder(); + } + settings_ = input.readMessage(context.ContextOuterClass.ConnectionSettings.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(settings_); + settings_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -17934,7 +42325,10 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + pathHopsEndpointIds_ = java.util.Collections.unmodifiableList(pathHopsEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = java.util.Collections.unmodifiableList(subServiceIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -17942,81 +42336,173 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); } - public static final int LINK_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.LinkId linkId_; + public static final int CONNECTION_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ConnectionId connectionId_; /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. */ @java.lang.Override - public boolean hasLinkId() { - return linkId_ != null; + public boolean hasConnectionId() { + return connectionId_ != null; } /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ConnectionId connection_id = 1; + * @return The connectionId. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkId() { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } /** - * .context.LinkId link_id = 1; + * .context.ConnectionId connection_id = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - return getLinkId(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + return getConnectionId(); } - public static final int LINK_ENDPOINT_IDS_FIELD_NUMBER = 2; - private java.util.List linkEndpointIds_; + public static final int SERVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ @java.lang.Override - public java.util.List getLinkEndpointIdsList() { - return linkEndpointIds_; + public boolean hasServiceId() { + return serviceId_ != null; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int PATH_HOPS_ENDPOINT_IDS_FIELD_NUMBER = 3; + private java.util.List pathHopsEndpointIds_; + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List getPathHopsEndpointIdsList() { + return pathHopsEndpointIds_; + } + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override public java.util.List - getLinkEndpointIdsOrBuilderList() { - return linkEndpointIds_; + getPathHopsEndpointIdsOrBuilderList() { + return pathHopsEndpointIds_; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public int getLinkEndpointIdsCount() { - return linkEndpointIds_.size(); + public int getPathHopsEndpointIdsCount() { + return pathHopsEndpointIds_.size(); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { - return linkEndpointIds_.get(index); + public context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index) { + return pathHopsEndpointIds_.get(index); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + public context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( int index) { - return linkEndpointIds_.get(index); + return pathHopsEndpointIds_.get(index); + } + + public static final int SUB_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List subServiceIds_; + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public java.util.List getSubServiceIdsList() { + return subServiceIds_; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public java.util.List + getSubServiceIdsOrBuilderList() { + return subServiceIds_; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public int getSubServiceIdsCount() { + return subServiceIds_.size(); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSubServiceIds(int index) { + return subServiceIds_.get(index); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( + int index) { + return subServiceIds_.get(index); + } + + public static final int SETTINGS_FIELD_NUMBER = 5; + private context.ContextOuterClass.ConnectionSettings settings_; + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + @java.lang.Override + public boolean hasSettings() { + return settings_ != null; + } + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings getSettings() { + return settings_ == null ? context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } + /** + * .context.ConnectionSettings settings = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder() { + return getSettings(); } private byte memoizedIsInitialized = -1; @@ -18033,11 +42519,20 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (linkId_ != null) { - output.writeMessage(1, getLinkId()); + if (connectionId_ != null) { + output.writeMessage(1, getConnectionId()); } - for (int i = 0; i < linkEndpointIds_.size(); i++) { - output.writeMessage(2, linkEndpointIds_.get(i)); + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); + } + for (int i = 0; i < pathHopsEndpointIds_.size(); i++) { + output.writeMessage(3, pathHopsEndpointIds_.get(i)); + } + for (int i = 0; i < subServiceIds_.size(); i++) { + output.writeMessage(4, subServiceIds_.get(i)); + } + if (settings_ != null) { + output.writeMessage(5, getSettings()); } unknownFields.writeTo(output); } @@ -18048,13 +42543,25 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (linkId_ != null) { + if (connectionId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getLinkId()); + .computeMessageSize(1, getConnectionId()); } - for (int i = 0; i < linkEndpointIds_.size(); i++) { + if (serviceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, linkEndpointIds_.get(i)); + .computeMessageSize(2, getServiceId()); + } + for (int i = 0; i < pathHopsEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, pathHopsEndpointIds_.get(i)); + } + for (int i = 0; i < subServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, subServiceIds_.get(i)); + } + if (settings_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getSettings()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18066,18 +42573,30 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Link)) { + if (!(obj instanceof context.ContextOuterClass.Connection)) { return super.equals(obj); } - context.ContextOuterClass.Link other = (context.ContextOuterClass.Link) obj; + context.ContextOuterClass.Connection other = (context.ContextOuterClass.Connection) obj; - if (hasLinkId() != other.hasLinkId()) return false; - if (hasLinkId()) { - if (!getLinkId() - .equals(other.getLinkId())) return false; + if (hasConnectionId() != other.hasConnectionId()) return false; + if (hasConnectionId()) { + if (!getConnectionId() + .equals(other.getConnectionId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (!getPathHopsEndpointIdsList() + .equals(other.getPathHopsEndpointIdsList())) return false; + if (!getSubServiceIdsList() + .equals(other.getSubServiceIdsList())) return false; + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings() + .equals(other.getSettings())) return false; } - if (!getLinkEndpointIdsList() - .equals(other.getLinkEndpointIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18089,82 +42608,94 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasLinkId()) { - hash = (37 * hash) + LINK_ID_FIELD_NUMBER; - hash = (53 * hash) + getLinkId().hashCode(); + if (hasConnectionId()) { + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); } - if (getLinkEndpointIdsCount() > 0) { - hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (getPathHopsEndpointIdsCount() > 0) { + hash = (37 * hash) + PATH_HOPS_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPathHopsEndpointIdsList().hashCode(); + } + if (getSubServiceIdsCount() > 0) { + hash = (37 * hash) + SUB_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSubServiceIdsList().hashCode(); + } + if (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom(byte[] data) + public static context.ContextOuterClass.Connection parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Connection parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection 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 context.ContextOuterClass.Link parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Connection parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseDelimitedFrom( + public static context.ContextOuterClass.Connection 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 context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -18177,7 +42708,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Link prototype) { + public static Builder newBuilder(context.ContextOuterClass.Connection prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -18193,26 +42724,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Link} + * Protobuf type {@code context.Connection} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Link) - context.ContextOuterClass.LinkOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Connection) + context.ContextOuterClass.ConnectionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); } - // Construct using context.ContextOuterClass.Link.newBuilder() + // Construct using context.ContextOuterClass.Connection.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -18225,23 +42756,42 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinkEndpointIdsFieldBuilder(); + getPathHopsEndpointIdsFieldBuilder(); + getSubServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linkIdBuilder_ == null) { - linkId_ = null; + if (connectionIdBuilder_ == null) { + connectionId_ = null; } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIds_ = java.util.Collections.emptyList(); + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linkEndpointIdsBuilder_.clear(); + pathHopsEndpointIdsBuilder_.clear(); + } + if (subServiceIdsBuilder_ == null) { + subServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + subServiceIdsBuilder_.clear(); + } + if (settingsBuilder_ == null) { + settings_ = null; + } else { + settings_ = null; + settingsBuilder_ = null; } return this; } @@ -18249,17 +42799,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override - public context.ContextOuterClass.Link getDefaultInstanceForType() { - return context.ContextOuterClass.Link.getDefaultInstance(); + public context.ContextOuterClass.Connection getDefaultInstanceForType() { + return context.ContextOuterClass.Connection.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Link build() { - context.ContextOuterClass.Link result = buildPartial(); + public context.ContextOuterClass.Connection build() { + context.ContextOuterClass.Connection result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -18267,22 +42817,41 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Link buildPartial() { - context.ContextOuterClass.Link result = new context.ContextOuterClass.Link(this); + public context.ContextOuterClass.Connection buildPartial() { + context.ContextOuterClass.Connection result = new context.ContextOuterClass.Connection(this); int from_bitField0_ = bitField0_; - if (linkIdBuilder_ == null) { - result.linkId_ = linkId_; + if (connectionIdBuilder_ == null) { + result.connectionId_ = connectionId_; } else { - result.linkId_ = linkIdBuilder_.build(); + result.connectionId_ = connectionIdBuilder_.build(); } - if (linkEndpointIdsBuilder_ == null) { + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (pathHopsEndpointIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + pathHopsEndpointIds_ = java.util.Collections.unmodifiableList(pathHopsEndpointIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.linkEndpointIds_ = linkEndpointIds_; + result.pathHopsEndpointIds_ = pathHopsEndpointIds_; } else { - result.linkEndpointIds_ = linkEndpointIdsBuilder_.build(); + result.pathHopsEndpointIds_ = pathHopsEndpointIdsBuilder_.build(); + } + if (subServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = java.util.Collections.unmodifiableList(subServiceIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.subServiceIds_ = subServiceIds_; + } else { + result.subServiceIds_ = subServiceIdsBuilder_.build(); + } + if (settingsBuilder_ == null) { + result.settings_ = settings_; + } else { + result.settings_ = settingsBuilder_.build(); } onBuilt(); return result; @@ -18322,432 +42891,942 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Link) { - return mergeFrom((context.ContextOuterClass.Link)other); + if (other instanceof context.ContextOuterClass.Connection) { + return mergeFrom((context.ContextOuterClass.Connection)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Link other) { - if (other == context.ContextOuterClass.Link.getDefaultInstance()) return this; - if (other.hasLinkId()) { - mergeLinkId(other.getLinkId()); + public Builder mergeFrom(context.ContextOuterClass.Connection other) { + if (other == context.ContextOuterClass.Connection.getDefaultInstance()) return this; + if (other.hasConnectionId()) { + mergeConnectionId(other.getConnectionId()); } - if (linkEndpointIdsBuilder_ == null) { - if (!other.linkEndpointIds_.isEmpty()) { - if (linkEndpointIds_.isEmpty()) { - linkEndpointIds_ = other.linkEndpointIds_; + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (pathHopsEndpointIdsBuilder_ == null) { + if (!other.pathHopsEndpointIds_.isEmpty()) { + if (pathHopsEndpointIds_.isEmpty()) { + pathHopsEndpointIds_ = other.pathHopsEndpointIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.addAll(other.linkEndpointIds_); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.addAll(other.pathHopsEndpointIds_); } onChanged(); } } else { - if (!other.linkEndpointIds_.isEmpty()) { - if (linkEndpointIdsBuilder_.isEmpty()) { - linkEndpointIdsBuilder_.dispose(); - linkEndpointIdsBuilder_ = null; - linkEndpointIds_ = other.linkEndpointIds_; + if (!other.pathHopsEndpointIds_.isEmpty()) { + if (pathHopsEndpointIdsBuilder_.isEmpty()) { + pathHopsEndpointIdsBuilder_.dispose(); + pathHopsEndpointIdsBuilder_ = null; + pathHopsEndpointIds_ = other.pathHopsEndpointIds_; bitField0_ = (bitField0_ & ~0x00000001); - linkEndpointIdsBuilder_ = + pathHopsEndpointIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkEndpointIdsFieldBuilder() : null; + getPathHopsEndpointIdsFieldBuilder() : null; } else { - linkEndpointIdsBuilder_.addAllMessages(other.linkEndpointIds_); + pathHopsEndpointIdsBuilder_.addAllMessages(other.pathHopsEndpointIds_); + } + } + } + if (subServiceIdsBuilder_ == null) { + if (!other.subServiceIds_.isEmpty()) { + if (subServiceIds_.isEmpty()) { + subServiceIds_ = other.subServiceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSubServiceIdsIsMutable(); + subServiceIds_.addAll(other.subServiceIds_); + } + onChanged(); + } + } else { + if (!other.subServiceIds_.isEmpty()) { + if (subServiceIdsBuilder_.isEmpty()) { + subServiceIdsBuilder_.dispose(); + subServiceIdsBuilder_ = null; + subServiceIds_ = other.subServiceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + subServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSubServiceIdsFieldBuilder() : null; + } else { + subServiceIdsBuilder_.addAllMessages(other.subServiceIds_); } } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + 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 { + context.ContextOuterClass.Connection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Connection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ConnectionId connectionId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; + /** + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. + */ + public boolean hasConnectionId() { + return connectionIdBuilder_ != null || connectionId_ != null; + } + /** + * .context.ConnectionId connection_id = 1; + * @return The connectionId. + */ + public context.ContextOuterClass.ConnectionId getConnectionId() { + if (connectionIdBuilder_ == null) { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; + } else { + return connectionIdBuilder_.getMessage(); + } + } + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionId_ = value; + onChanged(); + } else { + connectionIdBuilder_.setMessage(value); + } + return this; } + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder setConnectionId( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdBuilder_ == null) { + connectionId_ = builderForValue.build(); + onChanged(); + } else { + connectionIdBuilder_.setMessage(builderForValue.build()); + } - @java.lang.Override - public final boolean isInitialized() { - return true; + return this; } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.Link parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Link) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (connectionId_ != null) { + connectionId_ = + context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); + } else { + connectionId_ = value; } + onChanged(); + } else { + connectionIdBuilder_.mergeFrom(value); } + return this; } - private int bitField0_; + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder clearConnectionId() { + if (connectionIdBuilder_ == null) { + connectionId_ = null; + onChanged(); + } else { + connectionId_ = null; + connectionIdBuilder_ = null; + } - private context.ContextOuterClass.LinkId linkId_; + return this; + } + /** + * .context.ConnectionId connection_id = 1; + */ + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { + + onChanged(); + return getConnectionIdFieldBuilder().getBuilder(); + } + /** + * .context.ConnectionId connection_id = 1; + */ + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + if (connectionIdBuilder_ != null) { + return connectionIdBuilder_.getMessageOrBuilder(); + } else { + return connectionId_ == null ? + context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; + } + } + /** + * .context.ConnectionId connection_id = 1; + */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdFieldBuilder() { + if (connectionIdBuilder_ == null) { + connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + getConnectionId(), + getParentForChildren(), + isClean()); + connectionId_ = null; + } + return connectionIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - public boolean hasLinkId() { - return linkIdBuilder_ != null || linkId_ != null; + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; } /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ServiceId service_id = 2; + * @return The serviceId. */ - public context.ContextOuterClass.LinkId getLinkId() { - if (linkIdBuilder_ == null) { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } else { - return linkIdBuilder_.getMessage(); + return serviceIdBuilder_.getMessage(); } } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder setLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - linkId_ = value; + serviceId_ = value; onChanged(); } else { - linkIdBuilder_.setMessage(value); + serviceIdBuilder_.setMessage(value); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder setLinkId( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdBuilder_ == null) { - linkId_ = builderForValue.build(); + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); onChanged(); } else { - linkIdBuilder_.setMessage(builderForValue.build()); + serviceIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { - if (linkId_ != null) { - linkId_ = - context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); } else { - linkId_ = value; + serviceId_ = value; } onChanged(); } else { - linkIdBuilder_.mergeFrom(value); + serviceIdBuilder_.mergeFrom(value); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder clearLinkId() { - if (linkIdBuilder_ == null) { - linkId_ = null; + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; onChanged(); } else { - linkId_ = null; - linkIdBuilder_ = null; + serviceId_ = null; + serviceIdBuilder_ = null; } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { onChanged(); - return getLinkIdFieldBuilder().getBuilder(); + return getServiceIdFieldBuilder().getBuilder(); } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - if (linkIdBuilder_ != null) { - return linkIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); } else { - return linkId_ == null ? - context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdFieldBuilder() { - if (linkIdBuilder_ == null) { - linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - getLinkId(), + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), getParentForChildren(), isClean()); - linkId_ = null; + serviceId_ = null; } - return linkIdBuilder_; + return serviceIdBuilder_; } - private java.util.List linkEndpointIds_ = + private java.util.List pathHopsEndpointIds_ = java.util.Collections.emptyList(); - private void ensureLinkEndpointIdsIsMutable() { + private void ensurePathHopsEndpointIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = new java.util.ArrayList(linkEndpointIds_); + pathHopsEndpointIds_ = new java.util.ArrayList(pathHopsEndpointIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> linkEndpointIdsBuilder_; + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> pathHopsEndpointIdsBuilder_; /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public java.util.List getLinkEndpointIdsList() { - if (linkEndpointIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkEndpointIds_); + public java.util.List getPathHopsEndpointIdsList() { + if (pathHopsEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pathHopsEndpointIds_); } else { - return linkEndpointIdsBuilder_.getMessageList(); + return pathHopsEndpointIdsBuilder_.getMessageList(); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public int getLinkEndpointIdsCount() { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.size(); + public int getPathHopsEndpointIdsCount() { + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.size(); } else { - return linkEndpointIdsBuilder_.getCount(); + return pathHopsEndpointIdsBuilder_.getCount(); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.get(index); + public context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index) { + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.get(index); } else { - return linkEndpointIdsBuilder_.getMessage(index); + return pathHopsEndpointIdsBuilder_.getMessage(index); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder setLinkEndpointIds( + public Builder setPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.set(index, value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.set(index, value); onChanged(); } else { - linkEndpointIdsBuilder_.setMessage(index, value); + pathHopsEndpointIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder setLinkEndpointIds( + public Builder setPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.set(index, builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.set(index, builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + pathHopsEndpointIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds(context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + public Builder addPathHopsEndpointIds(context.ContextOuterClass.EndPointId value) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(value); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(value); + pathHopsEndpointIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(index, value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(index, value); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(index, value); + pathHopsEndpointIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(builderForValue.build()); + pathHopsEndpointIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(index, builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(index, builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + pathHopsEndpointIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addAllLinkEndpointIds( + public Builder addAllPathHopsEndpointIds( java.lang.Iterable values) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkEndpointIds_); + values, pathHopsEndpointIds_); onChanged(); } else { - linkEndpointIdsBuilder_.addAllMessages(values); + pathHopsEndpointIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder clearLinkEndpointIds() { - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIds_ = java.util.Collections.emptyList(); + public Builder clearPathHopsEndpointIds() { + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linkEndpointIdsBuilder_.clear(); + pathHopsEndpointIdsBuilder_.clear(); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder removeLinkEndpointIds(int index) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.remove(index); + public Builder removePathHopsEndpointIds(int index) { + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.remove(index); onChanged(); } else { - linkEndpointIdsBuilder_.remove(index); + pathHopsEndpointIdsBuilder_.remove(index); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder getLinkEndpointIdsBuilder( + public context.ContextOuterClass.EndPointId.Builder getPathHopsEndpointIdsBuilder( int index) { - return getLinkEndpointIdsFieldBuilder().getBuilder(index); + return getPathHopsEndpointIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + public context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( int index) { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.get(index); } else { - return linkEndpointIdsBuilder_.getMessageOrBuilder(index); + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.get(index); } else { + return pathHopsEndpointIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ public java.util.List - getLinkEndpointIdsOrBuilderList() { - if (linkEndpointIdsBuilder_ != null) { - return linkEndpointIdsBuilder_.getMessageOrBuilderList(); + getPathHopsEndpointIdsOrBuilderList() { + if (pathHopsEndpointIdsBuilder_ != null) { + return pathHopsEndpointIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(linkEndpointIds_); + return java.util.Collections.unmodifiableList(pathHopsEndpointIds_); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder() { - return getLinkEndpointIdsFieldBuilder().addBuilder( + public context.ContextOuterClass.EndPointId.Builder addPathHopsEndpointIdsBuilder() { + return getPathHopsEndpointIdsFieldBuilder().addBuilder( context.ContextOuterClass.EndPointId.getDefaultInstance()); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder( + public context.ContextOuterClass.EndPointId.Builder addPathHopsEndpointIdsBuilder( int index) { - return getLinkEndpointIdsFieldBuilder().addBuilder( + return getPathHopsEndpointIdsFieldBuilder().addBuilder( index, context.ContextOuterClass.EndPointId.getDefaultInstance()); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ public java.util.List - getLinkEndpointIdsBuilderList() { - return getLinkEndpointIdsFieldBuilder().getBuilderList(); + getPathHopsEndpointIdsBuilderList() { + return getPathHopsEndpointIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getLinkEndpointIdsFieldBuilder() { - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getPathHopsEndpointIdsFieldBuilder() { + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - linkEndpointIds_, + pathHopsEndpointIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - linkEndpointIds_ = null; + pathHopsEndpointIds_ = null; + } + return pathHopsEndpointIdsBuilder_; + } + + private java.util.List subServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSubServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = new java.util.ArrayList(subServiceIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> subServiceIdsBuilder_; + + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List getSubServiceIdsList() { + if (subServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(subServiceIds_); + } else { + return subServiceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public int getSubServiceIdsCount() { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.size(); + } else { + return subServiceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId getSubServiceIds(int index) { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.get(index); + } else { + return subServiceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder setSubServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.set(index, value); + onChanged(); + } else { + subServiceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder setSubServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds(context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(value); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(index, value); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addAllSubServiceIds( + java.lang.Iterable values) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subServiceIds_); + onChanged(); + } else { + subServiceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder clearSubServiceIds() { + if (subServiceIdsBuilder_ == null) { + subServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + subServiceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder removeSubServiceIds(int index) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.remove(index); + onChanged(); + } else { + subServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder getSubServiceIdsBuilder( + int index) { + return getSubServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( + int index) { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.get(index); } else { + return subServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List + getSubServiceIdsOrBuilderList() { + if (subServiceIdsBuilder_ != null) { + return subServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subServiceIds_); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSubServiceIdsBuilder() { + return getSubServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSubServiceIdsBuilder( + int index) { + return getSubServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List + getSubServiceIdsBuilderList() { + return getSubServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSubServiceIdsFieldBuilder() { + if (subServiceIdsBuilder_ == null) { + subServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + subServiceIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + subServiceIds_ = null; + } + return subServiceIdsBuilder_; + } + + private context.ContextOuterClass.ConnectionSettings settings_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder> settingsBuilder_; + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return settingsBuilder_ != null || settings_ != null; + } + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + public context.ContextOuterClass.ConnectionSettings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null ? context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder setSettings(context.ContextOuterClass.ConnectionSettings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + onChanged(); + } else { + settingsBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder setSettings( + context.ContextOuterClass.ConnectionSettings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + onChanged(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder mergeSettings(context.ContextOuterClass.ConnectionSettings value) { + if (settingsBuilder_ == null) { + if (settings_ != null) { + settings_ = + context.ContextOuterClass.ConnectionSettings.newBuilder(settings_).mergeFrom(value).buildPartial(); + } else { + settings_ = value; + } + onChanged(); + } else { + settingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder clearSettings() { + if (settingsBuilder_ == null) { + settings_ = null; + onChanged(); + } else { + settings_ = null; + settingsBuilder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public context.ContextOuterClass.ConnectionSettings.Builder getSettingsBuilder() { + + onChanged(); + return getSettingsFieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings settings = 5; + */ + public context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null ? + context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } + } + /** + * .context.ConnectionSettings settings = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder> + getSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder>( + getSettings(), + getParentForChildren(), + isClean()); + settings_ = null; } - return linkEndpointIdsBuilder_; + return settingsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -18762,95 +43841,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Link) + // @@protoc_insertion_point(builder_scope:context.Connection) } - // @@protoc_insertion_point(class_scope:context.Link) - private static final context.ContextOuterClass.Link DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Connection) + private static final context.ContextOuterClass.Connection DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Link(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Connection(); } - public static context.ContextOuterClass.Link getDefaultInstance() { + public static context.ContextOuterClass.Connection getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Link parsePartialFrom( + public Connection parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Link(input, extensionRegistry); + return new Connection(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Link getDefaultInstanceForType() { + public context.ContextOuterClass.Connection getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkIdList) + public interface ConnectionIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionIdList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - java.util.List - getLinkIdsList(); + java.util.List + getConnectionIdsList(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - context.ContextOuterClass.LinkId getLinkIds(int index); + context.ContextOuterClass.ConnectionId getConnectionIds(int index); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - int getLinkIdsCount(); + int getConnectionIdsCount(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - java.util.List - getLinkIdsOrBuilderList(); + java.util.List + getConnectionIdsOrBuilderList(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index); } /** - * Protobuf type {@code context.LinkIdList} + * Protobuf type {@code context.ConnectionIdList} */ - public static final class LinkIdList extends + public static final class ConnectionIdList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkIdList) - LinkIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionIdList) + ConnectionIdListOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkIdList.newBuilder() to construct. - private LinkIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionIdList.newBuilder() to construct. + private ConnectionIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkIdList() { - linkIds_ = java.util.Collections.emptyList(); + private ConnectionIdList() { + connectionIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkIdList(); + return new ConnectionIdList(); } @java.lang.Override @@ -18858,7 +43937,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkIdList( + private ConnectionIdList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -18879,11 +43958,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - linkIds_ = new java.util.ArrayList(); + connectionIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - linkIds_.add( - input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry)); + connectionIds_.add( + input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry)); break; } default: { @@ -18902,7 +43981,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -18910,55 +43989,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); } - public static final int LINK_IDS_FIELD_NUMBER = 1; - private java.util.List linkIds_; + public static final int CONNECTION_IDS_FIELD_NUMBER = 1; + private java.util.List connectionIds_; /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public java.util.List getLinkIdsList() { - return linkIds_; + public java.util.List getConnectionIdsList() { + return connectionIds_; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public java.util.List - getLinkIdsOrBuilderList() { - return linkIds_; + public java.util.List + getConnectionIdsOrBuilderList() { + return connectionIds_; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public int getLinkIdsCount() { - return linkIds_.size(); + public int getConnectionIdsCount() { + return connectionIds_.size(); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkIds(int index) { - return linkIds_.get(index); + public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { + return connectionIds_.get(index); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index) { - return linkIds_.get(index); + return connectionIds_.get(index); } private byte memoizedIsInitialized = -1; @@ -18975,8 +44054,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < linkIds_.size(); i++) { - output.writeMessage(1, linkIds_.get(i)); + for (int i = 0; i < connectionIds_.size(); i++) { + output.writeMessage(1, connectionIds_.get(i)); } unknownFields.writeTo(output); } @@ -18987,9 +44066,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < linkIds_.size(); i++) { + for (int i = 0; i < connectionIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, linkIds_.get(i)); + .computeMessageSize(1, connectionIds_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -19001,13 +44080,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkIdList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionIdList)) { return super.equals(obj); } - context.ContextOuterClass.LinkIdList other = (context.ContextOuterClass.LinkIdList) obj; + context.ContextOuterClass.ConnectionIdList other = (context.ContextOuterClass.ConnectionIdList) obj; - if (!getLinkIdsList() - .equals(other.getLinkIdsList())) return false; + if (!getConnectionIdsList() + .equals(other.getConnectionIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -19019,78 +44098,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getLinkIdsCount() > 0) { - hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkIdsList().hashCode(); + if (getConnectionIdsCount() > 0) { + hash = (37 * hash) + CONNECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionIdList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionIdList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList 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 context.ContextOuterClass.LinkIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionIdList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionIdList 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 context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -19103,7 +44182,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionIdList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -19119,26 +44198,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkIdList} + * Protobuf type {@code context.ConnectionIdList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkIdList) - context.ContextOuterClass.LinkIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionIdList) + context.ContextOuterClass.ConnectionIdListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); } - // Construct using context.ContextOuterClass.LinkIdList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionIdList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -19151,17 +44230,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinkIdsFieldBuilder(); + getConnectionIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); + if (connectionIdsBuilder_ == null) { + connectionIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linkIdsBuilder_.clear(); + connectionIdsBuilder_.clear(); } return this; } @@ -19169,17 +44248,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { - return context.ContextOuterClass.LinkIdList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionIdList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkIdList build() { - context.ContextOuterClass.LinkIdList result = buildPartial(); + public context.ContextOuterClass.ConnectionIdList build() { + context.ContextOuterClass.ConnectionIdList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -19187,17 +44266,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkIdList buildPartial() { - context.ContextOuterClass.LinkIdList result = new context.ContextOuterClass.LinkIdList(this); + public context.ContextOuterClass.ConnectionIdList buildPartial() { + context.ContextOuterClass.ConnectionIdList result = new context.ContextOuterClass.ConnectionIdList(this); int from_bitField0_ = bitField0_; - if (linkIdsBuilder_ == null) { + if (connectionIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.linkIds_ = linkIds_; + result.connectionIds_ = connectionIds_; } else { - result.linkIds_ = linkIdsBuilder_.build(); + result.connectionIds_ = connectionIdsBuilder_.build(); } onBuilt(); return result; @@ -19237,39 +44316,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkIdList) { - return mergeFrom((context.ContextOuterClass.LinkIdList)other); + if (other instanceof context.ContextOuterClass.ConnectionIdList) { + return mergeFrom((context.ContextOuterClass.ConnectionIdList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkIdList other) { - if (other == context.ContextOuterClass.LinkIdList.getDefaultInstance()) return this; - if (linkIdsBuilder_ == null) { - if (!other.linkIds_.isEmpty()) { - if (linkIds_.isEmpty()) { - linkIds_ = other.linkIds_; + public Builder mergeFrom(context.ContextOuterClass.ConnectionIdList other) { + if (other == context.ContextOuterClass.ConnectionIdList.getDefaultInstance()) return this; + if (connectionIdsBuilder_ == null) { + if (!other.connectionIds_.isEmpty()) { + if (connectionIds_.isEmpty()) { + connectionIds_ = other.connectionIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinkIdsIsMutable(); - linkIds_.addAll(other.linkIds_); + ensureConnectionIdsIsMutable(); + connectionIds_.addAll(other.connectionIds_); } onChanged(); } } else { - if (!other.linkIds_.isEmpty()) { - if (linkIdsBuilder_.isEmpty()) { - linkIdsBuilder_.dispose(); - linkIdsBuilder_ = null; - linkIds_ = other.linkIds_; + if (!other.connectionIds_.isEmpty()) { + if (connectionIdsBuilder_.isEmpty()) { + connectionIdsBuilder_.dispose(); + connectionIdsBuilder_ = null; + connectionIds_ = other.connectionIds_; bitField0_ = (bitField0_ & ~0x00000001); - linkIdsBuilder_ = + connectionIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkIdsFieldBuilder() : null; + getConnectionIdsFieldBuilder() : null; } else { - linkIdsBuilder_.addAllMessages(other.linkIds_); + connectionIdsBuilder_.addAllMessages(other.connectionIds_); } } } @@ -19288,11 +44367,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkIdList parsedMessage = null; + context.ContextOuterClass.ConnectionIdList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionIdList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -19303,244 +44382,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List linkIds_ = + private java.util.List connectionIds_ = java.util.Collections.emptyList(); - private void ensureLinkIdsIsMutable() { + private void ensureConnectionIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - linkIds_ = new java.util.ArrayList(linkIds_); + connectionIds_ = new java.util.ArrayList(connectionIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdsBuilder_; /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List getLinkIdsList() { - if (linkIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkIds_); + public java.util.List getConnectionIdsList() { + if (connectionIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connectionIds_); } else { - return linkIdsBuilder_.getMessageList(); + return connectionIdsBuilder_.getMessageList(); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public int getLinkIdsCount() { - if (linkIdsBuilder_ == null) { - return linkIds_.size(); + public int getConnectionIdsCount() { + if (connectionIdsBuilder_ == null) { + return connectionIds_.size(); } else { - return linkIdsBuilder_.getCount(); + return connectionIdsBuilder_.getCount(); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId getLinkIds(int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); + public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { + if (connectionIdsBuilder_ == null) { + return connectionIds_.get(index); } else { - return linkIdsBuilder_.getMessage(index); + return connectionIdsBuilder_.getMessage(index); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder setConnectionIds( + int index, context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.set(index, value); + ensureConnectionIdsIsMutable(); + connectionIds_.set(index, value); onChanged(); } else { - linkIdsBuilder_.setMessage(index, value); + connectionIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.set(index, builderForValue.build()); + public Builder setConnectionIds( + int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.set(index, builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.setMessage(index, builderForValue.build()); + connectionIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds(context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder addConnectionIds(context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.add(value); + ensureConnectionIdsIsMutable(); + connectionIds_.add(value); onChanged(); } else { - linkIdsBuilder_.addMessage(value); + connectionIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder addConnectionIds( + int index, context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.add(index, value); + ensureConnectionIdsIsMutable(); + connectionIds_.add(index, value); onChanged(); } else { - linkIdsBuilder_.addMessage(index, value); + connectionIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(builderForValue.build()); + public Builder addConnectionIds( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.add(builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.addMessage(builderForValue.build()); + connectionIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(index, builderForValue.build()); + public Builder addConnectionIds( + int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.add(index, builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.addMessage(index, builderForValue.build()); + connectionIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addAllLinkIds( - java.lang.Iterable values) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); + public Builder addAllConnectionIds( + java.lang.Iterable values) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkIds_); + values, connectionIds_); onChanged(); } else { - linkIdsBuilder_.addAllMessages(values); + connectionIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder clearLinkIds() { - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); + public Builder clearConnectionIds() { + if (connectionIdsBuilder_ == null) { + connectionIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linkIdsBuilder_.clear(); + connectionIdsBuilder_.clear(); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder removeLinkIds(int index) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.remove(index); + public Builder removeConnectionIds(int index) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.remove(index); onChanged(); } else { - linkIdsBuilder_.remove(index); + connectionIdsBuilder_.remove(index); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdsBuilder( int index) { - return getLinkIdsFieldBuilder().getBuilder(index); + return getConnectionIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); } else { - return linkIdsBuilder_.getMessageOrBuilder(index); + if (connectionIdsBuilder_ == null) { + return connectionIds_.get(index); } else { + return connectionIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List - getLinkIdsOrBuilderList() { - if (linkIdsBuilder_ != null) { - return linkIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getConnectionIdsOrBuilderList() { + if (connectionIdsBuilder_ != null) { + return connectionIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(linkIds_); + return java.util.Collections.unmodifiableList(connectionIds_); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { - return getLinkIdsFieldBuilder().addBuilder( - context.ContextOuterClass.LinkId.getDefaultInstance()); + public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder() { + return getConnectionIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ConnectionId.getDefaultInstance()); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder( int index) { - return getLinkIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.LinkId.getDefaultInstance()); + return getConnectionIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConnectionId.getDefaultInstance()); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List - getLinkIdsBuilderList() { - return getLinkIdsFieldBuilder().getBuilderList(); + public java.util.List + getConnectionIdsBuilderList() { + return getConnectionIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdsFieldBuilder() { - if (linkIdsBuilder_ == null) { - linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - linkIds_, + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdsFieldBuilder() { + if (connectionIdsBuilder_ == null) { + connectionIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + connectionIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - linkIds_ = null; + connectionIds_ = null; } - return linkIdsBuilder_; + return connectionIdsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -19555,95 +44634,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkIdList) + // @@protoc_insertion_point(builder_scope:context.ConnectionIdList) } - // @@protoc_insertion_point(class_scope:context.LinkIdList) - private static final context.ContextOuterClass.LinkIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionIdList) + private static final context.ContextOuterClass.ConnectionIdList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionIdList(); } - public static context.ContextOuterClass.LinkIdList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionIdList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkIdList parsePartialFrom( + public ConnectionIdList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkIdList(input, extensionRegistry); + return new ConnectionIdList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkList) + public interface ConnectionListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - java.util.List - getLinksList(); + java.util.List + getConnectionsList(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - context.ContextOuterClass.Link getLinks(int index); + context.ContextOuterClass.Connection getConnections(int index); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - int getLinksCount(); + int getConnectionsCount(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - java.util.List - getLinksOrBuilderList(); + java.util.List + getConnectionsOrBuilderList(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index); } /** - * Protobuf type {@code context.LinkList} + * Protobuf type {@code context.ConnectionList} */ - public static final class LinkList extends + public static final class ConnectionList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkList) - LinkListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionList) + ConnectionListOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkList.newBuilder() to construct. - private LinkList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionList.newBuilder() to construct. + private ConnectionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkList() { - links_ = java.util.Collections.emptyList(); + private ConnectionList() { + connections_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkList(); + return new ConnectionList(); } @java.lang.Override @@ -19651,7 +44730,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkList( + private ConnectionList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -19672,11 +44751,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - links_ = new java.util.ArrayList(); + connections_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - links_.add( - input.readMessage(context.ContextOuterClass.Link.parser(), extensionRegistry)); + connections_.add( + input.readMessage(context.ContextOuterClass.Connection.parser(), extensionRegistry)); break; } default: { @@ -19695,7 +44774,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - links_ = java.util.Collections.unmodifiableList(links_); + connections_ = java.util.Collections.unmodifiableList(connections_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -19703,55 +44782,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); } - public static final int LINKS_FIELD_NUMBER = 1; - private java.util.List links_; + public static final int CONNECTIONS_FIELD_NUMBER = 1; + private java.util.List connections_; /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public java.util.List getLinksList() { - return links_; + public java.util.List getConnectionsList() { + return connections_; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public java.util.List - getLinksOrBuilderList() { - return links_; + public java.util.List + getConnectionsOrBuilderList() { + return connections_; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public int getLinksCount() { - return links_.size(); + public int getConnectionsCount() { + return connections_.size(); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public context.ContextOuterClass.Link getLinks(int index) { - return links_.get(index); + public context.ContextOuterClass.Connection getConnections(int index) { + return connections_.get(index); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index) { - return links_.get(index); + return connections_.get(index); } private byte memoizedIsInitialized = -1; @@ -19768,8 +44847,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < links_.size(); i++) { - output.writeMessage(1, links_.get(i)); + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(1, connections_.get(i)); } unknownFields.writeTo(output); } @@ -19780,9 +44859,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < links_.size(); i++) { + for (int i = 0; i < connections_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, links_.get(i)); + .computeMessageSize(1, connections_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -19794,13 +44873,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionList)) { return super.equals(obj); } - context.ContextOuterClass.LinkList other = (context.ContextOuterClass.LinkList) obj; + context.ContextOuterClass.ConnectionList other = (context.ContextOuterClass.ConnectionList) obj; - if (!getLinksList() - .equals(other.getLinksList())) return false; + if (!getConnectionsList() + .equals(other.getConnectionsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -19812,78 +44891,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getLinksCount() > 0) { - hash = (37 * hash) + LINKS_FIELD_NUMBER; - hash = (53 * hash) + getLinksList().hashCode(); + if (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList 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 context.ContextOuterClass.LinkList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionList 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 context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -19896,7 +44975,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -19912,26 +44991,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkList} + * Protobuf type {@code context.ConnectionList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkList) - context.ContextOuterClass.LinkListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionList) + context.ContextOuterClass.ConnectionListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); } - // Construct using context.ContextOuterClass.LinkList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -19944,17 +45023,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinksFieldBuilder(); + getConnectionsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linksBuilder_ == null) { - links_ = java.util.Collections.emptyList(); + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linksBuilder_.clear(); + connectionsBuilder_.clear(); } return this; } @@ -19962,17 +45041,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkList getDefaultInstanceForType() { - return context.ContextOuterClass.LinkList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkList build() { - context.ContextOuterClass.LinkList result = buildPartial(); + public context.ContextOuterClass.ConnectionList build() { + context.ContextOuterClass.ConnectionList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -19980,17 +45059,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkList buildPartial() { - context.ContextOuterClass.LinkList result = new context.ContextOuterClass.LinkList(this); + public context.ContextOuterClass.ConnectionList buildPartial() { + context.ContextOuterClass.ConnectionList result = new context.ContextOuterClass.ConnectionList(this); int from_bitField0_ = bitField0_; - if (linksBuilder_ == null) { + if (connectionsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - links_ = java.util.Collections.unmodifiableList(links_); + connections_ = java.util.Collections.unmodifiableList(connections_); bitField0_ = (bitField0_ & ~0x00000001); } - result.links_ = links_; + result.connections_ = connections_; } else { - result.links_ = linksBuilder_.build(); + result.connections_ = connectionsBuilder_.build(); } onBuilt(); return result; @@ -20030,39 +45109,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkList) { - return mergeFrom((context.ContextOuterClass.LinkList)other); + if (other instanceof context.ContextOuterClass.ConnectionList) { + return mergeFrom((context.ContextOuterClass.ConnectionList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkList other) { - if (other == context.ContextOuterClass.LinkList.getDefaultInstance()) return this; - if (linksBuilder_ == null) { - if (!other.links_.isEmpty()) { - if (links_.isEmpty()) { - links_ = other.links_; + public Builder mergeFrom(context.ContextOuterClass.ConnectionList other) { + if (other == context.ContextOuterClass.ConnectionList.getDefaultInstance()) return this; + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinksIsMutable(); - links_.addAll(other.links_); + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); } onChanged(); } } else { - if (!other.links_.isEmpty()) { - if (linksBuilder_.isEmpty()) { - linksBuilder_.dispose(); - linksBuilder_ = null; - links_ = other.links_; + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; bitField0_ = (bitField0_ & ~0x00000001); - linksBuilder_ = + connectionsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinksFieldBuilder() : null; + getConnectionsFieldBuilder() : null; } else { - linksBuilder_.addAllMessages(other.links_); + connectionsBuilder_.addAllMessages(other.connections_); } } } @@ -20081,11 +45160,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkList parsedMessage = null; + context.ContextOuterClass.ConnectionList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -20096,244 +45175,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List links_ = + private java.util.List connections_ = java.util.Collections.emptyList(); - private void ensureLinksIsMutable() { + private void ensureConnectionsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - links_ = new java.util.ArrayList(links_); + connections_ = new java.util.ArrayList(connections_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> linksBuilder_; + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> connectionsBuilder_; /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List getLinksList() { - if (linksBuilder_ == null) { - return java.util.Collections.unmodifiableList(links_); + public java.util.List getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); } else { - return linksBuilder_.getMessageList(); + return connectionsBuilder_.getMessageList(); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public int getLinksCount() { - if (linksBuilder_ == null) { - return links_.size(); + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); } else { - return linksBuilder_.getCount(); + return connectionsBuilder_.getCount(); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link getLinks(int index) { - if (linksBuilder_ == null) { - return links_.get(index); + public context.ContextOuterClass.Connection getConnections(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); } else { - return linksBuilder_.getMessage(index); + return connectionsBuilder_.getMessage(index); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder setLinks( - int index, context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder setConnections( + int index, context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.set(index, value); + ensureConnectionsIsMutable(); + connections_.set(index, value); onChanged(); } else { - linksBuilder_.setMessage(index, value); + connectionsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder setLinks( - int index, context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.set(index, builderForValue.build()); + public Builder setConnections( + int index, context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); onChanged(); } else { - linksBuilder_.setMessage(index, builderForValue.build()); + connectionsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks(context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder addConnections(context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.add(value); + ensureConnectionsIsMutable(); + connections_.add(value); onChanged(); } else { - linksBuilder_.addMessage(value); + connectionsBuilder_.addMessage(value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - int index, context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder addConnections( + int index, context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.add(index, value); + ensureConnectionsIsMutable(); + connections_.add(index, value); onChanged(); } else { - linksBuilder_.addMessage(index, value); + connectionsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.add(builderForValue.build()); + public Builder addConnections( + context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); onChanged(); } else { - linksBuilder_.addMessage(builderForValue.build()); + connectionsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - int index, context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.add(index, builderForValue.build()); + public Builder addConnections( + int index, context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); onChanged(); } else { - linksBuilder_.addMessage(index, builderForValue.build()); + connectionsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addAllLinks( - java.lang.Iterable values) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); + public Builder addAllConnections( + java.lang.Iterable values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, links_); + values, connections_); onChanged(); } else { - linksBuilder_.addAllMessages(values); + connectionsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder clearLinks() { - if (linksBuilder_ == null) { - links_ = java.util.Collections.emptyList(); + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linksBuilder_.clear(); + connectionsBuilder_.clear(); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder removeLinks(int index) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.remove(index); + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); onChanged(); } else { - linksBuilder_.remove(index); + connectionsBuilder_.remove(index); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder getLinksBuilder( + public context.ContextOuterClass.Connection.Builder getConnectionsBuilder( int index) { - return getLinksFieldBuilder().getBuilder(index); + return getConnectionsFieldBuilder().getBuilder(index); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index) { - if (linksBuilder_ == null) { - return links_.get(index); } else { - return linksBuilder_.getMessageOrBuilder(index); + if (connectionsBuilder_ == null) { + return connections_.get(index); } else { + return connectionsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List - getLinksOrBuilderList() { - if (linksBuilder_ != null) { - return linksBuilder_.getMessageOrBuilderList(); + public java.util.List + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(links_); + return java.util.Collections.unmodifiableList(connections_); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder addLinksBuilder() { - return getLinksFieldBuilder().addBuilder( - context.ContextOuterClass.Link.getDefaultInstance()); + public context.ContextOuterClass.Connection.Builder addConnectionsBuilder() { + return getConnectionsFieldBuilder().addBuilder( + context.ContextOuterClass.Connection.getDefaultInstance()); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder addLinksBuilder( + public context.ContextOuterClass.Connection.Builder addConnectionsBuilder( int index) { - return getLinksFieldBuilder().addBuilder( - index, context.ContextOuterClass.Link.getDefaultInstance()); + return getConnectionsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Connection.getDefaultInstance()); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List - getLinksBuilderList() { - return getLinksFieldBuilder().getBuilderList(); + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> - getLinksFieldBuilder() { - if (linksBuilder_ == null) { - linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder>( - links_, + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder>( + connections_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - links_ = null; + connections_ = null; } - return linksBuilder_; + return connectionsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -20348,48 +45427,48 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkList) + // @@protoc_insertion_point(builder_scope:context.ConnectionList) } - // @@protoc_insertion_point(class_scope:context.LinkList) - private static final context.ContextOuterClass.LinkList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionList) + private static final context.ContextOuterClass.ConnectionList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionList(); } - public static context.ContextOuterClass.LinkList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkList parsePartialFrom( + public ConnectionList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkList(input, extensionRegistry); + return new ConnectionList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkEvent) + public interface ConnectionEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionEvent) com.google.protobuf.MessageOrBuilder { /** @@ -20408,40 +45487,40 @@ public final class ContextOuterClass { context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ - boolean hasLinkId(); + boolean hasConnectionId(); /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ - context.ContextOuterClass.LinkId getLinkId(); + context.ContextOuterClass.ConnectionId getConnectionId(); /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); } /** - * Protobuf type {@code context.LinkEvent} + * Protobuf type {@code context.ConnectionEvent} */ - public static final class LinkEvent extends + public static final class ConnectionEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkEvent) - LinkEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionEvent) + ConnectionEventOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkEvent.newBuilder() to construct. - private LinkEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionEvent.newBuilder() to construct. + private ConnectionEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkEvent() { + private ConnectionEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkEvent(); + return new ConnectionEvent(); } @java.lang.Override @@ -20449,7 +45528,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkEvent( + private ConnectionEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -20481,14 +45560,14 @@ public final class ContextOuterClass { break; } case 18: { - context.ContextOuterClass.LinkId.Builder subBuilder = null; - if (linkId_ != null) { - subBuilder = linkId_.toBuilder(); + context.ContextOuterClass.ConnectionId.Builder subBuilder = null; + if (connectionId_ != null) { + subBuilder = connectionId_.toBuilder(); } - linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkId_); - linkId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionId_); + connectionId_ = subBuilder.buildPartial(); } break; @@ -20514,15 +45593,15 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + context.ContextOuterClass.ConnectionEvent.class, context.ContextOuterClass.ConnectionEvent.Builder.class); } public static final int EVENT_FIELD_NUMBER = 1; @@ -20551,30 +45630,30 @@ public final class ContextOuterClass { return getEvent(); } - public static final int LINK_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.LinkId linkId_; + public static final int CONNECTION_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ConnectionId connectionId_; /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ @java.lang.Override - public boolean hasLinkId() { - return linkId_ != null; + public boolean hasConnectionId() { + return connectionId_ != null; } /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkId() { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - return getLinkId(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + return getConnectionId(); } private byte memoizedIsInitialized = -1; @@ -20594,8 +45673,8 @@ public final class ContextOuterClass { if (event_ != null) { output.writeMessage(1, getEvent()); } - if (linkId_ != null) { - output.writeMessage(2, getLinkId()); + if (connectionId_ != null) { + output.writeMessage(2, getConnectionId()); } unknownFields.writeTo(output); } @@ -20610,9 +45689,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getEvent()); } - if (linkId_ != null) { + if (connectionId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getLinkId()); + .computeMessageSize(2, getConnectionId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -20624,20 +45703,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkEvent)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionEvent)) { return super.equals(obj); } - context.ContextOuterClass.LinkEvent other = (context.ContextOuterClass.LinkEvent) obj; + context.ContextOuterClass.ConnectionEvent other = (context.ContextOuterClass.ConnectionEvent) obj; if (hasEvent() != other.hasEvent()) return false; if (hasEvent()) { if (!getEvent() .equals(other.getEvent())) return false; } - if (hasLinkId() != other.hasLinkId()) return false; - if (hasLinkId()) { - if (!getLinkId() - .equals(other.getLinkId())) return false; + if (hasConnectionId() != other.hasConnectionId()) return false; + if (hasConnectionId()) { + if (!getConnectionId() + .equals(other.getConnectionId())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -20654,78 +45733,78 @@ public final class ContextOuterClass { hash = (37 * hash) + EVENT_FIELD_NUMBER; hash = (53 * hash) + getEvent().hashCode(); } - if (hasLinkId()) { - hash = (37 * hash) + LINK_ID_FIELD_NUMBER; - hash = (53 * hash) + getLinkId().hashCode(); + if (hasConnectionId()) { + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent 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 context.ContextOuterClass.LinkEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionEvent 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 context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -20738,7 +45817,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -20754,26 +45833,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkEvent} + * Protobuf type {@code context.ConnectionEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkEvent) - context.ContextOuterClass.LinkEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionEvent) + context.ContextOuterClass.ConnectionEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + context.ContextOuterClass.ConnectionEvent.class, context.ContextOuterClass.ConnectionEvent.Builder.class); } - // Construct using context.ContextOuterClass.LinkEvent.newBuilder() + // Construct using context.ContextOuterClass.ConnectionEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -20797,11 +45876,11 @@ public final class ContextOuterClass { event_ = null; eventBuilder_ = null; } - if (linkIdBuilder_ == null) { - linkId_ = null; + if (connectionIdBuilder_ == null) { + connectionId_ = null; } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } return this; } @@ -20809,17 +45888,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { - return context.ContextOuterClass.LinkEvent.getDefaultInstance(); + public context.ContextOuterClass.ConnectionEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkEvent build() { - context.ContextOuterClass.LinkEvent result = buildPartial(); + public context.ContextOuterClass.ConnectionEvent build() { + context.ContextOuterClass.ConnectionEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -20827,17 +45906,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkEvent buildPartial() { - context.ContextOuterClass.LinkEvent result = new context.ContextOuterClass.LinkEvent(this); + public context.ContextOuterClass.ConnectionEvent buildPartial() { + context.ContextOuterClass.ConnectionEvent result = new context.ContextOuterClass.ConnectionEvent(this); if (eventBuilder_ == null) { result.event_ = event_; } else { result.event_ = eventBuilder_.build(); } - if (linkIdBuilder_ == null) { - result.linkId_ = linkId_; + if (connectionIdBuilder_ == null) { + result.connectionId_ = connectionId_; } else { - result.linkId_ = linkIdBuilder_.build(); + result.connectionId_ = connectionIdBuilder_.build(); } onBuilt(); return result; @@ -20877,21 +45956,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkEvent) { - return mergeFrom((context.ContextOuterClass.LinkEvent)other); + if (other instanceof context.ContextOuterClass.ConnectionEvent) { + return mergeFrom((context.ContextOuterClass.ConnectionEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkEvent other) { - if (other == context.ContextOuterClass.LinkEvent.getDefaultInstance()) return this; + public Builder mergeFrom(context.ContextOuterClass.ConnectionEvent other) { + if (other == context.ContextOuterClass.ConnectionEvent.getDefaultInstance()) return this; if (other.hasEvent()) { mergeEvent(other.getEvent()); } - if (other.hasLinkId()) { - mergeLinkId(other.getLinkId()); + if (other.hasConnectionId()) { + mergeConnectionId(other.getConnectionId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -20908,11 +45987,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkEvent parsedMessage = null; + context.ContextOuterClass.ConnectionEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -21041,123 +46120,123 @@ public final class ContextOuterClass { return eventBuilder_; } - private context.ContextOuterClass.LinkId linkId_; + private context.ContextOuterClass.ConnectionId connectionId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ - public boolean hasLinkId() { - return linkIdBuilder_ != null || linkId_ != null; + public boolean hasConnectionId() { + return connectionIdBuilder_ != null || connectionId_ != null; } /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ - public context.ContextOuterClass.LinkId getLinkId() { - if (linkIdBuilder_ == null) { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + if (connectionIdBuilder_ == null) { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } else { - return linkIdBuilder_.getMessage(); + return connectionIdBuilder_.getMessage(); } } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder setLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { + public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - linkId_ = value; + connectionId_ = value; onChanged(); } else { - linkIdBuilder_.setMessage(value); + connectionIdBuilder_.setMessage(value); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder setLinkId( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdBuilder_ == null) { - linkId_ = builderForValue.build(); + public Builder setConnectionId( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdBuilder_ == null) { + connectionId_ = builderForValue.build(); onChanged(); } else { - linkIdBuilder_.setMessage(builderForValue.build()); + connectionIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { - if (linkId_ != null) { - linkId_ = - context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (connectionId_ != null) { + connectionId_ = + context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); } else { - linkId_ = value; + connectionId_ = value; } onChanged(); } else { - linkIdBuilder_.mergeFrom(value); + connectionIdBuilder_.mergeFrom(value); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder clearLinkId() { - if (linkIdBuilder_ == null) { - linkId_ = null; + public Builder clearConnectionId() { + if (connectionIdBuilder_ == null) { + connectionId_ = null; onChanged(); } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { onChanged(); - return getLinkIdFieldBuilder().getBuilder(); + return getConnectionIdFieldBuilder().getBuilder(); } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - if (linkIdBuilder_ != null) { - return linkIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + if (connectionIdBuilder_ != null) { + return connectionIdBuilder_.getMessageOrBuilder(); } else { - return linkId_ == null ? - context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + return connectionId_ == null ? + context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdFieldBuilder() { - if (linkIdBuilder_ == null) { - linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - getLinkId(), + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdFieldBuilder() { + if (connectionIdBuilder_ == null) { + connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + getConnectionId(), getParentForChildren(), isClean()); - linkId_ = null; + connectionId_ = null; } - return linkIdBuilder_; + return connectionIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -21172,104 +46251,119 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkEvent) + // @@protoc_insertion_point(builder_scope:context.ConnectionEvent) } - // @@protoc_insertion_point(class_scope:context.LinkEvent) - private static final context.ContextOuterClass.LinkEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionEvent) + private static final context.ContextOuterClass.ConnectionEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionEvent(); } - public static context.ContextOuterClass.LinkEvent getDefaultInstance() { + public static context.ContextOuterClass.ConnectionEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkEvent parsePartialFrom( + public ConnectionEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkEvent(input, extensionRegistry); + return new ConnectionEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceId) + public interface EndPointIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.EndPointId) com.google.protobuf.MessageOrBuilder { /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ - boolean hasContextId(); + boolean hasTopologyId(); /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ - context.ContextOuterClass.ContextId getContextId(); + context.ContextOuterClass.TopologyId getTopologyId(); /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ - boolean hasServiceUuid(); + boolean hasDeviceId(); /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ - context.ContextOuterClass.Uuid getServiceUuid(); + context.ContextOuterClass.DeviceId getDeviceId(); /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder(); + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + boolean hasEndpointUuid(); + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + context.ContextOuterClass.Uuid getEndpointUuid(); + /** + * .context.Uuid endpoint_uuid = 3; + */ + context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder(); } /** *
-   * ----- Service -------------------------------------------------------------------------------------------------------
+   * ----- Endpoint ------------------------------------------------------------------------------------------------------
    * 
* - * Protobuf type {@code context.ServiceId} + * Protobuf type {@code context.EndPointId} */ - public static final class ServiceId extends + public static final class EndPointId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceId) - ServiceIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.EndPointId) + EndPointIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceId.newBuilder() to construct. - private ServiceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use EndPointId.newBuilder() to construct. + private EndPointId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceId() { + private EndPointId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceId(); + return new EndPointId(); } @java.lang.Override @@ -21277,7 +46371,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceId( + private EndPointId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -21296,27 +46390,40 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(topologyId_); + topologyId_ = subBuilder.buildPartial(); } break; } case 18: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (serviceUuid_ != null) { - subBuilder = serviceUuid_.toBuilder(); + if (endpointUuid_ != null) { + subBuilder = endpointUuid_.toBuilder(); } - serviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + endpointUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceUuid_); - serviceUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointUuid_); + endpointUuid_ = subBuilder.buildPartial(); } break; @@ -21342,67 +46449,93 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); } - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; + public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.TopologyId topologyId_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; + public boolean hasTopologyId() { + return topologyId_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); } - public static final int SERVICE_UUID_FIELD_NUMBER = 2; - private context.ContextOuterClass.Uuid serviceUuid_; + public static final int DEVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.DeviceId deviceId_; /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ @java.lang.Override - public boolean hasServiceUuid() { - return serviceUuid_ != null; + public boolean hasDeviceId() { + return deviceId_ != null; } /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ @java.lang.Override - public context.ContextOuterClass.Uuid getServiceUuid() { - return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { - return getServiceUuid(); + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_UUID_FIELD_NUMBER = 3; + private context.ContextOuterClass.Uuid endpointUuid_; + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + @java.lang.Override + public boolean hasEndpointUuid() { + return endpointUuid_ != null; + } + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getEndpointUuid() { + return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { + return getEndpointUuid(); } private byte memoizedIsInitialized = -1; @@ -21419,11 +46552,14 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); + if (topologyId_ != null) { + output.writeMessage(1, getTopologyId()); } - if (serviceUuid_ != null) { - output.writeMessage(2, getServiceUuid()); + if (deviceId_ != null) { + output.writeMessage(2, getDeviceId()); + } + if (endpointUuid_ != null) { + output.writeMessage(3, getEndpointUuid()); } unknownFields.writeTo(output); } @@ -21434,13 +46570,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextId_ != null) { + if (topologyId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); + .computeMessageSize(1, getTopologyId()); } - if (serviceUuid_ != null) { + if (deviceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getServiceUuid()); + .computeMessageSize(2, getDeviceId()); + } + if (endpointUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getEndpointUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -21452,20 +46592,25 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceId)) { + if (!(obj instanceof context.ContextOuterClass.EndPointId)) { return super.equals(obj); } - context.ContextOuterClass.ServiceId other = (context.ContextOuterClass.ServiceId) obj; + context.ContextOuterClass.EndPointId other = (context.ContextOuterClass.EndPointId) obj; - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) return false; } - if (hasServiceUuid() != other.hasServiceUuid()) return false; - if (hasServiceUuid()) { - if (!getServiceUuid() - .equals(other.getServiceUuid())) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointUuid() != other.hasEndpointUuid()) return false; + if (hasEndpointUuid()) { + if (!getEndpointUuid() + .equals(other.getEndpointUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -21478,82 +46623,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + if (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); } - if (hasServiceUuid()) { - hash = (37 * hash) + SERVICE_UUID_FIELD_NUMBER; - hash = (53 * hash) + getServiceUuid().hashCode(); + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointUuid()) { + hash = (37 * hash) + ENDPOINT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom(byte[] data) + public static context.ContextOuterClass.EndPointId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPointId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId 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 context.ContextOuterClass.ServiceId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPointId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseDelimitedFrom( + public static context.ContextOuterClass.EndPointId 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 context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -21566,7 +46715,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceId prototype) { + public static Builder newBuilder(context.ContextOuterClass.EndPointId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -21583,29 +46732,29 @@ public final class ContextOuterClass { } /** *
-     * ----- Service -------------------------------------------------------------------------------------------------------
+     * ----- Endpoint ------------------------------------------------------------------------------------------------------
      * 
* - * Protobuf type {@code context.ServiceId} + * Protobuf type {@code context.EndPointId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceId) - context.ContextOuterClass.ServiceIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.EndPointId) + context.ContextOuterClass.EndPointIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); } - // Construct using context.ContextOuterClass.ServiceId.newBuilder() + // Construct using context.ContextOuterClass.EndPointId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21623,17 +46772,23 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; + if (topologyIdBuilder_ == null) { + topologyId_ = null; } else { - contextId_ = null; - contextIdBuilder_ = null; + topologyId_ = null; + topologyIdBuilder_ = null; } - if (serviceUuidBuilder_ == null) { - serviceUuid_ = null; + if (deviceIdBuilder_ == null) { + deviceId_ = null; } else { - serviceUuid_ = null; - serviceUuidBuilder_ = null; + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointUuidBuilder_ == null) { + endpointUuid_ = null; + } else { + endpointUuid_ = null; + endpointUuidBuilder_ = null; } return this; } @@ -21641,17 +46796,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceId.getDefaultInstance(); + public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { + return context.ContextOuterClass.EndPointId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceId build() { - context.ContextOuterClass.ServiceId result = buildPartial(); + public context.ContextOuterClass.EndPointId build() { + context.ContextOuterClass.EndPointId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -21659,17 +46814,22 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceId buildPartial() { - context.ContextOuterClass.ServiceId result = new context.ContextOuterClass.ServiceId(this); - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + public context.ContextOuterClass.EndPointId buildPartial() { + context.ContextOuterClass.EndPointId result = new context.ContextOuterClass.EndPointId(this); + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; } else { - result.contextId_ = contextIdBuilder_.build(); + result.topologyId_ = topologyIdBuilder_.build(); } - if (serviceUuidBuilder_ == null) { - result.serviceUuid_ = serviceUuid_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; } else { - result.serviceUuid_ = serviceUuidBuilder_.build(); + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointUuidBuilder_ == null) { + result.endpointUuid_ = endpointUuid_; + } else { + result.endpointUuid_ = endpointUuidBuilder_.build(); } onBuilt(); return result; @@ -21709,21 +46869,24 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceId) { - return mergeFrom((context.ContextOuterClass.ServiceId)other); + if (other instanceof context.ContextOuterClass.EndPointId) { + return mergeFrom((context.ContextOuterClass.EndPointId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceId other) { - if (other == context.ContextOuterClass.ServiceId.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); + public Builder mergeFrom(context.ContextOuterClass.EndPointId other) { + if (other == context.ContextOuterClass.EndPointId.getDefaultInstance()) return this; + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); } - if (other.hasServiceUuid()) { - mergeServiceUuid(other.getServiceUuid()); + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointUuid()) { + mergeEndpointUuid(other.getEndpointUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -21740,11 +46903,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceId parsedMessage = null; + context.ContextOuterClass.EndPointId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.EndPointId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -21754,242 +46917,361 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.TopologyId topologyId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } else { - return contextIdBuilder_.getMessage(); + return topologyIdBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + topologyId_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + topologyIdBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + topologyIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); } else { - contextId_ = value; + topologyId_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + topologyIdBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + topologyId_ = null; + topologyIdBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getTopologyIdFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), getParentForChildren(), isClean()); - contextId_ = null; + topologyId_ = null; } - return contextIdBuilder_; + return topologyIdBuilder_; } - private context.ContextOuterClass.Uuid serviceUuid_; + private context.ContextOuterClass.DeviceId deviceId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> serviceUuidBuilder_; + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ - public boolean hasServiceUuid() { - return serviceUuidBuilder_ != null || serviceUuid_ != null; + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; } /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ - public context.ContextOuterClass.Uuid getServiceUuid() { - if (serviceUuidBuilder_ == null) { - return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; } else { - return serviceUuidBuilder_.getMessage(); + return deviceIdBuilder_.getMessage(); } } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - public Builder setServiceUuid(context.ContextOuterClass.Uuid value) { - if (serviceUuidBuilder_ == null) { + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - serviceUuid_ = value; + deviceId_ = value; onChanged(); } else { - serviceUuidBuilder_.setMessage(value); + deviceIdBuilder_.setMessage(value); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - public Builder setServiceUuid( + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.Uuid endpointUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> endpointUuidBuilder_; + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + public boolean hasEndpointUuid() { + return endpointUuidBuilder_ != null || endpointUuid_ != null; + } + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + public context.ContextOuterClass.Uuid getEndpointUuid() { + if (endpointUuidBuilder_ == null) { + return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + } else { + return endpointUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + public Builder setEndpointUuid(context.ContextOuterClass.Uuid value) { + if (endpointUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointUuid_ = value; + onChanged(); + } else { + endpointUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + public Builder setEndpointUuid( context.ContextOuterClass.Uuid.Builder builderForValue) { - if (serviceUuidBuilder_ == null) { - serviceUuid_ = builderForValue.build(); + if (endpointUuidBuilder_ == null) { + endpointUuid_ = builderForValue.build(); onChanged(); } else { - serviceUuidBuilder_.setMessage(builderForValue.build()); + endpointUuidBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public Builder mergeServiceUuid(context.ContextOuterClass.Uuid value) { - if (serviceUuidBuilder_ == null) { - if (serviceUuid_ != null) { - serviceUuid_ = - context.ContextOuterClass.Uuid.newBuilder(serviceUuid_).mergeFrom(value).buildPartial(); + public Builder mergeEndpointUuid(context.ContextOuterClass.Uuid value) { + if (endpointUuidBuilder_ == null) { + if (endpointUuid_ != null) { + endpointUuid_ = + context.ContextOuterClass.Uuid.newBuilder(endpointUuid_).mergeFrom(value).buildPartial(); } else { - serviceUuid_ = value; + endpointUuid_ = value; } onChanged(); } else { - serviceUuidBuilder_.mergeFrom(value); + endpointUuidBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public Builder clearServiceUuid() { - if (serviceUuidBuilder_ == null) { - serviceUuid_ = null; + public Builder clearEndpointUuid() { + if (endpointUuidBuilder_ == null) { + endpointUuid_ = null; onChanged(); } else { - serviceUuid_ = null; - serviceUuidBuilder_ = null; + endpointUuid_ = null; + endpointUuidBuilder_ = null; } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public context.ContextOuterClass.Uuid.Builder getServiceUuidBuilder() { + public context.ContextOuterClass.Uuid.Builder getEndpointUuidBuilder() { onChanged(); - return getServiceUuidFieldBuilder().getBuilder(); + return getEndpointUuidFieldBuilder().getBuilder(); } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { - if (serviceUuidBuilder_ != null) { - return serviceUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { + if (endpointUuidBuilder_ != null) { + return endpointUuidBuilder_.getMessageOrBuilder(); } else { - return serviceUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + return endpointUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; } } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ private com.google.protobuf.SingleFieldBuilderV3< context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getServiceUuidFieldBuilder() { - if (serviceUuidBuilder_ == null) { - serviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + getEndpointUuidFieldBuilder() { + if (endpointUuidBuilder_ == null) { + endpointUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getServiceUuid(), + getEndpointUuid(), getParentForChildren(), isClean()); - serviceUuid_ = null; + endpointUuid_ = null; } - return serviceUuidBuilder_; + return endpointUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -22004,177 +47286,143 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceId) + // @@protoc_insertion_point(builder_scope:context.EndPointId) } - // @@protoc_insertion_point(class_scope:context.ServiceId) - private static final context.ContextOuterClass.ServiceId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.EndPointId) + private static final context.ContextOuterClass.EndPointId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.EndPointId(); } - public static context.ContextOuterClass.ServiceId getDefaultInstance() { + public static context.ContextOuterClass.EndPointId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceId parsePartialFrom( + public EndPointId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceId(input, extensionRegistry); + return new EndPointId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { return DEFAULT_INSTANCE; - } - - } - - public interface ServiceOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Service) - com.google.protobuf.MessageOrBuilder { - - /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. - */ - boolean hasServiceId(); - /** - * .context.ServiceId service_id = 1; - * @return The serviceId. - */ - context.ContextOuterClass.ServiceId getServiceId(); - /** - * .context.ServiceId service_id = 1; - */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); - - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. - */ - int getServiceTypeValue(); - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. - */ - context.ContextOuterClass.ServiceTypeEnum getServiceType(); + } + + } + + public interface EndPointOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.EndPoint) + com.google.protobuf.MessageOrBuilder { /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - java.util.List - getServiceEndpointIdsList(); - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - context.ContextOuterClass.EndPointId getServiceEndpointIds(int index); - /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - int getServiceEndpointIdsCount(); + boolean hasEndpointId(); /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - java.util.List - getServiceEndpointIdsOrBuilderList(); + context.ContextOuterClass.EndPointId getEndpointId(); /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * .context.EndPointId endpoint_id = 1; */ - context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index); + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * repeated .context.Constraint service_constraints = 4; - */ - java.util.List - getServiceConstraintsList(); - /** - * repeated .context.Constraint service_constraints = 4; + * string endpoint_type = 2; + * @return The endpointType. */ - context.ContextOuterClass.Constraint getServiceConstraints(int index); + java.lang.String getEndpointType(); /** - * repeated .context.Constraint service_constraints = 4; + * string endpoint_type = 2; + * @return The bytes for endpointType. */ - int getServiceConstraintsCount(); + com.google.protobuf.ByteString + getEndpointTypeBytes(); + /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ - java.util.List - getServiceConstraintsOrBuilderList(); + java.util.List getKpiSampleTypesList(); /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ - context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index); - + int getKpiSampleTypesCount(); /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ - boolean hasServiceStatus(); + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index); /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ - context.ContextOuterClass.ServiceStatus getServiceStatus(); + java.util.List + getKpiSampleTypesValueList(); /** - * .context.ServiceStatus service_status = 5; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ - context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder(); + int getKpiSampleTypesValue(int index); /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. */ - boolean hasServiceConfig(); + boolean hasEndpointLocation(); /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ - context.ContextOuterClass.ServiceConfig getServiceConfig(); + context.ContextOuterClass.Location getEndpointLocation(); /** - * .context.ServiceConfig service_config = 6; + * .context.Location endpoint_location = 4; */ - context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder(); } /** - * Protobuf type {@code context.Service} + * Protobuf type {@code context.EndPoint} */ - public static final class Service extends + public static final class EndPoint extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Service) - ServiceOrBuilder { + // @@protoc_insertion_point(message_implements:context.EndPoint) + EndPointOrBuilder { private static final long serialVersionUID = 0L; - // Use Service.newBuilder() to construct. - private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use EndPoint.newBuilder() to construct. + private EndPoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Service() { - serviceType_ = 0; - serviceEndpointIds_ = java.util.Collections.emptyList(); - serviceConstraints_ = java.util.Collections.emptyList(); + private EndPoint() { + endpointType_ = ""; + kpiSampleTypes_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Service(); + return new EndPoint(); } @java.lang.Override @@ -22182,7 +47430,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Service( + private EndPoint( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -22202,64 +47450,56 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (serviceId_ != null) { - subBuilder = serviceId_.toBuilder(); + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); } - serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceId_); - serviceId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); } break; } - case 16: { - int rawValue = input.readEnum(); + case 18: { + java.lang.String s = input.readStringRequireUtf8(); - serviceType_ = rawValue; + endpointType_ = s; break; } - case 26: { + case 24: { + int rawValue = input.readEnum(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = new java.util.ArrayList(); + kpiSampleTypes_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - serviceEndpointIds_.add( - input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - serviceConstraints_.add( - input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + kpiSampleTypes_.add(rawValue); break; } - case 42: { - context.ContextOuterClass.ServiceStatus.Builder subBuilder = null; - if (serviceStatus_ != null) { - subBuilder = serviceStatus_.toBuilder(); - } - serviceStatus_ = input.readMessage(context.ContextOuterClass.ServiceStatus.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(serviceStatus_); - serviceStatus_ = subBuilder.buildPartial(); + case 26: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiSampleTypes_.add(rawValue); } - + input.popLimit(oldLimit); break; } - case 50: { - context.ContextOuterClass.ServiceConfig.Builder subBuilder = null; - if (serviceConfig_ != null) { - subBuilder = serviceConfig_.toBuilder(); + case 34: { + context.ContextOuterClass.Location.Builder subBuilder = null; + if (endpointLocation_ != null) { + subBuilder = endpointLocation_.toBuilder(); } - serviceConfig_ = input.readMessage(context.ContextOuterClass.ServiceConfig.parser(), extensionRegistry); + endpointLocation_ = input.readMessage(context.ContextOuterClass.Location.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceConfig_); - serviceConfig_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointLocation_); + endpointLocation_ = subBuilder.buildPartial(); } break; @@ -22280,10 +47520,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -22291,192 +47528,163 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); } - public static final int SERVICE_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ServiceId serviceId_; + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ @java.lang.Override - public boolean hasServiceId() { - return serviceId_ != null; + public boolean hasEndpointId() { + return endpointId_ != null; } /** - * .context.ServiceId service_id = 1; - * @return The serviceId. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceId() { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - return getServiceId(); - } - - public static final int SERVICE_TYPE_FIELD_NUMBER = 2; - private int serviceType_; - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. - */ - @java.lang.Override public int getServiceTypeValue() { - return serviceType_; - } - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. - */ - @java.lang.Override public context.ContextOuterClass.ServiceTypeEnum getServiceType() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); - return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); } - public static final int SERVICE_ENDPOINT_IDS_FIELD_NUMBER = 3; - private java.util.List serviceEndpointIds_; - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public java.util.List getServiceEndpointIdsList() { - return serviceEndpointIds_; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public java.util.List - getServiceEndpointIdsOrBuilderList() { - return serviceEndpointIds_; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public int getServiceEndpointIdsCount() { - return serviceEndpointIds_.size(); - } + public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object endpointType_; /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The endpointType. */ @java.lang.Override - public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { - return serviceEndpointIds_.get(index); + public java.lang.String getEndpointType() { + java.lang.Object ref = endpointType_; + 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(); + endpointType_ = s; + return s; + } } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The bytes for endpointType. */ @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index) { - return serviceEndpointIds_.get(index); + public com.google.protobuf.ByteString + getEndpointTypeBytes() { + java.lang.Object ref = endpointType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpointType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int SERVICE_CONSTRAINTS_FIELD_NUMBER = 4; - private java.util.List serviceConstraints_; - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public java.util.List getServiceConstraintsList() { - return serviceConstraints_; - } - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public java.util.List - getServiceConstraintsOrBuilderList() { - return serviceConstraints_; - } - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public int getServiceConstraintsCount() { - return serviceConstraints_.size(); - } + public static final int KPI_SAMPLE_TYPES_FIELD_NUMBER = 3; + private java.util.List kpiSampleTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType> kpiSampleTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>() { + public kpi_sample_types.KpiSampleTypes.KpiSampleType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(from); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + }; /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.Constraint getServiceConstraints(int index) { - return serviceConstraints_.get(index); + public java.util.List getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); } /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index) { - return serviceConstraints_.get(index); + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); } - - public static final int SERVICE_STATUS_FIELD_NUMBER = 5; - private context.ContextOuterClass.ServiceStatus serviceStatus_; /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ @java.lang.Override - public boolean hasServiceStatus() { - return serviceStatus_ != null; + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); } /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.ServiceStatus getServiceStatus() { - return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + public java.util.List + getKpiSampleTypesValueList() { + return kpiSampleTypes_; } /** - * .context.ServiceStatus service_status = 5; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ @java.lang.Override - public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { - return getServiceStatus(); + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); } + private int kpiSampleTypesMemoizedSerializedSize; - public static final int SERVICE_CONFIG_FIELD_NUMBER = 6; - private context.ContextOuterClass.ServiceConfig serviceConfig_; + public static final int ENDPOINT_LOCATION_FIELD_NUMBER = 4; + private context.ContextOuterClass.Location endpointLocation_; /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. */ @java.lang.Override - public boolean hasServiceConfig() { - return serviceConfig_ != null; + public boolean hasEndpointLocation() { + return endpointLocation_ != null; } /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ @java.lang.Override - public context.ContextOuterClass.ServiceConfig getServiceConfig() { - return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + public context.ContextOuterClass.Location getEndpointLocation() { + return endpointLocation_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } /** - * .context.ServiceConfig service_config = 6; + * .context.Location endpoint_location = 4; */ @java.lang.Override - public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { - return getServiceConfig(); + public context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder() { + return getEndpointLocation(); } private byte memoizedIsInitialized = -1; @@ -22493,23 +47701,22 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (serviceId_ != null) { - output.writeMessage(1, getServiceId()); - } - if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { - output.writeEnum(2, serviceType_); + getSerializedSize(); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); } - for (int i = 0; i < serviceEndpointIds_.size(); i++) { - output.writeMessage(3, serviceEndpointIds_.get(i)); + if (!getEndpointTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointType_); } - for (int i = 0; i < serviceConstraints_.size(); i++) { - output.writeMessage(4, serviceConstraints_.get(i)); + if (getKpiSampleTypesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(kpiSampleTypesMemoizedSerializedSize); } - if (serviceStatus_ != null) { - output.writeMessage(5, getServiceStatus()); + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + output.writeEnumNoTag(kpiSampleTypes_.get(i)); } - if (serviceConfig_ != null) { - output.writeMessage(6, getServiceConfig()); + if (endpointLocation_ != null) { + output.writeMessage(4, getEndpointLocation()); } unknownFields.writeTo(output); } @@ -22520,29 +47727,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (serviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getServiceId()); - } - if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, serviceType_); - } - for (int i = 0; i < serviceEndpointIds_.size(); i++) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, serviceEndpointIds_.get(i)); + .computeMessageSize(1, getEndpointId()); } - for (int i = 0; i < serviceConstraints_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, serviceConstraints_.get(i)); + if (!getEndpointTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointType_); } - if (serviceStatus_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getServiceStatus()); + { + int dataSize = 0; + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(kpiSampleTypes_.get(i)); + } + size += dataSize; + if (!getKpiSampleTypesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }kpiSampleTypesMemoizedSerializedSize = dataSize; } - if (serviceConfig_ != null) { + if (endpointLocation_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getServiceConfig()); + .computeMessageSize(4, getEndpointLocation()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -22554,30 +47760,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Service)) { + if (!(obj instanceof context.ContextOuterClass.EndPoint)) { return super.equals(obj); } - context.ContextOuterClass.Service other = (context.ContextOuterClass.Service) obj; + context.ContextOuterClass.EndPoint other = (context.ContextOuterClass.EndPoint) obj; - if (hasServiceId() != other.hasServiceId()) return false; - if (hasServiceId()) { - if (!getServiceId() - .equals(other.getServiceId())) return false; - } - if (serviceType_ != other.serviceType_) return false; - if (!getServiceEndpointIdsList() - .equals(other.getServiceEndpointIdsList())) return false; - if (!getServiceConstraintsList() - .equals(other.getServiceConstraintsList())) return false; - if (hasServiceStatus() != other.hasServiceStatus()) return false; - if (hasServiceStatus()) { - if (!getServiceStatus() - .equals(other.getServiceStatus())) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; } - if (hasServiceConfig() != other.hasServiceConfig()) return false; - if (hasServiceConfig()) { - if (!getServiceConfig() - .equals(other.getServiceConfig())) return false; + if (!getEndpointType() + .equals(other.getEndpointType())) return false; + if (!kpiSampleTypes_.equals(other.kpiSampleTypes_)) return false; + if (hasEndpointLocation() != other.hasEndpointLocation()) return false; + if (hasEndpointLocation()) { + if (!getEndpointLocation() + .equals(other.getEndpointLocation())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -22590,96 +47789,88 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasServiceId()) { - hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getServiceId().hashCode(); - } - hash = (37 * hash) + SERVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + serviceType_; - if (getServiceEndpointIdsCount() > 0) { - hash = (37 * hash) + SERVICE_ENDPOINT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceEndpointIdsList().hashCode(); - } - if (getServiceConstraintsCount() > 0) { - hash = (37 * hash) + SERVICE_CONSTRAINTS_FIELD_NUMBER; - hash = (53 * hash) + getServiceConstraintsList().hashCode(); + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); } - if (hasServiceStatus()) { - hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + getServiceStatus().hashCode(); + hash = (37 * hash) + ENDPOINT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEndpointType().hashCode(); + if (getKpiSampleTypesCount() > 0) { + hash = (37 * hash) + KPI_SAMPLE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleTypes_.hashCode(); } - if (hasServiceConfig()) { - hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getServiceConfig().hashCode(); + if (hasEndpointLocation()) { + hash = (37 * hash) + ENDPOINT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndpointLocation().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom(byte[] data) + public static context.ContextOuterClass.EndPoint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPoint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint 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 context.ContextOuterClass.Service parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPoint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseDelimitedFrom( + public static context.ContextOuterClass.EndPoint 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 context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -22692,7 +47883,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Service prototype) { + public static Builder newBuilder(context.ContextOuterClass.EndPoint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -22708,76 +47899,58 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Service} + * Protobuf type {@code context.EndPoint} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Service) - context.ContextOuterClass.ServiceOrBuilder { + // @@protoc_insertion_point(builder_implements:context.EndPoint) + context.ContextOuterClass.EndPointOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); } - // Construct using context.ContextOuterClass.Service.newBuilder() + // Construct using context.ContextOuterClass.EndPoint.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getServiceEndpointIdsFieldBuilder(); - getServiceConstraintsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (serviceIdBuilder_ == null) { - serviceId_ = null; - } else { - serviceId_ = null; - serviceIdBuilder_ = null; - } - serviceType_ = 0; - - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - serviceEndpointIdsBuilder_.clear(); - } - if (serviceConstraintsBuilder_ == null) { - serviceConstraints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - serviceConstraintsBuilder_.clear(); + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } - if (serviceStatusBuilder_ == null) { - serviceStatus_ = null; + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (endpointIdBuilder_ == null) { + endpointId_ = null; } else { - serviceStatus_ = null; - serviceStatusBuilder_ = null; + endpointId_ = null; + endpointIdBuilder_ = null; } - if (serviceConfigBuilder_ == null) { - serviceConfig_ = null; + endpointType_ = ""; + + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (endpointLocationBuilder_ == null) { + endpointLocation_ = null; } else { - serviceConfig_ = null; - serviceConfigBuilder_ = null; + endpointLocation_ = null; + endpointLocationBuilder_ = null; } return this; } @@ -22785,17 +47958,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override - public context.ContextOuterClass.Service getDefaultInstanceForType() { - return context.ContextOuterClass.Service.getDefaultInstance(); + public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + return context.ContextOuterClass.EndPoint.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Service build() { - context.ContextOuterClass.Service result = buildPartial(); + public context.ContextOuterClass.EndPoint build() { + context.ContextOuterClass.EndPoint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -22803,42 +47976,24 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Service buildPartial() { - context.ContextOuterClass.Service result = new context.ContextOuterClass.Service(this); + public context.ContextOuterClass.EndPoint buildPartial() { + context.ContextOuterClass.EndPoint result = new context.ContextOuterClass.EndPoint(this); int from_bitField0_ = bitField0_; - if (serviceIdBuilder_ == null) { - result.serviceId_ = serviceId_; - } else { - result.serviceId_ = serviceIdBuilder_.build(); - } - result.serviceType_ = serviceType_; - if (serviceEndpointIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.serviceEndpointIds_ = serviceEndpointIds_; - } else { - result.serviceEndpointIds_ = serviceEndpointIdsBuilder_.build(); - } - if (serviceConstraintsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.serviceConstraints_ = serviceConstraints_; + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; } else { - result.serviceConstraints_ = serviceConstraintsBuilder_.build(); + result.endpointId_ = endpointIdBuilder_.build(); } - if (serviceStatusBuilder_ == null) { - result.serviceStatus_ = serviceStatus_; - } else { - result.serviceStatus_ = serviceStatusBuilder_.build(); + result.endpointType_ = endpointType_; + if (((bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); + bitField0_ = (bitField0_ & ~0x00000001); } - if (serviceConfigBuilder_ == null) { - result.serviceConfig_ = serviceConfig_; + result.kpiSampleTypes_ = kpiSampleTypes_; + if (endpointLocationBuilder_ == null) { + result.endpointLocation_ = endpointLocation_; } else { - result.serviceConfig_ = serviceConfigBuilder_.build(); + result.endpointLocation_ = endpointLocationBuilder_.build(); } onBuilt(); return result; @@ -22878,79 +48033,35 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Service) { - return mergeFrom((context.ContextOuterClass.Service)other); + if (other instanceof context.ContextOuterClass.EndPoint) { + return mergeFrom((context.ContextOuterClass.EndPoint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Service other) { - if (other == context.ContextOuterClass.Service.getDefaultInstance()) return this; - if (other.hasServiceId()) { - mergeServiceId(other.getServiceId()); - } - if (other.serviceType_ != 0) { - setServiceTypeValue(other.getServiceTypeValue()); + public Builder mergeFrom(context.ContextOuterClass.EndPoint other) { + if (other == context.ContextOuterClass.EndPoint.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); } - if (serviceEndpointIdsBuilder_ == null) { - if (!other.serviceEndpointIds_.isEmpty()) { - if (serviceEndpointIds_.isEmpty()) { - serviceEndpointIds_ = other.serviceEndpointIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.addAll(other.serviceEndpointIds_); - } - onChanged(); - } - } else { - if (!other.serviceEndpointIds_.isEmpty()) { - if (serviceEndpointIdsBuilder_.isEmpty()) { - serviceEndpointIdsBuilder_.dispose(); - serviceEndpointIdsBuilder_ = null; - serviceEndpointIds_ = other.serviceEndpointIds_; - bitField0_ = (bitField0_ & ~0x00000001); - serviceEndpointIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceEndpointIdsFieldBuilder() : null; - } else { - serviceEndpointIdsBuilder_.addAllMessages(other.serviceEndpointIds_); - } - } + if (!other.getEndpointType().isEmpty()) { + endpointType_ = other.endpointType_; + onChanged(); } - if (serviceConstraintsBuilder_ == null) { - if (!other.serviceConstraints_.isEmpty()) { - if (serviceConstraints_.isEmpty()) { - serviceConstraints_ = other.serviceConstraints_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.addAll(other.serviceConstraints_); - } - onChanged(); - } - } else { - if (!other.serviceConstraints_.isEmpty()) { - if (serviceConstraintsBuilder_.isEmpty()) { - serviceConstraintsBuilder_.dispose(); - serviceConstraintsBuilder_ = null; - serviceConstraints_ = other.serviceConstraints_; - bitField0_ = (bitField0_ & ~0x00000002); - serviceConstraintsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceConstraintsFieldBuilder() : null; - } else { - serviceConstraintsBuilder_.addAllMessages(other.serviceConstraints_); - } + if (!other.kpiSampleTypes_.isEmpty()) { + if (kpiSampleTypes_.isEmpty()) { + kpiSampleTypes_ = other.kpiSampleTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.addAll(other.kpiSampleTypes_); } + onChanged(); } - if (other.hasServiceStatus()) { - mergeServiceStatus(other.getServiceStatus()); - } - if (other.hasServiceConfig()) { - mergeServiceConfig(other.getServiceConfig()); + if (other.hasEndpointLocation()) { + mergeEndpointLocation(other.getEndpointLocation()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -22967,11 +48078,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Service parsedMessage = null; + context.ContextOuterClass.EndPoint parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Service) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.EndPoint) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -22982,895 +48093,1176 @@ public final class ContextOuterClass { } private int bitField0_; - private context.ContextOuterClass.ServiceId serviceId_; + private context.ContextOuterClass.EndPointId endpointId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - public boolean hasServiceId() { - return serviceIdBuilder_ != null || serviceId_ != null; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ServiceId service_id = 1; - * @return The serviceId. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public context.ContextOuterClass.ServiceId getServiceId() { - if (serviceIdBuilder_ == null) { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } else { - return serviceIdBuilder_.getMessage(); + return endpointIdBuilder_.getMessage(); } } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - serviceId_ = value; + endpointId_ = value; onChanged(); } else { - serviceIdBuilder_.setMessage(value); + endpointIdBuilder_.setMessage(value); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdBuilder_ == null) { - serviceId_ = builderForValue.build(); + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); onChanged(); } else { - serviceIdBuilder_.setMessage(builderForValue.build()); + endpointIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (serviceId_ != null) { - serviceId_ = - context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); } else { - serviceId_ = value; + endpointId_ = value; } onChanged(); } else { - serviceIdBuilder_.mergeFrom(value); + endpointIdBuilder_.mergeFrom(value); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder clearServiceId() { - if (serviceIdBuilder_ == null) { - serviceId_ = null; + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; onChanged(); } else { - serviceId_ = null; - serviceIdBuilder_ = null; + endpointId_ = null; + endpointIdBuilder_ = null; } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { onChanged(); - return getServiceIdFieldBuilder().getBuilder(); + return getEndpointIdFieldBuilder().getBuilder(); } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - if (serviceIdBuilder_ != null) { - return serviceIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); } else { - return serviceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdFieldBuilder() { - if (serviceIdBuilder_ == null) { - serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getServiceId(), + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), getParentForChildren(), isClean()); - serviceId_ = null; + endpointId_ = null; } - return serviceIdBuilder_; + return endpointIdBuilder_; } - private int serviceType_ = 0; + private java.lang.Object endpointType_ = ""; /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. + * string endpoint_type = 2; + * @return The endpointType. */ - @java.lang.Override public int getServiceTypeValue() { - return serviceType_; + public java.lang.String getEndpointType() { + java.lang.Object ref = endpointType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointType_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** - * .context.ServiceTypeEnum service_type = 2; - * @param value The enum numeric value on the wire for serviceType to set. - * @return This builder for chaining. + * string endpoint_type = 2; + * @return The bytes for endpointType. */ - public Builder setServiceTypeValue(int value) { - - serviceType_ = value; - onChanged(); - return this; + public com.google.protobuf.ByteString + getEndpointTypeBytes() { + java.lang.Object ref = endpointType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpointType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. + * string endpoint_type = 2; + * @param value The endpointType to set. + * @return This builder for chaining. */ - @java.lang.Override - public context.ContextOuterClass.ServiceTypeEnum getServiceType() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); - return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + public Builder setEndpointType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endpointType_ = value; + onChanged(); + return this; } /** - * .context.ServiceTypeEnum service_type = 2; - * @param value The serviceType to set. + * string endpoint_type = 2; * @return This builder for chaining. */ - public Builder setServiceType(context.ContextOuterClass.ServiceTypeEnum value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder clearEndpointType() { - serviceType_ = value.getNumber(); + endpointType_ = getDefaultInstance().getEndpointType(); onChanged(); return this; } /** - * .context.ServiceTypeEnum service_type = 2; + * string endpoint_type = 2; + * @param value The bytes for endpointType to set. * @return This builder for chaining. */ - public Builder clearServiceType() { + public Builder setEndpointTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); - serviceType_ = 0; + endpointType_ = value; onChanged(); return this; } - private java.util.List serviceEndpointIds_ = + private java.util.List kpiSampleTypes_ = java.util.Collections.emptyList(); - private void ensureServiceEndpointIdsIsMutable() { + private void ensureKpiSampleTypesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = new java.util.ArrayList(serviceEndpointIds_); + kpiSampleTypes_ = new java.util.ArrayList(kpiSampleTypes_); bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> serviceEndpointIdsBuilder_; - - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public java.util.List getServiceEndpointIdsList() { - if (serviceEndpointIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceEndpointIds_); - } else { - return serviceEndpointIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public int getServiceEndpointIdsCount() { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.size(); - } else { - return serviceEndpointIdsBuilder_.getCount(); - } - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.get(index); - } else { - return serviceEndpointIdsBuilder_.getMessage(index); } } /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder setServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.set(index, value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder setServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.set(index, builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ - public Builder addServiceEndpointIds(context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder addServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(index, value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(index, value); - } - return this; + public java.util.List getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ - public Builder addServiceEndpointIds( - context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(builderForValue.build()); - } - return this; + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ - public Builder addServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index to set the value at. + * @param value The kpiSampleTypes to set. + * @return This builder for chaining. */ - public Builder addAllServiceEndpointIds( - java.lang.Iterable values) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceEndpointIds_); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addAllMessages(values); + public Builder setKpiSampleTypes( + int index, kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value.getNumber()); + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param value The kpiSampleTypes to add. + * @return This builder for chaining. */ - public Builder clearServiceEndpointIds() { - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - serviceEndpointIdsBuilder_.clear(); + public Builder addKpiSampleTypes(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value.getNumber()); + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param values The kpiSampleTypes to add. + * @return This builder for chaining. */ - public Builder removeServiceEndpointIds(int index) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.remove(index); - onChanged(); - } else { - serviceEndpointIdsBuilder_.remove(index); + public Builder addAllKpiSampleTypes( + java.lang.Iterable values) { + ensureKpiSampleTypesIsMutable(); + for (kpi_sample_types.KpiSampleTypes.KpiSampleType value : values) { + kpiSampleTypes_.add(value.getNumber()); } + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public context.ContextOuterClass.EndPointId.Builder getServiceEndpointIdsBuilder( - int index) { - return getServiceEndpointIdsFieldBuilder().getBuilder(index); + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return This builder for chaining. + */ + public Builder clearKpiSampleTypes() { + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ - public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index) { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.get(index); } else { - return serviceEndpointIdsBuilder_.getMessageOrBuilder(index); - } + public java.util.List + getKpiSampleTypesValueList() { + return java.util.Collections.unmodifiableList(kpiSampleTypes_); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ - public java.util.List - getServiceEndpointIdsOrBuilderList() { - if (serviceEndpointIdsBuilder_ != null) { - return serviceEndpointIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceEndpointIds_); - } + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + * @return This builder for chaining. */ - public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder() { - return getServiceEndpointIdsFieldBuilder().addBuilder( - context.ContextOuterClass.EndPointId.getDefaultInstance()); + public Builder setKpiSampleTypesValue( + int index, int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param value The enum numeric value on the wire for kpiSampleTypes to add. + * @return This builder for chaining. */ - public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder( - int index) { - return getServiceEndpointIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + public Builder addKpiSampleTypesValue(int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param values The enum numeric values on the wire for kpiSampleTypes to add. + * @return This builder for chaining. */ - public java.util.List - getServiceEndpointIdsBuilderList() { - return getServiceEndpointIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getServiceEndpointIdsFieldBuilder() { - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - serviceEndpointIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - serviceEndpointIds_ = null; + public Builder addAllKpiSampleTypesValue( + java.lang.Iterable values) { + ensureKpiSampleTypesIsMutable(); + for (int value : values) { + kpiSampleTypes_.add(value); } - return serviceEndpointIdsBuilder_; + onChanged(); + return this; } - private java.util.List serviceConstraints_ = - java.util.Collections.emptyList(); - private void ensureServiceConstraintsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = new java.util.ArrayList(serviceConstraints_); - bitField0_ |= 0x00000002; - } + private context.ContextOuterClass.Location endpointLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> endpointLocationBuilder_; + /** + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. + */ + public boolean hasEndpointLocation() { + return endpointLocationBuilder_ != null || endpointLocation_ != null; } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> serviceConstraintsBuilder_; - /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ - public java.util.List getServiceConstraintsList() { - if (serviceConstraintsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceConstraints_); + public context.ContextOuterClass.Location getEndpointLocation() { + if (endpointLocationBuilder_ == null) { + return endpointLocation_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } else { - return serviceConstraintsBuilder_.getMessageList(); + return endpointLocationBuilder_.getMessage(); } } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public int getServiceConstraintsCount() { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.size(); + public Builder setEndpointLocation(context.ContextOuterClass.Location value) { + if (endpointLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointLocation_ = value; + onChanged(); } else { - return serviceConstraintsBuilder_.getCount(); + endpointLocationBuilder_.setMessage(value); } + + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public context.ContextOuterClass.Constraint getServiceConstraints(int index) { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.get(index); + public Builder setEndpointLocation( + context.ContextOuterClass.Location.Builder builderForValue) { + if (endpointLocationBuilder_ == null) { + endpointLocation_ = builderForValue.build(); + onChanged(); } else { - return serviceConstraintsBuilder_.getMessage(index); + endpointLocationBuilder_.setMessage(builderForValue.build()); } + + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder setServiceConstraints( - int index, context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEndpointLocation(context.ContextOuterClass.Location value) { + if (endpointLocationBuilder_ == null) { + if (endpointLocation_ != null) { + endpointLocation_ = + context.ContextOuterClass.Location.newBuilder(endpointLocation_).mergeFrom(value).buildPartial(); + } else { + endpointLocation_ = value; } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.set(index, value); onChanged(); } else { - serviceConstraintsBuilder_.setMessage(index, value); + endpointLocationBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder setServiceConstraints( - int index, context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.set(index, builderForValue.build()); + public Builder clearEndpointLocation() { + if (endpointLocationBuilder_ == null) { + endpointLocation_ = null; onChanged(); } else { - serviceConstraintsBuilder_.setMessage(index, builderForValue.build()); + endpointLocation_ = null; + endpointLocationBuilder_ = null; } + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder addServiceConstraints(context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(value); - onChanged(); + public context.ContextOuterClass.Location.Builder getEndpointLocationBuilder() { + + onChanged(); + return getEndpointLocationFieldBuilder().getBuilder(); + } + /** + * .context.Location endpoint_location = 4; + */ + public context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder() { + if (endpointLocationBuilder_ != null) { + return endpointLocationBuilder_.getMessageOrBuilder(); } else { - serviceConstraintsBuilder_.addMessage(value); + return endpointLocation_ == null ? + context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } - return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - int index, context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(index, value); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(index, value); - } - return this; + /** + * .context.Location endpoint_location = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> + getEndpointLocationFieldBuilder() { + if (endpointLocationBuilder_ == null) { + endpointLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder>( + getEndpointLocation(), + getParentForChildren(), + isClean()); + endpointLocation_ = null; + } + return endpointLocationBuilder_; + } + @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:context.EndPoint) + } + + // @@protoc_insertion_point(class_scope:context.EndPoint) + private static final context.ContextOuterClass.EndPoint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.EndPoint(); + } + + public static context.ContextOuterClass.EndPoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EndPoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EndPoint(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 context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigRule_CustomOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule_Custom) + com.google.protobuf.MessageOrBuilder { + + /** + * string resource_key = 1; + * @return The resourceKey. + */ + java.lang.String getResourceKey(); + /** + * string resource_key = 1; + * @return The bytes for resourceKey. + */ + com.google.protobuf.ByteString + getResourceKeyBytes(); + + /** + * string resource_value = 2; + * @return The resourceValue. + */ + java.lang.String getResourceValue(); + /** + * string resource_value = 2; + * @return The bytes for resourceValue. + */ + com.google.protobuf.ByteString + getResourceValueBytes(); + } + /** + * Protobuf type {@code context.ConfigRule_Custom} + */ + public static final class ConfigRule_Custom extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ConfigRule_Custom) + ConfigRule_CustomOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigRule_Custom.newBuilder() to construct. + private ConfigRule_Custom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigRule_Custom() { + resourceKey_ = ""; + resourceValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConfigRule_Custom(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigRule_Custom( + 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(); + + resourceKey_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceValue_ = 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 context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule_Custom.class, context.ContextOuterClass.ConfigRule_Custom.Builder.class); + } + + public static final int RESOURCE_KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceKey_; + /** + * string resource_key = 1; + * @return The resourceKey. + */ + @java.lang.Override + public java.lang.String getResourceKey() { + java.lang.Object ref = resourceKey_; + 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(); + resourceKey_ = s; + return s; + } + } + /** + * string resource_key = 1; + * @return The bytes for resourceKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceKeyBytes() { + java.lang.Object ref = resourceKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceValue_; + /** + * string resource_value = 2; + * @return The resourceValue. + */ + @java.lang.Override + public java.lang.String getResourceValue() { + java.lang.Object ref = resourceValue_; + 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(); + resourceValue_ = s; + return s; + } + } + /** + * string resource_value = 2; + * @return The bytes for resourceValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceValueBytes() { + java.lang.Object ref = resourceValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceValue_ = 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 (!getResourceKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceKey_); + } + if (!getResourceValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceKey_); + } + if (!getResourceValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceValue_); + } + 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 context.ContextOuterClass.ConfigRule_Custom)) { + return super.equals(obj); + } + context.ContextOuterClass.ConfigRule_Custom other = (context.ContextOuterClass.ConfigRule_Custom) obj; + + if (!getResourceKey() + .equals(other.getResourceKey())) return false; + if (!getResourceValue() + .equals(other.getResourceValue())) 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) + RESOURCE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getResourceKey().hashCode(); + hash = (37 * hash) + RESOURCE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getResourceValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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 context.ContextOuterClass.ConfigRule_Custom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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 context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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(context.ContextOuterClass.ConfigRule_Custom 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 context.ConfigRule_Custom} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ConfigRule_Custom) + context.ContextOuterClass.ConfigRule_CustomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule_Custom.class, context.ContextOuterClass.ConfigRule_Custom.Builder.class); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(builderForValue.build()); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(builderForValue.build()); - } - return this; + + // Construct using context.ContextOuterClass.ConfigRule_Custom.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - int index, context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addAllServiceConstraints( - java.lang.Iterable values) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceConstraints_); - onChanged(); - } else { - serviceConstraintsBuilder_.addAllMessages(values); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } - return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder clearServiceConstraints() { - if (serviceConstraintsBuilder_ == null) { - serviceConstraints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - serviceConstraintsBuilder_.clear(); - } + @java.lang.Override + public Builder clear() { + super.clear(); + resourceKey_ = ""; + + resourceValue_ = ""; + return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder removeServiceConstraints(int index) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.remove(index); - onChanged(); - } else { - serviceConstraintsBuilder_.remove(index); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder getServiceConstraintsBuilder( - int index) { - return getServiceConstraintsFieldBuilder().getBuilder(index); + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index) { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.get(index); } else { - return serviceConstraintsBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom build() { + context.ContextOuterClass.ConfigRule_Custom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public java.util.List - getServiceConstraintsOrBuilderList() { - if (serviceConstraintsBuilder_ != null) { - return serviceConstraintsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceConstraints_); - } + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom buildPartial() { + context.ContextOuterClass.ConfigRule_Custom result = new context.ContextOuterClass.ConfigRule_Custom(this); + result.resourceKey_ = resourceKey_; + result.resourceValue_ = resourceValue_; + onBuilt(); + return result; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder() { - return getServiceConstraintsFieldBuilder().addBuilder( - context.ContextOuterClass.Constraint.getDefaultInstance()); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder( - int index) { - return getServiceConstraintsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Constraint.getDefaultInstance()); + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public java.util.List - getServiceConstraintsBuilderList() { - return getServiceConstraintsFieldBuilder().getBuilderList(); + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> - getServiceConstraintsFieldBuilder() { - if (serviceConstraintsBuilder_ == null) { - serviceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( - serviceConstraints_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - serviceConstraints_ = null; - } - return serviceConstraintsBuilder_; + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - - private context.ContextOuterClass.ServiceStatus serviceStatus_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> serviceStatusBuilder_; - /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. - */ - public boolean hasServiceStatus() { - return serviceStatusBuilder_ != null || serviceStatus_ != null; + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. - */ - public context.ContextOuterClass.ServiceStatus getServiceStatus() { - if (serviceStatusBuilder_ == null) { - return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + @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 context.ContextOuterClass.ConfigRule_Custom) { + return mergeFrom((context.ContextOuterClass.ConfigRule_Custom)other); } else { - return serviceStatusBuilder_.getMessage(); + super.mergeFrom(other); + return this; } } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder setServiceStatus(context.ContextOuterClass.ServiceStatus value) { - if (serviceStatusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceStatus_ = value; + + public Builder mergeFrom(context.ContextOuterClass.ConfigRule_Custom other) { + if (other == context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance()) return this; + if (!other.getResourceKey().isEmpty()) { + resourceKey_ = other.resourceKey_; onChanged(); - } else { - serviceStatusBuilder_.setMessage(value); } - - return this; - } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder setServiceStatus( - context.ContextOuterClass.ServiceStatus.Builder builderForValue) { - if (serviceStatusBuilder_ == null) { - serviceStatus_ = builderForValue.build(); + if (!other.getResourceValue().isEmpty()) { + resourceValue_ = other.resourceValue_; onChanged(); - } else { - serviceStatusBuilder_.setMessage(builderForValue.build()); } - + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder mergeServiceStatus(context.ContextOuterClass.ServiceStatus value) { - if (serviceStatusBuilder_ == null) { - if (serviceStatus_ != null) { - serviceStatus_ = - context.ContextOuterClass.ServiceStatus.newBuilder(serviceStatus_).mergeFrom(value).buildPartial(); - } else { - serviceStatus_ = value; - } - onChanged(); - } else { - serviceStatusBuilder_.mergeFrom(value); - } - return this; + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder clearServiceStatus() { - if (serviceStatusBuilder_ == null) { - serviceStatus_ = null; - onChanged(); - } else { - serviceStatus_ = null; - serviceStatusBuilder_ = null; - } + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.ConfigRule_Custom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ConfigRule_Custom) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } return this; } + + private java.lang.Object resourceKey_ = ""; /** - * .context.ServiceStatus service_status = 5; - */ - public context.ContextOuterClass.ServiceStatus.Builder getServiceStatusBuilder() { - - onChanged(); - return getServiceStatusFieldBuilder().getBuilder(); - } - /** - * .context.ServiceStatus service_status = 5; + * string resource_key = 1; + * @return The resourceKey. */ - public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { - if (serviceStatusBuilder_ != null) { - return serviceStatusBuilder_.getMessageOrBuilder(); + public java.lang.String getResourceKey() { + java.lang.Object ref = resourceKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceKey_ = s; + return s; } else { - return serviceStatus_ == null ? - context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + return (java.lang.String) ref; } } /** - * .context.ServiceStatus service_status = 5; + * string resource_key = 1; + * @return The bytes for resourceKey. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> - getServiceStatusFieldBuilder() { - if (serviceStatusBuilder_ == null) { - serviceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder>( - getServiceStatus(), - getParentForChildren(), - isClean()); - serviceStatus_ = null; + public com.google.protobuf.ByteString + getResourceKeyBytes() { + java.lang.Object ref = resourceKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - return serviceStatusBuilder_; } - - private context.ContextOuterClass.ServiceConfig serviceConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> serviceConfigBuilder_; /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. + * string resource_key = 1; + * @param value The resourceKey to set. + * @return This builder for chaining. */ - public boolean hasServiceConfig() { - return serviceConfigBuilder_ != null || serviceConfig_ != null; + public Builder setResourceKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceKey_ = value; + onChanged(); + return this; } /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * string resource_key = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceConfig getServiceConfig() { - if (serviceConfigBuilder_ == null) { - return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; - } else { - return serviceConfigBuilder_.getMessage(); - } + public Builder clearResourceKey() { + + resourceKey_ = getDefaultInstance().getResourceKey(); + onChanged(); + return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_key = 1; + * @param value The bytes for resourceKey to set. + * @return This builder for chaining. */ - public Builder setServiceConfig(context.ContextOuterClass.ServiceConfig value) { - if (serviceConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceConfig_ = value; - onChanged(); - } else { - serviceConfigBuilder_.setMessage(value); - } - + public Builder setResourceKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceKey_ = value; + onChanged(); return this; } + + private java.lang.Object resourceValue_ = ""; /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return The resourceValue. */ - public Builder setServiceConfig( - context.ContextOuterClass.ServiceConfig.Builder builderForValue) { - if (serviceConfigBuilder_ == null) { - serviceConfig_ = builderForValue.build(); - onChanged(); + public java.lang.String getResourceValue() { + java.lang.Object ref = resourceValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceValue_ = s; + return s; } else { - serviceConfigBuilder_.setMessage(builderForValue.build()); + return (java.lang.String) ref; } - - return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return The bytes for resourceValue. */ - public Builder mergeServiceConfig(context.ContextOuterClass.ServiceConfig value) { - if (serviceConfigBuilder_ == null) { - if (serviceConfig_ != null) { - serviceConfig_ = - context.ContextOuterClass.ServiceConfig.newBuilder(serviceConfig_).mergeFrom(value).buildPartial(); - } else { - serviceConfig_ = value; - } - onChanged(); + public com.google.protobuf.ByteString + getResourceValueBytes() { + java.lang.Object ref = resourceValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceValue_ = b; + return b; } else { - serviceConfigBuilder_.mergeFrom(value); + return (com.google.protobuf.ByteString) ref; } - - return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @param value The resourceValue to set. + * @return This builder for chaining. */ - public Builder clearServiceConfig() { - if (serviceConfigBuilder_ == null) { - serviceConfig_ = null; - onChanged(); - } else { - serviceConfig_ = null; - serviceConfigBuilder_ = null; - } - + public Builder setResourceValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceValue_ = value; + onChanged(); return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceConfig.Builder getServiceConfigBuilder() { + public Builder clearResourceValue() { + resourceValue_ = getDefaultInstance().getResourceValue(); onChanged(); - return getServiceConfigFieldBuilder().getBuilder(); - } - /** - * .context.ServiceConfig service_config = 6; - */ - public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { - if (serviceConfigBuilder_ != null) { - return serviceConfigBuilder_.getMessageOrBuilder(); - } else { - return serviceConfig_ == null ? - context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; - } + return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @param value The bytes for resourceValue to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> - getServiceConfigFieldBuilder() { - if (serviceConfigBuilder_ == null) { - serviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder>( - getServiceConfig(), - getParentForChildren(), - isClean()); - serviceConfig_ = null; - } - return serviceConfigBuilder_; + public Builder setResourceValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceValue_ = value; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -23885,82 +49277,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Service) + // @@protoc_insertion_point(builder_scope:context.ConfigRule_Custom) } - // @@protoc_insertion_point(class_scope:context.Service) - private static final context.ContextOuterClass.Service DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule_Custom) + private static final context.ContextOuterClass.ConfigRule_Custom DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Service(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule_Custom(); } - public static context.ContextOuterClass.Service getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule_Custom getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Service parsePartialFrom( + public ConfigRule_Custom parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Service(input, extensionRegistry); + return new ConfigRule_Custom(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Service getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule_Custom getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceStatusOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceStatus) + public interface ConfigRule_ACLOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule_ACL) com.google.protobuf.MessageOrBuilder { /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - int getServiceStatusValue(); + boolean hasEndpointId(); /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - context.ContextOuterClass.ServiceStatusEnum getServiceStatus(); + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 1; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + boolean hasRuleSet(); + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + acl.Acl.AclRuleSet getRuleSet(); + /** + * .acl.AclRuleSet rule_set = 2; + */ + acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder(); } /** - * Protobuf type {@code context.ServiceStatus} + * Protobuf type {@code context.ConfigRule_ACL} */ - public static final class ServiceStatus extends + public static final class ConfigRule_ACL extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceStatus) - ServiceStatusOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConfigRule_ACL) + ConfigRule_ACLOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceStatus.newBuilder() to construct. - private ServiceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConfigRule_ACL.newBuilder() to construct. + private ConfigRule_ACL(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceStatus() { - serviceStatus_ = 0; + private ConfigRule_ACL() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceStatus(); + return new ConfigRule_ACL(); } @java.lang.Override @@ -23968,7 +49378,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceStatus( + private ConfigRule_ACL( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -23986,10 +49396,30 @@ public final class ContextOuterClass { case 0: done = true; break; - case 8: { - int rawValue = input.readEnum(); + case 10: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + acl.Acl.AclRuleSet.Builder subBuilder = null; + if (ruleSet_ != null) { + subBuilder = ruleSet_.toBuilder(); + } + ruleSet_ = input.readMessage(acl.Acl.AclRuleSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(ruleSet_); + ruleSet_ = subBuilder.buildPartial(); + } - serviceStatus_ = rawValue; break; } default: { @@ -24013,34 +49443,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + context.ContextOuterClass.ConfigRule_ACL.class, context.ContextOuterClass.ConfigRule_ACL.Builder.class); } - public static final int SERVICE_STATUS_FIELD_NUMBER = 1; - private int serviceStatus_; + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override public int getServiceStatusValue() { - return serviceStatus_; + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - @java.lang.Override public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); - return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int RULE_SET_FIELD_NUMBER = 2; + private acl.Acl.AclRuleSet ruleSet_; + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + @java.lang.Override + public boolean hasRuleSet() { + return ruleSet_ != null; + } + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + @java.lang.Override + public acl.Acl.AclRuleSet getRuleSet() { + return ruleSet_ == null ? acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + @java.lang.Override + public acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder() { + return getRuleSet(); } private byte memoizedIsInitialized = -1; @@ -24057,8 +49520,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { - output.writeEnum(1, serviceStatus_); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); + } + if (ruleSet_ != null) { + output.writeMessage(2, getRuleSet()); } unknownFields.writeTo(output); } @@ -24069,9 +49535,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, serviceStatus_); + .computeMessageSize(1, getEndpointId()); + } + if (ruleSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getRuleSet()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -24083,12 +49553,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceStatus)) { + if (!(obj instanceof context.ContextOuterClass.ConfigRule_ACL)) { return super.equals(obj); } - context.ContextOuterClass.ServiceStatus other = (context.ContextOuterClass.ServiceStatus) obj; + context.ContextOuterClass.ConfigRule_ACL other = (context.ContextOuterClass.ConfigRule_ACL) obj; - if (serviceStatus_ != other.serviceStatus_) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasRuleSet() != other.hasRuleSet()) return false; + if (hasRuleSet()) { + if (!getRuleSet() + .equals(other.getRuleSet())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24100,76 +49579,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + serviceStatus_; + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasRuleSet()) { + hash = (37 * hash) + RULE_SET_FIELD_NUMBER; + hash = (53 * hash) + getRuleSet().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom(byte[] data) + public static context.ContextOuterClass.ConfigRule_ACL parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule_ACL parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL 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 context.ContextOuterClass.ServiceStatus parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule_ACL parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseDelimitedFrom( + public static context.ContextOuterClass.ConfigRule_ACL 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 context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -24182,7 +49667,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceStatus prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConfigRule_ACL prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -24198,26 +49683,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceStatus} + * Protobuf type {@code context.ConfigRule_ACL} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceStatus) - context.ContextOuterClass.ServiceStatusOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConfigRule_ACL) + context.ContextOuterClass.ConfigRule_ACLOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + context.ContextOuterClass.ConfigRule_ACL.class, context.ContextOuterClass.ConfigRule_ACL.Builder.class); } - // Construct using context.ContextOuterClass.ServiceStatus.newBuilder() + // Construct using context.ContextOuterClass.ConfigRule_ACL.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -24235,25 +49720,35 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - serviceStatus_ = 0; - + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceStatus.getDefaultInstance(); + public context.ContextOuterClass.ConfigRule_ACL getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceStatus build() { - context.ContextOuterClass.ServiceStatus result = buildPartial(); + public context.ContextOuterClass.ConfigRule_ACL build() { + context.ContextOuterClass.ConfigRule_ACL result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -24261,9 +49756,18 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceStatus buildPartial() { - context.ContextOuterClass.ServiceStatus result = new context.ContextOuterClass.ServiceStatus(this); - result.serviceStatus_ = serviceStatus_; + public context.ContextOuterClass.ConfigRule_ACL buildPartial() { + context.ContextOuterClass.ConfigRule_ACL result = new context.ContextOuterClass.ConfigRule_ACL(this); + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (ruleSetBuilder_ == null) { + result.ruleSet_ = ruleSet_; + } else { + result.ruleSet_ = ruleSetBuilder_.build(); + } onBuilt(); return result; } @@ -24302,18 +49806,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceStatus) { - return mergeFrom((context.ContextOuterClass.ServiceStatus)other); + if (other instanceof context.ContextOuterClass.ConfigRule_ACL) { + return mergeFrom((context.ContextOuterClass.ConfigRule_ACL)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceStatus other) { - if (other == context.ContextOuterClass.ServiceStatus.getDefaultInstance()) return this; - if (other.serviceStatus_ != 0) { - setServiceStatusValue(other.getServiceStatusValue()); + public Builder mergeFrom(context.ContextOuterClass.ConfigRule_ACL other) { + if (other == context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasRuleSet()) { + mergeRuleSet(other.getRuleSet()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -24330,11 +49837,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceStatus parsedMessage = null; + context.ContextOuterClass.ConfigRule_ACL parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceStatus) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConfigRule_ACL) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -24344,58 +49851,242 @@ public final class ContextOuterClass { return this; } - private int serviceStatus_ = 0; + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override public int getServiceStatusValue() { - return serviceStatus_; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ServiceStatusEnum service_status = 1; - * @param value The enum numeric value on the wire for serviceStatus to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public Builder setServiceStatusValue(int value) { - - serviceStatus_ = value; - onChanged(); + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; */ - @java.lang.Override - public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); - return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @param value The serviceStatus to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceStatus(context.ContextOuterClass.ServiceStatusEnum value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; } + + return this; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { - serviceStatus_ = value.getNumber(); onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private acl.Acl.AclRuleSet ruleSet_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder> ruleSetBuilder_; + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + public boolean hasRuleSet() { + return ruleSetBuilder_ != null || ruleSet_ != null; + } + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + public acl.Acl.AclRuleSet getRuleSet() { + if (ruleSetBuilder_ == null) { + return ruleSet_ == null ? acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } else { + return ruleSetBuilder_.getMessage(); + } + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder setRuleSet(acl.Acl.AclRuleSet value) { + if (ruleSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleSet_ = value; + onChanged(); + } else { + ruleSetBuilder_.setMessage(value); + } + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return This builder for chaining. + * .acl.AclRuleSet rule_set = 2; */ - public Builder clearServiceStatus() { + public Builder setRuleSet( + acl.Acl.AclRuleSet.Builder builderForValue) { + if (ruleSetBuilder_ == null) { + ruleSet_ = builderForValue.build(); + onChanged(); + } else { + ruleSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder mergeRuleSet(acl.Acl.AclRuleSet value) { + if (ruleSetBuilder_ == null) { + if (ruleSet_ != null) { + ruleSet_ = + acl.Acl.AclRuleSet.newBuilder(ruleSet_).mergeFrom(value).buildPartial(); + } else { + ruleSet_ = value; + } + onChanged(); + } else { + ruleSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder clearRuleSet() { + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + onChanged(); + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public acl.Acl.AclRuleSet.Builder getRuleSetBuilder() { - serviceStatus_ = 0; onChanged(); - return this; + return getRuleSetFieldBuilder().getBuilder(); + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder() { + if (ruleSetBuilder_ != null) { + return ruleSetBuilder_.getMessageOrBuilder(); + } else { + return ruleSet_ == null ? + acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder> + getRuleSetFieldBuilder() { + if (ruleSetBuilder_ == null) { + ruleSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder>( + getRuleSet(), + getParentForChildren(), + isClean()); + ruleSet_ = null; + } + return ruleSetBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -24410,95 +50101,114 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceStatus) + // @@protoc_insertion_point(builder_scope:context.ConfigRule_ACL) } - // @@protoc_insertion_point(class_scope:context.ServiceStatus) - private static final context.ContextOuterClass.ServiceStatus DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule_ACL) + private static final context.ContextOuterClass.ConfigRule_ACL DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceStatus(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule_ACL(); } - public static context.ContextOuterClass.ServiceStatus getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule_ACL getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceStatus parsePartialFrom( + public ConfigRule_ACL parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceStatus(input, extensionRegistry); + return new ConfigRule_ACL(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule_ACL getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceConfig) + public interface ConfigRuleOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. */ - java.util.List - getConfigRulesList(); + int getActionValue(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The action. */ - context.ContextOuterClass.ConfigRule getConfigRules(int index); + context.ContextOuterClass.ConfigActionEnum getAction(); + /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. */ - int getConfigRulesCount(); + boolean hasCustom(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return The custom. */ - java.util.List - getConfigRulesOrBuilderList(); + context.ContextOuterClass.ConfigRule_Custom getCustom(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index); + context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder(); + + /** + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. + */ + boolean hasAcl(); + /** + * .context.ConfigRule_ACL acl = 3; + * @return The acl. + */ + context.ContextOuterClass.ConfigRule_ACL getAcl(); + /** + * .context.ConfigRule_ACL acl = 3; + */ + context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder(); + + public context.ContextOuterClass.ConfigRule.ConfigRuleCase getConfigRuleCase(); } /** - * Protobuf type {@code context.ServiceConfig} + * Protobuf type {@code context.ConfigRule} */ - public static final class ServiceConfig extends + public static final class ConfigRule extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceConfig) - ServiceConfigOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConfigRule) + ConfigRuleOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceConfig.newBuilder() to construct. - private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConfigRule.newBuilder() to construct. + private ConfigRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceConfig() { - configRules_ = java.util.Collections.emptyList(); + private ConfigRule() { + action_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceConfig(); + return new ConfigRule(); } @java.lang.Override @@ -24506,7 +50216,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceConfig( + private ConfigRule( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -24514,7 +50224,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -24525,13 +50234,38 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + case 8: { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 18: { + context.ContextOuterClass.ConfigRule_Custom.Builder subBuilder = null; + if (configRuleCase_ == 2) { + subBuilder = ((context.ContextOuterClass.ConfigRule_Custom) configRule_).toBuilder(); } - configRules_.add( - input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); + configRule_ = + input.readMessage(context.ContextOuterClass.ConfigRule_Custom.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.ConfigRule_Custom) configRule_); + configRule_ = subBuilder.buildPartial(); + } + configRuleCase_ = 2; + break; + } + case 26: { + context.ContextOuterClass.ConfigRule_ACL.Builder subBuilder = null; + if (configRuleCase_ == 3) { + subBuilder = ((context.ContextOuterClass.ConfigRule_ACL) configRule_).toBuilder(); + } + configRule_ = + input.readMessage(context.ContextOuterClass.ConfigRule_ACL.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.ConfigRule_ACL) configRule_); + configRule_ = subBuilder.buildPartial(); + } + configRuleCase_ = 3; break; } default: { @@ -24549,64 +50283,143 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + } + + private int configRuleCase_ = 0; + private java.lang.Object configRule_; + public enum ConfigRuleCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CUSTOM(2), + ACL(3), + CONFIGRULE_NOT_SET(0); + private final int value; + private ConfigRuleCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigRuleCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigRuleCase forNumber(int value) { + switch (value) { + case 2: return CUSTOM; + case 3: return ACL; + case 0: return CONFIGRULE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ConfigRuleCase + getConfigRuleCase() { + return ConfigRuleCase.forNumber( + configRuleCase_); + } + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_; + /** + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * .context.ConfigActionEnum action = 1; + * @return The action. + */ + @java.lang.Override public context.ContextOuterClass.ConfigActionEnum getAction() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); + return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; } + public static final int CUSTOM_FIELD_NUMBER = 2; + /** + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + public boolean hasCustom() { + return configRuleCase_ == 2; } - - public static final int CONFIG_RULES_FIELD_NUMBER = 1; - private java.util.List configRules_; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return The custom. */ @java.lang.Override - public java.util.List getConfigRulesList() { - return configRules_; + public context.ContextOuterClass.ConfigRule_Custom getCustom() { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ @java.lang.Override - public java.util.List - getConfigRulesOrBuilderList() { - return configRules_; + public context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder() { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } + + public static final int ACL_FIELD_NUMBER = 3; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. */ @java.lang.Override - public int getConfigRulesCount() { - return configRules_.size(); + public boolean hasAcl() { + return configRuleCase_ == 3; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return The acl. */ @java.lang.Override - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - return configRules_.get(index); + public context.ContextOuterClass.ConfigRule_ACL getAcl() { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ @java.lang.Override - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - return configRules_.get(index); + public context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder() { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -24623,8 +50436,14 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < configRules_.size(); i++) { - output.writeMessage(1, configRules_.get(i)); + if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { + output.writeEnum(1, action_); + } + if (configRuleCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.ConfigRule_Custom) configRule_); + } + if (configRuleCase_ == 3) { + output.writeMessage(3, (context.ContextOuterClass.ConfigRule_ACL) configRule_); } unknownFields.writeTo(output); } @@ -24635,9 +50454,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < configRules_.size(); i++) { + if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, configRules_.get(i)); + .computeEnumSize(1, action_); + } + if (configRuleCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (context.ContextOuterClass.ConfigRule_Custom) configRule_); + } + if (configRuleCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (context.ContextOuterClass.ConfigRule_ACL) configRule_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -24649,13 +50476,25 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceConfig)) { + if (!(obj instanceof context.ContextOuterClass.ConfigRule)) { return super.equals(obj); } - context.ContextOuterClass.ServiceConfig other = (context.ContextOuterClass.ServiceConfig) obj; + context.ContextOuterClass.ConfigRule other = (context.ContextOuterClass.ConfigRule) obj; - if (!getConfigRulesList() - .equals(other.getConfigRulesList())) return false; + if (action_ != other.action_) return false; + if (!getConfigRuleCase().equals(other.getConfigRuleCase())) return false; + switch (configRuleCase_) { + case 2: + if (!getCustom() + .equals(other.getCustom())) return false; + break; + case 3: + if (!getAcl() + .equals(other.getAcl())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24667,78 +50506,88 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConfigRulesCount() > 0) { - hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; - hash = (53 * hash) + getConfigRulesList().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + switch (configRuleCase_) { + case 2: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 3: + hash = (37 * hash) + ACL_FIELD_NUMBER; + hash = (53 * hash) + getAcl().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom(byte[] data) + public static context.ContextOuterClass.ConfigRule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule 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 context.ContextOuterClass.ServiceConfig parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseDelimitedFrom( + public static context.ContextOuterClass.ConfigRule 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 context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -24751,7 +50600,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceConfig prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConfigRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -24767,26 +50616,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceConfig} + * Protobuf type {@code context.ConfigRule} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceConfig) - context.ContextOuterClass.ServiceConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConfigRule) + context.ContextOuterClass.ConfigRuleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); } - // Construct using context.ContextOuterClass.ServiceConfig.newBuilder() + // Construct using context.ContextOuterClass.ConfigRule.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -24799,35 +50648,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - configRulesBuilder_.clear(); - } + action_ = 0; + + configRuleCase_ = 0; + configRule_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceConfig.getDefaultInstance(); + public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceConfig build() { - context.ContextOuterClass.ServiceConfig result = buildPartial(); + public context.ContextOuterClass.ConfigRule build() { + context.ContextOuterClass.ConfigRule result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -24835,18 +50681,24 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceConfig buildPartial() { - context.ContextOuterClass.ServiceConfig result = new context.ContextOuterClass.ServiceConfig(this); - int from_bitField0_ = bitField0_; - if (configRulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - bitField0_ = (bitField0_ & ~0x00000001); + public context.ContextOuterClass.ConfigRule buildPartial() { + context.ContextOuterClass.ConfigRule result = new context.ContextOuterClass.ConfigRule(this); + result.action_ = action_; + if (configRuleCase_ == 2) { + if (customBuilder_ == null) { + result.configRule_ = configRule_; + } else { + result.configRule_ = customBuilder_.build(); + } + } + if (configRuleCase_ == 3) { + if (aclBuilder_ == null) { + result.configRule_ = configRule_; + } else { + result.configRule_ = aclBuilder_.build(); } - result.configRules_ = configRules_; - } else { - result.configRules_ = configRulesBuilder_.build(); } + result.configRuleCase_ = configRuleCase_; onBuilt(); return result; } @@ -24885,40 +50737,30 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceConfig) { - return mergeFrom((context.ContextOuterClass.ServiceConfig)other); + if (other instanceof context.ContextOuterClass.ConfigRule) { + return mergeFrom((context.ContextOuterClass.ConfigRule)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceConfig other) { - if (other == context.ContextOuterClass.ServiceConfig.getDefaultInstance()) return this; - if (configRulesBuilder_ == null) { - if (!other.configRules_.isEmpty()) { - if (configRules_.isEmpty()) { - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConfigRulesIsMutable(); - configRules_.addAll(other.configRules_); - } - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.ConfigRule other) { + if (other == context.ContextOuterClass.ConfigRule.getDefaultInstance()) return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + switch (other.getConfigRuleCase()) { + case CUSTOM: { + mergeCustom(other.getCustom()); + break; } - } else { - if (!other.configRules_.isEmpty()) { - if (configRulesBuilder_.isEmpty()) { - configRulesBuilder_.dispose(); - configRulesBuilder_ = null; - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - configRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConfigRulesFieldBuilder() : null; - } else { - configRulesBuilder_.addAllMessages(other.configRules_); - } + case ACL: { + mergeAcl(other.getAcl()); + break; + } + case CONFIGRULE_NOT_SET: { + break; } } this.mergeUnknownFields(other.unknownFields); @@ -24936,11 +50778,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceConfig parsedMessage = null; + context.ContextOuterClass.ConfigRule parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceConfig) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConfigRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -24949,246 +50791,356 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; + private int configRuleCase_ = 0; + private java.lang.Object configRule_; + public ConfigRuleCase + getConfigRuleCase() { + return ConfigRuleCase.forNumber( + configRuleCase_); + } - private java.util.List configRules_ = - java.util.Collections.emptyList(); - private void ensureConfigRulesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(configRules_); - bitField0_ |= 0x00000001; - } + public Builder clearConfigRule() { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + private int action_ = 0; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. */ - public java.util.List getConfigRulesList() { - if (configRulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(configRules_); - } else { - return configRulesBuilder_.getMessageList(); - } + @java.lang.Override public int getActionValue() { + return action_; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. */ - public int getConfigRulesCount() { - if (configRulesBuilder_ == null) { - return configRules_.size(); - } else { - return configRulesBuilder_.getCount(); + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * .context.ConfigActionEnum action = 1; + * @return The action. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigActionEnum getAction() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); + return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; + } + /** + * .context.ConfigActionEnum action = 1; + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(context.ContextOuterClass.ConfigActionEnum value) { + if (value == null) { + throw new NullPointerException(); } + + action_ = value.getNumber(); + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder> customBuilder_; + /** + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return configRuleCase_ == 2; + } + /** + * .context.ConfigRule_Custom custom = 2; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom getCustom() { + if (customBuilder_ == null) { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } else { - return configRulesBuilder_.getMessage(index); + if (configRuleCase_ == 2) { + return customBuilder_.getMessage(); + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { + public Builder setCustom(context.ContextOuterClass.ConfigRule_Custom value) { + if (customBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConfigRulesIsMutable(); - configRules_.set(index, value); + configRule_ = value; onChanged(); } else { - configRulesBuilder_.setMessage(index, value); + customBuilder_.setMessage(value); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.set(index, builderForValue.build()); + public Builder setCustom( + context.ContextOuterClass.ConfigRule_Custom.Builder builderForValue) { + if (customBuilder_ == null) { + configRule_ = builderForValue.build(); onChanged(); } else { - configRulesBuilder_.setMessage(index, builderForValue.build()); + customBuilder_.setMessage(builderForValue.build()); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeCustom(context.ContextOuterClass.ConfigRule_Custom value) { + if (customBuilder_ == null) { + if (configRuleCase_ == 2 && + configRule_ != context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance()) { + configRule_ = context.ContextOuterClass.ConfigRule_Custom.newBuilder((context.ContextOuterClass.ConfigRule_Custom) configRule_) + .mergeFrom(value).buildPartial(); + } else { + configRule_ = value; } - ensureConfigRulesIsMutable(); - configRules_.add(value); onChanged(); } else { - configRulesBuilder_.addMessage(value); + if (configRuleCase_ == 2) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder clearCustom() { + if (customBuilder_ == null) { + if (configRuleCase_ == 2) { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); } - ensureConfigRulesIsMutable(); - configRules_.add(index, value); - onChanged(); } else { - configRulesBuilder_.addMessage(index, value); + if (configRuleCase_ == 2) { + configRuleCase_ = 0; + configRule_ = null; + } + customBuilder_.clear(); } return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.ConfigRule_Custom.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * .context.ConfigRule_Custom custom = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder() { + if ((configRuleCase_ == 2) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); } else { - configRulesBuilder_.addMessage(builderForValue.build()); + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } - return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(configRuleCase_ == 2)) { + configRule_ = context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); + } + customBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder>( + (context.ContextOuterClass.ConfigRule_Custom) configRule_, + getParentForChildren(), + isClean()); + configRule_ = null; } - return this; + configRuleCase_ = 2; + onChanged();; + return customBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder> aclBuilder_; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. */ - public Builder addAllConfigRules( - java.lang.Iterable values) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, configRules_); - onChanged(); + @java.lang.Override + public boolean hasAcl() { + return configRuleCase_ == 3; + } + /** + * .context.ConfigRule_ACL acl = 3; + * @return The acl. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_ACL getAcl() { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } else { - configRulesBuilder_.addAllMessages(values); + if (configRuleCase_ == 3) { + return aclBuilder_.getMessage(); + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } - return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public Builder clearConfigRules() { - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setAcl(context.ContextOuterClass.ConfigRule_ACL value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + configRule_ = value; onChanged(); } else { - configRulesBuilder_.clear(); + aclBuilder_.setMessage(value); } + configRuleCase_ = 3; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public Builder removeConfigRules(int index) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.remove(index); + public Builder setAcl( + context.ContextOuterClass.ConfigRule_ACL.Builder builderForValue) { + if (aclBuilder_ == null) { + configRule_ = builderForValue.build(); onChanged(); } else { - configRulesBuilder_.remove(index); + aclBuilder_.setMessage(builderForValue.build()); } + configRuleCase_ = 3; return this; } /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); } else { - return configRulesBuilder_.getMessageOrBuilder(index); + public Builder mergeAcl(context.ContextOuterClass.ConfigRule_ACL value) { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3 && + configRule_ != context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance()) { + configRule_ = context.ContextOuterClass.ConfigRule_ACL.newBuilder((context.ContextOuterClass.ConfigRule_ACL) configRule_) + .mergeFrom(value).buildPartial(); + } else { + configRule_ = value; + } + onChanged(); + } else { + if (configRuleCase_ == 3) { + aclBuilder_.mergeFrom(value); + } + aclBuilder_.setMessage(value); } + configRuleCase_ = 3; + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public java.util.List - getConfigRulesOrBuilderList() { - if (configRulesBuilder_ != null) { - return configRulesBuilder_.getMessageOrBuilderList(); + public Builder clearAcl() { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3) { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); + } } else { - return java.util.Collections.unmodifiableList(configRules_); + if (configRuleCase_ == 3) { + configRuleCase_ = 0; + configRule_ = null; + } + aclBuilder_.clear(); } + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { - return getConfigRulesFieldBuilder().addBuilder( - context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public context.ContextOuterClass.ConfigRule_ACL.Builder getAclBuilder() { + return getAclFieldBuilder().getBuilder(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder() { + if ((configRuleCase_ == 3) && (aclBuilder_ != null)) { + return aclBuilder_.getMessageOrBuilder(); + } else { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); + } } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public java.util.List - getConfigRulesBuilderList() { - return getConfigRulesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> - getConfigRulesFieldBuilder() { - if (configRulesBuilder_ == null) { - configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( - configRules_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder> + getAclFieldBuilder() { + if (aclBuilder_ == null) { + if (!(configRuleCase_ == 3)) { + configRule_ = context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); + } + aclBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder>( + (context.ContextOuterClass.ConfigRule_ACL) configRule_, getParentForChildren(), isClean()); - configRules_ = null; + configRule_ = null; } - return configRulesBuilder_; + configRuleCase_ = 3; + onChanged();; + return aclBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -25203,95 +51155,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceConfig) + // @@protoc_insertion_point(builder_scope:context.ConfigRule) } - // @@protoc_insertion_point(class_scope:context.ServiceConfig) - private static final context.ContextOuterClass.ServiceConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule) + private static final context.ContextOuterClass.ConfigRule DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceConfig(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule(); } - public static context.ContextOuterClass.ServiceConfig getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceConfig parsePartialFrom( + public ConfigRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceConfig(input, extensionRegistry); + return new ConfigRule(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceIdList) + public interface Constraint_CustomOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_Custom) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ServiceId service_ids = 1; - */ - java.util.List - getServiceIdsList(); - /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ - context.ContextOuterClass.ServiceId getServiceIds(int index); + java.lang.String getConstraintType(); /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ - int getServiceIdsCount(); + com.google.protobuf.ByteString + getConstraintTypeBytes(); + /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ - java.util.List - getServiceIdsOrBuilderList(); + java.lang.String getConstraintValue(); /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index); + com.google.protobuf.ByteString + getConstraintValueBytes(); } /** - * Protobuf type {@code context.ServiceIdList} + *
+   * ----- Constraint ----------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.Constraint_Custom} */ - public static final class ServiceIdList extends + public static final class Constraint_Custom extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceIdList) - ServiceIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_Custom) + Constraint_CustomOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceIdList.newBuilder() to construct. - private ServiceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_Custom.newBuilder() to construct. + private Constraint_Custom(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceIdList() { - serviceIds_ = java.util.Collections.emptyList(); + private Constraint_Custom() { + constraintType_ = ""; + constraintValue_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceIdList(); + return new Constraint_Custom(); } @java.lang.Override @@ -25299,7 +51256,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceIdList( + private Constraint_Custom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -25307,7 +51264,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -25319,12 +51275,15 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - serviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - serviceIds_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + constraintType_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + constraintValue_ = s; break; } default: { @@ -25342,64 +51301,97 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Custom_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + context.ContextOuterClass.Constraint_Custom.class, context.ContextOuterClass.Constraint_Custom.Builder.class); } - public static final int SERVICE_IDS_FIELD_NUMBER = 1; - private java.util.List serviceIds_; - /** - * repeated .context.ServiceId service_ids = 1; - */ - @java.lang.Override - public java.util.List getServiceIdsList() { - return serviceIds_; - } + public static final int CONSTRAINT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object constraintType_; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ @java.lang.Override - public java.util.List - getServiceIdsOrBuilderList() { - return serviceIds_; + public java.lang.String getConstraintType() { + java.lang.Object ref = constraintType_; + 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(); + constraintType_ = s; + return s; + } } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ @java.lang.Override - public int getServiceIdsCount() { - return serviceIds_.size(); + public com.google.protobuf.ByteString + getConstraintTypeBytes() { + java.lang.Object ref = constraintType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int CONSTRAINT_VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object constraintValue_; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - return serviceIds_.get(index); + public java.lang.String getConstraintValue() { + java.lang.Object ref = constraintValue_; + 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(); + constraintValue_ = s; + return s; + } } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - return serviceIds_.get(index); + public com.google.protobuf.ByteString + getConstraintValueBytes() { + java.lang.Object ref = constraintValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -25416,8 +51408,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < serviceIds_.size(); i++) { - output.writeMessage(1, serviceIds_.get(i)); + if (!getConstraintTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraintType_); + } + if (!getConstraintValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, constraintValue_); } unknownFields.writeTo(output); } @@ -25428,9 +51423,11 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < serviceIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, serviceIds_.get(i)); + if (!getConstraintTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraintType_); + } + if (!getConstraintValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, constraintValue_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -25442,13 +51439,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceIdList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_Custom)) { return super.equals(obj); } - context.ContextOuterClass.ServiceIdList other = (context.ContextOuterClass.ServiceIdList) obj; + context.ContextOuterClass.Constraint_Custom other = (context.ContextOuterClass.Constraint_Custom) obj; - if (!getServiceIdsList() - .equals(other.getServiceIdsList())) return false; + if (!getConstraintType() + .equals(other.getConstraintType())) return false; + if (!getConstraintValue() + .equals(other.getConstraintValue())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -25460,78 +51459,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getServiceIdsCount() > 0) { - hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceIdsList().hashCode(); - } + hash = (37 * hash) + CONSTRAINT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getConstraintType().hashCode(); + hash = (37 * hash) + CONSTRAINT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getConstraintValue().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_Custom parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Custom parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom 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 context.ContextOuterClass.ServiceIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Custom parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_Custom 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 context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -25544,7 +51543,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_Custom prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -25560,26 +51559,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceIdList} + *
+     * ----- Constraint ----------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.Constraint_Custom} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceIdList) - context.ContextOuterClass.ServiceIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_Custom) + context.ContextOuterClass.Constraint_CustomOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Custom_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + context.ContextOuterClass.Constraint_Custom.class, context.ContextOuterClass.Constraint_Custom.Builder.class); } - // Construct using context.ContextOuterClass.ServiceIdList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_Custom.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -25592,35 +51595,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - serviceIdsBuilder_.clear(); - } + constraintType_ = ""; + + constraintValue_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceIdList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_Custom getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceIdList build() { - context.ContextOuterClass.ServiceIdList result = buildPartial(); + public context.ContextOuterClass.Constraint_Custom build() { + context.ContextOuterClass.Constraint_Custom result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -25628,18 +51628,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceIdList buildPartial() { - context.ContextOuterClass.ServiceIdList result = new context.ContextOuterClass.ServiceIdList(this); - int from_bitField0_ = bitField0_; - if (serviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.serviceIds_ = serviceIds_; - } else { - result.serviceIds_ = serviceIdsBuilder_.build(); - } + public context.ContextOuterClass.Constraint_Custom buildPartial() { + context.ContextOuterClass.Constraint_Custom result = new context.ContextOuterClass.Constraint_Custom(this); + result.constraintType_ = constraintType_; + result.constraintValue_ = constraintValue_; onBuilt(); return result; } @@ -25678,41 +51670,23 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceIdList) { - return mergeFrom((context.ContextOuterClass.ServiceIdList)other); + if (other instanceof context.ContextOuterClass.Constraint_Custom) { + return mergeFrom((context.ContextOuterClass.Constraint_Custom)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceIdList other) { - if (other == context.ContextOuterClass.ServiceIdList.getDefaultInstance()) return this; - if (serviceIdsBuilder_ == null) { - if (!other.serviceIds_.isEmpty()) { - if (serviceIds_.isEmpty()) { - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServiceIdsIsMutable(); - serviceIds_.addAll(other.serviceIds_); - } - onChanged(); - } - } else { - if (!other.serviceIds_.isEmpty()) { - if (serviceIdsBuilder_.isEmpty()) { - serviceIdsBuilder_.dispose(); - serviceIdsBuilder_ = null; - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - serviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceIdsFieldBuilder() : null; - } else { - serviceIdsBuilder_.addAllMessages(other.serviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_Custom other) { + if (other == context.ContextOuterClass.Constraint_Custom.getDefaultInstance()) return this; + if (!other.getConstraintType().isEmpty()) { + constraintType_ = other.constraintType_; + onChanged(); + } + if (!other.getConstraintValue().isEmpty()) { + constraintValue_ = other.constraintValue_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -25729,11 +51703,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceIdList parsedMessage = null; + context.ContextOuterClass.Constraint_Custom parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_Custom) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -25742,247 +51716,158 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List serviceIds_ = - java.util.Collections.emptyList(); - private void ensureServiceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - serviceIds_ = new java.util.ArrayList(serviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + private java.lang.Object constraintType_ = ""; /** - * repeated .context.ServiceId service_ids = 1; - */ - public java.util.List getServiceIdsList() { - if (serviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceIds_); - } else { - return serviceIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public int getServiceIdsCount() { - if (serviceIdsBuilder_ == null) { - return serviceIds_.size(); - } else { - return serviceIdsBuilder_.getCount(); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); - } else { - return serviceIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.set(index, value); - onChanged(); + public java.lang.String getConstraintType() { + java.lang.Object ref = constraintType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraintType_ = s; + return s; } else { - serviceIdsBuilder_.setMessage(index, value); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.set(index, builderForValue.build()); - onChanged(); + public com.google.protobuf.ByteString + getConstraintTypeBytes() { + java.lang.Object ref = constraintType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintType_ = b; + return b; } else { - serviceIdsBuilder_.setMessage(index, builderForValue.build()); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @param value The constraintType to set. + * @return This builder for chaining. */ - public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.add(value); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(value); - } + public Builder setConstraintType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + constraintType_ = value; + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return This builder for chaining. */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.add(index, value); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(index, value); - } + public Builder clearConstraintType() { + + constraintType_ = getDefaultInstance().getConstraintType(); + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @param value The bytes for constraintType to set. + * @return This builder for chaining. */ - public Builder addServiceIds( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(builderForValue.build()); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder setConstraintTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + constraintType_ = value; + onChanged(); return this; } + + private java.lang.Object constraintValue_ = ""; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(index, builderForValue.build()); - onChanged(); + public java.lang.String getConstraintValue() { + java.lang.Object ref = constraintValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraintValue_ = s; + return s; } else { - serviceIdsBuilder_.addMessage(index, builderForValue.build()); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ - public Builder addAllServiceIds( - java.lang.Iterable values) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceIds_); - onChanged(); + public com.google.protobuf.ByteString + getConstraintValueBytes() { + java.lang.Object ref = constraintValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintValue_ = b; + return b; } else { - serviceIdsBuilder_.addAllMessages(values); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @param value The constraintValue to set. + * @return This builder for chaining. */ - public Builder clearServiceIds() { - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - serviceIdsBuilder_.clear(); - } + public Builder setConstraintValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + constraintValue_ = value; + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return This builder for chaining. */ - public Builder removeServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.remove(index); - onChanged(); - } else { - serviceIdsBuilder_.remove(index); - } + public Builder clearConstraintValue() { + + constraintValue_ = getDefaultInstance().getConstraintValue(); + onChanged(); + return this; + } + /** + * string constraint_value = 2; + * @param value The bytes for constraintValue to set. + * @return This builder for chaining. + */ + public Builder setConstraintValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + constraintValue_ = value; + onChanged(); return this; } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( - int index) { - return getServiceIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); } else { - return serviceIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public java.util.List - getServiceIdsOrBuilderList() { - if (serviceIdsBuilder_ != null) { - return serviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceIds_); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { - return getServiceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( - int index) { - return getServiceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public java.util.List - getServiceIdsBuilderList() { - return getServiceIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdsFieldBuilder() { - if (serviceIdsBuilder_ == null) { - serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - serviceIds_ = null; - } - return serviceIdsBuilder_; - } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -25996,95 +51881,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceIdList) + // @@protoc_insertion_point(builder_scope:context.Constraint_Custom) } - // @@protoc_insertion_point(class_scope:context.ServiceIdList) - private static final context.ContextOuterClass.ServiceIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_Custom) + private static final context.ContextOuterClass.Constraint_Custom DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_Custom(); } - public static context.ContextOuterClass.ServiceIdList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_Custom getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceIdList parsePartialFrom( + public Constraint_Custom parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceIdList(input, extensionRegistry); + return new Constraint_Custom(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_Custom getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceList) + public interface Constraint_ScheduleOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_Schedule) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Service services = 1; - */ - java.util.List - getServicesList(); - /** - * repeated .context.Service services = 1; - */ - context.ContextOuterClass.Service getServices(int index); - /** - * repeated .context.Service services = 1; - */ - int getServicesCount(); - /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ - java.util.List - getServicesOrBuilderList(); + float getStartTimestamp(); + /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ - context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index); + float getDurationDays(); } /** - * Protobuf type {@code context.ServiceList} + * Protobuf type {@code context.Constraint_Schedule} */ - public static final class ServiceList extends + public static final class Constraint_Schedule extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceList) - ServiceListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_Schedule) + Constraint_ScheduleOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceList.newBuilder() to construct. - private ServiceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_Schedule.newBuilder() to construct. + private Constraint_Schedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceList() { - services_ = java.util.Collections.emptyList(); + private Constraint_Schedule() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceList(); + return new Constraint_Schedule(); } @java.lang.Override @@ -26092,7 +51964,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceList( + private Constraint_Schedule( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -26100,7 +51972,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -26111,13 +51982,14 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - services_.add( - input.readMessage(context.ContextOuterClass.Service.parser(), extensionRegistry)); + case 13: { + + startTimestamp_ = input.readFloat(); + break; + } + case 21: { + + durationDays_ = input.readFloat(); break; } default: { @@ -26135,64 +52007,43 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + context.ContextOuterClass.Constraint_Schedule.class, context.ContextOuterClass.Constraint_Schedule.Builder.class); } - public static final int SERVICES_FIELD_NUMBER = 1; - private java.util.List services_; - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public java.util.List getServicesList() { - return services_; - } - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public java.util.List - getServicesOrBuilderList() { - return services_; - } - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public int getServicesCount() { - return services_.size(); - } + public static final int START_TIMESTAMP_FIELD_NUMBER = 1; + private float startTimestamp_; /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ @java.lang.Override - public context.ContextOuterClass.Service getServices(int index) { - return services_.get(index); + public float getStartTimestamp() { + return startTimestamp_; } + + public static final int DURATION_DAYS_FIELD_NUMBER = 2; + private float durationDays_; /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ @java.lang.Override - public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index) { - return services_.get(index); + public float getDurationDays() { + return durationDays_; } private byte memoizedIsInitialized = -1; @@ -26209,8 +52060,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < services_.size(); i++) { - output.writeMessage(1, services_.get(i)); + if (startTimestamp_ != 0F) { + output.writeFloat(1, startTimestamp_); + } + if (durationDays_ != 0F) { + output.writeFloat(2, durationDays_); } unknownFields.writeTo(output); } @@ -26221,9 +52075,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < services_.size(); i++) { + if (startTimestamp_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, services_.get(i)); + .computeFloatSize(1, startTimestamp_); + } + if (durationDays_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, durationDays_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -26235,13 +52093,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_Schedule)) { return super.equals(obj); } - context.ContextOuterClass.ServiceList other = (context.ContextOuterClass.ServiceList) obj; + context.ContextOuterClass.Constraint_Schedule other = (context.ContextOuterClass.Constraint_Schedule) obj; - if (!getServicesList() - .equals(other.getServicesList())) return false; + if (java.lang.Float.floatToIntBits(getStartTimestamp()) + != java.lang.Float.floatToIntBits( + other.getStartTimestamp())) return false; + if (java.lang.Float.floatToIntBits(getDurationDays()) + != java.lang.Float.floatToIntBits( + other.getDurationDays())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -26253,78 +52115,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getServicesCount() > 0) { - hash = (37 * hash) + SERVICES_FIELD_NUMBER; - hash = (53 * hash) + getServicesList().hashCode(); - } + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getStartTimestamp()); + hash = (37 * hash) + DURATION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDurationDays()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_Schedule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Schedule parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule 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 context.ContextOuterClass.ServiceList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Schedule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_Schedule 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 context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -26337,7 +52201,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_Schedule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -26353,26 +52217,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceList} + * Protobuf type {@code context.Constraint_Schedule} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceList) - context.ContextOuterClass.ServiceListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_Schedule) + context.ContextOuterClass.Constraint_ScheduleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + context.ContextOuterClass.Constraint_Schedule.class, context.ContextOuterClass.Constraint_Schedule.Builder.class); } - // Construct using context.ContextOuterClass.ServiceList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_Schedule.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -26385,35 +52249,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getServicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - servicesBuilder_.clear(); - } + startTimestamp_ = 0F; + + durationDays_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_Schedule getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceList build() { - context.ContextOuterClass.ServiceList result = buildPartial(); + public context.ContextOuterClass.Constraint_Schedule build() { + context.ContextOuterClass.Constraint_Schedule result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -26421,18 +52282,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceList buildPartial() { - context.ContextOuterClass.ServiceList result = new context.ContextOuterClass.ServiceList(this); - int from_bitField0_ = bitField0_; - if (servicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.services_ = services_; - } else { - result.services_ = servicesBuilder_.build(); - } + public context.ContextOuterClass.Constraint_Schedule buildPartial() { + context.ContextOuterClass.Constraint_Schedule result = new context.ContextOuterClass.Constraint_Schedule(this); + result.startTimestamp_ = startTimestamp_; + result.durationDays_ = durationDays_; onBuilt(); return result; } @@ -26471,41 +52324,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceList) { - return mergeFrom((context.ContextOuterClass.ServiceList)other); + if (other instanceof context.ContextOuterClass.Constraint_Schedule) { + return mergeFrom((context.ContextOuterClass.Constraint_Schedule)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceList other) { - if (other == context.ContextOuterClass.ServiceList.getDefaultInstance()) return this; - if (servicesBuilder_ == null) { - if (!other.services_.isEmpty()) { - if (services_.isEmpty()) { - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServicesIsMutable(); - services_.addAll(other.services_); - } - onChanged(); - } - } else { - if (!other.services_.isEmpty()) { - if (servicesBuilder_.isEmpty()) { - servicesBuilder_.dispose(); - servicesBuilder_ = null; - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - servicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServicesFieldBuilder() : null; - } else { - servicesBuilder_.addAllMessages(other.services_); - } - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_Schedule other) { + if (other == context.ContextOuterClass.Constraint_Schedule.getDefaultInstance()) return this; + if (other.getStartTimestamp() != 0F) { + setStartTimestamp(other.getStartTimestamp()); + } + if (other.getDurationDays() != 0F) { + setDurationDays(other.getDurationDays()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -26522,11 +52355,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceList parsedMessage = null; + context.ContextOuterClass.Constraint_Schedule parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_Schedule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -26535,247 +52368,68 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List services_ = - java.util.Collections.emptyList(); - private void ensureServicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(services_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> servicesBuilder_; + private float startTimestamp_ ; /** - * repeated .context.Service services = 1; - */ - public java.util.List getServicesList() { - if (servicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(services_); - } else { - return servicesBuilder_.getMessageList(); - } - } - /** - * repeated .context.Service services = 1; - */ - public int getServicesCount() { - if (servicesBuilder_ == null) { - return services_.size(); - } else { - return servicesBuilder_.getCount(); - } - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service getServices(int index) { - if (servicesBuilder_ == null) { - return services_.get(index); - } else { - return servicesBuilder_.getMessage(index); - } - } - /** - * repeated .context.Service services = 1; - */ - public Builder setServices( - int index, context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.set(index, value); - onChanged(); - } else { - servicesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.Service services = 1; - */ - public Builder setServices( - int index, context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.set(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.Service services = 1; - */ - public Builder addServices(context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(value); - onChanged(); - } else { - servicesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ - public Builder addServices( - int index, context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(index, value); - onChanged(); - } else { - servicesBuilder_.addMessage(index, value); - } - return this; + @java.lang.Override + public float getStartTimestamp() { + return startTimestamp_; } /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @param value The startTimestamp to set. + * @return This builder for chaining. */ - public Builder addServices( - context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(builderForValue.build()); - } + public Builder setStartTimestamp(float value) { + + startTimestamp_ = value; + onChanged(); return this; } /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return This builder for chaining. */ - public Builder addServices( - int index, context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(index, builderForValue.build()); - } + public Builder clearStartTimestamp() { + + startTimestamp_ = 0F; + onChanged(); return this; } + + private float durationDays_ ; /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ - public Builder addAllServices( - java.lang.Iterable values) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, services_); - onChanged(); - } else { - servicesBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public float getDurationDays() { + return durationDays_; } /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @param value The durationDays to set. + * @return This builder for chaining. */ - public Builder clearServices() { - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - servicesBuilder_.clear(); - } + public Builder setDurationDays(float value) { + + durationDays_ = value; + onChanged(); return this; } /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return This builder for chaining. */ - public Builder removeServices(int index) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.remove(index); - onChanged(); - } else { - servicesBuilder_.remove(index); - } + public Builder clearDurationDays() { + + durationDays_ = 0F; + onChanged(); return this; } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder getServicesBuilder( - int index) { - return getServicesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index) { - if (servicesBuilder_ == null) { - return services_.get(index); } else { - return servicesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.Service services = 1; - */ - public java.util.List - getServicesOrBuilderList() { - if (servicesBuilder_ != null) { - return servicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(services_); - } - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder addServicesBuilder() { - return getServicesFieldBuilder().addBuilder( - context.ContextOuterClass.Service.getDefaultInstance()); - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder addServicesBuilder( - int index) { - return getServicesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Service.getDefaultInstance()); - } - /** - * repeated .context.Service services = 1; - */ - public java.util.List - getServicesBuilderList() { - return getServicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> - getServicesFieldBuilder() { - if (servicesBuilder_ == null) { - servicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder>( - services_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - services_ = null; - } - return servicesBuilder_; - } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -26789,100 +52443,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceList) + // @@protoc_insertion_point(builder_scope:context.Constraint_Schedule) } - // @@protoc_insertion_point(class_scope:context.ServiceList) - private static final context.ContextOuterClass.ServiceList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_Schedule) + private static final context.ContextOuterClass.Constraint_Schedule DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_Schedule(); } - public static context.ContextOuterClass.ServiceList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_Schedule getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceList parsePartialFrom( + public Constraint_Schedule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceList(input, extensionRegistry); + return new Constraint_Schedule(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_Schedule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceEvent) + public interface GPS_PositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.GPS_Position) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. - */ - context.ContextOuterClass.Event getEvent(); - /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + float getLatitude(); /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - boolean hasServiceId(); - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - context.ContextOuterClass.ServiceId getServiceId(); - /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + float getLongitude(); } /** - * Protobuf type {@code context.ServiceEvent} + * Protobuf type {@code context.GPS_Position} */ - public static final class ServiceEvent extends + public static final class GPS_Position extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceEvent) - ServiceEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.GPS_Position) + GPS_PositionOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceEvent.newBuilder() to construct. - private ServiceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use GPS_Position.newBuilder() to construct. + private GPS_Position(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceEvent() { + private GPS_Position() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceEvent(); + return new GPS_Position(); } @java.lang.Override @@ -26890,7 +52526,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceEvent( + private GPS_Position( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -26902,36 +52538,20 @@ public final class ContextOuterClass { com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (serviceId_ != null) { - subBuilder = serviceId_.toBuilder(); - } - serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(serviceId_); - serviceId_ = subBuilder.buildPartial(); - } + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + + latitude_ = input.readFloat(); + break; + } + case 21: { + longitude_ = input.readFloat(); break; } default: { @@ -26955,67 +52575,37 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_GPS_Position_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); + context.ContextOuterClass.GPS_Position.class, context.ContextOuterClass.GPS_Position.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } + public static final int LATITUDE_FIELD_NUMBER = 1; + private float latitude_; /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public float getLatitude() { + return latitude_; } - public static final int SERVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ServiceId serviceId_; - /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - @java.lang.Override - public boolean hasServiceId() { - return serviceId_ != null; - } - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceId() { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } + public static final int LONGITUDE_FIELD_NUMBER = 2; + private float longitude_; /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - return getServiceId(); + public float getLongitude() { + return longitude_; } private byte memoizedIsInitialized = -1; @@ -27032,11 +52622,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (latitude_ != 0F) { + output.writeFloat(1, latitude_); } - if (serviceId_ != null) { - output.writeMessage(2, getServiceId()); + if (longitude_ != 0F) { + output.writeFloat(2, longitude_); } unknownFields.writeTo(output); } @@ -27047,13 +52637,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (latitude_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeFloatSize(1, latitude_); } - if (serviceId_ != null) { + if (longitude_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getServiceId()); + .computeFloatSize(2, longitude_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27065,21 +52655,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceEvent)) { + if (!(obj instanceof context.ContextOuterClass.GPS_Position)) { return super.equals(obj); } - context.ContextOuterClass.ServiceEvent other = (context.ContextOuterClass.ServiceEvent) obj; + context.ContextOuterClass.GPS_Position other = (context.ContextOuterClass.GPS_Position) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasServiceId() != other.hasServiceId()) return false; - if (hasServiceId()) { - if (!getServiceId() - .equals(other.getServiceId())) return false; - } + if (java.lang.Float.floatToIntBits(getLatitude()) + != java.lang.Float.floatToIntBits( + other.getLatitude())) return false; + if (java.lang.Float.floatToIntBits(getLongitude()) + != java.lang.Float.floatToIntBits( + other.getLongitude())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -27091,82 +52677,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasServiceId()) { - hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getServiceId().hashCode(); - } + hash = (37 * hash) + LATITUDE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLatitude()); + hash = (37 * hash) + LONGITUDE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLongitude()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom(byte[] data) + public static context.ContextOuterClass.GPS_Position parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.GPS_Position parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position 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 context.ContextOuterClass.ServiceEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.GPS_Position parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseDelimitedFrom( + public static context.ContextOuterClass.GPS_Position 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 context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -27179,7 +52763,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.GPS_Position prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -27195,26 +52779,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceEvent} + * Protobuf type {@code context.GPS_Position} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceEvent) - context.ContextOuterClass.ServiceEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.GPS_Position) + context.ContextOuterClass.GPS_PositionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_GPS_Position_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); + context.ContextOuterClass.GPS_Position.class, context.ContextOuterClass.GPS_Position.Builder.class); } - // Construct using context.ContextOuterClass.ServiceEvent.newBuilder() + // Construct using context.ContextOuterClass.GPS_Position.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -27232,35 +52816,27 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (serviceIdBuilder_ == null) { - serviceId_ = null; - } else { - serviceId_ = null; - serviceIdBuilder_ = null; - } + latitude_ = 0F; + + longitude_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceEvent.getDefaultInstance(); + public context.ContextOuterClass.GPS_Position getDefaultInstanceForType() { + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceEvent build() { - context.ContextOuterClass.ServiceEvent result = buildPartial(); + public context.ContextOuterClass.GPS_Position build() { + context.ContextOuterClass.GPS_Position result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -27268,18 +52844,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceEvent buildPartial() { - context.ContextOuterClass.ServiceEvent result = new context.ContextOuterClass.ServiceEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (serviceIdBuilder_ == null) { - result.serviceId_ = serviceId_; - } else { - result.serviceId_ = serviceIdBuilder_.build(); - } + public context.ContextOuterClass.GPS_Position buildPartial() { + context.ContextOuterClass.GPS_Position result = new context.ContextOuterClass.GPS_Position(this); + result.latitude_ = latitude_; + result.longitude_ = longitude_; onBuilt(); return result; } @@ -27318,21 +52886,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceEvent) { - return mergeFrom((context.ContextOuterClass.ServiceEvent)other); + if (other instanceof context.ContextOuterClass.GPS_Position) { + return mergeFrom((context.ContextOuterClass.GPS_Position)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceEvent other) { - if (other == context.ContextOuterClass.ServiceEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.GPS_Position other) { + if (other == context.ContextOuterClass.GPS_Position.getDefaultInstance()) return this; + if (other.getLatitude() != 0F) { + setLatitude(other.getLatitude()); } - if (other.hasServiceId()) { - mergeServiceId(other.getServiceId()); + if (other.getLongitude() != 0F) { + setLongitude(other.getLongitude()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -27349,11 +52917,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceEvent parsedMessage = null; + context.ContextOuterClass.GPS_Position parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.GPS_Position) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -27363,242 +52931,66 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } - } - /** - * .context.Event event = 1; - */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.Event event = 1; - */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } - - return this; - } + private float latitude_ ; /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getLatitude() { + return latitude_; } /** - * .context.Event event = 1; + * float latitude = 1; + * @param value The latitude to set. + * @return This builder for chaining. */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } - + public Builder setLatitude(float value) { + + latitude_ = value; + onChanged(); return this; } /** - * .context.Event event = 1; + * float latitude = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { + public Builder clearLatitude() { + latitude_ = 0F; onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - } - /** - * .context.Event event = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - - private context.ContextOuterClass.ServiceId serviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; - /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - public boolean hasServiceId() { - return serviceIdBuilder_ != null || serviceId_ != null; - } - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - public context.ContextOuterClass.ServiceId getServiceId() { - if (serviceIdBuilder_ == null) { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } else { - return serviceIdBuilder_.getMessage(); - } - } - /** - * .context.ServiceId service_id = 2; - */ - public Builder setServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceId_ = value; - onChanged(); - } else { - serviceIdBuilder_.setMessage(value); - } - return this; } - /** - * .context.ServiceId service_id = 2; - */ - public Builder setServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdBuilder_ == null) { - serviceId_ = builderForValue.build(); - onChanged(); - } else { - serviceIdBuilder_.setMessage(builderForValue.build()); - } - return this; - } + private float longitude_ ; /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ - public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (serviceId_ != null) { - serviceId_ = - context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); - } else { - serviceId_ = value; - } - onChanged(); - } else { - serviceIdBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getLongitude() { + return longitude_; } /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @param value The longitude to set. + * @return This builder for chaining. */ - public Builder clearServiceId() { - if (serviceIdBuilder_ == null) { - serviceId_ = null; - onChanged(); - } else { - serviceId_ = null; - serviceIdBuilder_ = null; - } - + public Builder setLongitude(float value) { + + longitude_ = value; + onChanged(); return this; } /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + public Builder clearLongitude() { + longitude_ = 0F; onChanged(); - return getServiceIdFieldBuilder().getBuilder(); - } - /** - * .context.ServiceId service_id = 2; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - if (serviceIdBuilder_ != null) { - return serviceIdBuilder_.getMessageOrBuilder(); - } else { - return serviceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } - } - /** - * .context.ServiceId service_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdFieldBuilder() { - if (serviceIdBuilder_ == null) { - serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getServiceId(), - getParentForChildren(), - isClean()); - serviceId_ = null; - } - return serviceIdBuilder_; + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -27613,119 +53005,104 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceEvent) + // @@protoc_insertion_point(builder_scope:context.GPS_Position) } - // @@protoc_insertion_point(class_scope:context.ServiceEvent) - private static final context.ContextOuterClass.ServiceEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.GPS_Position) + private static final context.ContextOuterClass.GPS_Position DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.GPS_Position(); } - public static context.ContextOuterClass.ServiceEvent getDefaultInstance() { + public static context.ContextOuterClass.GPS_Position getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceEvent parsePartialFrom( + public GPS_Position parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceEvent(input, extensionRegistry); + return new GPS_Position(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { + public context.ContextOuterClass.GPS_Position getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface EndPointIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.EndPointId) + public interface LocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Location) com.google.protobuf.MessageOrBuilder { /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. + * string region = 1; + * @return Whether the region field is set. */ - boolean hasTopologyId(); + boolean hasRegion(); /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. + * string region = 1; + * @return The region. */ - context.ContextOuterClass.TopologyId getTopologyId(); + java.lang.String getRegion(); /** - * .context.TopologyId topology_id = 1; + * string region = 1; + * @return The bytes for region. */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + com.google.protobuf.ByteString + getRegionBytes(); /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ - boolean hasDeviceId(); + boolean hasGpsPosition(); /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ - context.ContextOuterClass.DeviceId getDeviceId(); + context.ContextOuterClass.GPS_Position getGpsPosition(); /** - * .context.DeviceId device_id = 2; + * .context.GPS_Position gps_position = 2; */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder(); - /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. - */ - boolean hasEndpointUuid(); - /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. - */ - context.ContextOuterClass.Uuid getEndpointUuid(); - /** - * .context.Uuid endpoint_uuid = 3; - */ - context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder(); + public context.ContextOuterClass.Location.LocationCase getLocationCase(); } /** - *
-   * ----- Endpoint ------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.EndPointId} + * Protobuf type {@code context.Location} */ - public static final class EndPointId extends + public static final class Location extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.EndPointId) - EndPointIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Location) + LocationOrBuilder { private static final long serialVersionUID = 0L; - // Use EndPointId.newBuilder() to construct. - private EndPointId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private EndPointId() { + private Location() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new EndPointId(); + return new Location(); } @java.lang.Override @@ -27733,7 +53110,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private EndPointId( + private Location( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -27752,42 +53129,23 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); - } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); - } - + java.lang.String s = input.readStringRequireUtf8(); + locationCase_ = 1; + location_ = s; break; } case 18: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (endpointUuid_ != null) { - subBuilder = endpointUuid_.toBuilder(); + context.ContextOuterClass.GPS_Position.Builder subBuilder = null; + if (locationCase_ == 2) { + subBuilder = ((context.ContextOuterClass.GPS_Position) location_).toBuilder(); } - endpointUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + location_ = + input.readMessage(context.ContextOuterClass.GPS_Position.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(endpointUuid_); - endpointUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom((context.ContextOuterClass.GPS_Position) location_); + location_ = subBuilder.buildPartial(); } - + locationCase_ = 2; break; } default: { @@ -27811,93 +53169,139 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); + context.ContextOuterClass.Location.class, context.ContextOuterClass.Location.Builder.class); } - public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.TopologyId topologyId_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - /** - * .context.TopologyId topology_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + private int locationCase_ = 0; + private java.lang.Object location_; + public enum LocationCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + REGION(1), + GPS_POSITION(2), + LOCATION_NOT_SET(0); + private final int value; + private LocationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LocationCase valueOf(int value) { + return forNumber(value); + } + + public static LocationCase forNumber(int value) { + switch (value) { + case 1: return REGION; + case 2: return GPS_POSITION; + case 0: return LOCATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public LocationCase + getLocationCase() { + return LocationCase.forNumber( + locationCase_); } - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.DeviceId deviceId_; + public static final int REGION_FIELD_NUMBER = 1; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * string region = 1; + * @return Whether the region field is set. */ - @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; + public boolean hasRegion() { + return locationCase_ == 1; } /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * string region = 1; + * @return The region. */ - @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + public java.lang.String getRegion() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + 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(); + if (locationCase_ == 1) { + location_ = s; + } + return s; + } } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return The bytes for region. */ - @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (locationCase_ == 1) { + location_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int ENDPOINT_UUID_FIELD_NUMBER = 3; - private context.ContextOuterClass.Uuid endpointUuid_; + public static final int GPS_POSITION_FIELD_NUMBER = 2; /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ @java.lang.Override - public boolean hasEndpointUuid() { - return endpointUuid_ != null; + public boolean hasGpsPosition() { + return locationCase_ == 2; } /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ @java.lang.Override - public context.ContextOuterClass.Uuid getEndpointUuid() { - return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + public context.ContextOuterClass.GPS_Position getGpsPosition() { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { - return getEndpointUuid(); + public context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder() { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -27914,14 +53318,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (topologyId_ != null) { - output.writeMessage(1, getTopologyId()); - } - if (deviceId_ != null) { - output.writeMessage(2, getDeviceId()); + if (locationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); } - if (endpointUuid_ != null) { - output.writeMessage(3, getEndpointUuid()); + if (locationCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.GPS_Position) location_); } unknownFields.writeTo(output); } @@ -27932,17 +53333,12 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (topologyId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTopologyId()); - } - if (deviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDeviceId()); + if (locationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); } - if (endpointUuid_ != null) { + if (locationCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getEndpointUuid()); + .computeMessageSize(2, (context.ContextOuterClass.GPS_Position) location_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27954,25 +53350,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.EndPointId)) { + if (!(obj instanceof context.ContextOuterClass.Location)) { return super.equals(obj); } - context.ContextOuterClass.EndPointId other = (context.ContextOuterClass.EndPointId) obj; - - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; - } - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } - if (hasEndpointUuid() != other.hasEndpointUuid()) return false; - if (hasEndpointUuid()) { - if (!getEndpointUuid() - .equals(other.getEndpointUuid())) return false; + context.ContextOuterClass.Location other = (context.ContextOuterClass.Location) obj; + + if (!getLocationCase().equals(other.getLocationCase())) return false; + switch (locationCase_) { + case 1: + if (!getRegion() + .equals(other.getRegion())) return false; + break; + case 2: + if (!getGpsPosition() + .equals(other.getGpsPosition())) return false; + break; + case 0: + default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -27985,86 +53379,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); - } - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } - if (hasEndpointUuid()) { - hash = (37 * hash) + ENDPOINT_UUID_FIELD_NUMBER; - hash = (53 * hash) + getEndpointUuid().hashCode(); + switch (locationCase_) { + case 1: + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + break; + case 2: + hash = (37 * hash) + GPS_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getGpsPosition().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom(byte[] data) + public static context.ContextOuterClass.Location parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Location parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location 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 context.ContextOuterClass.EndPointId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Location parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseDelimitedFrom( + public static context.ContextOuterClass.Location 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 context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -28077,7 +53471,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.EndPointId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Location prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -28093,30 +53487,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Endpoint ------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.EndPointId} + * Protobuf type {@code context.Location} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.EndPointId) - context.ContextOuterClass.EndPointIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Location) + context.ContextOuterClass.LocationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); + context.ContextOuterClass.Location.class, context.ContextOuterClass.Location.Builder.class); } - // Construct using context.ContextOuterClass.EndPointId.newBuilder() + // Construct using context.ContextOuterClass.Location.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -28134,41 +53524,25 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdBuilder_ == null) { - topologyId_ = null; - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - if (endpointUuidBuilder_ == null) { - endpointUuid_ = null; - } else { - endpointUuid_ = null; - endpointUuidBuilder_ = null; - } + locationCase_ = 0; + location_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override - public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { - return context.ContextOuterClass.EndPointId.getDefaultInstance(); + public context.ContextOuterClass.Location getDefaultInstanceForType() { + return context.ContextOuterClass.Location.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.EndPointId build() { - context.ContextOuterClass.EndPointId result = buildPartial(); + public context.ContextOuterClass.Location build() { + context.ContextOuterClass.Location result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -28176,23 +53550,19 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.EndPointId buildPartial() { - context.ContextOuterClass.EndPointId result = new context.ContextOuterClass.EndPointId(this); - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; - } else { - result.topologyId_ = topologyIdBuilder_.build(); + public context.ContextOuterClass.Location buildPartial() { + context.ContextOuterClass.Location result = new context.ContextOuterClass.Location(this); + if (locationCase_ == 1) { + result.location_ = location_; } - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); - } - if (endpointUuidBuilder_ == null) { - result.endpointUuid_ = endpointUuid_; - } else { - result.endpointUuid_ = endpointUuidBuilder_.build(); + if (locationCase_ == 2) { + if (gpsPositionBuilder_ == null) { + result.location_ = location_; + } else { + result.location_ = gpsPositionBuilder_.build(); + } } + result.locationCase_ = locationCase_; onBuilt(); return result; } @@ -28231,24 +53601,30 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.EndPointId) { - return mergeFrom((context.ContextOuterClass.EndPointId)other); + if (other instanceof context.ContextOuterClass.Location) { + return mergeFrom((context.ContextOuterClass.Location)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.EndPointId other) { - if (other == context.ContextOuterClass.EndPointId.getDefaultInstance()) return this; - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); - } - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); - } - if (other.hasEndpointUuid()) { - mergeEndpointUuid(other.getEndpointUuid()); + public Builder mergeFrom(context.ContextOuterClass.Location other) { + if (other == context.ContextOuterClass.Location.getDefaultInstance()) return this; + switch (other.getLocationCase()) { + case REGION: { + locationCase_ = 1; + location_ = other.location_; + onChanged(); + break; + } + case GPS_POSITION: { + mergeGpsPosition(other.getGpsPosition()); + break; + } + case LOCATION_NOT_SET: { + break; + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -28265,11 +53641,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.EndPointId parsedMessage = null; + context.ContextOuterClass.Location parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.EndPointId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Location) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -28278,362 +53654,258 @@ public final class ContextOuterClass { } return this; } - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } else { - return topologyIdBuilder_.getMessage(); - } - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; - onChanged(); - } else { - topologyIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); - onChanged(); - } else { - topologyIdBuilder_.setMessage(builderForValue.build()); - } - - return this; + private int locationCase_ = 0; + private java.lang.Object location_; + public LocationCase + getLocationCase() { + return LocationCase.forNumber( + locationCase_); } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } - onChanged(); - } else { - topologyIdBuilder_.mergeFrom(value); - } + public Builder clearLocation() { + locationCase_ = 0; + location_ = null; + onChanged(); return this; } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; - onChanged(); - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); - } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - } - /** - * .context.TopologyId topology_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), - getParentForChildren(), - isClean()); - topologyId_ = null; - } - return topologyIdBuilder_; - } - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * string region = 1; + * @return Whether the region field is set. */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; + @java.lang.Override + public boolean hasRegion() { + return locationCase_ == 1; } /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * string region = 1; + * @return The region. */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; } - } - /** - * .context.DeviceId device_id = 2; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (locationCase_ == 1) { + location_ = s; } - deviceId_ = value; - onChanged(); + return s; } else { - deviceIdBuilder_.setMessage(value); + return (java.lang.String) ref; } - - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return The bytes for region. */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); + @java.lang.Override + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (locationCase_ == 1) { + location_ = b; + } + return b; } else { - deviceIdBuilder_.setMessage(builderForValue.build()); + return (com.google.protobuf.ByteString) ref; } - - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @param value The region to set. + * @return This builder for chaining. */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - + public Builder setRegion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationCase_ = 1; + location_ = value; + onChanged(); return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return This builder for chaining. */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; + public Builder clearRegion() { + if (locationCase_ == 1) { + locationCase_ = 0; + location_ = null; onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; } - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @param value The bytes for region to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { - + public Builder setRegionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationCase_ = 1; + location_ = value; onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); - } - /** - * .context.DeviceId device_id = 2; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - } - /** - * .context.DeviceId device_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; + return this; } - private context.ContextOuterClass.Uuid endpointUuid_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> endpointUuidBuilder_; + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder> gpsPositionBuilder_; /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ - public boolean hasEndpointUuid() { - return endpointUuidBuilder_ != null || endpointUuid_ != null; + @java.lang.Override + public boolean hasGpsPosition() { + return locationCase_ == 2; } /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ - public context.ContextOuterClass.Uuid getEndpointUuid() { - if (endpointUuidBuilder_ == null) { - return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + @java.lang.Override + public context.ContextOuterClass.GPS_Position getGpsPosition() { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } else { - return endpointUuidBuilder_.getMessage(); + if (locationCase_ == 2) { + return gpsPositionBuilder_.getMessage(); + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder setEndpointUuid(context.ContextOuterClass.Uuid value) { - if (endpointUuidBuilder_ == null) { + public Builder setGpsPosition(context.ContextOuterClass.GPS_Position value) { + if (gpsPositionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - endpointUuid_ = value; + location_ = value; onChanged(); } else { - endpointUuidBuilder_.setMessage(value); + gpsPositionBuilder_.setMessage(value); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder setEndpointUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (endpointUuidBuilder_ == null) { - endpointUuid_ = builderForValue.build(); + public Builder setGpsPosition( + context.ContextOuterClass.GPS_Position.Builder builderForValue) { + if (gpsPositionBuilder_ == null) { + location_ = builderForValue.build(); onChanged(); } else { - endpointUuidBuilder_.setMessage(builderForValue.build()); + gpsPositionBuilder_.setMessage(builderForValue.build()); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder mergeEndpointUuid(context.ContextOuterClass.Uuid value) { - if (endpointUuidBuilder_ == null) { - if (endpointUuid_ != null) { - endpointUuid_ = - context.ContextOuterClass.Uuid.newBuilder(endpointUuid_).mergeFrom(value).buildPartial(); + public Builder mergeGpsPosition(context.ContextOuterClass.GPS_Position value) { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2 && + location_ != context.ContextOuterClass.GPS_Position.getDefaultInstance()) { + location_ = context.ContextOuterClass.GPS_Position.newBuilder((context.ContextOuterClass.GPS_Position) location_) + .mergeFrom(value).buildPartial(); } else { - endpointUuid_ = value; + location_ = value; } onChanged(); } else { - endpointUuidBuilder_.mergeFrom(value); + if (locationCase_ == 2) { + gpsPositionBuilder_.mergeFrom(value); + } + gpsPositionBuilder_.setMessage(value); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder clearEndpointUuid() { - if (endpointUuidBuilder_ == null) { - endpointUuid_ = null; - onChanged(); + public Builder clearGpsPosition() { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2) { + locationCase_ = 0; + location_ = null; + onChanged(); + } } else { - endpointUuid_ = null; - endpointUuidBuilder_ = null; + if (locationCase_ == 2) { + locationCase_ = 0; + location_ = null; + } + gpsPositionBuilder_.clear(); } - return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public context.ContextOuterClass.Uuid.Builder getEndpointUuidBuilder() { - - onChanged(); - return getEndpointUuidFieldBuilder().getBuilder(); + public context.ContextOuterClass.GPS_Position.Builder getGpsPositionBuilder() { + return getGpsPositionFieldBuilder().getBuilder(); } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { - if (endpointUuidBuilder_ != null) { - return endpointUuidBuilder_.getMessageOrBuilder(); + @java.lang.Override + public context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder() { + if ((locationCase_ == 2) && (gpsPositionBuilder_ != null)) { + return gpsPositionBuilder_.getMessageOrBuilder(); } else { - return endpointUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getEndpointUuidFieldBuilder() { - if (endpointUuidBuilder_ == null) { - endpointUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getEndpointUuid(), + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder> + getGpsPositionFieldBuilder() { + if (gpsPositionBuilder_ == null) { + if (!(locationCase_ == 2)) { + location_ = context.ContextOuterClass.GPS_Position.getDefaultInstance(); + } + gpsPositionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder>( + (context.ContextOuterClass.GPS_Position) location_, getParentForChildren(), isClean()); - endpointUuid_ = null; + location_ = null; } - return endpointUuidBuilder_; + locationCase_ = 2; + onChanged();; + return gpsPositionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -28648,48 +53920,48 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.EndPointId) + // @@protoc_insertion_point(builder_scope:context.Location) } - // @@protoc_insertion_point(class_scope:context.EndPointId) - private static final context.ContextOuterClass.EndPointId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Location) + private static final context.ContextOuterClass.Location DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.EndPointId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Location(); } - public static context.ContextOuterClass.EndPointId getDefaultInstance() { + public static context.ContextOuterClass.Location getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public EndPointId parsePartialFrom( + public Location parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EndPointId(input, extensionRegistry); + return new Location(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { + public context.ContextOuterClass.Location getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface EndPointOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.EndPoint) + public interface Constraint_EndPointLocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_EndPointLocation) com.google.protobuf.MessageOrBuilder { /** @@ -28708,46 +53980,40 @@ public final class ContextOuterClass { context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - *
-     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-     * 
- * - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ - java.lang.String getEndpointType(); + boolean hasLocation(); /** - *
-     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-     * 
- * - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; + * @return The location. */ - com.google.protobuf.ByteString - getEndpointTypeBytes(); + context.ContextOuterClass.Location getLocation(); + /** + * .context.Location location = 2; + */ + context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder(); } /** - * Protobuf type {@code context.EndPoint} + * Protobuf type {@code context.Constraint_EndPointLocation} */ - public static final class EndPoint extends + public static final class Constraint_EndPointLocation extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.EndPoint) - EndPointOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_EndPointLocation) + Constraint_EndPointLocationOrBuilder { private static final long serialVersionUID = 0L; - // Use EndPoint.newBuilder() to construct. - private EndPoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_EndPointLocation.newBuilder() to construct. + private Constraint_EndPointLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private EndPoint() { - endpointType_ = ""; + private Constraint_EndPointLocation() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new EndPoint(); + return new Constraint_EndPointLocation(); } @java.lang.Override @@ -28755,7 +54021,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private EndPoint( + private Constraint_EndPointLocation( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -28787,9 +54053,16 @@ public final class ContextOuterClass { break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); + context.ContextOuterClass.Location.Builder subBuilder = null; + if (location_ != null) { + subBuilder = location_.toBuilder(); + } + location_ = input.readMessage(context.ContextOuterClass.Location.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(location_); + location_ = subBuilder.buildPartial(); + } - endpointType_ = s; break; } default: { @@ -28813,15 +54086,15 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); + context.ContextOuterClass.Constraint_EndPointLocation.class, context.ContextOuterClass.Constraint_EndPointLocation.Builder.class); } public static final int ENDPOINT_ID_FIELD_NUMBER = 1; @@ -28850,50 +54123,30 @@ public final class ContextOuterClass { return getEndpointId(); } - public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object endpointType_; + public static final int LOCATION_FIELD_NUMBER = 2; + private context.ContextOuterClass.Location location_; /** - *
-     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-     * 
- * - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ @java.lang.Override - public java.lang.String getEndpointType() { - java.lang.Object ref = endpointType_; - 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(); - endpointType_ = s; - return s; - } + public boolean hasLocation() { + return location_ != null; } /** - *
-     *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-     * 
- * - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; + * @return The location. */ @java.lang.Override - public com.google.protobuf.ByteString - getEndpointTypeBytes() { - java.lang.Object ref = endpointType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpointType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public context.ContextOuterClass.Location getLocation() { + return location_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : location_; + } + /** + * .context.Location location = 2; + */ + @java.lang.Override + public context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder() { + return getLocation(); } private byte memoizedIsInitialized = -1; @@ -28913,8 +54166,8 @@ public final class ContextOuterClass { if (endpointId_ != null) { output.writeMessage(1, getEndpointId()); } - if (!getEndpointTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointType_); + if (location_ != null) { + output.writeMessage(2, getLocation()); } unknownFields.writeTo(output); } @@ -28929,8 +54182,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getEndpointId()); } - if (!getEndpointTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointType_); + if (location_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLocation()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -28942,18 +54196,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.EndPoint)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_EndPointLocation)) { return super.equals(obj); } - context.ContextOuterClass.EndPoint other = (context.ContextOuterClass.EndPoint) obj; + context.ContextOuterClass.Constraint_EndPointLocation other = (context.ContextOuterClass.Constraint_EndPointLocation) obj; if (hasEndpointId() != other.hasEndpointId()) return false; if (hasEndpointId()) { if (!getEndpointId() .equals(other.getEndpointId())) return false; } - if (!getEndpointType() - .equals(other.getEndpointType())) return false; + if (hasLocation() != other.hasLocation()) return false; + if (hasLocation()) { + if (!getLocation() + .equals(other.getLocation())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -28969,76 +54226,78 @@ public final class ContextOuterClass { hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; hash = (53 * hash) + getEndpointId().hashCode(); } - hash = (37 * hash) + ENDPOINT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getEndpointType().hashCode(); + if (hasLocation()) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation 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 context.ContextOuterClass.EndPoint parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointLocation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation 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 context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -29051,7 +54310,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.EndPoint prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_EndPointLocation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -29067,26 +54326,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.EndPoint} + * Protobuf type {@code context.Constraint_EndPointLocation} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.EndPoint) - context.ContextOuterClass.EndPointOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_EndPointLocation) + context.ContextOuterClass.Constraint_EndPointLocationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); + context.ContextOuterClass.Constraint_EndPointLocation.class, context.ContextOuterClass.Constraint_EndPointLocation.Builder.class); } - // Construct using context.ContextOuterClass.EndPoint.newBuilder() + // Construct using context.ContextOuterClass.Constraint_EndPointLocation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -29110,25 +54369,29 @@ public final class ContextOuterClass { endpointId_ = null; endpointIdBuilder_ = null; } - endpointType_ = ""; - + if (locationBuilder_ == null) { + location_ = null; + } else { + location_ = null; + locationBuilder_ = null; + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override - public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { - return context.ContextOuterClass.EndPoint.getDefaultInstance(); + public context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.EndPoint build() { - context.ContextOuterClass.EndPoint result = buildPartial(); + public context.ContextOuterClass.Constraint_EndPointLocation build() { + context.ContextOuterClass.Constraint_EndPointLocation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -29136,14 +54399,18 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.EndPoint buildPartial() { - context.ContextOuterClass.EndPoint result = new context.ContextOuterClass.EndPoint(this); + public context.ContextOuterClass.Constraint_EndPointLocation buildPartial() { + context.ContextOuterClass.Constraint_EndPointLocation result = new context.ContextOuterClass.Constraint_EndPointLocation(this); if (endpointIdBuilder_ == null) { result.endpointId_ = endpointId_; } else { result.endpointId_ = endpointIdBuilder_.build(); } - result.endpointType_ = endpointType_; + if (locationBuilder_ == null) { + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); + } onBuilt(); return result; } @@ -29182,22 +54449,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.EndPoint) { - return mergeFrom((context.ContextOuterClass.EndPoint)other); + if (other instanceof context.ContextOuterClass.Constraint_EndPointLocation) { + return mergeFrom((context.ContextOuterClass.Constraint_EndPointLocation)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.EndPoint other) { - if (other == context.ContextOuterClass.EndPoint.getDefaultInstance()) return this; + public Builder mergeFrom(context.ContextOuterClass.Constraint_EndPointLocation other) { + if (other == context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance()) return this; if (other.hasEndpointId()) { mergeEndpointId(other.getEndpointId()); } - if (!other.getEndpointType().isEmpty()) { - endpointType_ = other.endpointType_; - onChanged(); + if (other.hasLocation()) { + mergeLocation(other.getLocation()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -29214,11 +54480,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.EndPoint parsedMessage = null; + context.ContextOuterClass.Constraint_EndPointLocation parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.EndPoint) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_EndPointLocation) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -29347,100 +54613,123 @@ public final class ContextOuterClass { return endpointIdBuilder_; } - private java.lang.Object endpointType_ = ""; + private context.ContextOuterClass.Location location_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> locationBuilder_; /** - *
-       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-       * 
- * - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ - public java.lang.String getEndpointType() { - java.lang.Object ref = endpointType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - endpointType_ = s; - return s; + public boolean hasLocation() { + return locationBuilder_ != null || location_ != null; + } + /** + * .context.Location location = 2; + * @return The location. + */ + public context.ContextOuterClass.Location getLocation() { + if (locationBuilder_ == null) { + return location_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : location_; } else { - return (java.lang.String) ref; + return locationBuilder_.getMessage(); } } /** - *
-       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-       * 
- * - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; */ - public com.google.protobuf.ByteString - getEndpointTypeBytes() { - java.lang.Object ref = endpointType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpointType_ = b; - return b; + public Builder setLocation(context.ContextOuterClass.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + locationBuilder_.setMessage(value); } + + return this; } /** - *
-       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-       * 
- * - * string endpoint_type = 2; - * @param value The endpointType to set. - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder setEndpointType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - endpointType_ = value; - onChanged(); + public Builder setLocation( + context.ContextOuterClass.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + location_ = builderForValue.build(); + onChanged(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + return this; } /** - *
-       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-       * 
- * - * string endpoint_type = 2; - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder clearEndpointType() { - - endpointType_ = getDefaultInstance().getEndpointType(); - onChanged(); + public Builder mergeLocation(context.ContextOuterClass.Location value) { + if (locationBuilder_ == null) { + if (location_ != null) { + location_ = + context.ContextOuterClass.Location.newBuilder(location_).mergeFrom(value).buildPartial(); + } else { + location_ = value; + } + onChanged(); + } else { + locationBuilder_.mergeFrom(value); + } + return this; } /** - *
-       *repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3;
-       * 
- * - * string endpoint_type = 2; - * @param value The bytes for endpointType to set. - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder setEndpointTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearLocation() { + if (locationBuilder_ == null) { + location_ = null; + onChanged(); + } else { + location_ = null; + locationBuilder_ = null; + } + + return this; + } + /** + * .context.Location location = 2; + */ + public context.ContextOuterClass.Location.Builder getLocationBuilder() { - endpointType_ = value; onChanged(); - return this; + return getLocationFieldBuilder().getBuilder(); + } + /** + * .context.Location location = 2; + */ + public context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilder(); + } else { + return location_ == null ? + context.ContextOuterClass.Location.getDefaultInstance() : location_; + } + } + /** + * .context.Location location = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder>( + getLocation(), + getParentForChildren(), + isClean()); + location_ = null; + } + return locationBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -29455,108 +54744,91 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.EndPoint) + // @@protoc_insertion_point(builder_scope:context.Constraint_EndPointLocation) } - // @@protoc_insertion_point(class_scope:context.EndPoint) - private static final context.ContextOuterClass.EndPoint DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_EndPointLocation) + private static final context.ContextOuterClass.Constraint_EndPointLocation DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.EndPoint(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_EndPointLocation(); } - public static context.ContextOuterClass.EndPoint getDefaultInstance() { + public static context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public EndPoint parsePartialFrom( + public Constraint_EndPointLocation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EndPoint(input, extensionRegistry); + return new Constraint_EndPointLocation(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConfigRuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConfigRule) + public interface Constraint_EndPointPriorityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_EndPointPriority) com.google.protobuf.MessageOrBuilder { /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - int getActionValue(); - /** - * .context.ConfigActionEnum action = 1; - * @return The action. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - context.ContextOuterClass.ConfigActionEnum getAction(); - + boolean hasEndpointId(); /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - java.lang.String getResourceKey(); + context.ContextOuterClass.EndPointId getEndpointId(); /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; */ - com.google.protobuf.ByteString - getResourceKeyBytes(); + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * string resource_value = 3; - * @return The resourceValue. - */ - java.lang.String getResourceValue(); - /** - * string resource_value = 3; - * @return The bytes for resourceValue. + * uint32 priority = 2; + * @return The priority. */ - com.google.protobuf.ByteString - getResourceValueBytes(); + int getPriority(); } /** - * Protobuf type {@code context.ConfigRule} + * Protobuf type {@code context.Constraint_EndPointPriority} */ - public static final class ConfigRule extends + public static final class Constraint_EndPointPriority extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConfigRule) - ConfigRuleOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_EndPointPriority) + Constraint_EndPointPriorityOrBuilder { private static final long serialVersionUID = 0L; - // Use ConfigRule.newBuilder() to construct. - private ConfigRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_EndPointPriority.newBuilder() to construct. + private Constraint_EndPointPriority(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConfigRule() { - action_ = 0; - resourceKey_ = ""; - resourceValue_ = ""; + private Constraint_EndPointPriority() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConfigRule(); + return new Constraint_EndPointPriority(); } @java.lang.Override @@ -29564,7 +54836,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConfigRule( + private Constraint_EndPointPriority( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -29582,22 +54854,22 @@ public final class ContextOuterClass { case 0: done = true; break; - case 8: { - int rawValue = input.readEnum(); - - action_ = rawValue; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); + case 10: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } - resourceKey_ = s; break; } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); + case 16: { - resourceValue_ = s; + priority_ = input.readUInt32(); break; } default: { @@ -29621,110 +54893,52 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + context.ContextOuterClass.Constraint_EndPointPriority.class, context.ContextOuterClass.Constraint_EndPointPriority.Builder.class); } - public static final int ACTION_FIELD_NUMBER = 1; - private int action_; - /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } - /** - * .context.ConfigActionEnum action = 1; - * @return The action. - */ - @java.lang.Override public context.ContextOuterClass.ConfigActionEnum getAction() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); - return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; - } - - public static final int RESOURCE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object resourceKey_; + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ @java.lang.Override - public java.lang.String getResourceKey() { - java.lang.Object ref = resourceKey_; - 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(); - resourceKey_ = s; - return s; - } + public boolean hasEndpointId() { + return endpointId_ != null; } /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ @java.lang.Override - public com.google.protobuf.ByteString - getResourceKeyBytes() { - java.lang.Object ref = resourceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } - - public static final int RESOURCE_VALUE_FIELD_NUMBER = 3; - private volatile java.lang.Object resourceValue_; /** - * string resource_value = 3; - * @return The resourceValue. + * .context.EndPointId endpoint_id = 1; */ @java.lang.Override - public java.lang.String getResourceValue() { - java.lang.Object ref = resourceValue_; - 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(); - resourceValue_ = s; - return s; - } + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); } + + public static final int PRIORITY_FIELD_NUMBER = 2; + private int priority_; /** - * string resource_value = 3; - * @return The bytes for resourceValue. + * uint32 priority = 2; + * @return The priority. */ @java.lang.Override - public com.google.protobuf.ByteString - getResourceValueBytes() { - java.lang.Object ref = resourceValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getPriority() { + return priority_; } private byte memoizedIsInitialized = -1; @@ -29741,14 +54955,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { - output.writeEnum(1, action_); - } - if (!getResourceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceKey_); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); } - if (!getResourceValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceValue_); + if (priority_ != 0) { + output.writeUInt32(2, priority_); } unknownFields.writeTo(output); } @@ -29759,15 +54970,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, action_); - } - if (!getResourceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceKey_); + .computeMessageSize(1, getEndpointId()); } - if (!getResourceValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceValue_); + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, priority_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -29779,16 +54988,18 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConfigRule)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_EndPointPriority)) { return super.equals(obj); } - context.ContextOuterClass.ConfigRule other = (context.ContextOuterClass.ConfigRule) obj; + context.ContextOuterClass.Constraint_EndPointPriority other = (context.ContextOuterClass.Constraint_EndPointPriority) obj; - if (action_ != other.action_) return false; - if (!getResourceKey() - .equals(other.getResourceKey())) return false; - if (!getResourceValue() - .equals(other.getResourceValue())) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (getPriority() + != other.getPriority()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -29800,80 +55011,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + action_; - hash = (37 * hash) + RESOURCE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getResourceKey().hashCode(); - hash = (37 * hash) + RESOURCE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getResourceValue().hashCode(); + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority 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 context.ContextOuterClass.ConfigRule parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointPriority parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority 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 context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -29886,7 +55097,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConfigRule prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_EndPointPriority prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -29902,26 +55113,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConfigRule} + * Protobuf type {@code context.Constraint_EndPointPriority} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConfigRule) - context.ContextOuterClass.ConfigRuleOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_EndPointPriority) + context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + context.ContextOuterClass.Constraint_EndPointPriority.class, context.ContextOuterClass.Constraint_EndPointPriority.Builder.class); } - // Construct using context.ContextOuterClass.ConfigRule.newBuilder() + // Construct using context.ContextOuterClass.Constraint_EndPointPriority.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -29939,11 +55150,13 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - action_ = 0; - - resourceKey_ = ""; - - resourceValue_ = ""; + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + priority_ = 0; return this; } @@ -29951,17 +55164,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { - return context.ContextOuterClass.ConfigRule.getDefaultInstance(); + public context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConfigRule build() { - context.ContextOuterClass.ConfigRule result = buildPartial(); + public context.ContextOuterClass.Constraint_EndPointPriority build() { + context.ContextOuterClass.Constraint_EndPointPriority result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -29969,11 +55182,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConfigRule buildPartial() { - context.ContextOuterClass.ConfigRule result = new context.ContextOuterClass.ConfigRule(this); - result.action_ = action_; - result.resourceKey_ = resourceKey_; - result.resourceValue_ = resourceValue_; + public context.ContextOuterClass.Constraint_EndPointPriority buildPartial() { + context.ContextOuterClass.Constraint_EndPointPriority result = new context.ContextOuterClass.Constraint_EndPointPriority(this); + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + result.priority_ = priority_; onBuilt(); return result; } @@ -30012,26 +55228,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConfigRule) { - return mergeFrom((context.ContextOuterClass.ConfigRule)other); + if (other instanceof context.ContextOuterClass.Constraint_EndPointPriority) { + return mergeFrom((context.ContextOuterClass.Constraint_EndPointPriority)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConfigRule other) { - if (other == context.ContextOuterClass.ConfigRule.getDefaultInstance()) return this; - if (other.action_ != 0) { - setActionValue(other.getActionValue()); - } - if (!other.getResourceKey().isEmpty()) { - resourceKey_ = other.resourceKey_; - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.Constraint_EndPointPriority other) { + if (other == context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); } - if (!other.getResourceValue().isEmpty()) { - resourceValue_ = other.resourceValue_; - onChanged(); + if (other.getPriority() != 0) { + setPriority(other.getPriority()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -30048,11 +55259,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConfigRule parsedMessage = null; + context.ContextOuterClass.Constraint_EndPointPriority parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConfigRule) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_EndPointPriority) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -30062,208 +55273,152 @@ public final class ContextOuterClass { return this; } - private int action_ = 0; - /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } - /** - * .context.ConfigActionEnum action = 1; - * @param value The enum numeric value on the wire for action to set. - * @return This builder for chaining. - */ - public Builder setActionValue(int value) { - - action_ = value; - onChanged(); - return this; - } + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ConfigActionEnum action = 1; - * @return The action. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override - public context.ContextOuterClass.ConfigActionEnum getAction() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); - return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ConfigActionEnum action = 1; - * @param value The action to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public Builder setAction(context.ContextOuterClass.ConfigActionEnum value) { - if (value == null) { - throw new NullPointerException(); + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); } - - action_ = value.getNumber(); - onChanged(); - return this; } /** - * .context.ConfigActionEnum action = 1; - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder clearAction() { - - action_ = 0; - onChanged(); + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + return this; } - - private java.lang.Object resourceKey_ = ""; /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; */ - public java.lang.String getResourceKey() { - java.lang.Object ref = resourceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resourceKey_ = s; - return s; + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); } else { - return (java.lang.String) ref; + endpointIdBuilder_.setMessage(builderForValue.build()); } + + return this; } /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; */ - public com.google.protobuf.ByteString - getResourceKeyBytes() { - java.lang.Object ref = resourceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceKey_ = b; - return b; + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + endpointIdBuilder_.mergeFrom(value); } - } - /** - * string resource_key = 2; - * @param value The resourceKey to set. - * @return This builder for chaining. - */ - public Builder setResourceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resourceKey_ = value; - onChanged(); + return this; } /** - * string resource_key = 2; - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder clearResourceKey() { - - resourceKey_ = getDefaultInstance().getResourceKey(); - onChanged(); + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + return this; } /** - * string resource_key = 2; - * @param value The bytes for resourceKey to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder setResourceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { - resourceKey_ = value; onChanged(); - return this; + return getEndpointIdFieldBuilder().getBuilder(); } - - private java.lang.Object resourceValue_ = ""; /** - * string resource_value = 3; - * @return The resourceValue. + * .context.EndPointId endpoint_id = 1; */ - public java.lang.String getResourceValue() { - java.lang.Object ref = resourceValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resourceValue_ = s; - return s; + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); } else { - return (java.lang.String) ref; + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } } /** - * string resource_value = 3; - * @return The bytes for resourceValue. + * .context.EndPointId endpoint_id = 1; */ - public com.google.protobuf.ByteString - getResourceValueBytes() { - java.lang.Object ref = resourceValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; } + return endpointIdBuilder_; } + + private int priority_ ; /** - * string resource_value = 3; - * @param value The resourceValue to set. - * @return This builder for chaining. + * uint32 priority = 2; + * @return The priority. */ - public Builder setResourceValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resourceValue_ = value; - onChanged(); - return this; + @java.lang.Override + public int getPriority() { + return priority_; } /** - * string resource_value = 3; + * uint32 priority = 2; + * @param value The priority to set. * @return This builder for chaining. */ - public Builder clearResourceValue() { + public Builder setPriority(int value) { - resourceValue_ = getDefaultInstance().getResourceValue(); + priority_ = value; onChanged(); return this; } /** - * string resource_value = 3; - * @param value The bytes for resourceValue to set. + * uint32 priority = 2; * @return This builder for chaining. */ - public Builder setResourceValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearPriority() { - resourceValue_ = value; + priority_ = 0; onChanged(); return this; } @@ -30280,100 +55435,76 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConfigRule) + // @@protoc_insertion_point(builder_scope:context.Constraint_EndPointPriority) } - // @@protoc_insertion_point(class_scope:context.ConfigRule) - private static final context.ContextOuterClass.ConfigRule DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_EndPointPriority) + private static final context.ContextOuterClass.Constraint_EndPointPriority DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_EndPointPriority(); } - public static context.ContextOuterClass.ConfigRule getDefaultInstance() { + public static context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConfigRule parsePartialFrom( + public Constraint_EndPointPriority parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConfigRule(input, extensionRegistry); + return new Constraint_EndPointPriority(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConstraintOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Constraint) + public interface Constraint_SLA_LatencyOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Latency) com.google.protobuf.MessageOrBuilder { /** - * string constraint_type = 1; - * @return The constraintType. - */ - java.lang.String getConstraintType(); - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - com.google.protobuf.ByteString - getConstraintTypeBytes(); - - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - java.lang.String getConstraintValue(); - /** - * string constraint_value = 2; - * @return The bytes for constraintValue. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ - com.google.protobuf.ByteString - getConstraintValueBytes(); + float getE2ELatencyMs(); } /** - *
-   * ----- Constraint ----------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.Constraint} + * Protobuf type {@code context.Constraint_SLA_Latency} */ - public static final class Constraint extends + public static final class Constraint_SLA_Latency extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Constraint) - ConstraintOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Latency) + Constraint_SLA_LatencyOrBuilder { private static final long serialVersionUID = 0L; - // Use Constraint.newBuilder() to construct. - private Constraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Latency.newBuilder() to construct. + private Constraint_SLA_Latency(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Constraint() { - constraintType_ = ""; - constraintValue_ = ""; + private Constraint_SLA_Latency() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Constraint(); + return new Constraint_SLA_Latency(); } @java.lang.Override @@ -30381,7 +55512,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Constraint( + private Constraint_SLA_Latency( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -30399,16 +55530,9 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - constraintType_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); + case 13: { - constraintValue_ = s; + e2ELatencyMs_ = input.readFloat(); break; } default: { @@ -30432,91 +55556,26 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); - } - - public static final int CONSTRAINT_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object constraintType_; - /** - * string constraint_type = 1; - * @return The constraintType. - */ - @java.lang.Override - public java.lang.String getConstraintType() { - java.lang.Object ref = constraintType_; - 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(); - constraintType_ = s; - return s; - } - } - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getConstraintTypeBytes() { - java.lang.Object ref = constraintType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + context.ContextOuterClass.Constraint_SLA_Latency.class, context.ContextOuterClass.Constraint_SLA_Latency.Builder.class); } - public static final int CONSTRAINT_VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object constraintValue_; - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - @java.lang.Override - public java.lang.String getConstraintValue() { - java.lang.Object ref = constraintValue_; - 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(); - constraintValue_ = s; - return s; - } - } + public static final int E2E_LATENCY_MS_FIELD_NUMBER = 1; + private float e2ELatencyMs_; /** - * string constraint_value = 2; - * @return The bytes for constraintValue. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ @java.lang.Override - public com.google.protobuf.ByteString - getConstraintValueBytes() { - java.lang.Object ref = constraintValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public float getE2ELatencyMs() { + return e2ELatencyMs_; } private byte memoizedIsInitialized = -1; @@ -30533,11 +55592,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getConstraintTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraintType_); - } - if (!getConstraintValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, constraintValue_); + if (e2ELatencyMs_ != 0F) { + output.writeFloat(1, e2ELatencyMs_); } unknownFields.writeTo(output); } @@ -30548,11 +55604,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (!getConstraintTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraintType_); - } - if (!getConstraintValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, constraintValue_); + if (e2ELatencyMs_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, e2ELatencyMs_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -30564,15 +55618,14 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Constraint)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Latency)) { return super.equals(obj); } - context.ContextOuterClass.Constraint other = (context.ContextOuterClass.Constraint) obj; + context.ContextOuterClass.Constraint_SLA_Latency other = (context.ContextOuterClass.Constraint_SLA_Latency) obj; - if (!getConstraintType() - .equals(other.getConstraintType())) return false; - if (!getConstraintValue() - .equals(other.getConstraintValue())) return false; + if (java.lang.Float.floatToIntBits(getE2ELatencyMs()) + != java.lang.Float.floatToIntBits( + other.getE2ELatencyMs())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -30584,78 +55637,77 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONSTRAINT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getConstraintType().hashCode(); - hash = (37 * hash) + CONSTRAINT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getConstraintValue().hashCode(); + hash = (37 * hash) + E2E_LATENCY_MS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getE2ELatencyMs()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency 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 context.ContextOuterClass.Constraint parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Latency parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency 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 context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -30668,7 +55720,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Constraint prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Latency prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -30684,30 +55736,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Constraint ----------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.Constraint} + * Protobuf type {@code context.Constraint_SLA_Latency} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Constraint) - context.ContextOuterClass.ConstraintOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Latency) + context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); + context.ContextOuterClass.Constraint_SLA_Latency.class, context.ContextOuterClass.Constraint_SLA_Latency.Builder.class); } - // Construct using context.ContextOuterClass.Constraint.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Latency.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -30725,9 +55773,7 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - constraintType_ = ""; - - constraintValue_ = ""; + e2ELatencyMs_ = 0F; return this; } @@ -30735,17 +55781,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override - public context.ContextOuterClass.Constraint getDefaultInstanceForType() { - return context.ContextOuterClass.Constraint.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Constraint build() { - context.ContextOuterClass.Constraint result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Latency build() { + context.ContextOuterClass.Constraint_SLA_Latency result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -30753,10 +55799,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Constraint buildPartial() { - context.ContextOuterClass.Constraint result = new context.ContextOuterClass.Constraint(this); - result.constraintType_ = constraintType_; - result.constraintValue_ = constraintValue_; + public context.ContextOuterClass.Constraint_SLA_Latency buildPartial() { + context.ContextOuterClass.Constraint_SLA_Latency result = new context.ContextOuterClass.Constraint_SLA_Latency(this); + result.e2ELatencyMs_ = e2ELatencyMs_; onBuilt(); return result; } @@ -30795,201 +55840,75 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Constraint) { - return mergeFrom((context.ContextOuterClass.Constraint)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Latency) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Latency)other); } else { super.mergeFrom(other); return this; - } - } - - public Builder mergeFrom(context.ContextOuterClass.Constraint other) { - if (other == context.ContextOuterClass.Constraint.getDefaultInstance()) return this; - if (!other.getConstraintType().isEmpty()) { - constraintType_ = other.constraintType_; - onChanged(); - } - if (!other.getConstraintValue().isEmpty()) { - constraintValue_ = other.constraintValue_; - 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 { - context.ContextOuterClass.Constraint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Constraint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object constraintType_ = ""; - /** - * string constraint_type = 1; - * @return The constraintType. - */ - public java.lang.String getConstraintType() { - java.lang.Object ref = constraintType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - constraintType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - public com.google.protobuf.ByteString - getConstraintTypeBytes() { - java.lang.Object ref = constraintType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string constraint_type = 1; - * @param value The constraintType to set. - * @return This builder for chaining. - */ - public Builder setConstraintType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - constraintType_ = value; - onChanged(); - return this; - } - /** - * string constraint_type = 1; - * @return This builder for chaining. - */ - public Builder clearConstraintType() { - - constraintType_ = getDefaultInstance().getConstraintType(); - onChanged(); - return this; + } } - /** - * string constraint_type = 1; - * @param value The bytes for constraintType to set. - * @return This builder for chaining. - */ - public Builder setConstraintTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - constraintType_ = value; + + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Latency other) { + if (other == context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance()) return this; + if (other.getE2ELatencyMs() != 0F) { + setE2ELatencyMs(other.getE2ELatencyMs()); + } + this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } - private java.lang.Object constraintValue_ = ""; - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - public java.lang.String getConstraintValue() { - java.lang.Object ref = constraintValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - constraintValue_ = s; - return s; - } else { - return (java.lang.String) ref; - } + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * string constraint_value = 2; - * @return The bytes for constraintValue. - */ - public com.google.protobuf.ByteString - getConstraintValueBytes() { - java.lang.Object ref = constraintValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.Constraint_SLA_Latency parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Latency) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private float e2ELatencyMs_ ; /** - * string constraint_value = 2; - * @param value The constraintValue to set. - * @return This builder for chaining. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ - public Builder setConstraintValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - constraintValue_ = value; - onChanged(); - return this; + @java.lang.Override + public float getE2ELatencyMs() { + return e2ELatencyMs_; } /** - * string constraint_value = 2; + * float e2e_latency_ms = 1; + * @param value The e2eLatencyMs to set. * @return This builder for chaining. */ - public Builder clearConstraintValue() { + public Builder setE2ELatencyMs(float value) { - constraintValue_ = getDefaultInstance().getConstraintValue(); + e2ELatencyMs_ = value; onChanged(); return this; } /** - * string constraint_value = 2; - * @param value The bytes for constraintValue to set. + * float e2e_latency_ms = 1; * @return This builder for chaining. */ - public Builder setConstraintValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearE2ELatencyMs() { - constraintValue_ = value; + e2ELatencyMs_ = 0F; onChanged(); return this; } @@ -31006,89 +55925,76 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Constraint) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Latency) } - // @@protoc_insertion_point(class_scope:context.Constraint) - private static final context.ContextOuterClass.Constraint DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Latency) + private static final context.ContextOuterClass.Constraint_SLA_Latency DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Latency(); } - public static context.ContextOuterClass.Constraint getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Constraint parsePartialFrom( + public Constraint_SLA_Latency parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Constraint(input, extensionRegistry); + return new Constraint_SLA_Latency(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Constraint getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionId) + public interface Constraint_SLA_CapacityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Capacity) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - boolean hasConnectionUuid(); - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - context.ContextOuterClass.Uuid getConnectionUuid(); - /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ - context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + float getCapacityGbps(); } /** - *
-   * ----- Connection ----------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.Constraint_SLA_Capacity} */ - public static final class ConnectionId extends + public static final class Constraint_SLA_Capacity extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionId) - ConnectionIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Capacity) + Constraint_SLA_CapacityOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionId.newBuilder() to construct. - private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Capacity.newBuilder() to construct. + private Constraint_SLA_Capacity(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionId() { + private Constraint_SLA_Capacity() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionId(); + return new Constraint_SLA_Capacity(); } @java.lang.Override @@ -31096,7 +56002,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionId( + private Constraint_SLA_Capacity( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -31114,17 +56020,9 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (connectionUuid_ != null) { - subBuilder = connectionUuid_.toBuilder(); - } - connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connectionUuid_); - connectionUuid_ = subBuilder.buildPartial(); - } + case 13: { + capacityGbps_ = input.readFloat(); break; } default: { @@ -31148,41 +56046,26 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.Constraint_SLA_Capacity.class, context.ContextOuterClass.Constraint_SLA_Capacity.Builder.class); } - public static final int CONNECTION_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid connectionUuid_; - /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - @java.lang.Override - public boolean hasConnectionUuid() { - return connectionUuid_ != null; - } - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getConnectionUuid() { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } + public static final int CAPACITY_GBPS_FIELD_NUMBER = 1; + private float capacityGbps_; /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - return getConnectionUuid(); + public float getCapacityGbps() { + return capacityGbps_; } private byte memoizedIsInitialized = -1; @@ -31199,8 +56082,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionUuid_ != null) { - output.writeMessage(1, getConnectionUuid()); + if (capacityGbps_ != 0F) { + output.writeFloat(1, capacityGbps_); } unknownFields.writeTo(output); } @@ -31211,9 +56094,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionUuid_ != null) { + if (capacityGbps_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionUuid()); + .computeFloatSize(1, capacityGbps_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -31225,16 +56108,14 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Capacity)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + context.ContextOuterClass.Constraint_SLA_Capacity other = (context.ContextOuterClass.Constraint_SLA_Capacity) obj; - if (hasConnectionUuid() != other.hasConnectionUuid()) return false; - if (hasConnectionUuid()) { - if (!getConnectionUuid() - .equals(other.getConnectionUuid())) return false; - } + if (java.lang.Float.floatToIntBits(getCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getCapacityGbps())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -31246,78 +56127,77 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionUuid()) { - hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionUuid().hashCode(); - } + hash = (37 * hash) + CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getCapacityGbps()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity 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 context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity 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 context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -31330,7 +56210,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Capacity prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -31346,30 +56226,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Connection ----------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.Constraint_SLA_Capacity} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionId) - context.ContextOuterClass.ConnectionIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Capacity) + context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.Constraint_SLA_Capacity.class, context.ContextOuterClass.Constraint_SLA_Capacity.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Capacity.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -31387,29 +56263,25 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; - } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; - } + capacityGbps_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionId build() { - context.ContextOuterClass.ConnectionId result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Capacity build() { + context.ContextOuterClass.Constraint_SLA_Capacity result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -31417,13 +56289,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionId buildPartial() { - context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); - if (connectionUuidBuilder_ == null) { - result.connectionUuid_ = connectionUuid_; - } else { - result.connectionUuid_ = connectionUuidBuilder_.build(); - } + public context.ContextOuterClass.Constraint_SLA_Capacity buildPartial() { + context.ContextOuterClass.Constraint_SLA_Capacity result = new context.ContextOuterClass.Constraint_SLA_Capacity(this); + result.capacityGbps_ = capacityGbps_; onBuilt(); return result; } @@ -31462,18 +56330,18 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionId) { - return mergeFrom((context.ContextOuterClass.ConnectionId)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Capacity) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Capacity)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionId other) { - if (other == context.ContextOuterClass.ConnectionId.getDefaultInstance()) return this; - if (other.hasConnectionUuid()) { - mergeConnectionUuid(other.getConnectionUuid()); + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Capacity other) { + if (other == context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance()) return this; + if (other.getCapacityGbps() != 0F) { + setCapacityGbps(other.getCapacityGbps()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -31490,11 +56358,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionId parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Capacity parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Capacity) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -31504,123 +56372,35 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid connectionUuid_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> connectionUuidBuilder_; - /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - public boolean hasConnectionUuid() { - return connectionUuidBuilder_ != null || connectionUuid_ != null; - } - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - public context.ContextOuterClass.Uuid getConnectionUuid() { - if (connectionUuidBuilder_ == null) { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } else { - return connectionUuidBuilder_.getMessage(); - } - } - /** - * .context.Uuid connection_uuid = 1; - */ - public Builder setConnectionUuid(context.ContextOuterClass.Uuid value) { - if (connectionUuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connectionUuid_ = value; - onChanged(); - } else { - connectionUuidBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.Uuid connection_uuid = 1; - */ - public Builder setConnectionUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (connectionUuidBuilder_ == null) { - connectionUuid_ = builderForValue.build(); - onChanged(); - } else { - connectionUuidBuilder_.setMessage(builderForValue.build()); - } - - return this; - } + private float capacityGbps_ ; /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ - public Builder mergeConnectionUuid(context.ContextOuterClass.Uuid value) { - if (connectionUuidBuilder_ == null) { - if (connectionUuid_ != null) { - connectionUuid_ = - context.ContextOuterClass.Uuid.newBuilder(connectionUuid_).mergeFrom(value).buildPartial(); - } else { - connectionUuid_ = value; - } - onChanged(); - } else { - connectionUuidBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getCapacityGbps() { + return capacityGbps_; } /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @param value The capacityGbps to set. + * @return This builder for chaining. */ - public Builder clearConnectionUuid() { - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; - onChanged(); - } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; - } - + public Builder setCapacityGbps(float value) { + + capacityGbps_ = value; + onChanged(); return this; } /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.Uuid.Builder getConnectionUuidBuilder() { + public Builder clearCapacityGbps() { + capacityGbps_ = 0F; onChanged(); - return getConnectionUuidFieldBuilder().getBuilder(); - } - /** - * .context.Uuid connection_uuid = 1; - */ - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - if (connectionUuidBuilder_ != null) { - return connectionUuidBuilder_.getMessageOrBuilder(); - } else { - return connectionUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } - } - /** - * .context.Uuid connection_uuid = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getConnectionUuidFieldBuilder() { - if (connectionUuidBuilder_ == null) { - connectionUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getConnectionUuid(), - getParentForChildren(), - isClean()); - connectionUuid_ = null; - } - return connectionUuidBuilder_; + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -31635,125 +56415,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionId) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Capacity) } - // @@protoc_insertion_point(class_scope:context.ConnectionId) - private static final context.ContextOuterClass.ConnectionId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Capacity) + private static final context.ContextOuterClass.Constraint_SLA_Capacity DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Capacity(); } - public static context.ContextOuterClass.ConnectionId getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionId parsePartialFrom( + public Constraint_SLA_Capacity parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionId(input, extensionRegistry); + return new Constraint_SLA_Capacity(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Connection) + public interface Constraint_SLA_AvailabilityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Availability) com.google.protobuf.MessageOrBuilder { /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - boolean hasConnectionId(); - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - context.ContextOuterClass.ConnectionId getConnectionId(); - /** - * .context.ConnectionId connection_id = 1; - */ - context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); - - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - boolean hasRelatedServiceId(); - /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. - */ - context.ContextOuterClass.ServiceId getRelatedServiceId(); - /** - * .context.ServiceId related_service_id = 2; + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ - context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder(); + int getNumDisjointPaths(); /** - * repeated .context.EndPointId path = 3; - */ - java.util.List - getPathList(); - /** - * repeated .context.EndPointId path = 3; - */ - context.ContextOuterClass.EndPointId getPath(int index); - /** - * repeated .context.EndPointId path = 3; - */ - int getPathCount(); - /** - * repeated .context.EndPointId path = 3; - */ - java.util.List - getPathOrBuilderList(); - /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return The allActive. */ - context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index); + boolean getAllActive(); } /** - * Protobuf type {@code context.Connection} + * Protobuf type {@code context.Constraint_SLA_Availability} */ - public static final class Connection extends + public static final class Constraint_SLA_Availability extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Connection) - ConnectionOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Availability) + Constraint_SLA_AvailabilityOrBuilder { private static final long serialVersionUID = 0L; - // Use Connection.newBuilder() to construct. - private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Availability.newBuilder() to construct. + private Constraint_SLA_Availability(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Connection() { - path_ = java.util.Collections.emptyList(); + private Constraint_SLA_Availability() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Connection(); + return new Constraint_SLA_Availability(); } @java.lang.Override @@ -31761,7 +56498,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Connection( + private Constraint_SLA_Availability( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -31769,7 +56506,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -31780,39 +56516,14 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.ConnectionId.Builder subBuilder = null; - if (connectionId_ != null) { - subBuilder = connectionId_.toBuilder(); - } - connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connectionId_); - connectionId_ = subBuilder.buildPartial(); - } + case 8: { + numDisjointPaths_ = input.readUInt32(); break; } - case 18: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (relatedServiceId_ != null) { - subBuilder = relatedServiceId_.toBuilder(); - } - relatedServiceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(relatedServiceId_); - relatedServiceId_ = subBuilder.buildPartial(); - } + case 16: { - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - path_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - path_.add( - input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + allActive_ = input.readBool(); break; } default: { @@ -31830,116 +56541,43 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - path_ = java.util.Collections.unmodifiableList(path_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); - } - - public static final int CONNECTION_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ConnectionId connectionId_; - /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - @java.lang.Override - public boolean hasConnectionId() { - return connectionId_ != null; - } - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - @java.lang.Override - public context.ContextOuterClass.ConnectionId getConnectionId() { - return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } - /** - * .context.ConnectionId connection_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { - return getConnectionId(); + context.ContextOuterClass.Constraint_SLA_Availability.class, context.ContextOuterClass.Constraint_SLA_Availability.Builder.class); } - public static final int RELATED_SERVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ServiceId relatedServiceId_; - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - @java.lang.Override - public boolean hasRelatedServiceId() { - return relatedServiceId_ != null; - } + public static final int NUM_DISJOINT_PATHS_FIELD_NUMBER = 1; + private int numDisjointPaths_; /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getRelatedServiceId() { - return relatedServiceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } - /** - * .context.ServiceId related_service_id = 2; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder() { - return getRelatedServiceId(); + public int getNumDisjointPaths() { + return numDisjointPaths_; } - public static final int PATH_FIELD_NUMBER = 3; - private java.util.List path_; - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public java.util.List getPathList() { - return path_; - } + public static final int ALL_ACTIVE_FIELD_NUMBER = 2; + private boolean allActive_; /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return The allActive. */ @java.lang.Override - public java.util.List - getPathOrBuilderList() { - return path_; - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public int getPathCount() { - return path_.size(); - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public context.ContextOuterClass.EndPointId getPath(int index) { - return path_.get(index); - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index) { - return path_.get(index); + public boolean getAllActive() { + return allActive_; } private byte memoizedIsInitialized = -1; @@ -31956,14 +56594,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionId_ != null) { - output.writeMessage(1, getConnectionId()); + if (numDisjointPaths_ != 0) { + output.writeUInt32(1, numDisjointPaths_); } - if (relatedServiceId_ != null) { - output.writeMessage(2, getRelatedServiceId()); - } - for (int i = 0; i < path_.size(); i++) { - output.writeMessage(3, path_.get(i)); + if (allActive_ != false) { + output.writeBool(2, allActive_); } unknownFields.writeTo(output); } @@ -31974,17 +56609,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionId()); - } - if (relatedServiceId_ != null) { + if (numDisjointPaths_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getRelatedServiceId()); + .computeUInt32Size(1, numDisjointPaths_); } - for (int i = 0; i < path_.size(); i++) { + if (allActive_ != false) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, path_.get(i)); + .computeBoolSize(2, allActive_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -31996,23 +56627,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Connection)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Availability)) { return super.equals(obj); } - context.ContextOuterClass.Connection other = (context.ContextOuterClass.Connection) obj; + context.ContextOuterClass.Constraint_SLA_Availability other = (context.ContextOuterClass.Constraint_SLA_Availability) obj; - if (hasConnectionId() != other.hasConnectionId()) return false; - if (hasConnectionId()) { - if (!getConnectionId() - .equals(other.getConnectionId())) return false; - } - if (hasRelatedServiceId() != other.hasRelatedServiceId()) return false; - if (hasRelatedServiceId()) { - if (!getRelatedServiceId() - .equals(other.getRelatedServiceId())) return false; - } - if (!getPathList() - .equals(other.getPathList())) return false; + if (getNumDisjointPaths() + != other.getNumDisjointPaths()) return false; + if (getAllActive() + != other.getAllActive()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -32024,86 +56647,79 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionId()) { - hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionId().hashCode(); - } - if (hasRelatedServiceId()) { - hash = (37 * hash) + RELATED_SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getRelatedServiceId().hashCode(); - } - if (getPathCount() > 0) { - hash = (37 * hash) + PATH_FIELD_NUMBER; - hash = (53 * hash) + getPathList().hashCode(); - } + hash = (37 * hash) + NUM_DISJOINT_PATHS_FIELD_NUMBER; + hash = (53 * hash) + getNumDisjointPaths(); + hash = (37 * hash) + ALL_ACTIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllActive()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability 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 context.ContextOuterClass.Connection parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Availability parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability 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 context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -32116,7 +56732,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Connection prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Availability prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -32132,26 +56748,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Connection} + * Protobuf type {@code context.Constraint_SLA_Availability} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Connection) - context.ContextOuterClass.ConnectionOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Availability) + context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); + context.ContextOuterClass.Constraint_SLA_Availability.class, context.ContextOuterClass.Constraint_SLA_Availability.Builder.class); } - // Construct using context.ContextOuterClass.Connection.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Availability.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -32164,47 +56780,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPathFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionIdBuilder_ == null) { - connectionId_ = null; - } else { - connectionId_ = null; - connectionIdBuilder_ = null; - } - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = null; - } else { - relatedServiceId_ = null; - relatedServiceIdBuilder_ = null; - } - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - pathBuilder_.clear(); - } + numDisjointPaths_ = 0; + + allActive_ = false; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override - public context.ContextOuterClass.Connection getDefaultInstanceForType() { - return context.ContextOuterClass.Connection.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Connection build() { - context.ContextOuterClass.Connection result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Availability build() { + context.ContextOuterClass.Constraint_SLA_Availability result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -32212,28 +56813,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Connection buildPartial() { - context.ContextOuterClass.Connection result = new context.ContextOuterClass.Connection(this); - int from_bitField0_ = bitField0_; - if (connectionIdBuilder_ == null) { - result.connectionId_ = connectionId_; - } else { - result.connectionId_ = connectionIdBuilder_.build(); - } - if (relatedServiceIdBuilder_ == null) { - result.relatedServiceId_ = relatedServiceId_; - } else { - result.relatedServiceId_ = relatedServiceIdBuilder_.build(); - } - if (pathBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - path_ = java.util.Collections.unmodifiableList(path_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.path_ = path_; - } else { - result.path_ = pathBuilder_.build(); - } + public context.ContextOuterClass.Constraint_SLA_Availability buildPartial() { + context.ContextOuterClass.Constraint_SLA_Availability result = new context.ContextOuterClass.Constraint_SLA_Availability(this); + result.numDisjointPaths_ = numDisjointPaths_; + result.allActive_ = allActive_; onBuilt(); return result; } @@ -32272,47 +56855,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Connection) { - return mergeFrom((context.ContextOuterClass.Connection)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Availability) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Availability)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Connection other) { - if (other == context.ContextOuterClass.Connection.getDefaultInstance()) return this; - if (other.hasConnectionId()) { - mergeConnectionId(other.getConnectionId()); - } - if (other.hasRelatedServiceId()) { - mergeRelatedServiceId(other.getRelatedServiceId()); + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Availability other) { + if (other == context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance()) return this; + if (other.getNumDisjointPaths() != 0) { + setNumDisjointPaths(other.getNumDisjointPaths()); } - if (pathBuilder_ == null) { - if (!other.path_.isEmpty()) { - if (path_.isEmpty()) { - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePathIsMutable(); - path_.addAll(other.path_); - } - onChanged(); - } - } else { - if (!other.path_.isEmpty()) { - if (pathBuilder_.isEmpty()) { - pathBuilder_.dispose(); - pathBuilder_ = null; - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - pathBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPathFieldBuilder() : null; - } else { - pathBuilder_.addAllMessages(other.path_); - } - } + if (other.getAllActive() != false) { + setAllActive(other.getAllActive()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -32329,11 +56886,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Connection parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Availability parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Connection) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Availability) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -32342,485 +56899,68 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private context.ContextOuterClass.ConnectionId connectionId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; - /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - public boolean hasConnectionId() { - return connectionIdBuilder_ != null || connectionId_ != null; - } - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - public context.ContextOuterClass.ConnectionId getConnectionId() { - if (connectionIdBuilder_ == null) { - return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } else { - return connectionIdBuilder_.getMessage(); - } - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { - if (connectionIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connectionId_ = value; - onChanged(); - } else { - connectionIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder setConnectionId( - context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdBuilder_ == null) { - connectionId_ = builderForValue.build(); - onChanged(); - } else { - connectionIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { - if (connectionIdBuilder_ == null) { - if (connectionId_ != null) { - connectionId_ = - context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); - } else { - connectionId_ = value; - } - onChanged(); - } else { - connectionIdBuilder_.mergeFrom(value); - } - return this; - } + private int numDisjointPaths_ ; /** - * .context.ConnectionId connection_id = 1; + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ - public Builder clearConnectionId() { - if (connectionIdBuilder_ == null) { - connectionId_ = null; - onChanged(); - } else { - connectionId_ = null; - connectionIdBuilder_ = null; - } - - return this; + @java.lang.Override + public int getNumDisjointPaths() { + return numDisjointPaths_; } /** - * .context.ConnectionId connection_id = 1; + * uint32 num_disjoint_paths = 1; + * @param value The numDisjointPaths to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { + public Builder setNumDisjointPaths(int value) { + numDisjointPaths_ = value; onChanged(); - return getConnectionIdFieldBuilder().getBuilder(); - } - /** - * .context.ConnectionId connection_id = 1; - */ - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { - if (connectionIdBuilder_ != null) { - return connectionIdBuilder_.getMessageOrBuilder(); - } else { - return connectionId_ == null ? - context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } - } - /** - * .context.ConnectionId connection_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> - getConnectionIdFieldBuilder() { - if (connectionIdBuilder_ == null) { - connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( - getConnectionId(), - getParentForChildren(), - isClean()); - connectionId_ = null; - } - return connectionIdBuilder_; - } - - private context.ContextOuterClass.ServiceId relatedServiceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> relatedServiceIdBuilder_; - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - public boolean hasRelatedServiceId() { - return relatedServiceIdBuilder_ != null || relatedServiceId_ != null; - } - /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. - */ - public context.ContextOuterClass.ServiceId getRelatedServiceId() { - if (relatedServiceIdBuilder_ == null) { - return relatedServiceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } else { - return relatedServiceIdBuilder_.getMessage(); - } - } - /** - * .context.ServiceId related_service_id = 2; - */ - public Builder setRelatedServiceId(context.ContextOuterClass.ServiceId value) { - if (relatedServiceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - relatedServiceId_ = value; - onChanged(); - } else { - relatedServiceIdBuilder_.setMessage(value); - } - return this; } /** - * .context.ServiceId related_service_id = 2; + * uint32 num_disjoint_paths = 1; + * @return This builder for chaining. */ - public Builder setRelatedServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = builderForValue.build(); - onChanged(); - } else { - relatedServiceIdBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearNumDisjointPaths() { + + numDisjointPaths_ = 0; + onChanged(); return this; } - /** - * .context.ServiceId related_service_id = 2; - */ - public Builder mergeRelatedServiceId(context.ContextOuterClass.ServiceId value) { - if (relatedServiceIdBuilder_ == null) { - if (relatedServiceId_ != null) { - relatedServiceId_ = - context.ContextOuterClass.ServiceId.newBuilder(relatedServiceId_).mergeFrom(value).buildPartial(); - } else { - relatedServiceId_ = value; - } - onChanged(); - } else { - relatedServiceIdBuilder_.mergeFrom(value); - } - return this; - } + private boolean allActive_ ; /** - * .context.ServiceId related_service_id = 2; + * bool all_active = 2; + * @return The allActive. */ - public Builder clearRelatedServiceId() { - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = null; - onChanged(); - } else { - relatedServiceId_ = null; - relatedServiceIdBuilder_ = null; - } - - return this; + @java.lang.Override + public boolean getAllActive() { + return allActive_; } /** - * .context.ServiceId related_service_id = 2; + * bool all_active = 2; + * @param value The allActive to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceId.Builder getRelatedServiceIdBuilder() { + public Builder setAllActive(boolean value) { + allActive_ = value; onChanged(); - return getRelatedServiceIdFieldBuilder().getBuilder(); - } - /** - * .context.ServiceId related_service_id = 2; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder() { - if (relatedServiceIdBuilder_ != null) { - return relatedServiceIdBuilder_.getMessageOrBuilder(); - } else { - return relatedServiceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } - } - /** - * .context.ServiceId related_service_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getRelatedServiceIdFieldBuilder() { - if (relatedServiceIdBuilder_ == null) { - relatedServiceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getRelatedServiceId(), - getParentForChildren(), - isClean()); - relatedServiceId_ = null; - } - return relatedServiceIdBuilder_; - } - - private java.util.List path_ = - java.util.Collections.emptyList(); - private void ensurePathIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - path_ = new java.util.ArrayList(path_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> pathBuilder_; - - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List getPathList() { - if (pathBuilder_ == null) { - return java.util.Collections.unmodifiableList(path_); - } else { - return pathBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public int getPathCount() { - if (pathBuilder_ == null) { - return path_.size(); - } else { - return pathBuilder_.getCount(); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId getPath(int index) { - if (pathBuilder_ == null) { - return path_.get(index); - } else { - return pathBuilder_.getMessage(index); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder setPath( - int index, context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.set(index, value); - onChanged(); - } else { - pathBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder setPath( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.set(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath(context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(value); - onChanged(); - } else { - pathBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - int index, context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(index, value); - onChanged(); - } else { - pathBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addAllPath( - java.lang.Iterable values) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, path_); - onChanged(); - } else { - pathBuilder_.addAllMessages(values); - } return this; } /** - * repeated .context.EndPointId path = 3; - */ - public Builder clearPath() { - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - pathBuilder_.clear(); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return This builder for chaining. */ - public Builder removePath(int index) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.remove(index); - onChanged(); - } else { - pathBuilder_.remove(index); - } + public Builder clearAllActive() { + + allActive_ = false; + onChanged(); return this; } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder getPathBuilder( - int index) { - return getPathFieldBuilder().getBuilder(index); - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index) { - if (pathBuilder_ == null) { - return path_.get(index); } else { - return pathBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List - getPathOrBuilderList() { - if (pathBuilder_ != null) { - return pathBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(path_); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder addPathBuilder() { - return getPathFieldBuilder().addBuilder( - context.ContextOuterClass.EndPointId.getDefaultInstance()); - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder addPathBuilder( - int index) { - return getPathFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPointId.getDefaultInstance()); - } - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List - getPathBuilderList() { - return getPathFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getPathFieldBuilder() { - if (pathBuilder_ == null) { - pathBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - path_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - path_ = null; - } - return pathBuilder_; - } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -32834,95 +56974,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Connection) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Availability) } - // @@protoc_insertion_point(class_scope:context.Connection) - private static final context.ContextOuterClass.Connection DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Availability) + private static final context.ContextOuterClass.Constraint_SLA_Availability DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Connection(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Availability(); } - public static context.ContextOuterClass.Connection getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Connection parsePartialFrom( + public Constraint_SLA_Availability parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Connection(input, extensionRegistry); + return new Constraint_SLA_Availability(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Connection getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionIdList) + public interface Constraint_SLA_Isolation_levelOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Isolation_level) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ - java.util.List - getConnectionIdsList(); + java.util.List getIsolationLevelList(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ - context.ContextOuterClass.ConnectionId getConnectionIds(int index); + int getIsolationLevelCount(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ - int getConnectionIdsCount(); + context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ - java.util.List - getConnectionIdsOrBuilderList(); + java.util.List + getIsolationLevelValueList(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ - context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index); + int getIsolationLevelValue(int index); } /** - * Protobuf type {@code context.ConnectionIdList} + * Protobuf type {@code context.Constraint_SLA_Isolation_level} */ - public static final class ConnectionIdList extends + public static final class Constraint_SLA_Isolation_level extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionIdList) - ConnectionIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Isolation_level) + Constraint_SLA_Isolation_levelOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionIdList.newBuilder() to construct. - private ConnectionIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Isolation_level.newBuilder() to construct. + private Constraint_SLA_Isolation_level(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionIdList() { - connectionIds_ = java.util.Collections.emptyList(); + private Constraint_SLA_Isolation_level() { + isolationLevel_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionIdList(); + return new Constraint_SLA_Isolation_level(); } @java.lang.Override @@ -32930,7 +57075,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionIdList( + private Constraint_SLA_Isolation_level( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -32949,13 +57094,27 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { + case 8: { + int rawValue = input.readEnum(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { - connectionIds_ = new java.util.ArrayList(); + isolationLevel_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - connectionIds_.add( - input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry)); + isolationLevel_.add(rawValue); + break; + } + case 10: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + isolationLevel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + isolationLevel_.add(rawValue); + } + input.popLimit(oldLimit); break; } default: { @@ -32974,7 +57133,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); + isolationLevel_ = java.util.Collections.unmodifiableList(isolationLevel_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -32982,56 +57141,74 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); + context.ContextOuterClass.Constraint_SLA_Isolation_level.class, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder.class); } - public static final int CONNECTION_IDS_FIELD_NUMBER = 1; - private java.util.List connectionIds_; + public static final int ISOLATION_LEVEL_FIELD_NUMBER = 1; + private java.util.List isolationLevel_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum> isolationLevel_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>() { + public context.ContextOuterClass.IsolationLevelEnum convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + context.ContextOuterClass.IsolationLevelEnum result = context.ContextOuterClass.IsolationLevelEnum.valueOf(from); + return result == null ? context.ContextOuterClass.IsolationLevelEnum.UNRECOGNIZED : result; + } + }; /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ @java.lang.Override - public java.util.List getConnectionIdsList() { - return connectionIds_; + public java.util.List getIsolationLevelList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>(isolationLevel_, isolationLevel_converter_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ @java.lang.Override - public java.util.List - getConnectionIdsOrBuilderList() { - return connectionIds_; + public int getIsolationLevelCount() { + return isolationLevel_.size(); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ @java.lang.Override - public int getConnectionIdsCount() { - return connectionIds_.size(); + public context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index) { + return isolationLevel_converter_.convert(isolationLevel_.get(index)); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ @java.lang.Override - public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { - return connectionIds_.get(index); + public java.util.List + getIsolationLevelValueList() { + return isolationLevel_; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ @java.lang.Override - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index) { - return connectionIds_.get(index); + public int getIsolationLevelValue(int index) { + return isolationLevel_.get(index); } + private int isolationLevelMemoizedSerializedSize; private byte memoizedIsInitialized = -1; @java.lang.Override @@ -33047,8 +57224,13 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < connectionIds_.size(); i++) { - output.writeMessage(1, connectionIds_.get(i)); + getSerializedSize(); + if (getIsolationLevelList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(isolationLevelMemoizedSerializedSize); + } + for (int i = 0; i < isolationLevel_.size(); i++) { + output.writeEnumNoTag(isolationLevel_.get(i)); } unknownFields.writeTo(output); } @@ -33059,9 +57241,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < connectionIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, connectionIds_.get(i)); + { + int dataSize = 0; + for (int i = 0; i < isolationLevel_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(isolationLevel_.get(i)); + } + size += dataSize; + if (!getIsolationLevelList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }isolationLevelMemoizedSerializedSize = dataSize; } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -33073,13 +57263,12 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionIdList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Isolation_level)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionIdList other = (context.ContextOuterClass.ConnectionIdList) obj; + context.ContextOuterClass.Constraint_SLA_Isolation_level other = (context.ContextOuterClass.Constraint_SLA_Isolation_level) obj; - if (!getConnectionIdsList() - .equals(other.getConnectionIdsList())) return false; + if (!isolationLevel_.equals(other.isolationLevel_)) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -33091,78 +57280,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConnectionIdsCount() > 0) { - hash = (37 * hash) + CONNECTION_IDS_FIELD_NUMBER; - hash = (53 * hash) + getConnectionIdsList().hashCode(); + if (getIsolationLevelCount() > 0) { + hash = (37 * hash) + ISOLATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + isolationLevel_.hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level 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 context.ContextOuterClass.ConnectionIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level 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 context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -33175,7 +57364,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Isolation_level prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -33191,26 +57380,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConnectionIdList} + * Protobuf type {@code context.Constraint_SLA_Isolation_level} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionIdList) - context.ContextOuterClass.ConnectionIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Isolation_level) + context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); + context.ContextOuterClass.Constraint_SLA_Isolation_level.class, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionIdList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -33223,35 +57412,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConnectionIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionIdsBuilder_ == null) { - connectionIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - connectionIdsBuilder_.clear(); - } + isolationLevel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionIdList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList build() { - context.ContextOuterClass.ConnectionIdList result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Isolation_level build() { + context.ContextOuterClass.Constraint_SLA_Isolation_level result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -33259,18 +57443,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList buildPartial() { - context.ContextOuterClass.ConnectionIdList result = new context.ContextOuterClass.ConnectionIdList(this); + public context.ContextOuterClass.Constraint_SLA_Isolation_level buildPartial() { + context.ContextOuterClass.Constraint_SLA_Isolation_level result = new context.ContextOuterClass.Constraint_SLA_Isolation_level(this); int from_bitField0_ = bitField0_; - if (connectionIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.connectionIds_ = connectionIds_; - } else { - result.connectionIds_ = connectionIdsBuilder_.build(); + if (((bitField0_ & 0x00000001) != 0)) { + isolationLevel_ = java.util.Collections.unmodifiableList(isolationLevel_); + bitField0_ = (bitField0_ & ~0x00000001); } + result.isolationLevel_ = isolationLevel_; onBuilt(); return result; } @@ -33309,41 +57489,25 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionIdList) { - return mergeFrom((context.ContextOuterClass.ConnectionIdList)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Isolation_level) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Isolation_level)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionIdList other) { - if (other == context.ContextOuterClass.ConnectionIdList.getDefaultInstance()) return this; - if (connectionIdsBuilder_ == null) { - if (!other.connectionIds_.isEmpty()) { - if (connectionIds_.isEmpty()) { - connectionIds_ = other.connectionIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConnectionIdsIsMutable(); - connectionIds_.addAll(other.connectionIds_); - } - onChanged(); - } - } else { - if (!other.connectionIds_.isEmpty()) { - if (connectionIdsBuilder_.isEmpty()) { - connectionIdsBuilder_.dispose(); - connectionIdsBuilder_ = null; - connectionIds_ = other.connectionIds_; - bitField0_ = (bitField0_ & ~0x00000001); - connectionIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConnectionIdsFieldBuilder() : null; - } else { - connectionIdsBuilder_.addAllMessages(other.connectionIds_); - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Isolation_level other) { + if (other == context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance()) return this; + if (!other.isolationLevel_.isEmpty()) { + if (isolationLevel_.isEmpty()) { + isolationLevel_ = other.isolationLevel_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIsolationLevelIsMutable(); + isolationLevel_.addAll(other.isolationLevel_); } + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -33360,11 +57524,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionIdList parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Isolation_level parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Isolation_level) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -33375,244 +57539,144 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List connectionIds_ = + private java.util.List isolationLevel_ = java.util.Collections.emptyList(); - private void ensureConnectionIdsIsMutable() { + private void ensureIsolationLevelIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - connectionIds_ = new java.util.ArrayList(connectionIds_); + isolationLevel_ = new java.util.ArrayList(isolationLevel_); bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdsBuilder_; - - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public java.util.List getConnectionIdsList() { - if (connectionIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(connectionIds_); - } else { - return connectionIdsBuilder_.getMessageList(); } } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ - public int getConnectionIdsCount() { - if (connectionIdsBuilder_ == null) { - return connectionIds_.size(); - } else { - return connectionIdsBuilder_.getCount(); - } + public java.util.List getIsolationLevelList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>(isolationLevel_, isolationLevel_converter_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ - public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { - if (connectionIdsBuilder_ == null) { - return connectionIds_.get(index); - } else { - return connectionIdsBuilder_.getMessage(index); - } + public int getIsolationLevelCount() { + return isolationLevel_.size(); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ - public Builder setConnectionIds( - int index, context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.set(index, value); - onChanged(); - } else { - connectionIdsBuilder_.setMessage(index, value); - } - return this; + public context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index) { + return isolationLevel_converter_.convert(isolationLevel_.get(index)); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index to set the value at. + * @param value The isolationLevel to set. + * @return This builder for chaining. */ - public Builder setConnectionIds( - int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.set(index, builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.setMessage(index, builderForValue.build()); + public Builder setIsolationLevel( + int index, context.ContextOuterClass.IsolationLevelEnum value) { + if (value == null) { + throw new NullPointerException(); } + ensureIsolationLevelIsMutable(); + isolationLevel_.set(index, value.getNumber()); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param value The isolationLevel to add. + * @return This builder for chaining. */ - public Builder addConnectionIds(context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.add(value); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(value); + public Builder addIsolationLevel(context.ContextOuterClass.IsolationLevelEnum value) { + if (value == null) { + throw new NullPointerException(); } + ensureIsolationLevelIsMutable(); + isolationLevel_.add(value.getNumber()); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param values The isolationLevel to add. + * @return This builder for chaining. */ - public Builder addConnectionIds( - int index, context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.add(index, value); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(index, value); + public Builder addAllIsolationLevel( + java.lang.Iterable values) { + ensureIsolationLevelIsMutable(); + for (context.ContextOuterClass.IsolationLevelEnum value : values) { + isolationLevel_.add(value.getNumber()); } + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return This builder for chaining. */ - public Builder addConnectionIds( - context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.add(builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder clearIsolationLevel() { + isolationLevel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ - public Builder addConnectionIds( - int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.add(index, builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + public java.util.List + getIsolationLevelValueList() { + return java.util.Collections.unmodifiableList(isolationLevel_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ - public Builder addAllConnectionIds( - java.lang.Iterable values) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, connectionIds_); - onChanged(); - } else { - connectionIdsBuilder_.addAllMessages(values); - } - return this; + public int getIsolationLevelValue(int index) { + return isolationLevel_.get(index); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. + * @return This builder for chaining. */ - public Builder clearConnectionIds() { - if (connectionIdsBuilder_ == null) { - connectionIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - connectionIdsBuilder_.clear(); - } + public Builder setIsolationLevelValue( + int index, int value) { + ensureIsolationLevelIsMutable(); + isolationLevel_.set(index, value); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param value The enum numeric value on the wire for isolationLevel to add. + * @return This builder for chaining. */ - public Builder removeConnectionIds(int index) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.remove(index); - onChanged(); - } else { - connectionIdsBuilder_.remove(index); - } + public Builder addIsolationLevelValue(int value) { + ensureIsolationLevelIsMutable(); + isolationLevel_.add(value); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder getConnectionIdsBuilder( - int index) { - return getConnectionIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index) { - if (connectionIdsBuilder_ == null) { - return connectionIds_.get(index); } else { - return connectionIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public java.util.List - getConnectionIdsOrBuilderList() { - if (connectionIdsBuilder_ != null) { - return connectionIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(connectionIds_); - } - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder() { - return getConnectionIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ConnectionId.getDefaultInstance()); - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder( - int index) { - return getConnectionIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConnectionId.getDefaultInstance()); - } - /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param values The enum numeric values on the wire for isolationLevel to add. + * @return This builder for chaining. */ - public java.util.List - getConnectionIdsBuilderList() { - return getConnectionIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> - getConnectionIdsFieldBuilder() { - if (connectionIdsBuilder_ == null) { - connectionIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( - connectionIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - connectionIds_ = null; + public Builder addAllIsolationLevelValue( + java.lang.Iterable values) { + ensureIsolationLevelIsMutable(); + for (int value : values) { + isolationLevel_.add(value); } - return connectionIdsBuilder_; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -33627,95 +57691,192 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionIdList) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Isolation_level) } - // @@protoc_insertion_point(class_scope:context.ConnectionIdList) - private static final context.ContextOuterClass.ConnectionIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Isolation_level) + private static final context.ContextOuterClass.Constraint_SLA_Isolation_level DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Isolation_level(); } - public static context.ContextOuterClass.ConnectionIdList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionIdList parsePartialFrom( + public Constraint_SLA_Isolation_level parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionIdList(input, extensionRegistry); + return new Constraint_SLA_Isolation_level(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionList) + public interface ConstraintOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. */ - java.util.List - getConnectionsList(); + boolean hasCustom(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; + * @return The custom. */ - context.ContextOuterClass.Connection getConnections(int index); + context.ContextOuterClass.Constraint_Custom getCustom(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; */ - int getConnectionsCount(); + context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder(); + /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. */ - java.util.List - getConnectionsOrBuilderList(); + boolean hasSchedule(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. */ - context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index); + context.ContextOuterClass.Constraint_Schedule getSchedule(); + /** + * .context.Constraint_Schedule schedule = 2; + */ + context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder(); + + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + boolean hasEndpointLocation(); + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation(); + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder(); + + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + boolean hasEndpointPriority(); + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority(); + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder(); + + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + boolean hasSlaCapacity(); + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity(); + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder(); + + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + boolean hasSlaLatency(); + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency(); + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder(); + + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ + boolean hasSlaAvailability(); + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. + */ + context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability(); + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder(); + + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. + */ + boolean hasSlaIsolation(); + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. + */ + context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation(); + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + */ + context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder(); + + public context.ContextOuterClass.Constraint.ConstraintCase getConstraintCase(); } /** - * Protobuf type {@code context.ConnectionList} + * Protobuf type {@code context.Constraint} */ - public static final class ConnectionList extends + public static final class Constraint extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionList) - ConnectionListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint) + ConstraintOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionList.newBuilder() to construct. - private ConnectionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint.newBuilder() to construct. + private Constraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionList() { - connections_ = java.util.Collections.emptyList(); + private Constraint() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionList(); + return new Constraint(); } @java.lang.Override @@ -33723,7 +57884,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionList( + private Constraint( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -33731,7 +57892,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -33743,12 +57903,115 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.Constraint_Custom.Builder subBuilder = null; + if (constraintCase_ == 1) { + subBuilder = ((context.ContextOuterClass.Constraint_Custom) constraint_).toBuilder(); } - connections_.add( - input.readMessage(context.ContextOuterClass.Connection.parser(), extensionRegistry)); + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_Custom.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_Custom) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 1; + break; + } + case 18: { + context.ContextOuterClass.Constraint_Schedule.Builder subBuilder = null; + if (constraintCase_ == 2) { + subBuilder = ((context.ContextOuterClass.Constraint_Schedule) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_Schedule.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_Schedule) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 2; + break; + } + case 26: { + context.ContextOuterClass.Constraint_EndPointLocation.Builder subBuilder = null; + if (constraintCase_ == 3) { + subBuilder = ((context.ContextOuterClass.Constraint_EndPointLocation) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_EndPointLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 3; + break; + } + case 34: { + context.ContextOuterClass.Constraint_EndPointPriority.Builder subBuilder = null; + if (constraintCase_ == 4) { + subBuilder = ((context.ContextOuterClass.Constraint_EndPointPriority) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_EndPointPriority.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 4; + break; + } + case 42: { + context.ContextOuterClass.Constraint_SLA_Capacity.Builder subBuilder = null; + if (constraintCase_ == 5) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Capacity.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 5; + break; + } + case 50: { + context.ContextOuterClass.Constraint_SLA_Latency.Builder subBuilder = null; + if (constraintCase_ == 6) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Latency) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Latency.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 6; + break; + } + case 58: { + context.ContextOuterClass.Constraint_SLA_Availability.Builder subBuilder = null; + if (constraintCase_ == 7) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Availability) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Availability.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 7; + break; + } + case 66: { + context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder subBuilder = null; + if (constraintCase_ == 8) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Isolation_level.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 8; break; } default: { @@ -33766,64 +58029,322 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); + } + + private int constraintCase_ = 0; + private java.lang.Object constraint_; + public enum ConstraintCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CUSTOM(1), + SCHEDULE(2), + ENDPOINT_LOCATION(3), + ENDPOINT_PRIORITY(4), + SLA_CAPACITY(5), + SLA_LATENCY(6), + SLA_AVAILABILITY(7), + SLA_ISOLATION(8), + CONSTRAINT_NOT_SET(0); + private final int value; + private ConstraintCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConstraintCase valueOf(int value) { + return forNumber(value); + } + + public static ConstraintCase forNumber(int value) { + switch (value) { + case 1: return CUSTOM; + case 2: return SCHEDULE; + case 3: return ENDPOINT_LOCATION; + case 4: return ENDPOINT_PRIORITY; + case 5: return SLA_CAPACITY; + case 6: return SLA_LATENCY; + case 7: return SLA_AVAILABILITY; + case 8: return SLA_ISOLATION; + case 0: return CONSTRAINT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ConstraintCase + getConstraintCase() { + return ConstraintCase.forNumber( + constraintCase_); + } + + public static final int CUSTOM_FIELD_NUMBER = 1; + /** + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return constraintCase_ == 1; + } + /** + * .context.Constraint_Custom custom = 1; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Custom getCustom() { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + /** + * .context.Constraint_Custom custom = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder() { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + + public static final int SCHEDULE_FIELD_NUMBER = 2; + /** + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return constraintCase_ == 2; + } + /** + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Schedule getSchedule() { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder() { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + + public static final int ENDPOINT_LOCATION_FIELD_NUMBER = 3; + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + @java.lang.Override + public boolean hasEndpointLocation() { + return constraintCase_ == 3; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation() { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder() { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + + public static final int ENDPOINT_PRIORITY_FIELD_NUMBER = 4; + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + @java.lang.Override + public boolean hasEndpointPriority() { + return constraintCase_ == 4; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority() { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder() { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + + public static final int SLA_CAPACITY_FIELD_NUMBER = 5; + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + @java.lang.Override + public boolean hasSlaCapacity() { + return constraintCase_ == 5; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity() { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder() { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + + public static final int SLA_LATENCY_FIELD_NUMBER = 6; + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + @java.lang.Override + public boolean hasSlaLatency() { + return constraintCase_ == 6; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency() { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder() { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } + public static final int SLA_AVAILABILITY_FIELD_NUMBER = 7; + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); + public boolean hasSlaAvailability() { + return constraintCase_ == 7; } - - public static final int CONNECTIONS_FIELD_NUMBER = 1; - private java.util.List connections_; /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. */ @java.lang.Override - public java.util.List getConnectionsList() { - return connections_; + public context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability() { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ @java.lang.Override - public java.util.List - getConnectionsOrBuilderList() { - return connections_; + public context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder() { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } + + public static final int SLA_ISOLATION_FIELD_NUMBER = 8; /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. */ @java.lang.Override - public int getConnectionsCount() { - return connections_.size(); + public boolean hasSlaIsolation() { + return constraintCase_ == 8; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. */ @java.lang.Override - public context.ContextOuterClass.Connection getConnections(int index) { - return connections_.get(index); + public context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation() { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ @java.lang.Override - public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index) { - return connections_.get(index); + public context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder() { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -33840,8 +58361,29 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < connections_.size(); i++) { - output.writeMessage(1, connections_.get(i)); + if (constraintCase_ == 1) { + output.writeMessage(1, (context.ContextOuterClass.Constraint_Custom) constraint_); + } + if (constraintCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.Constraint_Schedule) constraint_); + } + if (constraintCase_ == 3) { + output.writeMessage(3, (context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + } + if (constraintCase_ == 4) { + output.writeMessage(4, (context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + } + if (constraintCase_ == 5) { + output.writeMessage(5, (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + } + if (constraintCase_ == 6) { + output.writeMessage(6, (context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + } + if (constraintCase_ == 7) { + output.writeMessage(7, (context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + } + if (constraintCase_ == 8) { + output.writeMessage(8, (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); } unknownFields.writeTo(output); } @@ -33852,9 +58394,37 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < connections_.size(); i++) { + if (constraintCase_ == 1) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, connections_.get(i)); + .computeMessageSize(1, (context.ContextOuterClass.Constraint_Custom) constraint_); + } + if (constraintCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (context.ContextOuterClass.Constraint_Schedule) constraint_); + } + if (constraintCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + } + if (constraintCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + } + if (constraintCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + } + if (constraintCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + } + if (constraintCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + } + if (constraintCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -33866,13 +58436,48 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionList other = (context.ContextOuterClass.ConnectionList) obj; + context.ContextOuterClass.Constraint other = (context.ContextOuterClass.Constraint) obj; - if (!getConnectionsList() - .equals(other.getConnectionsList())) return false; + if (!getConstraintCase().equals(other.getConstraintCase())) return false; + switch (constraintCase_) { + case 1: + if (!getCustom() + .equals(other.getCustom())) return false; + break; + case 2: + if (!getSchedule() + .equals(other.getSchedule())) return false; + break; + case 3: + if (!getEndpointLocation() + .equals(other.getEndpointLocation())) return false; + break; + case 4: + if (!getEndpointPriority() + .equals(other.getEndpointPriority())) return false; + break; + case 5: + if (!getSlaCapacity() + .equals(other.getSlaCapacity())) return false; + break; + case 6: + if (!getSlaLatency() + .equals(other.getSlaLatency())) return false; + break; + case 7: + if (!getSlaAvailability() + .equals(other.getSlaAvailability())) return false; + break; + case 8: + if (!getSlaIsolation() + .equals(other.getSlaIsolation())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -33884,78 +58489,110 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConnectionsCount() > 0) { - hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; - hash = (53 * hash) + getConnectionsList().hashCode(); + switch (constraintCase_) { + case 1: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 2: + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().hashCode(); + break; + case 3: + hash = (37 * hash) + ENDPOINT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndpointLocation().hashCode(); + break; + case 4: + hash = (37 * hash) + ENDPOINT_PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getEndpointPriority().hashCode(); + break; + case 5: + hash = (37 * hash) + SLA_CAPACITY_FIELD_NUMBER; + hash = (53 * hash) + getSlaCapacity().hashCode(); + break; + case 6: + hash = (37 * hash) + SLA_LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getSlaLatency().hashCode(); + break; + case 7: + hash = (37 * hash) + SLA_AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + getSlaAvailability().hashCode(); + break; + case 8: + hash = (37 * hash) + SLA_ISOLATION_FIELD_NUMBER; + hash = (53 * hash) + getSlaIsolation().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint 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 context.ContextOuterClass.ConnectionList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint 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 context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -33968,7 +58605,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -33984,26 +58621,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConnectionList} + * Protobuf type {@code context.Constraint} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionList) - context.ContextOuterClass.ConnectionListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint) + context.ContextOuterClass.ConstraintOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); + context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionList.newBuilder() + // Construct using context.ContextOuterClass.Constraint.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -34016,35 +58653,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConnectionsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - connectionsBuilder_.clear(); - } + constraintCase_ = 0; + constraint_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionList.getDefaultInstance(); + public context.ContextOuterClass.Constraint getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionList build() { - context.ContextOuterClass.ConnectionList result = buildPartial(); + public context.ContextOuterClass.Constraint build() { + context.ContextOuterClass.Constraint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -34052,18 +58684,65 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionList buildPartial() { - context.ContextOuterClass.ConnectionList result = new context.ContextOuterClass.ConnectionList(this); - int from_bitField0_ = bitField0_; - if (connectionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - bitField0_ = (bitField0_ & ~0x00000001); + public context.ContextOuterClass.Constraint buildPartial() { + context.ContextOuterClass.Constraint result = new context.ContextOuterClass.Constraint(this); + if (constraintCase_ == 1) { + if (customBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = customBuilder_.build(); + } + } + if (constraintCase_ == 2) { + if (scheduleBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = scheduleBuilder_.build(); + } + } + if (constraintCase_ == 3) { + if (endpointLocationBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = endpointLocationBuilder_.build(); + } + } + if (constraintCase_ == 4) { + if (endpointPriorityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = endpointPriorityBuilder_.build(); + } + } + if (constraintCase_ == 5) { + if (slaCapacityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaCapacityBuilder_.build(); + } + } + if (constraintCase_ == 6) { + if (slaLatencyBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaLatencyBuilder_.build(); + } + } + if (constraintCase_ == 7) { + if (slaAvailabilityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaAvailabilityBuilder_.build(); + } + } + if (constraintCase_ == 8) { + if (slaIsolationBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaIsolationBuilder_.build(); } - result.connections_ = connections_; - } else { - result.connections_ = connectionsBuilder_.build(); } + result.constraintCase_ = constraintCase_; onBuilt(); return result; } @@ -34102,40 +58781,51 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionList) { - return mergeFrom((context.ContextOuterClass.ConnectionList)other); + if (other instanceof context.ContextOuterClass.Constraint) { + return mergeFrom((context.ContextOuterClass.Constraint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionList other) { - if (other == context.ContextOuterClass.ConnectionList.getDefaultInstance()) return this; - if (connectionsBuilder_ == null) { - if (!other.connections_.isEmpty()) { - if (connections_.isEmpty()) { - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConnectionsIsMutable(); - connections_.addAll(other.connections_); - } - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.Constraint other) { + if (other == context.ContextOuterClass.Constraint.getDefaultInstance()) return this; + switch (other.getConstraintCase()) { + case CUSTOM: { + mergeCustom(other.getCustom()); + break; } - } else { - if (!other.connections_.isEmpty()) { - if (connectionsBuilder_.isEmpty()) { - connectionsBuilder_.dispose(); - connectionsBuilder_ = null; - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - connectionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConnectionsFieldBuilder() : null; - } else { - connectionsBuilder_.addAllMessages(other.connections_); - } + case SCHEDULE: { + mergeSchedule(other.getSchedule()); + break; + } + case ENDPOINT_LOCATION: { + mergeEndpointLocation(other.getEndpointLocation()); + break; + } + case ENDPOINT_PRIORITY: { + mergeEndpointPriority(other.getEndpointPriority()); + break; + } + case SLA_CAPACITY: { + mergeSlaCapacity(other.getSlaCapacity()); + break; + } + case SLA_LATENCY: { + mergeSlaLatency(other.getSlaLatency()); + break; + } + case SLA_AVAILABILITY: { + mergeSlaAvailability(other.getSlaAvailability()); + break; + } + case SLA_ISOLATION: { + mergeSlaIsolation(other.getSlaIsolation()); + break; + } + case CONSTRAINT_NOT_SET: { + break; } } this.mergeUnknownFields(other.unknownFields); @@ -34153,11 +58843,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionList parsedMessage = null; + context.ContextOuterClass.Constraint parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -34166,246 +58856,1148 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List connections_ = - java.util.Collections.emptyList(); - private void ensureConnectionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - connections_ = new java.util.ArrayList(connections_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> connectionsBuilder_; - + private int constraintCase_ = 0; + private java.lang.Object constraint_; + public ConstraintCase + getConstraintCase() { + return ConstraintCase.forNumber( + constraintCase_); + } + + public Builder clearConstraint() { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder> customBuilder_; + /** + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return constraintCase_ == 1; + } + /** + * .context.Constraint_Custom custom = 1; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Custom getCustom() { + if (customBuilder_ == null) { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } else { + if (constraintCase_ == 1) { + return customBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder setCustom(context.ContextOuterClass.Constraint_Custom value) { + if (customBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + customBuilder_.setMessage(value); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder setCustom( + context.ContextOuterClass.Constraint_Custom.Builder builderForValue) { + if (customBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + customBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder mergeCustom(context.ContextOuterClass.Constraint_Custom value) { + if (customBuilder_ == null) { + if (constraintCase_ == 1 && + constraint_ != context.ContextOuterClass.Constraint_Custom.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_Custom.newBuilder((context.ContextOuterClass.Constraint_Custom) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 1) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder clearCustom() { + if (customBuilder_ == null) { + if (constraintCase_ == 1) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 1) { + constraintCase_ = 0; + constraint_ = null; + } + customBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public context.ContextOuterClass.Constraint_Custom.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_Custom custom = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder() { + if ((constraintCase_ == 1) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + } + /** + * .context.Constraint_Custom custom = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(constraintCase_ == 1)) { + constraint_ = context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + customBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder>( + (context.ContextOuterClass.Constraint_Custom) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 1; + onChanged();; + return customBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder> scheduleBuilder_; + /** + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return constraintCase_ == 2; + } + /** + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Schedule getSchedule() { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } else { + if (constraintCase_ == 2) { + return scheduleBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder setSchedule(context.ContextOuterClass.Constraint_Schedule value) { + if (scheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + scheduleBuilder_.setMessage(value); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder setSchedule( + context.ContextOuterClass.Constraint_Schedule.Builder builderForValue) { + if (scheduleBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + scheduleBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder mergeSchedule(context.ContextOuterClass.Constraint_Schedule value) { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2 && + constraint_ != context.ContextOuterClass.Constraint_Schedule.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_Schedule.newBuilder((context.ContextOuterClass.Constraint_Schedule) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 2) { + scheduleBuilder_.mergeFrom(value); + } + scheduleBuilder_.setMessage(value); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder clearSchedule() { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 2) { + constraintCase_ = 0; + constraint_ = null; + } + scheduleBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public context.ContextOuterClass.Constraint_Schedule.Builder getScheduleBuilder() { + return getScheduleFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder() { + if ((constraintCase_ == 2) && (scheduleBuilder_ != null)) { + return scheduleBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder> + getScheduleFieldBuilder() { + if (scheduleBuilder_ == null) { + if (!(constraintCase_ == 2)) { + constraint_ = context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + scheduleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder>( + (context.ContextOuterClass.Constraint_Schedule) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 2; + onChanged();; + return scheduleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder> endpointLocationBuilder_; + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + @java.lang.Override + public boolean hasEndpointLocation() { + return constraintCase_ == 3; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation() { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } else { + if (constraintCase_ == 3) { + return endpointLocationBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder setEndpointLocation(context.ContextOuterClass.Constraint_EndPointLocation value) { + if (endpointLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + endpointLocationBuilder_.setMessage(value); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder setEndpointLocation( + context.ContextOuterClass.Constraint_EndPointLocation.Builder builderForValue) { + if (endpointLocationBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + endpointLocationBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder mergeEndpointLocation(context.ContextOuterClass.Constraint_EndPointLocation value) { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3 && + constraint_ != context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_EndPointLocation.newBuilder((context.ContextOuterClass.Constraint_EndPointLocation) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 3) { + endpointLocationBuilder_.mergeFrom(value); + } + endpointLocationBuilder_.setMessage(value); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder clearEndpointLocation() { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 3) { + constraintCase_ = 0; + constraint_ = null; + } + endpointLocationBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public context.ContextOuterClass.Constraint_EndPointLocation.Builder getEndpointLocationBuilder() { + return getEndpointLocationFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder() { + if ((constraintCase_ == 3) && (endpointLocationBuilder_ != null)) { + return endpointLocationBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder> + getEndpointLocationFieldBuilder() { + if (endpointLocationBuilder_ == null) { + if (!(constraintCase_ == 3)) { + constraint_ = context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + endpointLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder>( + (context.ContextOuterClass.Constraint_EndPointLocation) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 3; + onChanged();; + return endpointLocationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder> endpointPriorityBuilder_; + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + @java.lang.Override + public boolean hasEndpointPriority() { + return constraintCase_ == 4; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority() { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } else { + if (constraintCase_ == 4) { + return endpointPriorityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder setEndpointPriority(context.ContextOuterClass.Constraint_EndPointPriority value) { + if (endpointPriorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + endpointPriorityBuilder_.setMessage(value); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder setEndpointPriority( + context.ContextOuterClass.Constraint_EndPointPriority.Builder builderForValue) { + if (endpointPriorityBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + endpointPriorityBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder mergeEndpointPriority(context.ContextOuterClass.Constraint_EndPointPriority value) { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4 && + constraint_ != context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_EndPointPriority.newBuilder((context.ContextOuterClass.Constraint_EndPointPriority) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 4) { + endpointPriorityBuilder_.mergeFrom(value); + } + endpointPriorityBuilder_.setMessage(value); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder clearEndpointPriority() { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 4) { + constraintCase_ = 0; + constraint_ = null; + } + endpointPriorityBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public context.ContextOuterClass.Constraint_EndPointPriority.Builder getEndpointPriorityBuilder() { + return getEndpointPriorityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder() { + if ((constraintCase_ == 4) && (endpointPriorityBuilder_ != null)) { + return endpointPriorityBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder> + getEndpointPriorityFieldBuilder() { + if (endpointPriorityBuilder_ == null) { + if (!(constraintCase_ == 4)) { + constraint_ = context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + endpointPriorityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder>( + (context.ContextOuterClass.Constraint_EndPointPriority) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 4; + onChanged();; + return endpointPriorityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder> slaCapacityBuilder_; + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + @java.lang.Override + public boolean hasSlaCapacity() { + return constraintCase_ == 5; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity() { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } else { + if (constraintCase_ == 5) { + return slaCapacityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder setSlaCapacity(context.ContextOuterClass.Constraint_SLA_Capacity value) { + if (slaCapacityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + slaCapacityBuilder_.setMessage(value); + } + constraintCase_ = 5; + return this; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder setSlaCapacity( + context.ContextOuterClass.Constraint_SLA_Capacity.Builder builderForValue) { + if (slaCapacityBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + slaCapacityBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 5; + return this; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder mergeSlaCapacity(context.ContextOuterClass.Constraint_SLA_Capacity value) { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Capacity.newBuilder((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 5) { + slaCapacityBuilder_.mergeFrom(value); + } + slaCapacityBuilder_.setMessage(value); + } + constraintCase_ = 5; + return this; + } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public java.util.List getConnectionsList() { - if (connectionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(connections_); + public Builder clearSlaCapacity() { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - return connectionsBuilder_.getMessageList(); + if (constraintCase_ == 5) { + constraintCase_ = 0; + constraint_ = null; + } + slaCapacityBuilder_.clear(); } + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public int getConnectionsCount() { - if (connectionsBuilder_ == null) { - return connections_.size(); + public context.ContextOuterClass.Constraint_SLA_Capacity.Builder getSlaCapacityBuilder() { + return getSlaCapacityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder() { + if ((constraintCase_ == 5) && (slaCapacityBuilder_ != null)) { + return slaCapacityBuilder_.getMessageOrBuilder(); } else { - return connectionsBuilder_.getCount(); + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public context.ContextOuterClass.Connection getConnections(int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder> + getSlaCapacityFieldBuilder() { + if (slaCapacityBuilder_ == null) { + if (!(constraintCase_ == 5)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + slaCapacityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 5; + onChanged();; + return slaCapacityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder> slaLatencyBuilder_; + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + @java.lang.Override + public boolean hasSlaLatency() { + return constraintCase_ == 6; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency() { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } else { - return connectionsBuilder_.getMessage(index); + if (constraintCase_ == 6) { + return slaLatencyBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder setConnections( - int index, context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { + public Builder setSlaLatency(context.ContextOuterClass.Constraint_SLA_Latency value) { + if (slaLatencyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectionsIsMutable(); - connections_.set(index, value); + constraint_ = value; onChanged(); } else { - connectionsBuilder_.setMessage(index, value); + slaLatencyBuilder_.setMessage(value); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder setConnections( - int index, context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.set(index, builderForValue.build()); + public Builder setSlaLatency( + context.ContextOuterClass.Constraint_SLA_Latency.Builder builderForValue) { + if (slaLatencyBuilder_ == null) { + constraint_ = builderForValue.build(); onChanged(); } else { - connectionsBuilder_.setMessage(index, builderForValue.build()); + slaLatencyBuilder_.setMessage(builderForValue.build()); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder addConnections(context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeSlaLatency(context.ContextOuterClass.Constraint_SLA_Latency value) { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Latency.newBuilder((context.ContextOuterClass.Constraint_SLA_Latency) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; } - ensureConnectionsIsMutable(); - connections_.add(value); onChanged(); } else { - connectionsBuilder_.addMessage(value); + if (constraintCase_ == 6) { + slaLatencyBuilder_.mergeFrom(value); + } + slaLatencyBuilder_.setMessage(value); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder addConnections( - int index, context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { + public Builder clearSlaLatency() { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 6) { + constraintCase_ = 0; + constraint_ = null; + } + slaLatencyBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + public context.ContextOuterClass.Constraint_SLA_Latency.Builder getSlaLatencyBuilder() { + return getSlaLatencyFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder() { + if ((constraintCase_ == 6) && (slaLatencyBuilder_ != null)) { + return slaLatencyBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder> + getSlaLatencyFieldBuilder() { + if (slaLatencyBuilder_ == null) { + if (!(constraintCase_ == 6)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + slaLatencyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Latency) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 6; + onChanged();; + return slaLatencyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder> slaAvailabilityBuilder_; + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ + @java.lang.Override + public boolean hasSlaAvailability() { + return constraintCase_ == 7; + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability() { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } else { + if (constraintCase_ == 7) { + return slaAvailabilityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + public Builder setSlaAvailability(context.ContextOuterClass.Constraint_SLA_Availability value) { + if (slaAvailabilityBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectionsIsMutable(); - connections_.add(index, value); + constraint_ = value; onChanged(); } else { - connectionsBuilder_.addMessage(index, value); + slaAvailabilityBuilder_.setMessage(value); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addConnections( - context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(builderForValue.build()); + public Builder setSlaAvailability( + context.ContextOuterClass.Constraint_SLA_Availability.Builder builderForValue) { + if (slaAvailabilityBuilder_ == null) { + constraint_ = builderForValue.build(); onChanged(); } else { - connectionsBuilder_.addMessage(builderForValue.build()); + slaAvailabilityBuilder_.setMessage(builderForValue.build()); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addConnections( - int index, context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(index, builderForValue.build()); + public Builder mergeSlaAvailability(context.ContextOuterClass.Constraint_SLA_Availability value) { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Availability.newBuilder((context.ContextOuterClass.Constraint_SLA_Availability) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } onChanged(); } else { - connectionsBuilder_.addMessage(index, builderForValue.build()); + if (constraintCase_ == 7) { + slaAvailabilityBuilder_.mergeFrom(value); + } + slaAvailabilityBuilder_.setMessage(value); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addAllConnections( - java.lang.Iterable values) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, connections_); - onChanged(); + public Builder clearSlaAvailability() { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - connectionsBuilder_.addAllMessages(values); + if (constraintCase_ == 7) { + constraintCase_ = 0; + constraint_ = null; + } + slaAvailabilityBuilder_.clear(); } return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder clearConnections() { - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + public context.ContextOuterClass.Constraint_SLA_Availability.Builder getSlaAvailabilityBuilder() { + return getSlaAvailabilityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder() { + if ((constraintCase_ == 7) && (slaAvailabilityBuilder_ != null)) { + return slaAvailabilityBuilder_.getMessageOrBuilder(); } else { - connectionsBuilder_.clear(); + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } - return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder removeConnections(int index) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.remove(index); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder> + getSlaAvailabilityFieldBuilder() { + if (slaAvailabilityBuilder_ == null) { + if (!(constraintCase_ == 7)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } + slaAvailabilityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Availability) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 7; + onChanged();; + return slaAvailabilityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder> slaIsolationBuilder_; + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. + */ + @java.lang.Override + public boolean hasSlaIsolation() { + return constraintCase_ == 8; + } + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation() { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } else { + if (constraintCase_ == 8) { + return slaIsolationBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + */ + public Builder setSlaIsolation(context.ContextOuterClass.Constraint_SLA_Isolation_level value) { + if (slaIsolationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; onChanged(); } else { - connectionsBuilder_.remove(index); + slaIsolationBuilder_.setMessage(value); } + constraintCase_ = 8; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder getConnectionsBuilder( - int index) { - return getConnectionsFieldBuilder().getBuilder(index); + public Builder setSlaIsolation( + context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder builderForValue) { + if (slaIsolationBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + slaIsolationBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 8; + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); } else { - return connectionsBuilder_.getMessageOrBuilder(index); + public Builder mergeSlaIsolation(context.ContextOuterClass.Constraint_SLA_Isolation_level value) { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 8) { + slaIsolationBuilder_.mergeFrom(value); + } + slaIsolationBuilder_.setMessage(value); } + constraintCase_ = 8; + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public java.util.List - getConnectionsOrBuilderList() { - if (connectionsBuilder_ != null) { - return connectionsBuilder_.getMessageOrBuilderList(); + public Builder clearSlaIsolation() { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - return java.util.Collections.unmodifiableList(connections_); + if (constraintCase_ == 8) { + constraintCase_ = 0; + constraint_ = null; + } + slaIsolationBuilder_.clear(); } + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder addConnectionsBuilder() { - return getConnectionsFieldBuilder().addBuilder( - context.ContextOuterClass.Connection.getDefaultInstance()); + public context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder getSlaIsolationBuilder() { + return getSlaIsolationFieldBuilder().getBuilder(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder addConnectionsBuilder( - int index) { - return getConnectionsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Connection.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder() { + if ((constraintCase_ == 8) && (slaIsolationBuilder_ != null)) { + return slaIsolationBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public java.util.List - getConnectionsBuilderList() { - return getConnectionsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> - getConnectionsFieldBuilder() { - if (connectionsBuilder_ == null) { - connectionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder>( - connections_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder> + getSlaIsolationFieldBuilder() { + if (slaIsolationBuilder_ == null) { + if (!(constraintCase_ == 8)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } + slaIsolationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_, getParentForChildren(), isClean()); - connections_ = null; + constraint_ = null; } - return connectionsBuilder_; + constraintCase_ = 8; + onChanged();; + return slaIsolationBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -34420,41 +60012,41 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionList) + // @@protoc_insertion_point(builder_scope:context.Constraint) } - // @@protoc_insertion_point(class_scope:context.ConnectionList) - private static final context.ContextOuterClass.ConnectionList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint) + private static final context.ContextOuterClass.Constraint DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint(); } - public static context.ContextOuterClass.ConnectionList getDefaultInstance() { + public static context.ContextOuterClass.Constraint getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionList parsePartialFrom( + public Constraint parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionList(input, extensionRegistry); + return new Constraint(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -36011,6 +61603,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Uuid_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Timestamp_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Timestamp_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Event_descriptor; private static final @@ -36157,30 +61754,75 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ServiceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_EndPointId_descriptor; + internal_static_context_SliceId_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_EndPointId_fieldAccessorTable; + internal_static_context_SliceId_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_EndPoint_descriptor; + internal_static_context_Slice_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_EndPoint_fieldAccessorTable; + internal_static_context_Slice_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_ConfigRule_descriptor; + internal_static_context_SliceOwner_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_ConfigRule_fieldAccessorTable; + internal_static_context_SliceOwner_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_Constraint_descriptor; + internal_static_context_SliceStatus_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_Constraint_fieldAccessorTable; + internal_static_context_SliceStatus_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceConfig_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceIdList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceIdList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_ConnectionId_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ConnectionId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L0_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L0_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L2_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L2_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L3_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L3_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L4_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L4_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Connection_descriptor; private static final @@ -36196,6 +61838,91 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ConnectionList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_EndPointId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_EndPointId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_EndPoint_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_EndPoint_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_Custom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_Custom_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_ACL_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_ACL_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_Custom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_Custom_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_Schedule_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_Schedule_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_GPS_Position_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_GPS_Position_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Location_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Location_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_EndPointLocation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_EndPointLocation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_EndPointPriority_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_EndPointPriority_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Latency_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Latency_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Capacity_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Availability_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Availability_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Isolation_level_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_TeraFlowController_descriptor; private static final @@ -36215,160 +61942,275 @@ public final class ContextOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\rcontext.proto\022\007context\"\007\n\005Empty\"\024\n\004Uui" + - "d\022\014\n\004uuid\030\001 \001(\t\"F\n\005Event\022\021\n\ttimestamp\030\001 " + - "\001(\001\022*\n\nevent_type\030\002 \001(\0162\026.context.EventT" + - "ypeEnum\"0\n\tContextId\022#\n\014context_uuid\030\001 \001" + - "(\0132\r.context.Uuid\"\266\001\n\007Context\022&\n\ncontext" + - "_id\030\001 \001(\0132\022.context.ContextId\022)\n\014topolog" + - "y_ids\030\002 \003(\0132\023.context.TopologyId\022\'\n\013serv" + - "ice_ids\030\003 \003(\0132\022.context.ServiceId\022/\n\ncon" + - "troller\030\004 \001(\0132\033.context.TeraFlowControll" + - "er\"8\n\rContextIdList\022\'\n\013context_ids\030\001 \003(\013" + - "2\022.context.ContextId\"1\n\013ContextList\022\"\n\010c" + - "ontexts\030\001 \003(\0132\020.context.Context\"U\n\014Conte" + - "xtEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022&" + - "\n\ncontext_id\030\002 \001(\0132\022.context.ContextId\"Z" + - "\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132\022.conte" + - "xt.ContextId\022$\n\rtopology_uuid\030\002 \001(\0132\r.co" + - "ntext.Uuid\"~\n\010Topology\022(\n\013topology_id\030\001 " + - "\001(\0132\023.context.TopologyId\022%\n\ndevice_ids\030\002" + - " \003(\0132\021.context.DeviceId\022!\n\010link_ids\030\003 \003(" + - "\0132\017.context.LinkId\";\n\016TopologyIdList\022)\n\014" + - "topology_ids\030\001 \003(\0132\023.context.TopologyId\"" + - "5\n\014TopologyList\022%\n\ntopologies\030\001 \003(\0132\021.co" + - "ntext.Topology\"X\n\rTopologyEvent\022\035\n\005event" + - "\030\001 \001(\0132\016.context.Event\022(\n\013topology_id\030\002 " + - "\001(\0132\023.context.TopologyId\".\n\010DeviceId\022\"\n\013" + - "device_uuid\030\001 \001(\0132\r.context.Uuid\"\232\002\n\006Dev" + - "ice\022$\n\tdevice_id\030\001 \001(\0132\021.context.DeviceI" + - "d\022\023\n\013device_type\030\002 \001(\t\022,\n\rdevice_config\030" + - "\003 \001(\0132\025.context.DeviceConfig\022G\n\031device_o" + - "perational_status\030\004 \001(\0162$.context.Device" + - "OperationalStatusEnum\0221\n\016device_drivers\030" + - "\005 \003(\0162\031.context.DeviceDriverEnum\022+\n\020devi" + - "ce_endpoints\030\006 \003(\0132\021.context.EndPoint\"9\n" + - "\014DeviceConfig\022)\n\014config_rules\030\001 \003(\0132\023.co" + - "ntext.ConfigRule\"5\n\014DeviceIdList\022%\n\ndevi" + - "ce_ids\030\001 \003(\0132\021.context.DeviceId\".\n\nDevic" + - "eList\022 \n\007devices\030\001 \003(\0132\017.context.Device\"" + - "R\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016.context." + - "Event\022$\n\tdevice_id\030\002 \001(\0132\021.context.Devic" + - "eId\"*\n\006LinkId\022 \n\tlink_uuid\030\001 \001(\0132\r.conte" + - "xt.Uuid\"X\n\004Link\022 \n\007link_id\030\001 \001(\0132\017.conte" + - "xt.LinkId\022.\n\021link_endpoint_ids\030\002 \003(\0132\023.c" + - "ontext.EndPointId\"/\n\nLinkIdList\022!\n\010link_" + - "ids\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034" + - "\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEven" + - "t\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link" + - "_id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022" + - "&\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022" + - "#\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\246\002\n" + - "\007Service\022&\n\nservice_id\030\001 \001(\0132\022.context.S" + - "erviceId\022.\n\014service_type\030\002 \001(\0162\030.context" + - ".ServiceTypeEnum\0221\n\024service_endpoint_ids" + - "\030\003 \003(\0132\023.context.EndPointId\0220\n\023service_c" + - "onstraints\030\004 \003(\0132\023.context.Constraint\022.\n" + - "\016service_status\030\005 \001(\0132\026.context.ServiceS" + - "tatus\022.\n\016service_config\030\006 \001(\0132\026.context." + - "ServiceConfig\"C\n\rServiceStatus\0222\n\016servic" + - "e_status\030\001 \001(\0162\032.context.ServiceStatusEn" + - "um\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003(" + - "\0132\023.context.ConfigRule\"8\n\rServiceIdList\022" + - "\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceId" + - "\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.cont" + - "ext.Service\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001" + - "(\0132\016.context.Event\022&\n\nservice_id\030\002 \001(\0132\022" + - ".context.ServiceId\"\202\001\n\nEndPointId\022(\n\013top" + - "ology_id\030\001 \001(\0132\023.context.TopologyId\022$\n\td" + - "evice_id\030\002 \001(\0132\021.context.DeviceId\022$\n\rend" + - "point_uuid\030\003 \001(\0132\r.context.Uuid\"K\n\010EndPo" + - "int\022(\n\013endpoint_id\030\001 \001(\0132\023.context.EndPo" + - "intId\022\025\n\rendpoint_type\030\002 \001(\t\"e\n\nConfigRu" + - "le\022)\n\006action\030\001 \001(\0162\031.context.ConfigActio" + - "nEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resource_" + - "value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constraint_" + - "type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"6\n\014" + - "ConnectionId\022&\n\017connection_uuid\030\001 \001(\0132\r." + - "context.Uuid\"\215\001\n\nConnection\022,\n\rconnectio" + - "n_id\030\001 \001(\0132\025.context.ConnectionId\022.\n\022rel" + - "ated_service_id\030\002 \001(\0132\022.context.ServiceI" + - "d\022!\n\004path\030\003 \003(\0132\023.context.EndPointId\"A\n\020" + - "ConnectionIdList\022-\n\016connection_ids\030\001 \003(\013" + - "2\025.context.ConnectionId\":\n\016ConnectionLis" + - "t\022(\n\013connections\030\001 \003(\0132\023.context.Connect" + - "ion\"^\n\022TeraFlowController\022&\n\ncontext_id\030" + - "\001 \001(\0132\022.context.ContextId\022\022\n\nip_address\030" + - "\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationRes" + - "ult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Contex" + - "tId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventTypeE" + - "num\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYP" + - "E_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVEN" + - "TTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n\026D" + - "EVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_" + - "OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_A" + - "PI\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVE" + - "R_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVE" + - "R_ONF_TR_352\020\005*\217\001\n\033DeviceOperationalStat" + - "usEnum\022%\n!DEVICEOPERATIONALSTATUS_UNDEFI" + - "NED\020\000\022$\n DEVICEOPERATIONALSTATUS_DISABLE" + - "D\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002" + - "*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKN" + - "OWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETY" + - "PE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVI" + - "TY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027SE" + - "RVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS" + - "_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!\n\035" + - "SERVICESTATUS_PENDING_REMOVAL\020\003*]\n\020Confi" + - "gActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022" + - "\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DE" + - "LETE\020\0022\245\r\n\016ContextService\022:\n\016ListContext" + - "Ids\022\016.context.Empty\032\026.context.ContextIdL" + - "ist\"\000\0226\n\014ListContexts\022\016.context.Empty\032\024." + - "context.ContextList\"\000\0224\n\nGetContext\022\022.co" + - "ntext.ContextId\032\020.context.Context\"\000\0224\n\nS" + - "etContext\022\020.context.Context\032\022.context.Co" + - "ntextId\"\000\0225\n\rRemoveContext\022\022.context.Con" + - "textId\032\016.context.Empty\"\000\022=\n\020GetContextEv" + - "ents\022\016.context.Empty\032\025.context.ContextEv" + - "ent\"\0000\001\022@\n\017ListTopologyIds\022\022.context.Con" + - "textId\032\027.context.TopologyIdList\"\000\022=\n\016Lis" + - "tTopologies\022\022.context.ContextId\032\025.contex" + - "t.TopologyList\"\000\0227\n\013GetTopology\022\023.contex" + - "t.TopologyId\032\021.context.Topology\"\000\0227\n\013Set" + - "Topology\022\021.context.Topology\032\023.context.To" + - "pologyId\"\000\0227\n\016RemoveTopology\022\023.context.T" + - "opologyId\032\016.context.Empty\"\000\022?\n\021GetTopolo" + - "gyEvents\022\016.context.Empty\032\026.context.Topol" + - "ogyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context." + - "Empty\032\025.context.DeviceIdList\"\000\0224\n\013ListDe" + - "vices\022\016.context.Empty\032\023.context.DeviceLi" + - "st\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.c" + - "ontext.Device\"\000\0221\n\tSetDevice\022\017.context.D" + - "evice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevi" + - "ce\022\021.context.DeviceId\032\016.context.Empty\"\000\022" + - ";\n\017GetDeviceEvents\022\016.context.Empty\032\024.con" + - "text.DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.co" + - "ntext.Empty\032\023.context.LinkIdList\"\000\0220\n\tLi" + - "stLinks\022\016.context.Empty\032\021.context.LinkLi" + - "st\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.conte" + - "xt.Link\"\000\022+\n\007SetLink\022\r.context.Link\032\017.co" + - "ntext.LinkId\"\000\022/\n\nRemoveLink\022\017.context.L" + - "inkId\032\016.context.Empty\"\000\0227\n\rGetLinkEvents" + - "\022\016.context.Empty\032\022.context.LinkEvent\"\0000\001" + - "\022>\n\016ListServiceIds\022\022.context.ContextId\032\026" + - ".context.ServiceIdList\"\000\022:\n\014ListServices" + - "\022\022.context.ContextId\032\024.context.ServiceLi" + - "st\"\000\0224\n\nGetService\022\022.context.ServiceId\032\020" + - ".context.Service\"\000\0224\n\nSetService\022\020.conte" + - "xt.Service\032\022.context.ServiceId\"\000\0225\n\rRemo" + - "veService\022\022.context.ServiceId\032\016.context." + - "Empty\"\000\022=\n\020GetServiceEvents\022\016.context.Em" + - "pty\032\025.context.ServiceEvent\"\0000\001b\006proto3" + "\n\rcontext.proto\022\007context\032\tacl.proto\032\026kpi" + + "_sample_types.proto\"\007\n\005Empty\"\024\n\004Uuid\022\014\n\004" + + "uuid\030\001 \001(\t\"\036\n\tTimestamp\022\021\n\ttimestamp\030\001 \001" + + "(\001\"Z\n\005Event\022%\n\ttimestamp\030\001 \001(\0132\022.context" + + ".Timestamp\022*\n\nevent_type\030\002 \001(\0162\026.context" + + ".EventTypeEnum\"0\n\tContextId\022#\n\014context_u" + + "uid\030\001 \001(\0132\r.context.Uuid\"\266\001\n\007Context\022&\n\n" + + "context_id\030\001 \001(\0132\022.context.ContextId\022)\n\014" + + "topology_ids\030\002 \003(\0132\023.context.TopologyId\022" + + "\'\n\013service_ids\030\003 \003(\0132\022.context.ServiceId" + + "\022/\n\ncontroller\030\004 \001(\0132\033.context.TeraFlowC" + + "ontroller\"8\n\rContextIdList\022\'\n\013context_id" + + "s\030\001 \003(\0132\022.context.ContextId\"1\n\013ContextLi" + + "st\022\"\n\010contexts\030\001 \003(\0132\020.context.Context\"U" + + "\n\014ContextEvent\022\035\n\005event\030\001 \001(\0132\016.context." + + "Event\022&\n\ncontext_id\030\002 \001(\0132\022.context.Cont" + + "extId\"Z\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132" + + "\022.context.ContextId\022$\n\rtopology_uuid\030\002 \001" + + "(\0132\r.context.Uuid\"~\n\010Topology\022(\n\013topolog" + + "y_id\030\001 \001(\0132\023.context.TopologyId\022%\n\ndevic" + + "e_ids\030\002 \003(\0132\021.context.DeviceId\022!\n\010link_i" + + "ds\030\003 \003(\0132\017.context.LinkId\";\n\016TopologyIdL" + + "ist\022)\n\014topology_ids\030\001 \003(\0132\023.context.Topo" + + "logyId\"5\n\014TopologyList\022%\n\ntopologies\030\001 \003" + + "(\0132\021.context.Topology\"X\n\rTopologyEvent\022\035" + + "\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013topolog" + + "y_id\030\002 \001(\0132\023.context.TopologyId\".\n\010Devic" + + "eId\022\"\n\013device_uuid\030\001 \001(\0132\r.context.Uuid\"" + + "\232\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.context." + + "DeviceId\022\023\n\013device_type\030\002 \001(\t\022,\n\rdevice_" + + "config\030\003 \001(\0132\025.context.DeviceConfig\022G\n\031d" + + "evice_operational_status\030\004 \001(\0162$.context" + + ".DeviceOperationalStatusEnum\0221\n\016device_d" + + "rivers\030\005 \003(\0162\031.context.DeviceDriverEnum\022" + + "+\n\020device_endpoints\030\006 \003(\0132\021.context.EndP" + + "oint\"9\n\014DeviceConfig\022)\n\014config_rules\030\001 \003" + + "(\0132\023.context.ConfigRule\"5\n\014DeviceIdList\022" + + "%\n\ndevice_ids\030\001 \003(\0132\021.context.DeviceId\"." + + "\n\nDeviceList\022 \n\007devices\030\001 \003(\0132\017.context." + + "Device\"R\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016.c" + + "ontext.Event\022$\n\tdevice_id\030\002 \001(\0132\021.contex" + + "t.DeviceId\"*\n\006LinkId\022 \n\tlink_uuid\030\001 \001(\0132" + + "\r.context.Uuid\"X\n\004Link\022 \n\007link_id\030\001 \001(\0132" + + "\017.context.LinkId\022.\n\021link_endpoint_ids\030\002 " + + "\003(\0132\023.context.EndPointId\"/\n\nLinkIdList\022!" + + "\n\010link_ids\030\001 \003(\0132\017.context.LinkId\"(\n\010Lin" + + "kList\022\034\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tL" + + "inkEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022" + + " \n\007link_id\030\002 \001(\0132\017.context.LinkId\"X\n\tSer" + + "viceId\022&\n\ncontext_id\030\001 \001(\0132\022.context.Con" + + "textId\022#\n\014service_uuid\030\002 \001(\0132\r.context.U" + + "uid\"\315\002\n\007Service\022&\n\nservice_id\030\001 \001(\0132\022.co" + + "ntext.ServiceId\022.\n\014service_type\030\002 \001(\0162\030." + + "context.ServiceTypeEnum\0221\n\024service_endpo" + + "int_ids\030\003 \003(\0132\023.context.EndPointId\0220\n\023se" + + "rvice_constraints\030\004 \003(\0132\023.context.Constr" + + "aint\022.\n\016service_status\030\005 \001(\0132\026.context.S" + + "erviceStatus\022.\n\016service_config\030\006 \001(\0132\026.c" + + "ontext.ServiceConfig\022%\n\ttimestamp\030\007 \001(\0132" + + "\022.context.Timestamp\"C\n\rServiceStatus\0222\n\016" + + "service_status\030\001 \001(\0162\032.context.ServiceSt" + + "atusEnum\":\n\rServiceConfig\022)\n\014config_rule" + + "s\030\001 \003(\0132\023.context.ConfigRule\"8\n\rServiceI" + + "dList\022\'\n\013service_ids\030\001 \003(\0132\022.context.Ser" + + "viceId\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132" + + "\020.context.Service\"U\n\014ServiceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002" + + " \001(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\nc" + + "ontext_id\030\001 \001(\0132\022.context.ContextId\022!\n\ns" + + "lice_uuid\030\002 \001(\0132\r.context.Uuid\"\222\003\n\005Slice" + + "\022\"\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022/\n\022" + + "slice_endpoint_ids\030\002 \003(\0132\023.context.EndPo" + + "intId\022.\n\021slice_constraints\030\003 \003(\0132\023.conte" + + "xt.Constraint\022-\n\021slice_service_ids\030\004 \003(\013" + + "2\022.context.ServiceId\022,\n\022slice_subslice_i" + + "ds\030\005 \003(\0132\020.context.SliceId\022*\n\014slice_stat" + + "us\030\006 \001(\0132\024.context.SliceStatus\022*\n\014slice_" + + "config\030\007 \001(\0132\024.context.SliceConfig\022(\n\013sl" + + "ice_owner\030\010 \001(\0132\023.context.SliceOwner\022%\n\t" + + "timestamp\030\t \001(\0132\022.context.Timestamp\"E\n\nS" + + "liceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context." + + "Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStatu" + + "s\022.\n\014slice_status\030\001 \001(\0162\030.context.SliceS" + + "tatusEnum\"8\n\013SliceConfig\022)\n\014config_rules" + + "\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdLi" + + "st\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId\"" + + "+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context.S" + + "lice\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132\016.cont" + + "ext.Event\022\"\n\010slice_id\030\002 \001(\0132\020.context.Sl" + + "iceId\"6\n\014ConnectionId\022&\n\017connection_uuid" + + "\030\001 \001(\0132\r.context.Uuid\"2\n\025ConnectionSetti" + + "ngs_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"\236\001\n\025Co" + + "nnectionSettings_L2\022\027\n\017src_mac_address\030\001" + + " \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\nether_t" + + "ype\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls_label" + + "\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r\"t\n\025Co" + + "nnectionSettings_L3\022\026\n\016src_ip_address\030\001 " + + "\001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dscp\030\003 \001(" + + "\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[\n\025Conn" + + "ectionSettings_L4\022\020\n\010src_port\030\001 \001(\r\022\020\n\010d" + + "st_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013\n\003ttl\030" + + "\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0\030\001 \001(\013" + + "2\036.context.ConnectionSettings_L0\022*\n\002l2\030\002" + + " \001(\0132\036.context.ConnectionSettings_L2\022*\n\002" + + "l3\030\003 \001(\0132\036.context.ConnectionSettings_L3" + + "\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionSetting" + + "s_L4\"\363\001\n\nConnection\022,\n\rconnection_id\030\001 \001" + + "(\0132\025.context.ConnectionId\022&\n\nservice_id\030" + + "\002 \001(\0132\022.context.ServiceId\0223\n\026path_hops_e" + + "ndpoint_ids\030\003 \003(\0132\023.context.EndPointId\022+" + + "\n\017sub_service_ids\030\004 \003(\0132\022.context.Servic" + + "eId\022-\n\010settings\030\005 \001(\0132\033.context.Connecti" + + "onSettings\"A\n\020ConnectionIdList\022-\n\016connec" + + "tion_ids\030\001 \003(\0132\025.context.ConnectionId\":\n" + + "\016ConnectionList\022(\n\013connections\030\001 \003(\0132\023.c" + + "ontext.Connection\"^\n\017ConnectionEvent\022\035\n\005" + + "event\030\001 \001(\0132\016.context.Event\022,\n\rconnectio" + + "n_id\030\002 \001(\0132\025.context.ConnectionId\"\202\001\n\nEn" + + "dPointId\022(\n\013topology_id\030\001 \001(\0132\023.context." + + "TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.context." + + "DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r.contex" + + "t.Uuid\"\264\001\n\010EndPoint\022(\n\013endpoint_id\030\001 \001(\013" + + "2\023.context.EndPointId\022\025\n\rendpoint_type\030\002" + + " \001(\t\0229\n\020kpi_sample_types\030\003 \003(\0162\037.kpi_sam" + + "ple_types.KpiSampleType\022,\n\021endpoint_loca" + + "tion\030\004 \001(\0132\021.context.Location\"A\n\021ConfigR" + + "ule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016reso" + + "urce_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013en" + + "dpoint_id\030\001 \001(\0132\023.context.EndPointId\022!\n\010" + + "rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConf" + + "igRule\022)\n\006action\030\001 \001(\0162\031.context.ConfigA" + + "ctionEnum\022,\n\006custom\030\002 \001(\0132\032.context.Conf" + + "igRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.C" + + "onfigRule_ACLH\000B\r\n\013config_rule\"F\n\021Constr" + + "aint_Custom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020" + + "constraint_value\030\002 \001(\t\"E\n\023Constraint_Sch" + + "edule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rdurati" + + "on_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitud" + + "e\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020" + + "\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025" + + ".context.GPS_PositionH\000B\n\n\010location\"l\n\033C" + + "onstraint_EndPointLocation\022(\n\013endpoint_i" + + "d\030\001 \001(\0132\023.context.EndPointId\022#\n\010location" + + "\030\002 \001(\0132\021.context.Location\"Y\n\033Constraint_" + + "EndPointPriority\022(\n\013endpoint_id\030\001 \001(\0132\023." + + "context.EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026" + + "Constraint_SLA_Latency\022\026\n\016e2e_latency_ms" + + "\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025\n\rcap" + + "acity_gbps\030\001 \001(\002\"M\n\033Constraint_SLA_Avail" + + "ability\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\na" + + "ll_active\030\002 \001(\010\"V\n\036Constraint_SLA_Isolat" + + "ion_level\0224\n\017isolation_level\030\001 \003(\0162\033.con" + + "text.IsolationLevelEnum\"\366\003\n\nConstraint\022," + + "\n\006custom\030\001 \001(\0132\032.context.Constraint_Cust" + + "omH\000\0220\n\010schedule\030\002 \001(\0132\034.context.Constra" + + "int_ScheduleH\000\022A\n\021endpoint_location\030\003 \001(" + + "\0132$.context.Constraint_EndPointLocationH" + + "\000\022A\n\021endpoint_priority\030\004 \001(\0132$.context.C" + + "onstraint_EndPointPriorityH\000\0228\n\014sla_capa" + + "city\030\005 \001(\0132 .context.Constraint_SLA_Capa" + + "cityH\000\0226\n\013sla_latency\030\006 \001(\0132\037.context.Co" + + "nstraint_SLA_LatencyH\000\022@\n\020sla_availabili" + + "ty\030\007 \001(\0132$.context.Constraint_SLA_Availa" + + "bilityH\000\022@\n\rsla_isolation\030\010 \001(\0132\'.contex" + + "t.Constraint_SLA_Isolation_levelH\000B\014\n\nco" + + "nstraint\"^\n\022TeraFlowController\022&\n\ncontex" + + "t_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_add" + + "ress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticati" + + "onResult\022&\n\ncontext_id\030\001 \001(\0132\022.context.C" + + "ontextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEvent" + + "TypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVE" + + "NTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n" + + "\020EVENTTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum" + + "\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDR" + + "IVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSP" + + "ORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICE" + + "DRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICE" + + "DRIVER_ONF_TR_352\020\005*\217\001\n\033DeviceOperationa" + + "lStatusEnum\022%\n!DEVICEOPERATIONALSTATUS_U" + + "NDEFINED\020\000\022$\n DEVICEOPERATIONALSTATUS_DI" + + "SABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENAB" + + "LED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE" + + "_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERV" + + "ICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNE" + + "CTIVITY_SERVICE\020\003*\250\001\n\021ServiceStatusEnum\022" + + "\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICES" + + "TATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020" + + "\002\022!\n\035SERVICESTATUS_PENDING_REMOVAL\020\003\022\036\n\032" + + "SERVICESTATUS_SLA_VIOLATED\020\004*\251\001\n\017SliceSt" + + "atusEnum\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023S" + + "LICESTATUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT" + + "\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATU" + + "S_DEINIT\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005" + + "*]\n\020ConfigActionEnum\022\032\n\026CONFIGACTION_UND" + + "EFINED\020\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIG" + + "ACTION_DELETE\020\002*\203\002\n\022IsolationLevelEnum\022\020" + + "\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICAL_ISOLATION\020\001" + + "\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021PROCESS_ISOLA" + + "TION\020\003\022\035\n\031PHYSICAL_MEMORY_ISOLATION\020\004\022\036\n" + + "\032PHYSICAL_NETWORK_ISOLATION\020\005\022\036\n\032VIRTUAL" + + "_RESOURCE_ISOLATION\020\006\022\037\n\033NETWORK_FUNCTIO" + + "NS_ISOLATION\020\007\022\025\n\021SERVICE_ISOLATION\020\0102\357\022" + + "\n\016ContextService\022:\n\016ListContextIds\022\016.con" + + "text.Empty\032\026.context.ContextIdList\"\000\0226\n\014" + + "ListContexts\022\016.context.Empty\032\024.context.C" + + "ontextList\"\000\0224\n\nGetContext\022\022.context.Con" + + "textId\032\020.context.Context\"\000\0224\n\nSetContext" + + "\022\020.context.Context\032\022.context.ContextId\"\000" + + "\0225\n\rRemoveContext\022\022.context.ContextId\032\016." + + "context.Empty\"\000\022=\n\020GetContextEvents\022\016.co" + + "ntext.Empty\032\025.context.ContextEvent\"\0000\001\022@" + + "\n\017ListTopologyIds\022\022.context.ContextId\032\027." + + "context.TopologyIdList\"\000\022=\n\016ListTopologi" + + "es\022\022.context.ContextId\032\025.context.Topolog" + + "yList\"\000\0227\n\013GetTopology\022\023.context.Topolog" + + "yId\032\021.context.Topology\"\000\0227\n\013SetTopology\022" + + "\021.context.Topology\032\023.context.TopologyId\"" + + "\000\0227\n\016RemoveTopology\022\023.context.TopologyId" + + "\032\016.context.Empty\"\000\022?\n\021GetTopologyEvents\022" + + "\016.context.Empty\032\026.context.TopologyEvent\"" + + "\0000\001\0228\n\rListDeviceIds\022\016.context.Empty\032\025.c" + + "ontext.DeviceIdList\"\000\0224\n\013ListDevices\022\016.c" + + "ontext.Empty\032\023.context.DeviceList\"\000\0221\n\tG" + + "etDevice\022\021.context.DeviceId\032\017.context.De" + + "vice\"\000\0221\n\tSetDevice\022\017.context.Device\032\021.c" + + "ontext.DeviceId\"\000\0223\n\014RemoveDevice\022\021.cont" + + "ext.DeviceId\032\016.context.Empty\"\000\022;\n\017GetDev" + + "iceEvents\022\016.context.Empty\032\024.context.Devi" + + "ceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.context.Emp" + + "ty\032\023.context.LinkIdList\"\000\0220\n\tListLinks\022\016" + + ".context.Empty\032\021.context.LinkList\"\000\022+\n\007G" + + "etLink\022\017.context.LinkId\032\r.context.Link\"\000" + + "\022+\n\007SetLink\022\r.context.Link\032\017.context.Lin" + + "kId\"\000\022/\n\nRemoveLink\022\017.context.LinkId\032\016.c" + + "ontext.Empty\"\000\0227\n\rGetLinkEvents\022\016.contex" + + "t.Empty\032\022.context.LinkEvent\"\0000\001\022>\n\016ListS" + + "erviceIds\022\022.context.ContextId\032\026.context." + + "ServiceIdList\"\000\022:\n\014ListServices\022\022.contex" + + "t.ContextId\032\024.context.ServiceList\"\000\0224\n\nG" + + "etService\022\022.context.ServiceId\032\020.context." + + "Service\"\000\0224\n\nSetService\022\020.context.Servic" + + "e\032\022.context.ServiceId\"\000\0225\n\rRemoveService" + + "\022\022.context.ServiceId\032\016.context.Empty\"\000\022=" + + "\n\020GetServiceEvents\022\016.context.Empty\032\025.con" + + "text.ServiceEvent\"\0000\001\022:\n\014ListSliceIds\022\022." + + "context.ContextId\032\024.context.SliceIdList\"" + + "\000\0226\n\nListSlices\022\022.context.ContextId\032\022.co" + + "ntext.SliceList\"\000\022.\n\010GetSlice\022\020.context." + + "SliceId\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016." + + "context.Slice\032\020.context.SliceId\"\000\0221\n\013Rem" + + "oveSlice\022\020.context.SliceId\032\016.context.Emp" + + "ty\"\000\0229\n\016GetSliceEvents\022\016.context.Empty\032\023" + + ".context.SliceEvent\"\0000\001\022D\n\021ListConnectio" + + "nIds\022\022.context.ServiceId\032\031.context.Conne" + + "ctionIdList\"\000\022@\n\017ListConnections\022\022.conte" + + "xt.ServiceId\032\027.context.ConnectionList\"\000\022" + + "=\n\rGetConnection\022\025.context.ConnectionId\032" + + "\023.context.Connection\"\000\022=\n\rSetConnection\022" + + "\023.context.Connection\032\025.context.Connectio" + + "nId\"\000\022;\n\020RemoveConnection\022\025.context.Conn" + + "ectionId\032\016.context.Empty\"\000\022C\n\023GetConnect" + + "ionEvents\022\016.context.Empty\032\030.context.Conn" + + "ectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + acl.Acl.getDescriptor(), + kpi_sample_types.KpiSampleTypes.getDescriptor(), }); internal_static_context_Empty_descriptor = getDescriptor().getMessageTypes().get(0); @@ -36382,240 +62224,404 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Uuid_descriptor, new java.lang.String[] { "Uuid", }); - internal_static_context_Event_descriptor = + internal_static_context_Timestamp_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_context_Timestamp_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Timestamp_descriptor, + new java.lang.String[] { "Timestamp", }); + internal_static_context_Event_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_context_Event_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Event_descriptor, new java.lang.String[] { "Timestamp", "EventType", }); internal_static_context_ContextId_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_context_ContextId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextId_descriptor, new java.lang.String[] { "ContextUuid", }); internal_static_context_Context_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_context_Context_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Context_descriptor, new java.lang.String[] { "ContextId", "TopologyIds", "ServiceIds", "Controller", }); internal_static_context_ContextIdList_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_context_ContextIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextIdList_descriptor, new java.lang.String[] { "ContextIds", }); internal_static_context_ContextList_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_context_ContextList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextList_descriptor, new java.lang.String[] { "Contexts", }); internal_static_context_ContextEvent_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_context_ContextEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextEvent_descriptor, new java.lang.String[] { "Event", "ContextId", }); internal_static_context_TopologyId_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_context_TopologyId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyId_descriptor, new java.lang.String[] { "ContextId", "TopologyUuid", }); internal_static_context_Topology_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_context_Topology_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Topology_descriptor, new java.lang.String[] { "TopologyId", "DeviceIds", "LinkIds", }); internal_static_context_TopologyIdList_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_context_TopologyIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyIdList_descriptor, new java.lang.String[] { "TopologyIds", }); internal_static_context_TopologyList_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_context_TopologyList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyList_descriptor, new java.lang.String[] { "Topologies", }); internal_static_context_TopologyEvent_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_context_TopologyEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyEvent_descriptor, new java.lang.String[] { "Event", "TopologyId", }); internal_static_context_DeviceId_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_context_DeviceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceId_descriptor, new java.lang.String[] { "DeviceUuid", }); internal_static_context_Device_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, new java.lang.String[] { "DeviceId", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", }); internal_static_context_DeviceConfig_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_context_DeviceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_DeviceIdList_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_context_DeviceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceIdList_descriptor, new java.lang.String[] { "DeviceIds", }); internal_static_context_DeviceList_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceList_descriptor, new java.lang.String[] { "Devices", }); internal_static_context_DeviceEvent_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_context_DeviceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceEvent_descriptor, new java.lang.String[] { "Event", "DeviceId", }); internal_static_context_LinkId_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_context_LinkId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid", }); internal_static_context_Link_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Link_descriptor, new java.lang.String[] { "LinkId", "LinkEndpointIds", }); internal_static_context_LinkIdList_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_context_LinkIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkIdList_descriptor, new java.lang.String[] { "LinkIds", }); internal_static_context_LinkList_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_context_LinkList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkList_descriptor, new java.lang.String[] { "Links", }); internal_static_context_LinkEvent_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_context_LinkEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkEvent_descriptor, new java.lang.String[] { "Event", "LinkId", }); internal_static_context_ServiceId_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_context_ServiceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceId_descriptor, new java.lang.String[] { "ContextId", "ServiceUuid", }); internal_static_context_Service_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_context_Service_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Service_descriptor, - new java.lang.String[] { "ServiceId", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", }); + new java.lang.String[] { "ServiceId", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", "Timestamp", }); internal_static_context_ServiceStatus_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_context_ServiceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceStatus_descriptor, new java.lang.String[] { "ServiceStatus", }); internal_static_context_ServiceConfig_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_context_ServiceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_ServiceIdList_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_context_ServiceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceIdList_descriptor, new java.lang.String[] { "ServiceIds", }); internal_static_context_ServiceList_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_context_ServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceList_descriptor, new java.lang.String[] { "Services", }); internal_static_context_ServiceEvent_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_context_ServiceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); - internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(31); - internal_static_context_EndPointId_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_EndPointId_descriptor, - new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); - internal_static_context_EndPoint_descriptor = + internal_static_context_SliceId_descriptor = getDescriptor().getMessageTypes().get(32); - internal_static_context_EndPoint_fieldAccessorTable = new + internal_static_context_SliceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_EndPoint_descriptor, - new java.lang.String[] { "EndpointId", "EndpointType", }); - internal_static_context_ConfigRule_descriptor = + internal_static_context_SliceId_descriptor, + new java.lang.String[] { "ContextId", "SliceUuid", }); + internal_static_context_Slice_descriptor = getDescriptor().getMessageTypes().get(33); - internal_static_context_ConfigRule_fieldAccessorTable = new + internal_static_context_Slice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_ConfigRule_descriptor, - new java.lang.String[] { "Action", "ResourceKey", "ResourceValue", }); - internal_static_context_Constraint_descriptor = + internal_static_context_Slice_descriptor, + new java.lang.String[] { "SliceId", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", "SliceConfig", "SliceOwner", "Timestamp", }); + internal_static_context_SliceOwner_descriptor = getDescriptor().getMessageTypes().get(34); - internal_static_context_Constraint_fieldAccessorTable = new + internal_static_context_SliceOwner_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_Constraint_descriptor, - new java.lang.String[] { "ConstraintType", "ConstraintValue", }); - internal_static_context_ConnectionId_descriptor = + internal_static_context_SliceOwner_descriptor, + new java.lang.String[] { "OwnerUuid", "OwnerString", }); + internal_static_context_SliceStatus_descriptor = getDescriptor().getMessageTypes().get(35); + internal_static_context_SliceStatus_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceStatus_descriptor, + new java.lang.String[] { "SliceStatus", }); + internal_static_context_SliceConfig_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_context_SliceConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceConfig_descriptor, + new java.lang.String[] { "ConfigRules", }); + internal_static_context_SliceIdList_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_context_SliceIdList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceIdList_descriptor, + new java.lang.String[] { "SliceIds", }); + internal_static_context_SliceList_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_context_SliceList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceList_descriptor, + new java.lang.String[] { "Slices", }); + internal_static_context_SliceEvent_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_context_SliceEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceEvent_descriptor, + new java.lang.String[] { "Event", "SliceId", }); + internal_static_context_ConnectionId_descriptor = + getDescriptor().getMessageTypes().get(40); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); + internal_static_context_ConnectionSettings_L0_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_context_ConnectionSettings_L0_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L0_descriptor, + new java.lang.String[] { "LspSymbolicName", }); + internal_static_context_ConnectionSettings_L2_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_context_ConnectionSettings_L2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L2_descriptor, + new java.lang.String[] { "SrcMacAddress", "DstMacAddress", "EtherType", "VlanId", "MplsLabel", "MplsTrafficClass", }); + internal_static_context_ConnectionSettings_L3_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_context_ConnectionSettings_L3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L3_descriptor, + new java.lang.String[] { "SrcIpAddress", "DstIpAddress", "Dscp", "Protocol", "Ttl", }); + internal_static_context_ConnectionSettings_L4_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_context_ConnectionSettings_L4_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L4_descriptor, + new java.lang.String[] { "SrcPort", "DstPort", "TcpFlags", "Ttl", }); + internal_static_context_ConnectionSettings_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_context_ConnectionSettings_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_descriptor, + new java.lang.String[] { "L0", "L2", "L3", "L4", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(46); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, - new java.lang.String[] { "ConnectionId", "RelatedServiceId", "Path", }); + new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", "Settings", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(47); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(48); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); + internal_static_context_ConnectionEvent_descriptor = + getDescriptor().getMessageTypes().get(49); + internal_static_context_ConnectionEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionEvent_descriptor, + new java.lang.String[] { "Event", "ConnectionId", }); + internal_static_context_EndPointId_descriptor = + getDescriptor().getMessageTypes().get(50); + internal_static_context_EndPointId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_EndPointId_descriptor, + new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); + internal_static_context_EndPoint_descriptor = + getDescriptor().getMessageTypes().get(51); + internal_static_context_EndPoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_EndPoint_descriptor, + new java.lang.String[] { "EndpointId", "EndpointType", "KpiSampleTypes", "EndpointLocation", }); + internal_static_context_ConfigRule_Custom_descriptor = + getDescriptor().getMessageTypes().get(52); + internal_static_context_ConfigRule_Custom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_Custom_descriptor, + new java.lang.String[] { "ResourceKey", "ResourceValue", }); + internal_static_context_ConfigRule_ACL_descriptor = + getDescriptor().getMessageTypes().get(53); + internal_static_context_ConfigRule_ACL_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_ACL_descriptor, + new java.lang.String[] { "EndpointId", "RuleSet", }); + internal_static_context_ConfigRule_descriptor = + getDescriptor().getMessageTypes().get(54); + internal_static_context_ConfigRule_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_descriptor, + new java.lang.String[] { "Action", "Custom", "Acl", "ConfigRule", }); + internal_static_context_Constraint_Custom_descriptor = + getDescriptor().getMessageTypes().get(55); + internal_static_context_Constraint_Custom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_Custom_descriptor, + new java.lang.String[] { "ConstraintType", "ConstraintValue", }); + internal_static_context_Constraint_Schedule_descriptor = + getDescriptor().getMessageTypes().get(56); + internal_static_context_Constraint_Schedule_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_Schedule_descriptor, + new java.lang.String[] { "StartTimestamp", "DurationDays", }); + internal_static_context_GPS_Position_descriptor = + getDescriptor().getMessageTypes().get(57); + internal_static_context_GPS_Position_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_GPS_Position_descriptor, + new java.lang.String[] { "Latitude", "Longitude", }); + internal_static_context_Location_descriptor = + getDescriptor().getMessageTypes().get(58); + internal_static_context_Location_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Location_descriptor, + new java.lang.String[] { "Region", "GpsPosition", "Location", }); + internal_static_context_Constraint_EndPointLocation_descriptor = + getDescriptor().getMessageTypes().get(59); + internal_static_context_Constraint_EndPointLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_EndPointLocation_descriptor, + new java.lang.String[] { "EndpointId", "Location", }); + internal_static_context_Constraint_EndPointPriority_descriptor = + getDescriptor().getMessageTypes().get(60); + internal_static_context_Constraint_EndPointPriority_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_EndPointPriority_descriptor, + new java.lang.String[] { "EndpointId", "Priority", }); + internal_static_context_Constraint_SLA_Latency_descriptor = + getDescriptor().getMessageTypes().get(61); + internal_static_context_Constraint_SLA_Latency_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Latency_descriptor, + new java.lang.String[] { "E2ELatencyMs", }); + internal_static_context_Constraint_SLA_Capacity_descriptor = + getDescriptor().getMessageTypes().get(62); + internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Capacity_descriptor, + new java.lang.String[] { "CapacityGbps", }); + internal_static_context_Constraint_SLA_Availability_descriptor = + getDescriptor().getMessageTypes().get(63); + internal_static_context_Constraint_SLA_Availability_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Availability_descriptor, + new java.lang.String[] { "NumDisjointPaths", "AllActive", }); + internal_static_context_Constraint_SLA_Isolation_level_descriptor = + getDescriptor().getMessageTypes().get(64); + internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Isolation_level_descriptor, + new java.lang.String[] { "IsolationLevel", }); + internal_static_context_Constraint_descriptor = + getDescriptor().getMessageTypes().get(65); + internal_static_context_Constraint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_descriptor, + new java.lang.String[] { "Custom", "Schedule", "EndpointLocation", "EndpointPriority", "SlaCapacity", "SlaLatency", "SlaAvailability", "SlaIsolation", "Constraint", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(66); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(67); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, new java.lang.String[] { "ContextId", "Authenticated", }); + acl.Acl.getDescriptor(); + kpi_sample_types.KpiSampleTypes.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/automation/target/generated-sources/grpc/context/ContextService.java b/src/automation/target/generated-sources/grpc/context/ContextService.java index 8e5095d25896abc5ff37b7a5e7d4ac7f97825dc6..d54c56057ca53e40071490d3b9aa313a13a77665 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextService.java +++ b/src/automation/target/generated-sources/grpc/context/ContextService.java @@ -58,6 +58,26 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Uni removeService(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request); + + io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request); + + io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request); + + io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request); + + io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request); + + io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request); + io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request); @@ -69,6 +89,10 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Multi getServiceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request); + } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java b/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java index fbecd5d2f3cdf04e9f47693a4aeea37753855cdf..f552294b8e6d645af41cc30632ae0432504bbc67 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java @@ -215,6 +215,86 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } + @Override + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSliceIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSlices(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.getSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + try { + return delegate.setSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.removeSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + try { + return delegate.listConnectionIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + try { + return delegate.listConnections(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + try { + return delegate.getConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + try { + return delegate.setConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + try { + return delegate.removeConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } @Override public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { @@ -261,4 +341,22 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } + @Override + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getSliceEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getConnectionEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java b/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java index 6e815b940e668e33bf936d7d9de0930d086ff9a3..c6493bd4d381967238e5eb87dd717f679d028526 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java @@ -120,6 +120,46 @@ public class ContextServiceClient implements ContextService, MutinyClient removeService(context.ContextOuterClass.ServiceId request) { return stub.removeService(request); } + @Override + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + return stub.listSliceIds(request); + } + @Override + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + return stub.listSlices(request); + } + @Override + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + return stub.getSlice(request); + } + @Override + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + return stub.setSlice(request); + } + @Override + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + return stub.removeSlice(request); + } + @Override + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + return stub.listConnectionIds(request); + } + @Override + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + return stub.listConnections(request); + } + @Override + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + return stub.getConnection(request); + } + @Override + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + return stub.setConnection(request); + } + @Override + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + return stub.removeConnection(request); + } @Override public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { @@ -146,4 +186,14 @@ public class ContextServiceClient implements ContextService, MutinyClient getSliceEvents(context.ContextOuterClass.Empty request) { + return stub.getSliceEvents(request); + } + + @Override + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + return stub.getConnectionEvents(request); + } + } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java index 03f2a66f6f09ed54eb1c359a356ba5240b184166..be720c127439e50f68c2518332f85f750d6579ee 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java @@ -944,6 +944,378 @@ public final class ContextServiceGrpc { return getGetServiceEventsMethod; } + private static volatile io.grpc.MethodDescriptor getListSliceIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSliceIds", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListSliceIdsMethod() { + io.grpc.MethodDescriptor getListSliceIdsMethod; + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + ContextServiceGrpc.getListSliceIdsMethod = getListSliceIdsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSliceIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSliceIds")) + .build(); + } + } + } + return getListSliceIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListSlicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSlices", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListSlicesMethod() { + io.grpc.MethodDescriptor getListSlicesMethod; + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + ContextServiceGrpc.getListSlicesMethod = getListSlicesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSlices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSlices")) + .build(); + } + } + } + return getListSlicesMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Slice.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSliceMethod() { + io.grpc.MethodDescriptor getGetSliceMethod; + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + ContextServiceGrpc.getGetSliceMethod = getGetSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSlice")) + .build(); + } + } + } + return getGetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getSetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetSlice", + requestType = context.ContextOuterClass.Slice.class, + responseType = context.ContextOuterClass.SliceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetSliceMethod() { + io.grpc.MethodDescriptor getSetSliceMethod; + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + ContextServiceGrpc.getSetSliceMethod = getSetSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetSlice")) + .build(); + } + } + } + return getSetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getRemoveSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRemoveSliceMethod() { + io.grpc.MethodDescriptor getRemoveSliceMethod; + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + ContextServiceGrpc.getRemoveSliceMethod = getRemoveSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveSlice")) + .build(); + } + } + } + return getRemoveSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSliceEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSliceEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.SliceEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetSliceEventsMethod() { + io.grpc.MethodDescriptor getGetSliceEventsMethod; + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + ContextServiceGrpc.getGetSliceEventsMethod = getGetSliceEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSliceEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSliceEvents")) + .build(); + } + } + } + return getGetSliceEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListConnectionIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnectionIds", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.ConnectionIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListConnectionIdsMethod() { + io.grpc.MethodDescriptor getListConnectionIdsMethod; + if ((getListConnectionIdsMethod = ContextServiceGrpc.getListConnectionIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListConnectionIdsMethod = ContextServiceGrpc.getListConnectionIdsMethod) == null) { + ContextServiceGrpc.getListConnectionIdsMethod = getListConnectionIdsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnectionIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListConnectionIds")) + .build(); + } + } + } + return getListConnectionIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnections", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.ConnectionList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListConnectionsMethod() { + io.grpc.MethodDescriptor getListConnectionsMethod; + if ((getListConnectionsMethod = ContextServiceGrpc.getListConnectionsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListConnectionsMethod = ContextServiceGrpc.getListConnectionsMethod) == null) { + ContextServiceGrpc.getListConnectionsMethod = getListConnectionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListConnections")) + .build(); + } + } + } + return getListConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnection", + requestType = context.ContextOuterClass.ConnectionId.class, + responseType = context.ContextOuterClass.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetConnectionMethod() { + io.grpc.MethodDescriptor getGetConnectionMethod; + if ((getGetConnectionMethod = ContextServiceGrpc.getGetConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetConnectionMethod = ContextServiceGrpc.getGetConnectionMethod) == null) { + ContextServiceGrpc.getGetConnectionMethod = getGetConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Connection.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetConnection")) + .build(); + } + } + } + return getGetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getSetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetConnection", + requestType = context.ContextOuterClass.Connection.class, + responseType = context.ContextOuterClass.ConnectionId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetConnectionMethod() { + io.grpc.MethodDescriptor getSetConnectionMethod; + if ((getSetConnectionMethod = ContextServiceGrpc.getSetConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetConnectionMethod = ContextServiceGrpc.getSetConnectionMethod) == null) { + ContextServiceGrpc.getSetConnectionMethod = getSetConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Connection.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetConnection")) + .build(); + } + } + } + return getSetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getRemoveConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveConnection", + requestType = context.ContextOuterClass.ConnectionId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRemoveConnectionMethod() { + io.grpc.MethodDescriptor getRemoveConnectionMethod; + if ((getRemoveConnectionMethod = ContextServiceGrpc.getRemoveConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveConnectionMethod = ContextServiceGrpc.getRemoveConnectionMethod) == null) { + ContextServiceGrpc.getRemoveConnectionMethod = getRemoveConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveConnection")) + .build(); + } + } + } + return getRemoveConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetConnectionEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectionEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.ConnectionEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetConnectionEventsMethod() { + io.grpc.MethodDescriptor getGetConnectionEventsMethod; + if ((getGetConnectionEventsMethod = ContextServiceGrpc.getGetConnectionEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetConnectionEventsMethod = ContextServiceGrpc.getGetConnectionEventsMethod) == null) { + ContextServiceGrpc.getGetConnectionEventsMethod = getGetConnectionEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectionEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetConnectionEvents")) + .build(); + } + } + } + return getGetConnectionEventsMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -1202,6 +1574,90 @@ public final class ContextServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServiceEventsMethod(), responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSliceIdsMethod(), responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSlicesMethod(), responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceMethod(), responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetSliceMethod(), responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveSliceMethod(), responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceEventsMethod(), responseObserver); + } + + /** + */ + public void listConnectionIds(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListConnectionIdsMethod(), responseObserver); + } + + /** + */ + public void listConnections(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListConnectionsMethod(), responseObserver); + } + + /** + */ + public void getConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetConnectionMethod(), responseObserver); + } + + /** + */ + public void setConnection(context.ContextOuterClass.Connection request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetConnectionMethod(), responseObserver); + } + + /** + */ + public void removeConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveConnectionMethod(), responseObserver); + } + + /** + */ + public void getConnectionEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetConnectionEventsMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -1414,6 +1870,90 @@ public final class ContextServiceGrpc { context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS))) + .addMethod( + getListSliceIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS))) + .addMethod( + getListSlicesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES))) + .addMethod( + getGetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE))) + .addMethod( + getSetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE))) + .addMethod( + getRemoveSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE))) + .addMethod( + getGetSliceEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS))) + .addMethod( + getListConnectionIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionIdList>( + this, METHODID_LIST_CONNECTION_IDS))) + .addMethod( + getListConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionList>( + this, METHODID_LIST_CONNECTIONS))) + .addMethod( + getGetConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Connection>( + this, METHODID_GET_CONNECTION))) + .addMethod( + getSetConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Connection, + context.ContextOuterClass.ConnectionId>( + this, METHODID_SET_CONNECTION))) + .addMethod( + getRemoveConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_CONNECTION))) + .addMethod( + getGetConnectionEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.ConnectionEvent>( + this, METHODID_GET_CONNECTION_EVENTS))) .build(); } } @@ -1671,6 +2211,102 @@ public final class ContextServiceGrpc { io.grpc.stub.ClientCalls.asyncServerStreamingCall( getChannel().newCall(getGetServiceEventsMethod(), getCallOptions()), request, responseObserver); } + + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetSliceEventsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listConnectionIds(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConnectionIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listConnections(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setConnection(context.ContextOuterClass.Connection request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getConnectionEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetConnectionEventsMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -1901,6 +2537,92 @@ public final class ContextServiceGrpc { return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getGetServiceEventsMethod(), getCallOptions(), request); } + + /** + */ + public context.ContextOuterClass.SliceIdList listSliceIds(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSliceIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceList listSlices(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSlicesMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Slice getSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceId setSlice(context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveSliceMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getSliceEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetSliceEventsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionIdList listConnectionIds(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConnectionIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionList listConnections(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConnectionsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Connection getConnection(context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionId setConnection(context.ContextOuterClass.Connection request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeConnection(context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getConnectionEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetConnectionEventsMethod(), getCallOptions(), request); + } } /** @@ -2116,6 +2838,86 @@ public final class ContextServiceGrpc { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getRemoveServiceMethod(), getCallOptions()), request); } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listSliceIds( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listSlices( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture setSlice( + context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture removeSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listConnectionIds( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConnectionIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listConnections( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getConnection( + context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture setConnection( + context.ContextOuterClass.Connection request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetConnectionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture removeConnection( + context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveConnectionMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CONTEXT_IDS = 0; @@ -2148,6 +2950,18 @@ public final class ContextServiceGrpc { private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2286,6 +3100,54 @@ public final class ContextServiceGrpc { serviceImpl.getServiceEvents((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_SLICE_IDS: + serviceImpl.listSliceIds((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SLICES: + serviceImpl.listSlices((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SLICE: + serviceImpl.getSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_SLICE: + serviceImpl.setSlice((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_SLICE: + serviceImpl.removeSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SLICE_EVENTS: + serviceImpl.getSliceEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CONNECTION_IDS: + serviceImpl.listConnectionIds((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CONNECTIONS: + serviceImpl.listConnections((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONNECTION: + serviceImpl.getConnection((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_CONNECTION: + serviceImpl.setConnection((context.ContextOuterClass.Connection) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_CONNECTION: + serviceImpl.removeConnection((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONNECTION_EVENTS: + serviceImpl.getConnectionEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2377,6 +3239,18 @@ public final class ContextServiceGrpc { .addMethod(getSetServiceMethod()) .addMethod(getRemoveServiceMethod()) .addMethod(getGetServiceEventsMethod()) + .addMethod(getListSliceIdsMethod()) + .addMethod(getListSlicesMethod()) + .addMethod(getGetSliceMethod()) + .addMethod(getSetSliceMethod()) + .addMethod(getRemoveSliceMethod()) + .addMethod(getGetSliceEventsMethod()) + .addMethod(getListConnectionIdsMethod()) + .addMethod(getListConnectionsMethod()) + .addMethod(getGetConnectionMethod()) + .addMethod(getSetConnectionMethod()) + .addMethod(getRemoveConnectionMethod()) + .addMethod(getGetConnectionEventsMethod()) .build(); } } diff --git a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java index 7642fdfd5c6d203fe0e0b042ca06448477b05bad..9f71b53786e40922546dc59cfd4328040a40bd7c 100644 --- a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java @@ -161,6 +161,56 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSliceIds); + } + + + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSlices); + } + + + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSlice); + } + + + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setSlice); + } + + + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeSlice); + } + + + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnectionIds); + } + + + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnections); + } + + + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getConnection); + } + + + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setConnection); + } + + + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeConnection); + } + + public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getContextEvents); } @@ -185,6 +235,16 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getServiceEvents); } + + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getSliceEvents); + } + + + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getConnectionEvents); + } + } @@ -328,6 +388,56 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -352,6 +462,16 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } + + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -564,6 +684,90 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSliceIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSlicesMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getSetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListConnectionIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionIdList>( + this, METHODID_LIST_CONNECTION_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListConnectionsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionList>( + this, METHODID_LIST_CONNECTIONS, compression))) + .addMethod( + context.ContextServiceGrpc.getGetConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Connection>( + this, METHODID_GET_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getSetConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Connection, + context.ContextOuterClass.ConnectionId>( + this, METHODID_SET_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getGetConnectionEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.ConnectionEvent>( + this, METHODID_GET_CONNECTION_EVENTS, compression))) .build(); } } @@ -598,6 +802,18 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -798,6 +1014,78 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M compression, serviceImpl::getServiceEvents); break; + case METHODID_LIST_SLICE_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listSliceIds); + break; + case METHODID_LIST_SLICES: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listSlices); + break; + case METHODID_GET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSlice); + break; + case METHODID_SET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::setSlice); + break; + case METHODID_REMOVE_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::removeSlice); + break; + case METHODID_GET_SLICE_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSliceEvents); + break; + case METHODID_LIST_CONNECTION_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listConnectionIds); + break; + case METHODID_LIST_CONNECTIONS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listConnections); + break; + case METHODID_GET_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getConnection); + break; + case METHODID_SET_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Connection) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::setConnection); + break; + case METHODID_REMOVE_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::removeConnection); + break; + case METHODID_GET_CONNECTION_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getConnectionEvents); + break; default: throw new java.lang.AssertionError(); } diff --git a/src/automation/target/generated-sources/grpc/device/Device.java b/src/automation/target/generated-sources/grpc/device/Device.java index 460f29a6188215daff9a55c1039ba84c5abf3ecc..bc57d19cae53bf0540a402e9771bc87c1ecf49c5 100644 --- a/src/automation/target/generated-sources/grpc/device/Device.java +++ b/src/automation/target/generated-sources/grpc/device/Device.java @@ -14,6 +14,979 @@ public final class Device { registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } + public interface MonitoringSettingsOrBuilder extends + // @@protoc_insertion_point(interface_extends:device.MonitoringSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return Whether the kpiDescriptor field is set. + */ + boolean hasKpiDescriptor(); + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return The kpiDescriptor. + */ + monitoring.Monitoring.KpiDescriptor getKpiDescriptor(); + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder(); + + /** + * float sampling_duration_s = 3; + * @return The samplingDurationS. + */ + float getSamplingDurationS(); + + /** + * float sampling_interval_s = 4; + * @return The samplingIntervalS. + */ + float getSamplingIntervalS(); + } + /** + * Protobuf type {@code device.MonitoringSettings} + */ + public static final class MonitoringSettings extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:device.MonitoringSettings) + MonitoringSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitoringSettings.newBuilder() to construct. + private MonitoringSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MonitoringSettings() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MonitoringSettings(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MonitoringSettings( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + monitoring.Monitoring.KpiDescriptor.Builder subBuilder = null; + if (kpiDescriptor_ != null) { + subBuilder = kpiDescriptor_.toBuilder(); + } + kpiDescriptor_ = input.readMessage(monitoring.Monitoring.KpiDescriptor.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiDescriptor_); + kpiDescriptor_ = subBuilder.buildPartial(); + } + + break; + } + case 29: { + + samplingDurationS_ = input.readFloat(); + break; + } + case 37: { + + samplingIntervalS_ = input.readFloat(); + 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 device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return device.Device.internal_static_device_MonitoringSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + device.Device.MonitoringSettings.class, device.Device.MonitoringSettings.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int KPI_DESCRIPTOR_FIELD_NUMBER = 2; + private monitoring.Monitoring.KpiDescriptor kpiDescriptor_; + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return Whether the kpiDescriptor field is set. + */ + @java.lang.Override + public boolean hasKpiDescriptor() { + return kpiDescriptor_ != null; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return The kpiDescriptor. + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor() { + return kpiDescriptor_ == null ? monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder() { + return getKpiDescriptor(); + } + + public static final int SAMPLING_DURATION_S_FIELD_NUMBER = 3; + private float samplingDurationS_; + /** + * float sampling_duration_s = 3; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + + public static final int SAMPLING_INTERVAL_S_FIELD_NUMBER = 4; + private float samplingIntervalS_; + /** + * float sampling_interval_s = 4; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (kpiDescriptor_ != null) { + output.writeMessage(2, getKpiDescriptor()); + } + if (samplingDurationS_ != 0F) { + output.writeFloat(3, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + output.writeFloat(4, samplingIntervalS_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (kpiDescriptor_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getKpiDescriptor()); + } + if (samplingDurationS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, samplingIntervalS_); + } + 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 device.Device.MonitoringSettings)) { + return super.equals(obj); + } + device.Device.MonitoringSettings other = (device.Device.MonitoringSettings) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (hasKpiDescriptor() != other.hasKpiDescriptor()) return false; + if (hasKpiDescriptor()) { + if (!getKpiDescriptor() + .equals(other.getKpiDescriptor())) return false; + } + if (java.lang.Float.floatToIntBits(getSamplingDurationS()) + != java.lang.Float.floatToIntBits( + other.getSamplingDurationS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingIntervalS()) + != java.lang.Float.floatToIntBits( + other.getSamplingIntervalS())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + if (hasKpiDescriptor()) { + hash = (37 * hash) + KPI_DESCRIPTOR_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescriptor().hashCode(); + } + hash = (37 * hash) + SAMPLING_DURATION_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingDurationS()); + hash = (37 * hash) + SAMPLING_INTERVAL_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingIntervalS()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static device.Device.MonitoringSettings parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static device.Device.MonitoringSettings parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static device.Device.MonitoringSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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 device.Device.MonitoringSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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 device.Device.MonitoringSettings parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static device.Device.MonitoringSettings 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(device.Device.MonitoringSettings 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 device.MonitoringSettings} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:device.MonitoringSettings) + device.Device.MonitoringSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return device.Device.internal_static_device_MonitoringSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + device.Device.MonitoringSettings.class, device.Device.MonitoringSettings.Builder.class); + } + + // Construct using device.Device.MonitoringSettings.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = null; + } else { + kpiDescriptor_ = null; + kpiDescriptorBuilder_ = null; + } + samplingDurationS_ = 0F; + + samplingIntervalS_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return device.Device.internal_static_device_MonitoringSettings_descriptor; + } + + @java.lang.Override + public device.Device.MonitoringSettings getDefaultInstanceForType() { + return device.Device.MonitoringSettings.getDefaultInstance(); + } + + @java.lang.Override + public device.Device.MonitoringSettings build() { + device.Device.MonitoringSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public device.Device.MonitoringSettings buildPartial() { + device.Device.MonitoringSettings result = new device.Device.MonitoringSettings(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + if (kpiDescriptorBuilder_ == null) { + result.kpiDescriptor_ = kpiDescriptor_; + } else { + result.kpiDescriptor_ = kpiDescriptorBuilder_.build(); + } + result.samplingDurationS_ = samplingDurationS_; + result.samplingIntervalS_ = samplingIntervalS_; + 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 device.Device.MonitoringSettings) { + return mergeFrom((device.Device.MonitoringSettings)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(device.Device.MonitoringSettings other) { + if (other == device.Device.MonitoringSettings.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.hasKpiDescriptor()) { + mergeKpiDescriptor(other.getKpiDescriptor()); + } + if (other.getSamplingDurationS() != 0F) { + setSamplingDurationS(other.getSamplingDurationS()); + } + if (other.getSamplingIntervalS() != 0F) { + setSamplingIntervalS(other.getSamplingIntervalS()); + } + 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 { + device.Device.MonitoringSettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (device.Device.MonitoringSettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private monitoring.Monitoring.KpiDescriptor kpiDescriptor_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> kpiDescriptorBuilder_; + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return Whether the kpiDescriptor field is set. + */ + public boolean hasKpiDescriptor() { + return kpiDescriptorBuilder_ != null || kpiDescriptor_ != null; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + * @return The kpiDescriptor. + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor() { + if (kpiDescriptorBuilder_ == null) { + return kpiDescriptor_ == null ? monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } else { + return kpiDescriptorBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public Builder setKpiDescriptor(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiDescriptor_ = value; + onChanged(); + } else { + kpiDescriptorBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public Builder setKpiDescriptor( + monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = builderForValue.build(); + onChanged(); + } else { + kpiDescriptorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public Builder mergeKpiDescriptor(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorBuilder_ == null) { + if (kpiDescriptor_ != null) { + kpiDescriptor_ = + monitoring.Monitoring.KpiDescriptor.newBuilder(kpiDescriptor_).mergeFrom(value).buildPartial(); + } else { + kpiDescriptor_ = value; + } + onChanged(); + } else { + kpiDescriptorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public Builder clearKpiDescriptor() { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptor_ = null; + onChanged(); + } else { + kpiDescriptor_ = null; + kpiDescriptorBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public monitoring.Monitoring.KpiDescriptor.Builder getKpiDescriptorBuilder() { + + onChanged(); + return getKpiDescriptorFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorOrBuilder() { + if (kpiDescriptorBuilder_ != null) { + return kpiDescriptorBuilder_.getMessageOrBuilder(); + } else { + return kpiDescriptor_ == null ? + monitoring.Monitoring.KpiDescriptor.getDefaultInstance() : kpiDescriptor_; + } + } + /** + * .monitoring.KpiDescriptor kpi_descriptor = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> + getKpiDescriptorFieldBuilder() { + if (kpiDescriptorBuilder_ == null) { + kpiDescriptorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder>( + getKpiDescriptor(), + getParentForChildren(), + isClean()); + kpiDescriptor_ = null; + } + return kpiDescriptorBuilder_; + } + + private float samplingDurationS_ ; + /** + * float sampling_duration_s = 3; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + /** + * float sampling_duration_s = 3; + * @param value The samplingDurationS to set. + * @return This builder for chaining. + */ + public Builder setSamplingDurationS(float value) { + + samplingDurationS_ = value; + onChanged(); + return this; + } + /** + * float sampling_duration_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingDurationS() { + + samplingDurationS_ = 0F; + onChanged(); + return this; + } + + private float samplingIntervalS_ ; + /** + * float sampling_interval_s = 4; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + /** + * float sampling_interval_s = 4; + * @param value The samplingIntervalS to set. + * @return This builder for chaining. + */ + public Builder setSamplingIntervalS(float value) { + + samplingIntervalS_ = value; + onChanged(); + return this; + } + /** + * float sampling_interval_s = 4; + * @return This builder for chaining. + */ + public Builder clearSamplingIntervalS() { + + samplingIntervalS_ = 0F; + 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:device.MonitoringSettings) + } + + // @@protoc_insertion_point(class_scope:device.MonitoringSettings) + private static final device.Device.MonitoringSettings DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new device.Device.MonitoringSettings(); + } + + public static device.Device.MonitoringSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MonitoringSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitoringSettings(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 device.Device.MonitoringSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_device_MonitoringSettings_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_device_MonitoringSettings_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -23,21 +996,35 @@ public final class Device { descriptor; static { java.lang.String[] descriptorData = { - "\n\014device.proto\022\006device\032\rcontext.proto2\360\001" + - "\n\rDeviceService\0221\n\tAddDevice\022\017.context.D" + - "evice\032\021.context.DeviceId\"\000\0227\n\017ConfigureD" + - "evice\022\017.context.Device\032\021.context.DeviceI" + - "d\"\000\0223\n\014DeleteDevice\022\021.context.DeviceId\032\016" + - ".context.Empty\"\000\022>\n\020GetInitialConfig\022\021.c" + - "ontext.DeviceId\032\025.context.DeviceConfig\"\000" + - "b\006proto3" + "\n\014device.proto\022\006device\032\rcontext.proto\032\020m" + + "onitoring.proto\"\244\001\n\022MonitoringSettings\022!" + + "\n\006kpi_id\030\001 \001(\0132\021.monitoring.KpiId\0221\n\016kpi" + + "_descriptor\030\002 \001(\0132\031.monitoring.KpiDescri" + + "ptor\022\033\n\023sampling_duration_s\030\003 \001(\002\022\033\n\023sam" + + "pling_interval_s\030\004 \001(\0022\262\002\n\rDeviceService" + + "\0221\n\tAddDevice\022\017.context.Device\032\021.context" + + ".DeviceId\"\000\0227\n\017ConfigureDevice\022\017.context" + + ".Device\032\021.context.DeviceId\"\000\0223\n\014DeleteDe" + + "vice\022\021.context.DeviceId\032\016.context.Empty\"" + + "\000\022>\n\020GetInitialConfig\022\021.context.DeviceId" + + "\032\025.context.DeviceConfig\"\000\022@\n\020MonitorDevi" + + "ceKpi\022\032.device.MonitoringSettings\032\016.cont" + + "ext.Empty\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { context.ContextOuterClass.getDescriptor(), + monitoring.Monitoring.getDescriptor(), }); + internal_static_device_MonitoringSettings_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_device_MonitoringSettings_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_device_MonitoringSettings_descriptor, + new java.lang.String[] { "KpiId", "KpiDescriptor", "SamplingDurationS", "SamplingIntervalS", }); context.ContextOuterClass.getDescriptor(); + monitoring.Monitoring.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/automation/target/generated-sources/grpc/device/DeviceService.java b/src/automation/target/generated-sources/grpc/device/DeviceService.java index c2d9be46eb44a8e05efab74866f7ff8337934ed3..1768f9911b9d05a7c61e70d8f75e397f9a3341a4 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceService.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceService.java @@ -16,6 +16,8 @@ public interface DeviceService extends MutinyService { io.smallrye.mutiny.Uni getInitialConfig(context.ContextOuterClass.DeviceId request); + io.smallrye.mutiny.Uni monitorDeviceKpi(device.Device.MonitoringSettings request); + diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java index 203e2f2b3e1d42e7a848cdcc19f251e484def93f..c7e767237abc22ff273cc454f1433e5f811382fc 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java @@ -47,5 +47,13 @@ public class DeviceServiceBean extends MutinyDeviceServiceGrpc.DeviceServiceImpl throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } + @Override + public io.smallrye.mutiny.Uni monitorDeviceKpi(device.Device.MonitoringSettings request) { + try { + return delegate.monitorDeviceKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java index e987e6333549200193cf9b6a77f8589b15086718..2445752a6392c3f6f9df0b0ef439d789e6a8d925 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java @@ -36,5 +36,9 @@ public class DeviceServiceClient implements DeviceService, MutinyClient getInitialConfig(context.ContextOuterClass.DeviceId request) { return stub.getInitialConfig(request); } + @Override + public io.smallrye.mutiny.Uni monitorDeviceKpi(device.Device.MonitoringSettings request) { + return stub.monitorDeviceKpi(request); + } } \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java b/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java index c19e45888168c69c1454dfde99af59cf64195851..9c2e379d311a58ca51c9208feba359120c086c0e 100644 --- a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java @@ -138,6 +138,37 @@ public final class DeviceServiceGrpc { return getGetInitialConfigMethod; } + private static volatile io.grpc.MethodDescriptor getMonitorDeviceKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MonitorDeviceKpi", + requestType = device.Device.MonitoringSettings.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getMonitorDeviceKpiMethod() { + io.grpc.MethodDescriptor getMonitorDeviceKpiMethod; + if ((getMonitorDeviceKpiMethod = DeviceServiceGrpc.getMonitorDeviceKpiMethod) == null) { + synchronized (DeviceServiceGrpc.class) { + if ((getMonitorDeviceKpiMethod = DeviceServiceGrpc.getMonitorDeviceKpiMethod) == null) { + DeviceServiceGrpc.getMonitorDeviceKpiMethod = getMonitorDeviceKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MonitorDeviceKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + device.Device.MonitoringSettings.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new DeviceServiceMethodDescriptorSupplier("MonitorDeviceKpi")) + .build(); + } + } + } + return getMonitorDeviceKpiMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -214,6 +245,13 @@ public final class DeviceServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetInitialConfigMethod(), responseObserver); } + /** + */ + public void monitorDeviceKpi(device.Device.MonitoringSettings request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMonitorDeviceKpiMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -244,6 +282,13 @@ public final class DeviceServiceGrpc { context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceConfig>( this, METHODID_GET_INITIAL_CONFIG))) + .addMethod( + getMonitorDeviceKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + device.Device.MonitoringSettings, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_DEVICE_KPI))) .build(); } } @@ -293,6 +338,14 @@ public final class DeviceServiceGrpc { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetInitialConfigMethod(), getCallOptions()), request, responseObserver); } + + /** + */ + public void monitorDeviceKpi(device.Device.MonitoringSettings request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMonitorDeviceKpiMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -336,6 +389,13 @@ public final class DeviceServiceGrpc { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetInitialConfigMethod(), getCallOptions(), request); } + + /** + */ + public context.ContextOuterClass.Empty monitorDeviceKpi(device.Device.MonitoringSettings request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMonitorDeviceKpiMethod(), getCallOptions(), request); + } } /** @@ -383,12 +443,21 @@ public final class DeviceServiceGrpc { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetInitialConfigMethod(), getCallOptions()), request); } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture monitorDeviceKpi( + device.Device.MonitoringSettings request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMonitorDeviceKpiMethod(), getCallOptions()), request); + } } private static final int METHODID_ADD_DEVICE = 0; private static final int METHODID_CONFIGURE_DEVICE = 1; private static final int METHODID_DELETE_DEVICE = 2; private static final int METHODID_GET_INITIAL_CONFIG = 3; + private static final int METHODID_MONITOR_DEVICE_KPI = 4; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -423,6 +492,10 @@ public final class DeviceServiceGrpc { serviceImpl.getInitialConfig((context.ContextOuterClass.DeviceId) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_MONITOR_DEVICE_KPI: + serviceImpl.monitorDeviceKpi((device.Device.MonitoringSettings) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -488,6 +561,7 @@ public final class DeviceServiceGrpc { .addMethod(getConfigureDeviceMethod()) .addMethod(getDeleteDeviceMethod()) .addMethod(getGetInitialConfigMethod()) + .addMethod(getMonitorDeviceKpiMethod()) .build(); } } diff --git a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java b/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java index ee52d131578ede0769997d3f76a02a302568c21f..096784b5a39fa66afbe2ff5402b8beec6c294730 100644 --- a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java +++ b/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java @@ -55,6 +55,11 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getInitialConfig); } + + public io.smallrye.mutiny.Uni monitorDeviceKpi(device.Device.MonitoringSettings request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::monitorDeviceKpi); + } + } @@ -92,6 +97,11 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } + + public io.smallrye.mutiny.Uni monitorDeviceKpi(device.Device.MonitoringSettings request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -122,6 +132,13 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceConfig>( this, METHODID_GET_INITIAL_CONFIG, compression))) + .addMethod( + device.DeviceServiceGrpc.getMonitorDeviceKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + device.Device.MonitoringSettings, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_DEVICE_KPI, compression))) .build(); } } @@ -130,6 +147,7 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu private static final int METHODID_CONFIGURE_DEVICE = 1; private static final int METHODID_DELETE_DEVICE = 2; private static final int METHODID_GET_INITIAL_CONFIG = 3; + private static final int METHODID_MONITOR_DEVICE_KPI = 4; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -174,6 +192,12 @@ public final class MutinyDeviceServiceGrpc implements io.quarkus.grpc.runtime.Mu compression, serviceImpl::getInitialConfig); break; + case METHODID_MONITOR_DEVICE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((device.Device.MonitoringSettings) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::monitorDeviceKpi); + break; default: throw new java.lang.AssertionError(); } diff --git a/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java new file mode 100644 index 0000000000000000000000000000000000000000..67e1ec736f9d83cbf95b419e9e61e92e82e73b88 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java @@ -0,0 +1,176 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: kpi_sample_types.proto + +package kpi_sample_types; + +public final class KpiSampleTypes { + private KpiSampleTypes() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code kpi_sample_types.KpiSampleType} + */ + public enum KpiSampleType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * KPISAMPLETYPE_UNKNOWN = 0; + */ + KPISAMPLETYPE_UNKNOWN(0), + /** + * KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; + */ + KPISAMPLETYPE_PACKETS_TRANSMITTED(101), + /** + * KPISAMPLETYPE_PACKETS_RECEIVED = 102; + */ + KPISAMPLETYPE_PACKETS_RECEIVED(102), + /** + * KPISAMPLETYPE_BYTES_TRANSMITTED = 201; + */ + KPISAMPLETYPE_BYTES_TRANSMITTED(201), + /** + * KPISAMPLETYPE_BYTES_RECEIVED = 202; + */ + KPISAMPLETYPE_BYTES_RECEIVED(202), + UNRECOGNIZED(-1), + ; + + /** + * KPISAMPLETYPE_UNKNOWN = 0; + */ + public static final int KPISAMPLETYPE_UNKNOWN_VALUE = 0; + /** + * KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; + */ + public static final int KPISAMPLETYPE_PACKETS_TRANSMITTED_VALUE = 101; + /** + * KPISAMPLETYPE_PACKETS_RECEIVED = 102; + */ + public static final int KPISAMPLETYPE_PACKETS_RECEIVED_VALUE = 102; + /** + * KPISAMPLETYPE_BYTES_TRANSMITTED = 201; + */ + public static final int KPISAMPLETYPE_BYTES_TRANSMITTED_VALUE = 201; + /** + * KPISAMPLETYPE_BYTES_RECEIVED = 202; + */ + public static final int KPISAMPLETYPE_BYTES_RECEIVED_VALUE = 202; + + + 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 KpiSampleType 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 KpiSampleType forNumber(int value) { + switch (value) { + case 0: return KPISAMPLETYPE_UNKNOWN; + case 101: return KPISAMPLETYPE_PACKETS_TRANSMITTED; + case 102: return KPISAMPLETYPE_PACKETS_RECEIVED; + case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED; + case 202: return KPISAMPLETYPE_BYTES_RECEIVED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + KpiSampleType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public KpiSampleType findValueByNumber(int number) { + return KpiSampleType.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 kpi_sample_types.KpiSampleTypes.getDescriptor().getEnumTypes().get(0); + } + + private static final KpiSampleType[] VALUES = values(); + + public static KpiSampleType 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 KpiSampleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:kpi_sample_types.KpiSampleType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026kpi_sample_types.proto\022\020kpi_sample_typ" + + "es*\276\001\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" + + "KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" + + "TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" + + "\020f\022$\n\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001" + + "\022!\n\034KPISAMPLETYPE_BYTES_RECEIVED\020\312\001b\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java b/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java new file mode 100644 index 0000000000000000000000000000000000000000..5d63d4aa45e578957a7a3414c33491cebe98acbe --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java @@ -0,0 +1,20152 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitoring.proto + +package monitoring; + +public final class Monitoring { + private Monitoring() {} + 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 KpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 3; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 4; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 5; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 6; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiDescriptor} + */ + public static final class KpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiDescriptor) + KpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiDescriptor.newBuilder() to construct. + private KpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiDescriptor() { + kpiDescription_ = ""; + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiDescriptor( + 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(); + + kpiDescription_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 26: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 2; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 3; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 4; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(2, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(3, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(4, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(5, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(6, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceId()); + } + 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 monitoring.Monitoring.KpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiDescriptor other = (monitoring.Monitoring.KpiDescriptor) obj; + + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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 monitoring.Monitoring.KpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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 monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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(monitoring.Monitoring.KpiDescriptor 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 monitoring.KpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiDescriptor) + monitoring.Monitoring.KpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiDescriptor.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(); + kpiDescription_ = ""; + + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.KpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor build() { + monitoring.Monitoring.KpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor buildPartial() { + monitoring.Monitoring.KpiDescriptor result = new monitoring.Monitoring.KpiDescriptor(this); + result.kpiDescription_ = kpiDescription_; + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.KpiDescriptor) { + return mergeFrom((monitoring.Monitoring.KpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiDescriptor other) { + if (other == monitoring.Monitoring.KpiDescriptor.getDefaultInstance()) return this; + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.KpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 1; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 3; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 5; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 6; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.KpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) + private static final monitoring.Monitoring.KpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiDescriptor(); + } + + public static monitoring.Monitoring.KpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiDescriptor(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 monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BundleKpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.BundleKpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + java.util.List + getKpiIdListList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + monitoring.Monitoring.KpiId getKpiIdList(int index); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + int getKpiIdListCount(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + java.util.List + getKpiIdListOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 4; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 5; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 6; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 7; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.BundleKpiDescriptor} + */ + public static final class BundleKpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.BundleKpiDescriptor) + BundleKpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundleKpiDescriptor.newBuilder() to construct. + private BundleKpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BundleKpiDescriptor() { + kpiDescription_ = ""; + kpiIdList_ = java.util.Collections.emptyList(); + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BundleKpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BundleKpiDescriptor( + 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(); + + kpiDescription_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiIdList_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 24: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 34: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.BundleKpiDescriptor.class, monitoring.Monitoring.BundleKpiDescriptor.Builder.class); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_ID_LIST_FIELD_NUMBER = 2; + private java.util.List kpiIdList_; + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public java.util.List getKpiIdListList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public java.util.List + getKpiIdListOrBuilderList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public int getKpiIdListCount() { + return kpiIdList_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + return kpiIdList_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + return kpiIdList_.get(index); + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 3; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 4; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 4; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 7; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 7; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + output.writeMessage(2, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(3, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(4, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(5, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(6, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(7, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSliceId()); + } + 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 monitoring.Monitoring.BundleKpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.BundleKpiDescriptor other = (monitoring.Monitoring.BundleKpiDescriptor) obj; + + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (!getKpiIdListList() + .equals(other.getKpiIdListList())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + if (getKpiIdListCount() > 0) { + hash = (37 * hash) + KPI_ID_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdListList().hashCode(); + } + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.Monitoring.BundleKpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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(monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.BundleKpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.BundleKpiDescriptor) + monitoring.Monitoring.BundleKpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.BundleKpiDescriptor.class, monitoring.Monitoring.BundleKpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.BundleKpiDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + kpiDescription_ = ""; + + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdListBuilder_.clear(); + } + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor build() { + monitoring.Monitoring.BundleKpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor buildPartial() { + monitoring.Monitoring.BundleKpiDescriptor result = new monitoring.Monitoring.BundleKpiDescriptor(this); + int from_bitField0_ = bitField0_; + result.kpiDescription_ = kpiDescription_; + if (kpiIdListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiIdList_ = kpiIdList_; + } else { + result.kpiIdList_ = kpiIdListBuilder_.build(); + } + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.BundleKpiDescriptor) { + return mergeFrom((monitoring.Monitoring.BundleKpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.BundleKpiDescriptor other) { + if (other == monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance()) return this; + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (kpiIdListBuilder_ == null) { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdList_.isEmpty()) { + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdListIsMutable(); + kpiIdList_.addAll(other.kpiIdList_); + } + onChanged(); + } + } else { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdListBuilder_.isEmpty()) { + kpiIdListBuilder_.dispose(); + kpiIdListBuilder_ = null; + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdListFieldBuilder() : null; + } else { + kpiIdListBuilder_.addAllMessages(other.kpiIdList_); + } + } + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.BundleKpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.BundleKpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 1; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private java.util.List kpiIdList_ = + java.util.Collections.emptyList(); + private void ensureKpiIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(kpiIdList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdListBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List getKpiIdListList() { + if (kpiIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiIdList_); + } else { + return kpiIdListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public int getKpiIdListCount() { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.size(); + } else { + return kpiIdListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); + } else { + return kpiIdListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, value); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList(monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addAllKpiIdList( + java.lang.Iterable values) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiIdList_); + onChanged(); + } else { + kpiIdListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder clearKpiIdList() { + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder removeKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.remove(index); + onChanged(); + } else { + kpiIdListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); } else { + return kpiIdListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List + getKpiIdListOrBuilderList() { + if (kpiIdListBuilder_ != null) { + return kpiIdListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiIdList_); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder() { + return getKpiIdListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List + getKpiIdListBuilderList() { + return getKpiIdListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdListFieldBuilder() { + if (kpiIdListBuilder_ == null) { + kpiIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiIdList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiIdList_ = null; + } + return kpiIdListBuilder_; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 4; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 6; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 7; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.BundleKpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.BundleKpiDescriptor) + private static final monitoring.Monitoring.BundleKpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.BundleKpiDescriptor(); + } + + public static monitoring.Monitoring.BundleKpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleKpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundleKpiDescriptor(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 monitoring.Monitoring.BundleKpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EditedKpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.EditedKpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + java.util.List + getKpiIdListList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + monitoring.Monitoring.KpiId getKpiIdList(int index); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + int getKpiIdListCount(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + java.util.List + getKpiIdListOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 5; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 6; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 7; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 8; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.EditedKpiDescriptor} + */ + public static final class EditedKpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.EditedKpiDescriptor) + EditedKpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use EditedKpiDescriptor.newBuilder() to construct. + private EditedKpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EditedKpiDescriptor() { + kpiDescription_ = ""; + kpiIdList_ = java.util.Collections.emptyList(); + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EditedKpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EditedKpiDescriptor( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + kpiDescription_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiIdList_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 32: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 42: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.EditedKpiDescriptor.class, monitoring.Monitoring.EditedKpiDescriptor.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_ID_LIST_FIELD_NUMBER = 3; + private java.util.List kpiIdList_; + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public java.util.List getKpiIdListList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public java.util.List + getKpiIdListOrBuilderList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public int getKpiIdListCount() { + return kpiIdList_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + return kpiIdList_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + return kpiIdList_.get(index); + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 4; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 7; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 7; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 8; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 8; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + output.writeMessage(3, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(4, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(5, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(6, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(7, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(8, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSliceId()); + } + 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 monitoring.Monitoring.EditedKpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.EditedKpiDescriptor other = (monitoring.Monitoring.EditedKpiDescriptor) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (!getKpiIdListList() + .equals(other.getKpiIdListList())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + if (getKpiIdListCount() > 0) { + hash = (37 * hash) + KPI_ID_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdListList().hashCode(); + } + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.Monitoring.EditedKpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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(monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.EditedKpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.EditedKpiDescriptor) + monitoring.Monitoring.EditedKpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.EditedKpiDescriptor.class, monitoring.Monitoring.EditedKpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.EditedKpiDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + kpiDescription_ = ""; + + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdListBuilder_.clear(); + } + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor build() { + monitoring.Monitoring.EditedKpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor buildPartial() { + monitoring.Monitoring.EditedKpiDescriptor result = new monitoring.Monitoring.EditedKpiDescriptor(this); + int from_bitField0_ = bitField0_; + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.kpiDescription_ = kpiDescription_; + if (kpiIdListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiIdList_ = kpiIdList_; + } else { + result.kpiIdList_ = kpiIdListBuilder_.build(); + } + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.EditedKpiDescriptor) { + return mergeFrom((monitoring.Monitoring.EditedKpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.EditedKpiDescriptor other) { + if (other == monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (kpiIdListBuilder_ == null) { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdList_.isEmpty()) { + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdListIsMutable(); + kpiIdList_.addAll(other.kpiIdList_); + } + onChanged(); + } + } else { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdListBuilder_.isEmpty()) { + kpiIdListBuilder_.dispose(); + kpiIdListBuilder_ = null; + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdListFieldBuilder() : null; + } else { + kpiIdListBuilder_.addAllMessages(other.kpiIdList_); + } + } + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.EditedKpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.EditedKpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 2; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 2; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 2; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private java.util.List kpiIdList_ = + java.util.Collections.emptyList(); + private void ensureKpiIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(kpiIdList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdListBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List getKpiIdListList() { + if (kpiIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiIdList_); + } else { + return kpiIdListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public int getKpiIdListCount() { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.size(); + } else { + return kpiIdListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); + } else { + return kpiIdListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, value); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList(monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addAllKpiIdList( + java.lang.Iterable values) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiIdList_); + onChanged(); + } else { + kpiIdListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder clearKpiIdList() { + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder removeKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.remove(index); + onChanged(); + } else { + kpiIdListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); } else { + return kpiIdListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List + getKpiIdListOrBuilderList() { + if (kpiIdListBuilder_ != null) { + return kpiIdListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiIdList_); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder() { + return getKpiIdListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List + getKpiIdListBuilderList() { + return getKpiIdListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdListFieldBuilder() { + if (kpiIdListBuilder_ == null) { + kpiIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiIdList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiIdList_ = null; + } + return kpiIdListBuilder_; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 5; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 7; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 8; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.EditedKpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.EditedKpiDescriptor) + private static final monitoring.Monitoring.EditedKpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.EditedKpiDescriptor(); + } + + public static monitoring.Monitoring.EditedKpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EditedKpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EditedKpiDescriptor(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 monitoring.Monitoring.EditedKpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MonitorKpiRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.MonitorKpiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + float getMonitoringWindowS(); + + /** + *
+     * Pending add field to reflect Available Device Protocols
+     * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + float getSamplingRateS(); + } + /** + * Protobuf type {@code monitoring.MonitorKpiRequest} + */ + public static final class MonitorKpiRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.MonitorKpiRequest) + MonitorKpiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitorKpiRequest.newBuilder() to construct. + private MonitorKpiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MonitorKpiRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MonitorKpiRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MonitorKpiRequest( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + monitoringWindowS_ = input.readFloat(); + break; + } + case 29: { + + samplingRateS_ = input.readFloat(); + 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 monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int MONITORING_WINDOW_S_FIELD_NUMBER = 2; + private float monitoringWindowS_; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + + public static final int SAMPLING_RATE_S_FIELD_NUMBER = 3; + private float samplingRateS_; + /** + *
+     * Pending add field to reflect Available Device Protocols
+     * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (monitoringWindowS_ != 0F) { + output.writeFloat(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + output.writeFloat(3, samplingRateS_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (monitoringWindowS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingRateS_); + } + 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 monitoring.Monitoring.MonitorKpiRequest)) { + return super.equals(obj); + } + monitoring.Monitoring.MonitorKpiRequest other = (monitoring.Monitoring.MonitorKpiRequest) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (java.lang.Float.floatToIntBits(getMonitoringWindowS()) + != java.lang.Float.floatToIntBits( + other.getMonitoringWindowS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingRateS()) + != java.lang.Float.floatToIntBits( + other.getSamplingRateS())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + MONITORING_WINDOW_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMonitoringWindowS()); + hash = (37 * hash) + SAMPLING_RATE_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingRateS()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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 monitoring.Monitoring.MonitorKpiRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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 monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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(monitoring.Monitoring.MonitorKpiRequest 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 monitoring.MonitorKpiRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.MonitorKpiRequest) + monitoring.Monitoring.MonitorKpiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + // Construct using monitoring.Monitoring.MonitorKpiRequest.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + monitoringWindowS_ = 0F; + + samplingRateS_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest build() { + monitoring.Monitoring.MonitorKpiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest buildPartial() { + monitoring.Monitoring.MonitorKpiRequest result = new monitoring.Monitoring.MonitorKpiRequest(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.monitoringWindowS_ = monitoringWindowS_; + result.samplingRateS_ = samplingRateS_; + 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 monitoring.Monitoring.MonitorKpiRequest) { + return mergeFrom((monitoring.Monitoring.MonitorKpiRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.MonitorKpiRequest other) { + if (other == monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.getMonitoringWindowS() != 0F) { + setMonitoringWindowS(other.getMonitoringWindowS()); + } + if (other.getSamplingRateS() != 0F) { + setSamplingRateS(other.getSamplingRateS()); + } + 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 { + monitoring.Monitoring.MonitorKpiRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.MonitorKpiRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float monitoringWindowS_ ; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + /** + * float monitoring_window_s = 2; + * @param value The monitoringWindowS to set. + * @return This builder for chaining. + */ + public Builder setMonitoringWindowS(float value) { + + monitoringWindowS_ = value; + onChanged(); + return this; + } + /** + * float monitoring_window_s = 2; + * @return This builder for chaining. + */ + public Builder clearMonitoringWindowS() { + + monitoringWindowS_ = 0F; + onChanged(); + return this; + } + + private float samplingRateS_ ; + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @param value The samplingRateS to set. + * @return This builder for chaining. + */ + public Builder setSamplingRateS(float value) { + + samplingRateS_ = value; + onChanged(); + return this; + } + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingRateS() { + + samplingRateS_ = 0F; + 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:monitoring.MonitorKpiRequest) + } + + // @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) + private static final monitoring.Monitoring.MonitorKpiRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.MonitorKpiRequest(); + } + + public static monitoring.Monitoring.MonitorKpiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MonitorKpiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitorKpiRequest(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 monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiQueryOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + java.util.List + getKpiIdList(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiId getKpiId(int index); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + int getKpiIdCount(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + java.util.List + getKpiIdOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index); + + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + float getMonitoringWindowS(); + + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + float getSamplingRateS(); + + /** + *
+     * used when you want something like "get the last N many samples
+     * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + int getLastNSamples(); + + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The startDate. + */ + java.lang.String getStartDate(); + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString + getStartDateBytes(); + + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The endDate. + */ + java.lang.String getEndDate(); + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString + getEndDateBytes(); + } + /** + * Protobuf type {@code monitoring.KpiQuery} + */ + public static final class KpiQuery extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiQuery) + KpiQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiQuery.newBuilder() to construct. + private KpiQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiQuery() { + kpiId_ = java.util.Collections.emptyList(); + startDate_ = ""; + endDate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiQuery( + 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)) { + kpiId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiId_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 21: { + + monitoringWindowS_ = input.readFloat(); + break; + } + case 29: { + + samplingRateS_ = input.readFloat(); + break; + } + case 32: { + + lastNSamples_ = input.readUInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + startDate_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + endDate_ = 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)) { + kpiId_ = java.util.Collections.unmodifiableList(kpiId_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiQuery.class, monitoring.Monitoring.KpiQuery.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private java.util.List kpiId_; + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public java.util.List getKpiIdList() { + return kpiId_; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public java.util.List + getKpiIdOrBuilderList() { + return kpiId_; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public int getKpiIdCount() { + return kpiId_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId(int index) { + return kpiId_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index) { + return kpiId_.get(index); + } + + public static final int MONITORING_WINDOW_S_FIELD_NUMBER = 2; + private float monitoringWindowS_; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + + public static final int SAMPLING_RATE_S_FIELD_NUMBER = 3; + private float samplingRateS_; + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + + public static final int LAST_N_SAMPLES_FIELD_NUMBER = 4; + private int lastNSamples_; + /** + *
+     * used when you want something like "get the last N many samples
+     * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + @java.lang.Override + public int getLastNSamples() { + return lastNSamples_; + } + + public static final int START_DATE_FIELD_NUMBER = 5; + private volatile java.lang.Object startDate_; + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + 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(); + startDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 6; + private volatile java.lang.Object endDate_; + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + 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(); + endDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = 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 { + for (int i = 0; i < kpiId_.size(); i++) { + output.writeMessage(1, kpiId_.get(i)); + } + if (monitoringWindowS_ != 0F) { + output.writeFloat(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + output.writeFloat(3, samplingRateS_); + } + if (lastNSamples_ != 0) { + output.writeUInt32(4, lastNSamples_); + } + if (!getStartDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, endDate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < kpiId_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiId_.get(i)); + } + if (monitoringWindowS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingRateS_); + } + if (lastNSamples_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, lastNSamples_); + } + if (!getStartDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, endDate_); + } + 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 monitoring.Monitoring.KpiQuery)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiQuery other = (monitoring.Monitoring.KpiQuery) obj; + + if (!getKpiIdList() + .equals(other.getKpiIdList())) return false; + if (java.lang.Float.floatToIntBits(getMonitoringWindowS()) + != java.lang.Float.floatToIntBits( + other.getMonitoringWindowS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingRateS()) + != java.lang.Float.floatToIntBits( + other.getSamplingRateS())) return false; + if (getLastNSamples() + != other.getLastNSamples()) return false; + if (!getStartDate() + .equals(other.getStartDate())) return false; + if (!getEndDate() + .equals(other.getEndDate())) 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 (getKpiIdCount() > 0) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdList().hashCode(); + } + hash = (37 * hash) + MONITORING_WINDOW_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMonitoringWindowS()); + hash = (37 * hash) + SAMPLING_RATE_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingRateS()); + hash = (37 * hash) + LAST_N_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getLastNSamples(); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiQuery parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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 monitoring.Monitoring.KpiQuery parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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 monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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(monitoring.Monitoring.KpiQuery 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 monitoring.KpiQuery} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiQuery) + monitoring.Monitoring.KpiQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiQuery.class, monitoring.Monitoring.KpiQuery.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdBuilder_.clear(); + } + monitoringWindowS_ = 0F; + + samplingRateS_ = 0F; + + lastNSamples_ = 0; + + startDate_ = ""; + + endDate_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery getDefaultInstanceForType() { + return monitoring.Monitoring.KpiQuery.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery build() { + monitoring.Monitoring.KpiQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery buildPartial() { + monitoring.Monitoring.KpiQuery result = new monitoring.Monitoring.KpiQuery(this); + int from_bitField0_ = bitField0_; + if (kpiIdBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiId_ = java.util.Collections.unmodifiableList(kpiId_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.monitoringWindowS_ = monitoringWindowS_; + result.samplingRateS_ = samplingRateS_; + result.lastNSamples_ = lastNSamples_; + result.startDate_ = startDate_; + result.endDate_ = endDate_; + 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 monitoring.Monitoring.KpiQuery) { + return mergeFrom((monitoring.Monitoring.KpiQuery)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiQuery other) { + if (other == monitoring.Monitoring.KpiQuery.getDefaultInstance()) return this; + if (kpiIdBuilder_ == null) { + if (!other.kpiId_.isEmpty()) { + if (kpiId_.isEmpty()) { + kpiId_ = other.kpiId_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdIsMutable(); + kpiId_.addAll(other.kpiId_); + } + onChanged(); + } + } else { + if (!other.kpiId_.isEmpty()) { + if (kpiIdBuilder_.isEmpty()) { + kpiIdBuilder_.dispose(); + kpiIdBuilder_ = null; + kpiId_ = other.kpiId_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdFieldBuilder() : null; + } else { + kpiIdBuilder_.addAllMessages(other.kpiId_); + } + } + } + if (other.getMonitoringWindowS() != 0F) { + setMonitoringWindowS(other.getMonitoringWindowS()); + } + if (other.getSamplingRateS() != 0F) { + setSamplingRateS(other.getSamplingRateS()); + } + if (other.getLastNSamples() != 0) { + setLastNSamples(other.getLastNSamples()); + } + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + 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 { + monitoring.Monitoring.KpiQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiId_ = + java.util.Collections.emptyList(); + private void ensureKpiIdIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiId_ = new java.util.ArrayList(kpiId_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List getKpiIdList() { + if (kpiIdBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiId_); + } else { + return kpiIdBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public int getKpiIdCount() { + if (kpiIdBuilder_ == null) { + return kpiId_.size(); + } else { + return kpiIdBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId getKpiId(int index) { + if (kpiIdBuilder_ == null) { + return kpiId_.get(index); + } else { + return kpiIdBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.set(index, value); + onChanged(); + } else { + kpiIdBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.add(value); + onChanged(); + } else { + kpiIdBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.add(index, value); + onChanged(); + } else { + kpiIdBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addAllKpiId( + java.lang.Iterable values) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiId_); + onChanged(); + } else { + kpiIdBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder removeKpiId(int index) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.remove(index); + onChanged(); + } else { + kpiIdBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder( + int index) { + return getKpiIdFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index) { + if (kpiIdBuilder_ == null) { + return kpiId_.get(index); } else { + return kpiIdBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List + getKpiIdOrBuilderList() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiId_); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdBuilder() { + return getKpiIdFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdBuilder( + int index) { + return getKpiIdFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List + getKpiIdBuilderList() { + return getKpiIdFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiId_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float monitoringWindowS_ ; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + /** + * float monitoring_window_s = 2; + * @param value The monitoringWindowS to set. + * @return This builder for chaining. + */ + public Builder setMonitoringWindowS(float value) { + + monitoringWindowS_ = value; + onChanged(); + return this; + } + /** + * float monitoring_window_s = 2; + * @return This builder for chaining. + */ + public Builder clearMonitoringWindowS() { + + monitoringWindowS_ = 0F; + onChanged(); + return this; + } + + private float samplingRateS_ ; + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + /** + * float sampling_rate_s = 3; + * @param value The samplingRateS to set. + * @return This builder for chaining. + */ + public Builder setSamplingRateS(float value) { + + samplingRateS_ = value; + onChanged(); + return this; + } + /** + * float sampling_rate_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingRateS() { + + samplingRateS_ = 0F; + onChanged(); + return this; + } + + private int lastNSamples_ ; + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + @java.lang.Override + public int getLastNSamples() { + return lastNSamples_; + } + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @param value The lastNSamples to set. + * @return This builder for chaining. + */ + public Builder setLastNSamples(int value) { + + lastNSamples_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @return This builder for chaining. + */ + public Builder clearLastNSamples() { + + lastNSamples_ = 0; + onChanged(); + return this; + } + + private java.lang.Object startDate_ = ""; + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return This builder for chaining. + */ + public Builder clearStartDate() { + + startDate_ = getDefaultInstance().getStartDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startDate_ = value; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return This builder for chaining. + */ + public Builder clearEndDate() { + + endDate_ = getDefaultInstance().getEndDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endDate_ = 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:monitoring.KpiQuery) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiQuery) + private static final monitoring.Monitoring.KpiQuery DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiQuery(); + } + + public static monitoring.Monitoring.KpiQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiQuery(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 monitoring.Monitoring.KpiQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + context.ContextOuterClass.Uuid getKpiId(); + /** + * .context.Uuid kpi_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiId} + */ + public static final class KpiId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiId) + KpiIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiId.newBuilder() to construct. + private KpiId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid kpiId_; + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getKpiId() { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + /** + * .context.Uuid kpi_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + 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 monitoring.Monitoring.KpiId)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiId other = (monitoring.Monitoring.KpiId) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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 monitoring.Monitoring.KpiId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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 monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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(monitoring.Monitoring.KpiId 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 monitoring.KpiId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiId) + monitoring.Monitoring.KpiIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiId.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return monitoring.Monitoring.KpiId.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiId build() { + monitoring.Monitoring.KpiId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId buildPartial() { + monitoring.Monitoring.KpiId result = new monitoring.Monitoring.KpiId(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.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 monitoring.Monitoring.KpiId) { + return mergeFrom((monitoring.Monitoring.KpiId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiId other) { + if (other == monitoring.Monitoring.KpiId.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + 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 { + monitoring.Monitoring.KpiId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> kpiIdBuilder_; + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + public context.ContextOuterClass.Uuid getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder setKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder setKpiId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder mergeKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + context.ContextOuterClass.Uuid.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid kpi_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + } + /** + * .context.Uuid kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + @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:monitoring.KpiId) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiId) + private static final monitoring.Monitoring.KpiId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiId(); + } + + public static monitoring.Monitoring.KpiId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiId(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 monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.Kpi) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * string timestamp = 2; + * @return The timestamp. + */ + java.lang.String getTimestamp(); + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + com.google.protobuf.ByteString + getTimestampBytes(); + + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.Kpi} + */ + public static final class Kpi extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.Kpi) + KpiOrBuilder { + private static final long serialVersionUID = 0L; + // Use Kpi.newBuilder() to construct. + private Kpi(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Kpi() { + timestamp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Kpi(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Kpi( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + timestamp_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = 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 monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private volatile java.lang.Object timestamp_; + /** + * string timestamp = 2; + * @return The timestamp. + */ + @java.lang.Override + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + 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(); + timestamp_ = s; + return s; + } + } + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_VALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, timestamp_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, timestamp_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + 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 monitoring.Monitoring.Kpi)) { + return super.equals(obj); + } + monitoring.Monitoring.Kpi other = (monitoring.Monitoring.Kpi) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + if (hasKpiValue()) { + hash = (37 * hash) + KPI_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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 monitoring.Monitoring.Kpi parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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 monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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(monitoring.Monitoring.Kpi 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 monitoring.Kpi} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.Kpi) + monitoring.Monitoring.KpiOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + // Construct using monitoring.Monitoring.Kpi.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + timestamp_ = ""; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return monitoring.Monitoring.Kpi.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.Kpi build() { + monitoring.Monitoring.Kpi result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi buildPartial() { + monitoring.Monitoring.Kpi result = new monitoring.Monitoring.Kpi(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.timestamp_ = timestamp_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.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 monitoring.Monitoring.Kpi) { + return mergeFrom((monitoring.Monitoring.Kpi)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.Kpi other) { + if (other == monitoring.Monitoring.Kpi.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (!other.getTimestamp().isEmpty()) { + timestamp_ = other.timestamp_; + onChanged(); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + 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 { + monitoring.Monitoring.Kpi parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.Kpi) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private java.lang.Object timestamp_ = ""; + /** + * string timestamp = 2; + * @return The timestamp. + */ + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string timestamp = 2; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timestamp_ = value; + onChanged(); + return this; + } + /** + * string timestamp = 2; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = getDefaultInstance().getTimestamp(); + onChanged(); + return this; + } + /** + * string timestamp = 2; + * @param value The bytes for timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestampBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timestamp_ = value; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @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:monitoring.Kpi) + } + + // @@protoc_insertion_point(class_scope:monitoring.Kpi) + private static final monitoring.Monitoring.Kpi DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.Kpi(); + } + + public static monitoring.Monitoring.Kpi getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Kpi parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Kpi(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 monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiValueRangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiValueRange) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + boolean hasKpiMinValue(); + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + monitoring.Monitoring.KpiValue getKpiMinValue(); + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder(); + + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + boolean hasKpiMaxValue(); + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + monitoring.Monitoring.KpiValue getKpiMaxValue(); + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiValueRange} + */ + public static final class KpiValueRange extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiValueRange) + KpiValueRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiValueRange.newBuilder() to construct. + private KpiValueRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiValueRange() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiValueRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiValueRange( + 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: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiMinValue_ != null) { + subBuilder = kpiMinValue_.toBuilder(); + } + kpiMinValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiMinValue_); + kpiMinValue_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiMaxValue_ != null) { + subBuilder = kpiMaxValue_.toBuilder(); + } + kpiMaxValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiMaxValue_); + kpiMaxValue_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValueRange.class, monitoring.Monitoring.KpiValueRange.Builder.class); + } + + public static final int KPIMINVALUE_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiValue kpiMinValue_; + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + @java.lang.Override + public boolean hasKpiMinValue() { + return kpiMinValue_ != null; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiMinValue() { + return kpiMinValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder() { + return getKpiMinValue(); + } + + public static final int KPIMAXVALUE_FIELD_NUMBER = 2; + private monitoring.Monitoring.KpiValue kpiMaxValue_; + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + @java.lang.Override + public boolean hasKpiMaxValue() { + return kpiMaxValue_ != null; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiMaxValue() { + return kpiMaxValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder() { + return getKpiMaxValue(); + } + + 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 (kpiMinValue_ != null) { + output.writeMessage(1, getKpiMinValue()); + } + if (kpiMaxValue_ != null) { + output.writeMessage(2, getKpiMaxValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiMinValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiMinValue()); + } + if (kpiMaxValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getKpiMaxValue()); + } + 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 monitoring.Monitoring.KpiValueRange)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiValueRange other = (monitoring.Monitoring.KpiValueRange) obj; + + if (hasKpiMinValue() != other.hasKpiMinValue()) return false; + if (hasKpiMinValue()) { + if (!getKpiMinValue() + .equals(other.getKpiMinValue())) return false; + } + if (hasKpiMaxValue() != other.hasKpiMaxValue()) return false; + if (hasKpiMaxValue()) { + if (!getKpiMaxValue() + .equals(other.getKpiMaxValue())) 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 (hasKpiMinValue()) { + hash = (37 * hash) + KPIMINVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiMinValue().hashCode(); + } + if (hasKpiMaxValue()) { + hash = (37 * hash) + KPIMAXVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiMaxValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiValueRange parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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 monitoring.Monitoring.KpiValueRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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 monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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(monitoring.Monitoring.KpiValueRange 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 monitoring.KpiValueRange} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiValueRange) + monitoring.Monitoring.KpiValueRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValueRange.class, monitoring.Monitoring.KpiValueRange.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiValueRange.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 (kpiMinValueBuilder_ == null) { + kpiMinValue_ = null; + } else { + kpiMinValue_ = null; + kpiMinValueBuilder_ = null; + } + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = null; + } else { + kpiMaxValue_ = null; + kpiMaxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange getDefaultInstanceForType() { + return monitoring.Monitoring.KpiValueRange.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange build() { + monitoring.Monitoring.KpiValueRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange buildPartial() { + monitoring.Monitoring.KpiValueRange result = new monitoring.Monitoring.KpiValueRange(this); + if (kpiMinValueBuilder_ == null) { + result.kpiMinValue_ = kpiMinValue_; + } else { + result.kpiMinValue_ = kpiMinValueBuilder_.build(); + } + if (kpiMaxValueBuilder_ == null) { + result.kpiMaxValue_ = kpiMaxValue_; + } else { + result.kpiMaxValue_ = kpiMaxValueBuilder_.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 monitoring.Monitoring.KpiValueRange) { + return mergeFrom((monitoring.Monitoring.KpiValueRange)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiValueRange other) { + if (other == monitoring.Monitoring.KpiValueRange.getDefaultInstance()) return this; + if (other.hasKpiMinValue()) { + mergeKpiMinValue(other.getKpiMinValue()); + } + if (other.hasKpiMaxValue()) { + mergeKpiMaxValue(other.getKpiMaxValue()); + } + 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 { + monitoring.Monitoring.KpiValueRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiValueRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiValue kpiMinValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiMinValueBuilder_; + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + public boolean hasKpiMinValue() { + return kpiMinValueBuilder_ != null || kpiMinValue_ != null; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + public monitoring.Monitoring.KpiValue getKpiMinValue() { + if (kpiMinValueBuilder_ == null) { + return kpiMinValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } else { + return kpiMinValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder setKpiMinValue(monitoring.Monitoring.KpiValue value) { + if (kpiMinValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiMinValue_ = value; + onChanged(); + } else { + kpiMinValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder setKpiMinValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiMinValueBuilder_ == null) { + kpiMinValue_ = builderForValue.build(); + onChanged(); + } else { + kpiMinValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder mergeKpiMinValue(monitoring.Monitoring.KpiValue value) { + if (kpiMinValueBuilder_ == null) { + if (kpiMinValue_ != null) { + kpiMinValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiMinValue_).mergeFrom(value).buildPartial(); + } else { + kpiMinValue_ = value; + } + onChanged(); + } else { + kpiMinValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder clearKpiMinValue() { + if (kpiMinValueBuilder_ == null) { + kpiMinValue_ = null; + onChanged(); + } else { + kpiMinValue_ = null; + kpiMinValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiMinValueBuilder() { + + onChanged(); + return getKpiMinValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder() { + if (kpiMinValueBuilder_ != null) { + return kpiMinValueBuilder_.getMessageOrBuilder(); + } else { + return kpiMinValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiMinValueFieldBuilder() { + if (kpiMinValueBuilder_ == null) { + kpiMinValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiMinValue(), + getParentForChildren(), + isClean()); + kpiMinValue_ = null; + } + return kpiMinValueBuilder_; + } + + private monitoring.Monitoring.KpiValue kpiMaxValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiMaxValueBuilder_; + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + public boolean hasKpiMaxValue() { + return kpiMaxValueBuilder_ != null || kpiMaxValue_ != null; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + public monitoring.Monitoring.KpiValue getKpiMaxValue() { + if (kpiMaxValueBuilder_ == null) { + return kpiMaxValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } else { + return kpiMaxValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder setKpiMaxValue(monitoring.Monitoring.KpiValue value) { + if (kpiMaxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiMaxValue_ = value; + onChanged(); + } else { + kpiMaxValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder setKpiMaxValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = builderForValue.build(); + onChanged(); + } else { + kpiMaxValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder mergeKpiMaxValue(monitoring.Monitoring.KpiValue value) { + if (kpiMaxValueBuilder_ == null) { + if (kpiMaxValue_ != null) { + kpiMaxValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiMaxValue_).mergeFrom(value).buildPartial(); + } else { + kpiMaxValue_ = value; + } + onChanged(); + } else { + kpiMaxValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder clearKpiMaxValue() { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = null; + onChanged(); + } else { + kpiMaxValue_ = null; + kpiMaxValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiMaxValueBuilder() { + + onChanged(); + return getKpiMaxValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder() { + if (kpiMaxValueBuilder_ != null) { + return kpiMaxValueBuilder_.getMessageOrBuilder(); + } else { + return kpiMaxValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiMaxValueFieldBuilder() { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiMaxValue(), + getParentForChildren(), + isClean()); + kpiMaxValue_ = null; + } + return kpiMaxValueBuilder_; + } + @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:monitoring.KpiValueRange) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiValueRange) + private static final monitoring.Monitoring.KpiValueRange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiValueRange(); + } + + public static monitoring.Monitoring.KpiValueRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiValueRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiValueRange(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 monitoring.Monitoring.KpiValueRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiValue) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + boolean hasIntVal(); + /** + * uint32 intVal = 1; + * @return The intVal. + */ + int getIntVal(); + + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + boolean hasFloatVal(); + /** + * float floatVal = 2; + * @return The floatVal. + */ + float getFloatVal(); + + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + boolean hasStringVal(); + /** + * string stringVal = 3; + * @return The stringVal. + */ + java.lang.String getStringVal(); + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + com.google.protobuf.ByteString + getStringValBytes(); + + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + boolean hasBoolVal(); + /** + * bool boolVal = 4; + * @return The boolVal. + */ + boolean getBoolVal(); + + public monitoring.Monitoring.KpiValue.ValueCase getValueCase(); + } + /** + * Protobuf type {@code monitoring.KpiValue} + */ + public static final class KpiValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiValue) + KpiValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiValue.newBuilder() to construct. + private KpiValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiValue() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiValue( + 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: { + valueCase_ = 1; + value_ = input.readUInt32(); + break; + } + case 21: { + valueCase_ = 2; + value_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 3; + value_ = s; + break; + } + case 32: { + valueCase_ = 4; + value_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INTVAL(1), + FLOATVAL(2), + STRINGVAL(3), + BOOLVAL(4), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: return INTVAL; + case 2: return FLOATVAL; + case 3: return STRINGVAL; + case 4: return BOOLVAL; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int INTVAL_FIELD_NUMBER = 1; + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + @java.lang.Override + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * uint32 intVal = 1; + * @return The intVal. + */ + @java.lang.Override + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + + public static final int FLOATVAL_FIELD_NUMBER = 2; + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + @java.lang.Override + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * float floatVal = 2; + * @return The floatVal. + */ + @java.lang.Override + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + + public static final int STRINGVAL_FIELD_NUMBER = 3; + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * string stringVal = 3; + * @return The stringVal. + */ + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + 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(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } + } + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOLVAL_FIELD_NUMBER = 4; + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + @java.lang.Override + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * bool boolVal = 4; + * @return The boolVal. + */ + @java.lang.Override + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + + 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 (valueCase_ == 1) { + output.writeUInt32( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + output.writeFloat( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + if (valueCase_ == 4) { + output.writeBool( + 4, (boolean)((java.lang.Boolean) value_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 4, (boolean)((java.lang.Boolean) 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 monitoring.Monitoring.KpiValue)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiValue other = (monitoring.Monitoring.KpiValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (getIntVal() + != other.getIntVal()) return false; + break; + case 2: + if (java.lang.Float.floatToIntBits(getFloatVal()) + != java.lang.Float.floatToIntBits( + other.getFloatVal())) return false; + break; + case 3: + if (!getStringVal() + .equals(other.getStringVal())) return false; + break; + case 4: + if (getBoolVal() + != other.getBoolVal()) return false; + break; + case 0: + default: + } + 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(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + INTVAL_FIELD_NUMBER; + hash = (53 * hash) + getIntVal(); + break; + case 2: + hash = (37 * hash) + FLOATVAL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFloatVal()); + break; + case 3: + hash = (37 * hash) + STRINGVAL_FIELD_NUMBER; + hash = (53 * hash) + getStringVal().hashCode(); + break; + case 4: + hash = (37 * hash) + BOOLVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolVal()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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 monitoring.Monitoring.KpiValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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 monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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(monitoring.Monitoring.KpiValue 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 monitoring.KpiValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiValue) + monitoring.Monitoring.KpiValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiValue.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(); + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return monitoring.Monitoring.KpiValue.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue build() { + monitoring.Monitoring.KpiValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue buildPartial() { + monitoring.Monitoring.KpiValue result = new monitoring.Monitoring.KpiValue(this); + if (valueCase_ == 1) { + result.value_ = value_; + } + if (valueCase_ == 2) { + result.value_ = value_; + } + if (valueCase_ == 3) { + result.value_ = value_; + } + if (valueCase_ == 4) { + result.value_ = value_; + } + result.valueCase_ = valueCase_; + 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 monitoring.Monitoring.KpiValue) { + return mergeFrom((monitoring.Monitoring.KpiValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiValue other) { + if (other == monitoring.Monitoring.KpiValue.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case INTVAL: { + setIntVal(other.getIntVal()); + break; + } + case FLOATVAL: { + setFloatVal(other.getFloatVal()); + break; + } + case STRINGVAL: { + valueCase_ = 3; + value_ = other.value_; + onChanged(); + break; + } + case BOOLVAL: { + setBoolVal(other.getBoolVal()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + 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 { + monitoring.Monitoring.KpiValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * uint32 intVal = 1; + * @return The intVal. + */ + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + /** + * uint32 intVal = 1; + * @param value The intVal to set. + * @return This builder for chaining. + */ + public Builder setIntVal(int value) { + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + /** + * uint32 intVal = 1; + * @return This builder for chaining. + */ + public Builder clearIntVal() { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * float floatVal = 2; + * @return The floatVal. + */ + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + /** + * float floatVal = 2; + * @param value The floatVal to set. + * @return This builder for chaining. + */ + public Builder setFloatVal(float value) { + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * float floatVal = 2; + * @return This builder for chaining. + */ + public Builder clearFloatVal() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + @java.lang.Override + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * string stringVal = 3; + * @return The stringVal. + */ + @java.lang.Override + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stringVal = 3; + * @param value The stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringVal( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * string stringVal = 3; + * @return This builder for chaining. + */ + public Builder clearStringVal() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string stringVal = 3; + * @param value The bytes for stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * bool boolVal = 4; + * @return The boolVal. + */ + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + * bool boolVal = 4; + * @param value The boolVal to set. + * @return This builder for chaining. + */ + public Builder setBoolVal(boolean value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * bool boolVal = 4; + * @return This builder for chaining. + */ + public Builder clearBoolVal() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + 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:monitoring.KpiValue) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiValue) + private static final monitoring.Monitoring.KpiValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiValue(); + } + + public static monitoring.Monitoring.KpiValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiValue(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 monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + java.util.List + getKpiListList(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + monitoring.Monitoring.Kpi getKpiList(int index); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + int getKpiListCount(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + java.util.List + getKpiListOrBuilderList(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.KpiList} + */ + public static final class KpiList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiList) + KpiListOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiList.newBuilder() to construct. + private KpiList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiList() { + kpiList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiList( + 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)) { + kpiList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiList_.add( + input.readMessage(monitoring.Monitoring.Kpi.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)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + public static final int KPI_LIST_FIELD_NUMBER = 1; + private java.util.List kpiList_; + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public java.util.List getKpiListList() { + return kpiList_; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public java.util.List + getKpiListOrBuilderList() { + return kpiList_; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public int getKpiListCount() { + return kpiList_.size(); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.Kpi getKpiList(int index) { + return kpiList_.get(index); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + return kpiList_.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 < kpiList_.size(); i++) { + output.writeMessage(1, kpiList_.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 < kpiList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiList_.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 monitoring.Monitoring.KpiList)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiList other = (monitoring.Monitoring.KpiList) obj; + + if (!getKpiListList() + .equals(other.getKpiListList())) 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 (getKpiListCount() > 0) { + hash = (37 * hash) + KPI_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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 monitoring.Monitoring.KpiList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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 monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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(monitoring.Monitoring.KpiList 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 monitoring.KpiList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiList) + monitoring.Monitoring.KpiListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return monitoring.Monitoring.KpiList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiList build() { + monitoring.Monitoring.KpiList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList buildPartial() { + monitoring.Monitoring.KpiList result = new monitoring.Monitoring.KpiList(this); + int from_bitField0_ = bitField0_; + if (kpiListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiList_ = kpiList_; + } else { + result.kpiList_ = kpiListBuilder_.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 monitoring.Monitoring.KpiList) { + return mergeFrom((monitoring.Monitoring.KpiList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiList other) { + if (other == monitoring.Monitoring.KpiList.getDefaultInstance()) return this; + if (kpiListBuilder_ == null) { + if (!other.kpiList_.isEmpty()) { + if (kpiList_.isEmpty()) { + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiListIsMutable(); + kpiList_.addAll(other.kpiList_); + } + onChanged(); + } + } else { + if (!other.kpiList_.isEmpty()) { + if (kpiListBuilder_.isEmpty()) { + kpiListBuilder_.dispose(); + kpiListBuilder_ = null; + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiListFieldBuilder() : null; + } else { + kpiListBuilder_.addAllMessages(other.kpiList_); + } + } + } + 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 { + monitoring.Monitoring.KpiList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiList_ = + java.util.Collections.emptyList(); + private void ensureKpiListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(kpiList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> kpiListBuilder_; + + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List getKpiListList() { + if (kpiListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiList_); + } else { + return kpiListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public int getKpiListCount() { + if (kpiListBuilder_ == null) { + return kpiList_.size(); + } else { + return kpiListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi getKpiList(int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); + } else { + return kpiListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.set(index, value); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList(monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(value); + onChanged(); + } else { + kpiListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(index, value); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addAllKpiList( + java.lang.Iterable values) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiList_); + onChanged(); + } else { + kpiListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder clearKpiList() { + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder removeKpiList(int index) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.remove(index); + onChanged(); + } else { + kpiListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder getKpiListBuilder( + int index) { + return getKpiListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); } else { + return kpiListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List + getKpiListOrBuilderList() { + if (kpiListBuilder_ != null) { + return kpiListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiList_); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder() { + return getKpiListFieldBuilder().addBuilder( + monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder( + int index) { + return getKpiListFieldBuilder().addBuilder( + index, monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List + getKpiListBuilderList() { + return getKpiListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> + getKpiListFieldBuilder() { + if (kpiListBuilder_ == null) { + kpiListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder>( + kpiList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiList_ = null; + } + return kpiListBuilder_; + } + @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:monitoring.KpiList) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiList) + private static final monitoring.Monitoring.KpiList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiList(); + } + + public static monitoring.Monitoring.KpiList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiList(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 monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiDescriptorListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiDescriptorList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + java.util.List + getKpiDescriptorListList(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + int getKpiDescriptorListCount(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + java.util.List + getKpiDescriptorListOrBuilderList(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.KpiDescriptorList} + */ + public static final class KpiDescriptorList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiDescriptorList) + KpiDescriptorListOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiDescriptorList.newBuilder() to construct. + private KpiDescriptorList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiDescriptorList() { + kpiDescriptorList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiDescriptorList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiDescriptorList( + 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)) { + kpiDescriptorList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiDescriptorList_.add( + input.readMessage(monitoring.Monitoring.KpiDescriptor.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)) { + kpiDescriptorList_ = java.util.Collections.unmodifiableList(kpiDescriptorList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptorList.class, monitoring.Monitoring.KpiDescriptorList.Builder.class); + } + + public static final int KPI_DESCRIPTOR_LIST_FIELD_NUMBER = 1; + private java.util.List kpiDescriptorList_; + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public java.util.List getKpiDescriptorListList() { + return kpiDescriptorList_; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public java.util.List + getKpiDescriptorListOrBuilderList() { + return kpiDescriptorList_; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public int getKpiDescriptorListCount() { + return kpiDescriptorList_.size(); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index) { + return kpiDescriptorList_.get(index); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index) { + return kpiDescriptorList_.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 < kpiDescriptorList_.size(); i++) { + output.writeMessage(1, kpiDescriptorList_.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 < kpiDescriptorList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiDescriptorList_.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 monitoring.Monitoring.KpiDescriptorList)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiDescriptorList other = (monitoring.Monitoring.KpiDescriptorList) obj; + + if (!getKpiDescriptorListList() + .equals(other.getKpiDescriptorListList())) 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 (getKpiDescriptorListCount() > 0) { + hash = (37 * hash) + KPI_DESCRIPTOR_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescriptorListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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 monitoring.Monitoring.KpiDescriptorList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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 monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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(monitoring.Monitoring.KpiDescriptorList 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 monitoring.KpiDescriptorList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiDescriptorList) + monitoring.Monitoring.KpiDescriptorListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptorList.class, monitoring.Monitoring.KpiDescriptorList.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiDescriptorList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiDescriptorListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiDescriptorListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList getDefaultInstanceForType() { + return monitoring.Monitoring.KpiDescriptorList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList build() { + monitoring.Monitoring.KpiDescriptorList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList buildPartial() { + monitoring.Monitoring.KpiDescriptorList result = new monitoring.Monitoring.KpiDescriptorList(this); + int from_bitField0_ = bitField0_; + if (kpiDescriptorListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiDescriptorList_ = java.util.Collections.unmodifiableList(kpiDescriptorList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiDescriptorList_ = kpiDescriptorList_; + } else { + result.kpiDescriptorList_ = kpiDescriptorListBuilder_.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 monitoring.Monitoring.KpiDescriptorList) { + return mergeFrom((monitoring.Monitoring.KpiDescriptorList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiDescriptorList other) { + if (other == monitoring.Monitoring.KpiDescriptorList.getDefaultInstance()) return this; + if (kpiDescriptorListBuilder_ == null) { + if (!other.kpiDescriptorList_.isEmpty()) { + if (kpiDescriptorList_.isEmpty()) { + kpiDescriptorList_ = other.kpiDescriptorList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.addAll(other.kpiDescriptorList_); + } + onChanged(); + } + } else { + if (!other.kpiDescriptorList_.isEmpty()) { + if (kpiDescriptorListBuilder_.isEmpty()) { + kpiDescriptorListBuilder_.dispose(); + kpiDescriptorListBuilder_ = null; + kpiDescriptorList_ = other.kpiDescriptorList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiDescriptorListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiDescriptorListFieldBuilder() : null; + } else { + kpiDescriptorListBuilder_.addAllMessages(other.kpiDescriptorList_); + } + } + } + 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 { + monitoring.Monitoring.KpiDescriptorList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiDescriptorList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiDescriptorList_ = + java.util.Collections.emptyList(); + private void ensureKpiDescriptorListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiDescriptorList_ = new java.util.ArrayList(kpiDescriptorList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> kpiDescriptorListBuilder_; + + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List getKpiDescriptorListList() { + if (kpiDescriptorListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiDescriptorList_); + } else { + return kpiDescriptorListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public int getKpiDescriptorListCount() { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.size(); + } else { + return kpiDescriptorListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index) { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.get(index); + } else { + return kpiDescriptorListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder setKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.set(index, value); + onChanged(); + } else { + kpiDescriptorListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder setKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(value); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(index, value); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addAllKpiDescriptorList( + java.lang.Iterable values) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiDescriptorList_); + onChanged(); + } else { + kpiDescriptorListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder clearKpiDescriptorList() { + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiDescriptorListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder removeKpiDescriptorList(int index) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.remove(index); + onChanged(); + } else { + kpiDescriptorListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder getKpiDescriptorListBuilder( + int index) { + return getKpiDescriptorListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index) { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.get(index); } else { + return kpiDescriptorListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List + getKpiDescriptorListOrBuilderList() { + if (kpiDescriptorListBuilder_ != null) { + return kpiDescriptorListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiDescriptorList_); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder addKpiDescriptorListBuilder() { + return getKpiDescriptorListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder addKpiDescriptorListBuilder( + int index) { + return getKpiDescriptorListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiDescriptor.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List + getKpiDescriptorListBuilderList() { + return getKpiDescriptorListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> + getKpiDescriptorListFieldBuilder() { + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder>( + kpiDescriptorList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiDescriptorList_ = null; + } + return kpiDescriptorListBuilder_; + } + @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:monitoring.KpiDescriptorList) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiDescriptorList) + private static final monitoring.Monitoring.KpiDescriptorList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiDescriptorList(); + } + + public static monitoring.Monitoring.KpiDescriptorList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiDescriptorList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiDescriptorList(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 monitoring.Monitoring.KpiDescriptorList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + float getSamplingDurationS(); + + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + float getSamplingIntervalS(); + + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The startDate. + */ + java.lang.String getStartDate(); + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString + getStartDateBytes(); + + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The endDate. + */ + java.lang.String getEndDate(); + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString + getEndDateBytes(); + } + /** + * Protobuf type {@code monitoring.SubsDescriptor} + */ + public static final class SubsDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsDescriptor) + SubsDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsDescriptor.newBuilder() to construct. + private SubsDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsDescriptor() { + startDate_ = ""; + endDate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsDescriptor( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + samplingDurationS_ = input.readFloat(); + break; + } + case 29: { + + samplingIntervalS_ = input.readFloat(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + startDate_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + endDate_ = 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 monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsDescriptor.class, monitoring.Monitoring.SubsDescriptor.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int SAMPLING_DURATION_S_FIELD_NUMBER = 2; + private float samplingDurationS_; + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + + public static final int SAMPLING_INTERVAL_S_FIELD_NUMBER = 3; + private float samplingIntervalS_; + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + + public static final int START_DATE_FIELD_NUMBER = 4; + private volatile java.lang.Object startDate_; + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + 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(); + startDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 5; + private volatile java.lang.Object endDate_; + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + 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(); + endDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + output.writeFloat(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + output.writeFloat(3, samplingIntervalS_); + } + if (!getStartDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, endDate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingIntervalS_); + } + if (!getStartDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, endDate_); + } + 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 monitoring.Monitoring.SubsDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsDescriptor other = (monitoring.Monitoring.SubsDescriptor) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (java.lang.Float.floatToIntBits(getSamplingDurationS()) + != java.lang.Float.floatToIntBits( + other.getSamplingDurationS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingIntervalS()) + != java.lang.Float.floatToIntBits( + other.getSamplingIntervalS())) return false; + if (!getStartDate() + .equals(other.getStartDate())) return false; + if (!getEndDate() + .equals(other.getEndDate())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + SAMPLING_DURATION_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingDurationS()); + hash = (37 * hash) + SAMPLING_INTERVAL_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingIntervalS()); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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 monitoring.Monitoring.SubsDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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 monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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(monitoring.Monitoring.SubsDescriptor 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 monitoring.SubsDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsDescriptor) + monitoring.Monitoring.SubsDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsDescriptor.class, monitoring.Monitoring.SubsDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsDescriptor.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + samplingDurationS_ = 0F; + + samplingIntervalS_ = 0F; + + startDate_ = ""; + + endDate_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.SubsDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor build() { + monitoring.Monitoring.SubsDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor buildPartial() { + monitoring.Monitoring.SubsDescriptor result = new monitoring.Monitoring.SubsDescriptor(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.samplingDurationS_ = samplingDurationS_; + result.samplingIntervalS_ = samplingIntervalS_; + result.startDate_ = startDate_; + result.endDate_ = endDate_; + 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 monitoring.Monitoring.SubsDescriptor) { + return mergeFrom((monitoring.Monitoring.SubsDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsDescriptor other) { + if (other == monitoring.Monitoring.SubsDescriptor.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.getSamplingDurationS() != 0F) { + setSamplingDurationS(other.getSamplingDurationS()); + } + if (other.getSamplingIntervalS() != 0F) { + setSamplingIntervalS(other.getSamplingIntervalS()); + } + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + 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 { + monitoring.Monitoring.SubsDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float samplingDurationS_ ; + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + /** + * float sampling_duration_s = 2; + * @param value The samplingDurationS to set. + * @return This builder for chaining. + */ + public Builder setSamplingDurationS(float value) { + + samplingDurationS_ = value; + onChanged(); + return this; + } + /** + * float sampling_duration_s = 2; + * @return This builder for chaining. + */ + public Builder clearSamplingDurationS() { + + samplingDurationS_ = 0F; + onChanged(); + return this; + } + + private float samplingIntervalS_ ; + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + /** + * float sampling_interval_s = 3; + * @param value The samplingIntervalS to set. + * @return This builder for chaining. + */ + public Builder setSamplingIntervalS(float value) { + + samplingIntervalS_ = value; + onChanged(); + return this; + } + /** + * float sampling_interval_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingIntervalS() { + + samplingIntervalS_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object startDate_ = ""; + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return This builder for chaining. + */ + public Builder clearStartDate() { + + startDate_ = getDefaultInstance().getStartDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startDate_ = value; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return This builder for chaining. + */ + public Builder clearEndDate() { + + endDate_ = getDefaultInstance().getEndDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endDate_ = 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:monitoring.SubsDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsDescriptor) + private static final monitoring.Monitoring.SubsDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsDescriptor(); + } + + public static monitoring.Monitoring.SubsDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsDescriptor(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 monitoring.Monitoring.SubsDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubscriptionIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubscriptionID) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + boolean hasSubsId(); + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + context.ContextOuterClass.Uuid getSubsId(); + /** + * .context.Uuid subs_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.SubscriptionID} + */ + public static final class SubscriptionID extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubscriptionID) + SubscriptionIDOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscriptionID.newBuilder() to construct. + private SubscriptionID(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubscriptionID() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubscriptionID(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubscriptionID( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (subsId_ != null) { + subBuilder = subsId_.toBuilder(); + } + subsId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subsId_); + subsId_ = 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 monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubscriptionID.class, monitoring.Monitoring.SubscriptionID.Builder.class); + } + + public static final int SUBS_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid subsId_; + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + @java.lang.Override + public boolean hasSubsId() { + return subsId_ != null; + } + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getSubsId() { + return subsId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } + /** + * .context.Uuid subs_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder() { + return getSubsId(); + } + + 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 (subsId_ != null) { + output.writeMessage(1, getSubsId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subsId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSubsId()); + } + 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 monitoring.Monitoring.SubscriptionID)) { + return super.equals(obj); + } + monitoring.Monitoring.SubscriptionID other = (monitoring.Monitoring.SubscriptionID) obj; + + if (hasSubsId() != other.hasSubsId()) return false; + if (hasSubsId()) { + if (!getSubsId() + .equals(other.getSubsId())) 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 (hasSubsId()) { + hash = (37 * hash) + SUBS_ID_FIELD_NUMBER; + hash = (53 * hash) + getSubsId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubscriptionID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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 monitoring.Monitoring.SubscriptionID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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 monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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(monitoring.Monitoring.SubscriptionID 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 monitoring.SubscriptionID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubscriptionID) + monitoring.Monitoring.SubscriptionIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubscriptionID.class, monitoring.Monitoring.SubscriptionID.Builder.class); + } + + // Construct using monitoring.Monitoring.SubscriptionID.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 (subsIdBuilder_ == null) { + subsId_ = null; + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getDefaultInstanceForType() { + return monitoring.Monitoring.SubscriptionID.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID build() { + monitoring.Monitoring.SubscriptionID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID buildPartial() { + monitoring.Monitoring.SubscriptionID result = new monitoring.Monitoring.SubscriptionID(this); + if (subsIdBuilder_ == null) { + result.subsId_ = subsId_; + } else { + result.subsId_ = subsIdBuilder_.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 monitoring.Monitoring.SubscriptionID) { + return mergeFrom((monitoring.Monitoring.SubscriptionID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubscriptionID other) { + if (other == monitoring.Monitoring.SubscriptionID.getDefaultInstance()) return this; + if (other.hasSubsId()) { + mergeSubsId(other.getSubsId()); + } + 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 { + monitoring.Monitoring.SubscriptionID parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubscriptionID) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid subsId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> subsIdBuilder_; + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + public boolean hasSubsId() { + return subsIdBuilder_ != null || subsId_ != null; + } + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + public context.ContextOuterClass.Uuid getSubsId() { + if (subsIdBuilder_ == null) { + return subsId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } else { + return subsIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder setSubsId(context.ContextOuterClass.Uuid value) { + if (subsIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subsId_ = value; + onChanged(); + } else { + subsIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder setSubsId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (subsIdBuilder_ == null) { + subsId_ = builderForValue.build(); + onChanged(); + } else { + subsIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder mergeSubsId(context.ContextOuterClass.Uuid value) { + if (subsIdBuilder_ == null) { + if (subsId_ != null) { + subsId_ = + context.ContextOuterClass.Uuid.newBuilder(subsId_).mergeFrom(value).buildPartial(); + } else { + subsId_ = value; + } + onChanged(); + } else { + subsIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder clearSubsId() { + if (subsIdBuilder_ == null) { + subsId_ = null; + onChanged(); + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getSubsIdBuilder() { + + onChanged(); + return getSubsIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid subs_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder() { + if (subsIdBuilder_ != null) { + return subsIdBuilder_.getMessageOrBuilder(); + } else { + return subsId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } + } + /** + * .context.Uuid subs_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSubsIdFieldBuilder() { + if (subsIdBuilder_ == null) { + subsIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSubsId(), + getParentForChildren(), + isClean()); + subsId_ = null; + } + return subsIdBuilder_; + } + @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:monitoring.SubscriptionID) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubscriptionID) + private static final monitoring.Monitoring.SubscriptionID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubscriptionID(); + } + + public static monitoring.Monitoring.SubscriptionID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscriptionID parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubscriptionID(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 monitoring.Monitoring.SubscriptionID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + boolean hasSubsId(); + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + monitoring.Monitoring.SubscriptionID getSubsId(); + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder(); + + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + java.util.List + getKpiListList(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + monitoring.Monitoring.KpiList getKpiList(int index); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + int getKpiListCount(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + java.util.List + getKpiListOrBuilderList(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.SubsResponse} + */ + public static final class SubsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsResponse) + SubsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsResponse.newBuilder() to construct. + private SubsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsResponse() { + kpiList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsResponse( + 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: { + monitoring.Monitoring.SubscriptionID.Builder subBuilder = null; + if (subsId_ != null) { + subBuilder = subsId_.toBuilder(); + } + subsId_ = input.readMessage(monitoring.Monitoring.SubscriptionID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subsId_); + subsId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiList_.add( + input.readMessage(monitoring.Monitoring.KpiList.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)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsResponse.class, monitoring.Monitoring.SubsResponse.Builder.class); + } + + public static final int SUBS_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.SubscriptionID subsId_; + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + @java.lang.Override + public boolean hasSubsId() { + return subsId_ != null; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getSubsId() { + return subsId_ == null ? monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder() { + return getSubsId(); + } + + public static final int KPI_LIST_FIELD_NUMBER = 2; + private java.util.List kpiList_; + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public java.util.List getKpiListList() { + return kpiList_; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public java.util.List + getKpiListOrBuilderList() { + return kpiList_; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public int getKpiListCount() { + return kpiList_.size(); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiList getKpiList(int index) { + return kpiList_.get(index); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index) { + return kpiList_.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 (subsId_ != null) { + output.writeMessage(1, getSubsId()); + } + for (int i = 0; i < kpiList_.size(); i++) { + output.writeMessage(2, kpiList_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subsId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSubsId()); + } + for (int i = 0; i < kpiList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, kpiList_.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 monitoring.Monitoring.SubsResponse)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsResponse other = (monitoring.Monitoring.SubsResponse) obj; + + if (hasSubsId() != other.hasSubsId()) return false; + if (hasSubsId()) { + if (!getSubsId() + .equals(other.getSubsId())) return false; + } + if (!getKpiListList() + .equals(other.getKpiListList())) 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 (hasSubsId()) { + hash = (37 * hash) + SUBS_ID_FIELD_NUMBER; + hash = (53 * hash) + getSubsId().hashCode(); + } + if (getKpiListCount() > 0) { + hash = (37 * hash) + KPI_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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 monitoring.Monitoring.SubsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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 monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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(monitoring.Monitoring.SubsResponse 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 monitoring.SubsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsResponse) + monitoring.Monitoring.SubsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsResponse.class, monitoring.Monitoring.SubsResponse.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (subsIdBuilder_ == null) { + subsId_ = null; + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse getDefaultInstanceForType() { + return monitoring.Monitoring.SubsResponse.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse build() { + monitoring.Monitoring.SubsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse buildPartial() { + monitoring.Monitoring.SubsResponse result = new monitoring.Monitoring.SubsResponse(this); + int from_bitField0_ = bitField0_; + if (subsIdBuilder_ == null) { + result.subsId_ = subsId_; + } else { + result.subsId_ = subsIdBuilder_.build(); + } + if (kpiListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiList_ = kpiList_; + } else { + result.kpiList_ = kpiListBuilder_.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 monitoring.Monitoring.SubsResponse) { + return mergeFrom((monitoring.Monitoring.SubsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsResponse other) { + if (other == monitoring.Monitoring.SubsResponse.getDefaultInstance()) return this; + if (other.hasSubsId()) { + mergeSubsId(other.getSubsId()); + } + if (kpiListBuilder_ == null) { + if (!other.kpiList_.isEmpty()) { + if (kpiList_.isEmpty()) { + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiListIsMutable(); + kpiList_.addAll(other.kpiList_); + } + onChanged(); + } + } else { + if (!other.kpiList_.isEmpty()) { + if (kpiListBuilder_.isEmpty()) { + kpiListBuilder_.dispose(); + kpiListBuilder_ = null; + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiListFieldBuilder() : null; + } else { + kpiListBuilder_.addAllMessages(other.kpiList_); + } + } + } + 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 { + monitoring.Monitoring.SubsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private monitoring.Monitoring.SubscriptionID subsId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> subsIdBuilder_; + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + public boolean hasSubsId() { + return subsIdBuilder_ != null || subsId_ != null; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + public monitoring.Monitoring.SubscriptionID getSubsId() { + if (subsIdBuilder_ == null) { + return subsId_ == null ? monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } else { + return subsIdBuilder_.getMessage(); + } + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder setSubsId(monitoring.Monitoring.SubscriptionID value) { + if (subsIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subsId_ = value; + onChanged(); + } else { + subsIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder setSubsId( + monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsIdBuilder_ == null) { + subsId_ = builderForValue.build(); + onChanged(); + } else { + subsIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder mergeSubsId(monitoring.Monitoring.SubscriptionID value) { + if (subsIdBuilder_ == null) { + if (subsId_ != null) { + subsId_ = + monitoring.Monitoring.SubscriptionID.newBuilder(subsId_).mergeFrom(value).buildPartial(); + } else { + subsId_ = value; + } + onChanged(); + } else { + subsIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder clearSubsId() { + if (subsIdBuilder_ == null) { + subsId_ = null; + onChanged(); + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder getSubsIdBuilder() { + + onChanged(); + return getSubsIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder() { + if (subsIdBuilder_ != null) { + return subsIdBuilder_.getMessageOrBuilder(); + } else { + return subsId_ == null ? + monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> + getSubsIdFieldBuilder() { + if (subsIdBuilder_ == null) { + subsIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder>( + getSubsId(), + getParentForChildren(), + isClean()); + subsId_ = null; + } + return subsIdBuilder_; + } + + private java.util.List kpiList_ = + java.util.Collections.emptyList(); + private void ensureKpiListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(kpiList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder> kpiListBuilder_; + + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List getKpiListList() { + if (kpiListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiList_); + } else { + return kpiListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public int getKpiListCount() { + if (kpiListBuilder_ == null) { + return kpiList_.size(); + } else { + return kpiListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList getKpiList(int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); + } else { + return kpiListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.set(index, value); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList(monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(value); + onChanged(); + } else { + kpiListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(index, value); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addAllKpiList( + java.lang.Iterable values) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiList_); + onChanged(); + } else { + kpiListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder clearKpiList() { + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder removeKpiList(int index) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.remove(index); + onChanged(); + } else { + kpiListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder getKpiListBuilder( + int index) { + return getKpiListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); } else { + return kpiListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List + getKpiListOrBuilderList() { + if (kpiListBuilder_ != null) { + return kpiListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiList_); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder addKpiListBuilder() { + return getKpiListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiList.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder addKpiListBuilder( + int index) { + return getKpiListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiList.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List + getKpiListBuilderList() { + return getKpiListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder> + getKpiListFieldBuilder() { + if (kpiListBuilder_ == null) { + kpiListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder>( + kpiList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiList_ = null; + } + return kpiListBuilder_; + } + @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:monitoring.SubsResponse) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsResponse) + private static final monitoring.Monitoring.SubsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsResponse(); + } + + public static monitoring.Monitoring.SubsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsResponse(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 monitoring.Monitoring.SubsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsIDListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsIDList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + java.util.List + getSubsListList(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + monitoring.Monitoring.SubscriptionID getSubsList(int index); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + int getSubsListCount(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + java.util.List + getSubsListOrBuilderList(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.SubsIDList} + */ + public static final class SubsIDList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsIDList) + SubsIDListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsIDList.newBuilder() to construct. + private SubsIDList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsIDList() { + subsList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsIDList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsIDList( + 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)) { + subsList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + subsList_.add( + input.readMessage(monitoring.Monitoring.SubscriptionID.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)) { + subsList_ = java.util.Collections.unmodifiableList(subsList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsIDList.class, monitoring.Monitoring.SubsIDList.Builder.class); + } + + public static final int SUBS_LIST_FIELD_NUMBER = 1; + private java.util.List subsList_; + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public java.util.List getSubsListList() { + return subsList_; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public java.util.List + getSubsListOrBuilderList() { + return subsList_; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public int getSubsListCount() { + return subsList_.size(); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getSubsList(int index) { + return subsList_.get(index); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index) { + return subsList_.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 < subsList_.size(); i++) { + output.writeMessage(1, subsList_.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 < subsList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, subsList_.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 monitoring.Monitoring.SubsIDList)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsIDList other = (monitoring.Monitoring.SubsIDList) obj; + + if (!getSubsListList() + .equals(other.getSubsListList())) 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 (getSubsListCount() > 0) { + hash = (37 * hash) + SUBS_LIST_FIELD_NUMBER; + hash = (53 * hash) + getSubsListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsIDList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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 monitoring.Monitoring.SubsIDList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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 monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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(monitoring.Monitoring.SubsIDList 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 monitoring.SubsIDList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsIDList) + monitoring.Monitoring.SubsIDListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsIDList.class, monitoring.Monitoring.SubsIDList.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsIDList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSubsListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (subsListBuilder_ == null) { + subsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + subsListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList getDefaultInstanceForType() { + return monitoring.Monitoring.SubsIDList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList build() { + monitoring.Monitoring.SubsIDList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList buildPartial() { + monitoring.Monitoring.SubsIDList result = new monitoring.Monitoring.SubsIDList(this); + int from_bitField0_ = bitField0_; + if (subsListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + subsList_ = java.util.Collections.unmodifiableList(subsList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subsList_ = subsList_; + } else { + result.subsList_ = subsListBuilder_.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 monitoring.Monitoring.SubsIDList) { + return mergeFrom((monitoring.Monitoring.SubsIDList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsIDList other) { + if (other == monitoring.Monitoring.SubsIDList.getDefaultInstance()) return this; + if (subsListBuilder_ == null) { + if (!other.subsList_.isEmpty()) { + if (subsList_.isEmpty()) { + subsList_ = other.subsList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubsListIsMutable(); + subsList_.addAll(other.subsList_); + } + onChanged(); + } + } else { + if (!other.subsList_.isEmpty()) { + if (subsListBuilder_.isEmpty()) { + subsListBuilder_.dispose(); + subsListBuilder_ = null; + subsList_ = other.subsList_; + bitField0_ = (bitField0_ & ~0x00000001); + subsListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSubsListFieldBuilder() : null; + } else { + subsListBuilder_.addAllMessages(other.subsList_); + } + } + } + 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 { + monitoring.Monitoring.SubsIDList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsIDList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List subsList_ = + java.util.Collections.emptyList(); + private void ensureSubsListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + subsList_ = new java.util.ArrayList(subsList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> subsListBuilder_; + + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List getSubsListList() { + if (subsListBuilder_ == null) { + return java.util.Collections.unmodifiableList(subsList_); + } else { + return subsListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public int getSubsListCount() { + if (subsListBuilder_ == null) { + return subsList_.size(); + } else { + return subsListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID getSubsList(int index) { + if (subsListBuilder_ == null) { + return subsList_.get(index); + } else { + return subsListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder setSubsList( + int index, monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.set(index, value); + onChanged(); + } else { + subsListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder setSubsList( + int index, monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.set(index, builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList(monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.add(value); + onChanged(); + } else { + subsListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + int index, monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.add(index, value); + onChanged(); + } else { + subsListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.add(builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + int index, monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.add(index, builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addAllSubsList( + java.lang.Iterable values) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subsList_); + onChanged(); + } else { + subsListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder clearSubsList() { + if (subsListBuilder_ == null) { + subsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subsListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder removeSubsList(int index) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.remove(index); + onChanged(); + } else { + subsListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder getSubsListBuilder( + int index) { + return getSubsListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index) { + if (subsListBuilder_ == null) { + return subsList_.get(index); } else { + return subsListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List + getSubsListOrBuilderList() { + if (subsListBuilder_ != null) { + return subsListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subsList_); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder addSubsListBuilder() { + return getSubsListFieldBuilder().addBuilder( + monitoring.Monitoring.SubscriptionID.getDefaultInstance()); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder addSubsListBuilder( + int index) { + return getSubsListFieldBuilder().addBuilder( + index, monitoring.Monitoring.SubscriptionID.getDefaultInstance()); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List + getSubsListBuilderList() { + return getSubsListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> + getSubsListFieldBuilder() { + if (subsListBuilder_ == null) { + subsListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder>( + subsList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + subsList_ = null; + } + return subsListBuilder_; + } + @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:monitoring.SubsIDList) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsIDList) + private static final monitoring.Monitoring.SubsIDList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsIDList(); + } + + public static monitoring.Monitoring.SubsIDList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsIDList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsIDList(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 monitoring.Monitoring.SubsIDList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + java.lang.String getAlarmDescription(); + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + com.google.protobuf.ByteString + getAlarmDescriptionBytes(); + + /** + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 3; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + boolean hasKpiValueRange(); + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + monitoring.Monitoring.KpiValueRange getKpiValueRange(); + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder(); + + /** + * string timestamp = 5; + * @return The timestamp. + */ + java.lang.String getTimestamp(); + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + com.google.protobuf.ByteString + getTimestampBytes(); + } + /** + * Protobuf type {@code monitoring.AlarmDescriptor} + */ + public static final class AlarmDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmDescriptor) + AlarmDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmDescriptor.newBuilder() to construct. + private AlarmDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmDescriptor() { + alarmDescription_ = ""; + name_ = ""; + timestamp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmDescriptor( + 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(); + + alarmDescription_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + monitoring.Monitoring.KpiValueRange.Builder subBuilder = null; + if (kpiValueRange_ != null) { + subBuilder = kpiValueRange_.toBuilder(); + } + kpiValueRange_ = input.readMessage(monitoring.Monitoring.KpiValueRange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValueRange_); + kpiValueRange_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + timestamp_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmDescriptor.class, monitoring.Monitoring.AlarmDescriptor.Builder.class); + } + + public static final int ALARM_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object alarmDescription_; + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + @java.lang.Override + public java.lang.String getAlarmDescription() { + java.lang.Object ref = alarmDescription_; + 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(); + alarmDescription_ = s; + return s; + } + } + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAlarmDescriptionBytes() { + java.lang.Object ref = alarmDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alarmDescription_ = 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 KPI_ID_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int KPI_VALUE_RANGE_FIELD_NUMBER = 4; + private monitoring.Monitoring.KpiValueRange kpiValueRange_; + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + @java.lang.Override + public boolean hasKpiValueRange() { + return kpiValueRange_ != null; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueRange getKpiValueRange() { + return kpiValueRange_ == null ? monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder() { + return getKpiValueRange(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private volatile java.lang.Object timestamp_; + /** + * string timestamp = 5; + * @return The timestamp. + */ + @java.lang.Override + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + 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(); + timestamp_ = s; + return s; + } + } + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = 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 (!getAlarmDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, alarmDescription_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (kpiId_ != null) { + output.writeMessage(3, getKpiId()); + } + if (kpiValueRange_ != null) { + output.writeMessage(4, getKpiValueRange()); + } + if (!getTimestampBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAlarmDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, alarmDescription_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiId()); + } + if (kpiValueRange_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getKpiValueRange()); + } + if (!getTimestampBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, timestamp_); + } + 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 monitoring.Monitoring.AlarmDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmDescriptor other = (monitoring.Monitoring.AlarmDescriptor) obj; + + if (!getAlarmDescription() + .equals(other.getAlarmDescription())) return false; + if (!getName() + .equals(other.getName())) return false; + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (hasKpiValueRange() != other.hasKpiValueRange()) return false; + if (hasKpiValueRange()) { + if (!getKpiValueRange() + .equals(other.getKpiValueRange())) return false; + } + if (!getTimestamp() + .equals(other.getTimestamp())) 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) + ALARM_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getAlarmDescription().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + if (hasKpiValueRange()) { + hash = (37 * hash) + KPI_VALUE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValueRange().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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 monitoring.Monitoring.AlarmDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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 monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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(monitoring.Monitoring.AlarmDescriptor 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 monitoring.AlarmDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmDescriptor) + monitoring.Monitoring.AlarmDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmDescriptor.class, monitoring.Monitoring.AlarmDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmDescriptor.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(); + alarmDescription_ = ""; + + name_ = ""; + + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = null; + } else { + kpiValueRange_ = null; + kpiValueRangeBuilder_ = null; + } + timestamp_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor build() { + monitoring.Monitoring.AlarmDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor buildPartial() { + monitoring.Monitoring.AlarmDescriptor result = new monitoring.Monitoring.AlarmDescriptor(this); + result.alarmDescription_ = alarmDescription_; + result.name_ = name_; + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + if (kpiValueRangeBuilder_ == null) { + result.kpiValueRange_ = kpiValueRange_; + } else { + result.kpiValueRange_ = kpiValueRangeBuilder_.build(); + } + result.timestamp_ = timestamp_; + 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 monitoring.Monitoring.AlarmDescriptor) { + return mergeFrom((monitoring.Monitoring.AlarmDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmDescriptor other) { + if (other == monitoring.Monitoring.AlarmDescriptor.getDefaultInstance()) return this; + if (!other.getAlarmDescription().isEmpty()) { + alarmDescription_ = other.alarmDescription_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.hasKpiValueRange()) { + mergeKpiValueRange(other.getKpiValueRange()); + } + if (!other.getTimestamp().isEmpty()) { + timestamp_ = other.timestamp_; + 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 { + monitoring.Monitoring.AlarmDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object alarmDescription_ = ""; + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + public java.lang.String getAlarmDescription() { + java.lang.Object ref = alarmDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alarmDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + public com.google.protobuf.ByteString + getAlarmDescriptionBytes() { + java.lang.Object ref = alarmDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alarmDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string alarm_description = 1; + * @param value The alarmDescription to set. + * @return This builder for chaining. + */ + public Builder setAlarmDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + alarmDescription_ = value; + onChanged(); + return this; + } + /** + * string alarm_description = 1; + * @return This builder for chaining. + */ + public Builder clearAlarmDescription() { + + alarmDescription_ = getDefaultInstance().getAlarmDescription(); + onChanged(); + return this; + } + /** + * string alarm_description = 1; + * @param value The bytes for alarmDescription to set. + * @return This builder for chaining. + */ + public Builder setAlarmDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + alarmDescription_ = 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 monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private monitoring.Monitoring.KpiValueRange kpiValueRange_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder> kpiValueRangeBuilder_; + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + public boolean hasKpiValueRange() { + return kpiValueRangeBuilder_ != null || kpiValueRange_ != null; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + public monitoring.Monitoring.KpiValueRange getKpiValueRange() { + if (kpiValueRangeBuilder_ == null) { + return kpiValueRange_ == null ? monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } else { + return kpiValueRangeBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder setKpiValueRange(monitoring.Monitoring.KpiValueRange value) { + if (kpiValueRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValueRange_ = value; + onChanged(); + } else { + kpiValueRangeBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder setKpiValueRange( + monitoring.Monitoring.KpiValueRange.Builder builderForValue) { + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = builderForValue.build(); + onChanged(); + } else { + kpiValueRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder mergeKpiValueRange(monitoring.Monitoring.KpiValueRange value) { + if (kpiValueRangeBuilder_ == null) { + if (kpiValueRange_ != null) { + kpiValueRange_ = + monitoring.Monitoring.KpiValueRange.newBuilder(kpiValueRange_).mergeFrom(value).buildPartial(); + } else { + kpiValueRange_ = value; + } + onChanged(); + } else { + kpiValueRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder clearKpiValueRange() { + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = null; + onChanged(); + } else { + kpiValueRange_ = null; + kpiValueRangeBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public monitoring.Monitoring.KpiValueRange.Builder getKpiValueRangeBuilder() { + + onChanged(); + return getKpiValueRangeFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder() { + if (kpiValueRangeBuilder_ != null) { + return kpiValueRangeBuilder_.getMessageOrBuilder(); + } else { + return kpiValueRange_ == null ? + monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder> + getKpiValueRangeFieldBuilder() { + if (kpiValueRangeBuilder_ == null) { + kpiValueRangeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder>( + getKpiValueRange(), + getParentForChildren(), + isClean()); + kpiValueRange_ = null; + } + return kpiValueRangeBuilder_; + } + + private java.lang.Object timestamp_ = ""; + /** + * string timestamp = 5; + * @return The timestamp. + */ + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string timestamp = 5; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timestamp_ = value; + onChanged(); + return this; + } + /** + * string timestamp = 5; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = getDefaultInstance().getTimestamp(); + onChanged(); + return this; + } + /** + * string timestamp = 5; + * @param value The bytes for timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestampBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timestamp_ = 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:monitoring.AlarmDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmDescriptor) + private static final monitoring.Monitoring.AlarmDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmDescriptor(); + } + + public static monitoring.Monitoring.AlarmDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmDescriptor(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 monitoring.Monitoring.AlarmDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmID) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + boolean hasAlarmId(); + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + context.ContextOuterClass.Uuid getAlarmId(); + /** + * .context.Uuid alarm_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.AlarmID} + */ + public static final class AlarmID extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmID) + AlarmIDOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmID.newBuilder() to construct. + private AlarmID(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmID() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmID(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmID( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (alarmId_ != null) { + subBuilder = alarmId_.toBuilder(); + } + alarmId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(alarmId_); + alarmId_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmID.class, monitoring.Monitoring.AlarmID.Builder.class); + } + + public static final int ALARM_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid alarmId_; + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + @java.lang.Override + public boolean hasAlarmId() { + return alarmId_ != null; + } + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getAlarmId() { + return alarmId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } + /** + * .context.Uuid alarm_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder() { + return getAlarmId(); + } + + 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 (alarmId_ != null) { + output.writeMessage(1, getAlarmId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (alarmId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAlarmId()); + } + 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 monitoring.Monitoring.AlarmID)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmID other = (monitoring.Monitoring.AlarmID) obj; + + if (hasAlarmId() != other.hasAlarmId()) return false; + if (hasAlarmId()) { + if (!getAlarmId() + .equals(other.getAlarmId())) 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 (hasAlarmId()) { + hash = (37 * hash) + ALARM_ID_FIELD_NUMBER; + hash = (53 * hash) + getAlarmId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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 monitoring.Monitoring.AlarmID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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 monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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(monitoring.Monitoring.AlarmID 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 monitoring.AlarmID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmID) + monitoring.Monitoring.AlarmIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmID.class, monitoring.Monitoring.AlarmID.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmID.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 (alarmIdBuilder_ == null) { + alarmId_ = null; + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmID.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID build() { + monitoring.Monitoring.AlarmID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID buildPartial() { + monitoring.Monitoring.AlarmID result = new monitoring.Monitoring.AlarmID(this); + if (alarmIdBuilder_ == null) { + result.alarmId_ = alarmId_; + } else { + result.alarmId_ = alarmIdBuilder_.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 monitoring.Monitoring.AlarmID) { + return mergeFrom((monitoring.Monitoring.AlarmID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmID other) { + if (other == monitoring.Monitoring.AlarmID.getDefaultInstance()) return this; + if (other.hasAlarmId()) { + mergeAlarmId(other.getAlarmId()); + } + 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 { + monitoring.Monitoring.AlarmID parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmID) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid alarmId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> alarmIdBuilder_; + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + public boolean hasAlarmId() { + return alarmIdBuilder_ != null || alarmId_ != null; + } + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + public context.ContextOuterClass.Uuid getAlarmId() { + if (alarmIdBuilder_ == null) { + return alarmId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } else { + return alarmIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder setAlarmId(context.ContextOuterClass.Uuid value) { + if (alarmIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + alarmId_ = value; + onChanged(); + } else { + alarmIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder setAlarmId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (alarmIdBuilder_ == null) { + alarmId_ = builderForValue.build(); + onChanged(); + } else { + alarmIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder mergeAlarmId(context.ContextOuterClass.Uuid value) { + if (alarmIdBuilder_ == null) { + if (alarmId_ != null) { + alarmId_ = + context.ContextOuterClass.Uuid.newBuilder(alarmId_).mergeFrom(value).buildPartial(); + } else { + alarmId_ = value; + } + onChanged(); + } else { + alarmIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder clearAlarmId() { + if (alarmIdBuilder_ == null) { + alarmId_ = null; + onChanged(); + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getAlarmIdBuilder() { + + onChanged(); + return getAlarmIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid alarm_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder() { + if (alarmIdBuilder_ != null) { + return alarmIdBuilder_.getMessageOrBuilder(); + } else { + return alarmId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } + } + /** + * .context.Uuid alarm_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getAlarmIdFieldBuilder() { + if (alarmIdBuilder_ == null) { + alarmIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getAlarmId(), + getParentForChildren(), + isClean()); + alarmId_ = null; + } + return alarmIdBuilder_; + } + @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:monitoring.AlarmID) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmID) + private static final monitoring.Monitoring.AlarmID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmID(); + } + + public static monitoring.Monitoring.AlarmID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmID parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmID(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 monitoring.Monitoring.AlarmID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + boolean hasAlarmId(); + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + monitoring.Monitoring.AlarmID getAlarmId(); + /** + * .monitoring.AlarmID alarm_id = 1; + */ + monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder(); + + /** + * string text = 2; + * @return The text. + */ + java.lang.String getText(); + /** + * string text = 2; + * @return The bytes for text. + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.AlarmResponse} + */ + public static final class AlarmResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmResponse) + AlarmResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmResponse.newBuilder() to construct. + private AlarmResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmResponse() { + text_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmResponse( + 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: { + monitoring.Monitoring.AlarmID.Builder subBuilder = null; + if (alarmId_ != null) { + subBuilder = alarmId_.toBuilder(); + } + alarmId_ = input.readMessage(monitoring.Monitoring.AlarmID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(alarmId_); + alarmId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmResponse.class, monitoring.Monitoring.AlarmResponse.Builder.class); + } + + public static final int ALARM_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.AlarmID alarmId_; + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + @java.lang.Override + public boolean hasAlarmId() { + return alarmId_ != null; + } + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + @java.lang.Override + public monitoring.Monitoring.AlarmID getAlarmId() { + return alarmId_ == null ? monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder() { + return getAlarmId(); + } + + public static final int TEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object text_; + /** + * string text = 2; + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * string text = 2; + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_VALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + 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 (alarmId_ != null) { + output.writeMessage(1, getAlarmId()); + } + if (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (alarmId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAlarmId()); + } + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + 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 monitoring.Monitoring.AlarmResponse)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmResponse other = (monitoring.Monitoring.AlarmResponse) obj; + + if (hasAlarmId() != other.hasAlarmId()) return false; + if (hasAlarmId()) { + if (!getAlarmId() + .equals(other.getAlarmId())) return false; + } + if (!getText() + .equals(other.getText())) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) 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 (hasAlarmId()) { + hash = (37 * hash) + ALARM_ID_FIELD_NUMBER; + hash = (53 * hash) + getAlarmId().hashCode(); + } + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + if (hasKpiValue()) { + hash = (37 * hash) + KPI_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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 monitoring.Monitoring.AlarmResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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 monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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(monitoring.Monitoring.AlarmResponse 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 monitoring.AlarmResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmResponse) + monitoring.Monitoring.AlarmResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmResponse.class, monitoring.Monitoring.AlarmResponse.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmResponse.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 (alarmIdBuilder_ == null) { + alarmId_ = null; + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + text_ = ""; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmResponse.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse build() { + monitoring.Monitoring.AlarmResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse buildPartial() { + monitoring.Monitoring.AlarmResponse result = new monitoring.Monitoring.AlarmResponse(this); + if (alarmIdBuilder_ == null) { + result.alarmId_ = alarmId_; + } else { + result.alarmId_ = alarmIdBuilder_.build(); + } + result.text_ = text_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.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 monitoring.Monitoring.AlarmResponse) { + return mergeFrom((monitoring.Monitoring.AlarmResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmResponse other) { + if (other == monitoring.Monitoring.AlarmResponse.getDefaultInstance()) return this; + if (other.hasAlarmId()) { + mergeAlarmId(other.getAlarmId()); + } + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + 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 { + monitoring.Monitoring.AlarmResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.AlarmID alarmId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> alarmIdBuilder_; + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + public boolean hasAlarmId() { + return alarmIdBuilder_ != null || alarmId_ != null; + } + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + public monitoring.Monitoring.AlarmID getAlarmId() { + if (alarmIdBuilder_ == null) { + return alarmId_ == null ? monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } else { + return alarmIdBuilder_.getMessage(); + } + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder setAlarmId(monitoring.Monitoring.AlarmID value) { + if (alarmIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + alarmId_ = value; + onChanged(); + } else { + alarmIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder setAlarmId( + monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmIdBuilder_ == null) { + alarmId_ = builderForValue.build(); + onChanged(); + } else { + alarmIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder mergeAlarmId(monitoring.Monitoring.AlarmID value) { + if (alarmIdBuilder_ == null) { + if (alarmId_ != null) { + alarmId_ = + monitoring.Monitoring.AlarmID.newBuilder(alarmId_).mergeFrom(value).buildPartial(); + } else { + alarmId_ = value; + } + onChanged(); + } else { + alarmIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder clearAlarmId() { + if (alarmIdBuilder_ == null) { + alarmId_ = null; + onChanged(); + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public monitoring.Monitoring.AlarmID.Builder getAlarmIdBuilder() { + + onChanged(); + return getAlarmIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder() { + if (alarmIdBuilder_ != null) { + return alarmIdBuilder_.getMessageOrBuilder(); + } else { + return alarmId_ == null ? + monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> + getAlarmIdFieldBuilder() { + if (alarmIdBuilder_ == null) { + alarmIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder>( + getAlarmId(), + getParentForChildren(), + isClean()); + alarmId_ = null; + } + return alarmIdBuilder_; + } + + private java.lang.Object text_ = ""; + /** + * string text = 2; + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string text = 2; + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string text = 2; + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + * string text = 2; + * @return This builder for chaining. + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + * string text = 2; + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @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:monitoring.AlarmResponse) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmResponse) + private static final monitoring.Monitoring.AlarmResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmResponse(); + } + + public static monitoring.Monitoring.AlarmResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmResponse(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 monitoring.Monitoring.AlarmResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmIDListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmIDList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + java.util.List + getAlarmListList(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + monitoring.Monitoring.AlarmID getAlarmList(int index); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + int getAlarmListCount(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + java.util.List + getAlarmListOrBuilderList(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.AlarmIDList} + */ + public static final class AlarmIDList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmIDList) + AlarmIDListOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmIDList.newBuilder() to construct. + private AlarmIDList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmIDList() { + alarmList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmIDList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmIDList( + 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)) { + alarmList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alarmList_.add( + input.readMessage(monitoring.Monitoring.AlarmID.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)) { + alarmList_ = java.util.Collections.unmodifiableList(alarmList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmIDList.class, monitoring.Monitoring.AlarmIDList.Builder.class); + } + + public static final int ALARM_LIST_FIELD_NUMBER = 1; + private java.util.List alarmList_; + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public java.util.List getAlarmListList() { + return alarmList_; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public java.util.List + getAlarmListOrBuilderList() { + return alarmList_; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public int getAlarmListCount() { + return alarmList_.size(); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmID getAlarmList(int index) { + return alarmList_.get(index); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index) { + return alarmList_.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 < alarmList_.size(); i++) { + output.writeMessage(1, alarmList_.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 < alarmList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alarmList_.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 monitoring.Monitoring.AlarmIDList)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmIDList other = (monitoring.Monitoring.AlarmIDList) obj; + + if (!getAlarmListList() + .equals(other.getAlarmListList())) 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 (getAlarmListCount() > 0) { + hash = (37 * hash) + ALARM_LIST_FIELD_NUMBER; + hash = (53 * hash) + getAlarmListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmIDList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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 monitoring.Monitoring.AlarmIDList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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 monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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(monitoring.Monitoring.AlarmIDList 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 monitoring.AlarmIDList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmIDList) + monitoring.Monitoring.AlarmIDListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmIDList.class, monitoring.Monitoring.AlarmIDList.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmIDList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlarmListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alarmListBuilder_ == null) { + alarmList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alarmListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmIDList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList build() { + monitoring.Monitoring.AlarmIDList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList buildPartial() { + monitoring.Monitoring.AlarmIDList result = new monitoring.Monitoring.AlarmIDList(this); + int from_bitField0_ = bitField0_; + if (alarmListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alarmList_ = java.util.Collections.unmodifiableList(alarmList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alarmList_ = alarmList_; + } else { + result.alarmList_ = alarmListBuilder_.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 monitoring.Monitoring.AlarmIDList) { + return mergeFrom((monitoring.Monitoring.AlarmIDList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmIDList other) { + if (other == monitoring.Monitoring.AlarmIDList.getDefaultInstance()) return this; + if (alarmListBuilder_ == null) { + if (!other.alarmList_.isEmpty()) { + if (alarmList_.isEmpty()) { + alarmList_ = other.alarmList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlarmListIsMutable(); + alarmList_.addAll(other.alarmList_); + } + onChanged(); + } + } else { + if (!other.alarmList_.isEmpty()) { + if (alarmListBuilder_.isEmpty()) { + alarmListBuilder_.dispose(); + alarmListBuilder_ = null; + alarmList_ = other.alarmList_; + bitField0_ = (bitField0_ & ~0x00000001); + alarmListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlarmListFieldBuilder() : null; + } else { + alarmListBuilder_.addAllMessages(other.alarmList_); + } + } + } + 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 { + monitoring.Monitoring.AlarmIDList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmIDList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alarmList_ = + java.util.Collections.emptyList(); + private void ensureAlarmListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alarmList_ = new java.util.ArrayList(alarmList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> alarmListBuilder_; + + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List getAlarmListList() { + if (alarmListBuilder_ == null) { + return java.util.Collections.unmodifiableList(alarmList_); + } else { + return alarmListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public int getAlarmListCount() { + if (alarmListBuilder_ == null) { + return alarmList_.size(); + } else { + return alarmListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID getAlarmList(int index) { + if (alarmListBuilder_ == null) { + return alarmList_.get(index); + } else { + return alarmListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder setAlarmList( + int index, monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.set(index, value); + onChanged(); + } else { + alarmListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder setAlarmList( + int index, monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.set(index, builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList(monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.add(value); + onChanged(); + } else { + alarmListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + int index, monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.add(index, value); + onChanged(); + } else { + alarmListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.add(builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + int index, monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.add(index, builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAllAlarmList( + java.lang.Iterable values) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alarmList_); + onChanged(); + } else { + alarmListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder clearAlarmList() { + if (alarmListBuilder_ == null) { + alarmList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alarmListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder removeAlarmList(int index) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.remove(index); + onChanged(); + } else { + alarmListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder getAlarmListBuilder( + int index) { + return getAlarmListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index) { + if (alarmListBuilder_ == null) { + return alarmList_.get(index); } else { + return alarmListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List + getAlarmListOrBuilderList() { + if (alarmListBuilder_ != null) { + return alarmListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alarmList_); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder addAlarmListBuilder() { + return getAlarmListFieldBuilder().addBuilder( + monitoring.Monitoring.AlarmID.getDefaultInstance()); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder addAlarmListBuilder( + int index) { + return getAlarmListFieldBuilder().addBuilder( + index, monitoring.Monitoring.AlarmID.getDefaultInstance()); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List + getAlarmListBuilderList() { + return getAlarmListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> + getAlarmListFieldBuilder() { + if (alarmListBuilder_ == null) { + alarmListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder>( + alarmList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alarmList_ = null; + } + return alarmListBuilder_; + } + @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:monitoring.AlarmIDList) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmIDList) + private static final monitoring.Monitoring.AlarmIDList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmIDList(); + } + + public static monitoring.Monitoring.AlarmIDList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmIDList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmIDList(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 monitoring.Monitoring.AlarmIDList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_BundleKpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_EditedKpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_MonitorKpiRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiQuery_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiQuery_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_Kpi_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_Kpi_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiValueRange_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiValueRange_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiValue_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiDescriptorList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiDescriptorList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubscriptionID_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubscriptionID_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsIDList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsIDList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmID_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmID_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmIDList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmIDList_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\020monitoring.proto\022\nmonitoring\032\rcontext." + + "proto\032\026kpi_sample_types.proto\"\376\001\n\rKpiDes" + + "criptor\022\027\n\017kpi_description\030\001 \001(\t\0228\n\017kpi_" + + "sample_type\030\002 \001(\0162\037.kpi_sample_types.Kpi" + + "SampleType\022$\n\tdevice_id\030\003 \001(\0132\021.context." + + "DeviceId\022(\n\013endpoint_id\030\004 \001(\0132\023.context." + + "EndPointId\022&\n\nservice_id\030\005 \001(\0132\022.context" + + ".ServiceId\022\"\n\010slice_id\030\006 \001(\0132\020.context.S" + + "liceId\"\254\002\n\023BundleKpiDescriptor\022\027\n\017kpi_de" + + "scription\030\001 \001(\t\022&\n\013kpi_id_list\030\002 \003(\0132\021.m" + + "onitoring.KpiId\0228\n\017kpi_sample_type\030\003 \001(\016" + + "2\037.kpi_sample_types.KpiSampleType\022$\n\tdev" + + "ice_id\030\004 \001(\0132\021.context.DeviceId\022(\n\013endpo" + + "int_id\030\005 \001(\0132\023.context.EndPointId\022&\n\nser" + + "vice_id\030\006 \001(\0132\022.context.ServiceId\022\"\n\010sli" + + "ce_id\030\007 \001(\0132\020.context.SliceId\"\317\002\n\023Edited" + + "KpiDescriptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitori" + + "ng.KpiId\022\027\n\017kpi_description\030\002 \001(\t\022&\n\013kpi" + + "_id_list\030\003 \003(\0132\021.monitoring.KpiId\0228\n\017kpi" + + "_sample_type\030\004 \001(\0162\037.kpi_sample_types.Kp" + + "iSampleType\022$\n\tdevice_id\030\005 \001(\0132\021.context" + + ".DeviceId\022(\n\013endpoint_id\030\006 \001(\0132\023.context" + + ".EndPointId\022&\n\nservice_id\030\007 \001(\0132\022.contex" + + "t.ServiceId\022\"\n\010slice_id\030\010 \001(\0132\020.context." + + "SliceId\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001" + + " \001(\0132\021.monitoring.KpiId\022\033\n\023monitoring_wi" + + "ndow_s\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\241\001" + + "\n\010KpiQuery\022!\n\006kpi_id\030\001 \003(\0132\021.monitoring." + + "KpiId\022\033\n\023monitoring_window_s\030\002 \001(\002\022\027\n\017sa" + + "mpling_rate_s\030\003 \001(\002\022\026\n\016last_n_samples\030\004 " + + "\001(\r\022\022\n\nstart_date\030\005 \001(\t\022\020\n\010end_date\030\006 \001(" + + "\t\"&\n\005KpiId\022\035\n\006kpi_id\030\001 \001(\0132\r.context.Uui" + + "d\"d\n\003Kpi\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kp" + + "iId\022\021\n\ttimestamp\030\002 \001(\t\022\'\n\tkpi_value\030\003 \001(" + + "\0132\024.monitoring.KpiValue\"e\n\rKpiValueRange" + + "\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring.KpiVa" + + "lue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitoring.Kp" + + "iValue\"a\n\010KpiValue\022\020\n\006intVal\030\001 \001(\rH\000\022\022\n\010" + + "floatVal\030\002 \001(\002H\000\022\023\n\tstringVal\030\003 \001(\tH\000\022\021\n" + + "\007boolVal\030\004 \001(\010H\000B\007\n\005value\",\n\007KpiList\022!\n\010" + + "kpi_list\030\001 \003(\0132\017.monitoring.Kpi\"K\n\021KpiDe" + + "scriptorList\0226\n\023kpi_descriptor_list\030\001 \003(" + + "\0132\031.monitoring.KpiDescriptor\"\223\001\n\016SubsDes" + + "criptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kpi" + + "Id\022\033\n\023sampling_duration_s\030\002 \001(\002\022\033\n\023sampl" + + "ing_interval_s\030\003 \001(\002\022\022\n\nstart_date\030\004 \001(\t" + + "\022\020\n\010end_date\030\005 \001(\t\"0\n\016SubscriptionID\022\036\n\007" + + "subs_id\030\001 \001(\0132\r.context.Uuid\"b\n\014SubsResp" + + "onse\022+\n\007subs_id\030\001 \001(\0132\032.monitoring.Subsc" + + "riptionID\022%\n\010kpi_list\030\002 \003(\0132\023.monitoring" + + ".KpiList\";\n\nSubsIDList\022-\n\tsubs_list\030\001 \003(" + + "\0132\032.monitoring.SubscriptionID\"\244\001\n\017AlarmD" + + "escriptor\022\031\n\021alarm_description\030\001 \001(\t\022\014\n\004" + + "name\030\002 \001(\t\022!\n\006kpi_id\030\003 \001(\0132\021.monitoring." + + "KpiId\0222\n\017kpi_value_range\030\004 \001(\0132\031.monitor" + + "ing.KpiValueRange\022\021\n\ttimestamp\030\005 \001(\t\"*\n\007" + + "AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.context.Uuid" + + "\"m\n\rAlarmResponse\022%\n\010alarm_id\030\001 \001(\0132\023.mo" + + "nitoring.AlarmID\022\014\n\004text\030\002 \001(\t\022\'\n\tkpi_va" + + "lue\030\003 \001(\0132\024.monitoring.KpiValue\"6\n\013Alarm" + + "IDList\022\'\n\nalarm_list\030\001 \003(\0132\023.monitoring." + + "AlarmID2\271\t\n\021MonitoringService\022;\n\tCreateK" + + "pi\022\031.monitoring.KpiDescriptor\032\021.monitori" + + "ng.KpiId\"\000\022F\n\021EditKpiDescriptor\022\037.monito" + + "ring.EditedKpiDescriptor\032\016.context.Empty" + + "\"\000\0220\n\tDeleteKpi\022\021.monitoring.KpiId\032\016.con" + + "text.Empty\"\000\022G\n\024GetKpiDescriptorList\022\016.c" + + "ontext.Empty\032\035.monitoring.KpiDescriptorL" + + "ist\"\000\022G\n\017CreateBundleKpi\022\037.monitoring.Bu" + + "ndleKpiDescriptor\032\021.monitoring.KpiId\"\000\022B" + + "\n\020GetKpiDescriptor\022\021.monitoring.KpiId\032\031." + + "monitoring.KpiDescriptor\"\000\022/\n\nIncludeKpi" + + "\022\017.monitoring.Kpi\032\016.context.Empty\"\000\022=\n\nM" + + "onitorKpi\022\035.monitoring.MonitorKpiRequest" + + "\032\016.context.Empty\"\000\022;\n\014QueryKpiData\022\024.mon" + + "itoring.KpiQuery\032\023.monitoring.KpiList\"\000\022" + + "C\n\014SubscribeKpi\022\032.monitoring.SubsDescrip" + + "tor\032\023.monitoring.KpiList\"\0000\001\022M\n\021GetSubsD" + + "escriptor\022\032.monitoring.SubscriptionID\032\032." + + "monitoring.SubsDescriptor\"\000\022<\n\020GetSubscr" + + "iptions\022\016.context.Empty\032\026.monitoring.Sub" + + "sIDList\"\000\022C\n\023EditKpiSubscription\022\032.monit" + + "oring.SubsDescriptor\032\016.context.Empty\"\000\022D" + + "\n\016CreateKpiAlarm\022\033.monitoring.AlarmDescr" + + "iptor\032\023.monitoring.AlarmID\"\000\022=\n\014EditKpiA" + + "larm\022\033.monitoring.AlarmDescriptor\032\016.cont" + + "ext.Empty\"\000\0226\n\tGetAlarms\022\016.context.Empty" + + "\032\027.monitoring.AlarmIDList\"\000\022H\n\022GetAlarmD" + + "escriptor\022\023.monitoring.AlarmID\032\033.monitor" + + "ing.AlarmDescriptor\"\000\022L\n\026GetAlarmRespons" + + "eStream\022\023.monitoring.AlarmID\032\031.monitorin" + + "g.AlarmResponse\"\0000\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + kpi_sample_types.KpiSampleTypes.getDescriptor(), + }); + internal_static_monitoring_KpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_monitoring_KpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiDescriptor_descriptor, + new java.lang.String[] { "KpiDescription", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_BundleKpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_BundleKpiDescriptor_descriptor, + new java.lang.String[] { "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_EditedKpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_EditedKpiDescriptor_descriptor, + new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_MonitorKpiRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_MonitorKpiRequest_descriptor, + new java.lang.String[] { "KpiId", "MonitoringWindowS", "SamplingRateS", }); + internal_static_monitoring_KpiQuery_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_monitoring_KpiQuery_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiQuery_descriptor, + new java.lang.String[] { "KpiId", "MonitoringWindowS", "SamplingRateS", "LastNSamples", "StartDate", "EndDate", }); + internal_static_monitoring_KpiId_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_monitoring_KpiId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiId_descriptor, + new java.lang.String[] { "KpiId", }); + internal_static_monitoring_Kpi_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_monitoring_Kpi_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_Kpi_descriptor, + new java.lang.String[] { "KpiId", "Timestamp", "KpiValue", }); + internal_static_monitoring_KpiValueRange_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_monitoring_KpiValueRange_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiValueRange_descriptor, + new java.lang.String[] { "KpiMinValue", "KpiMaxValue", }); + internal_static_monitoring_KpiValue_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_monitoring_KpiValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiValue_descriptor, + new java.lang.String[] { "IntVal", "FloatVal", "StringVal", "BoolVal", "Value", }); + internal_static_monitoring_KpiList_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_monitoring_KpiList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiList_descriptor, + new java.lang.String[] { "KpiList", }); + internal_static_monitoring_KpiDescriptorList_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_monitoring_KpiDescriptorList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiDescriptorList_descriptor, + new java.lang.String[] { "KpiDescriptorList", }); + internal_static_monitoring_SubsDescriptor_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_monitoring_SubsDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsDescriptor_descriptor, + new java.lang.String[] { "KpiId", "SamplingDurationS", "SamplingIntervalS", "StartDate", "EndDate", }); + internal_static_monitoring_SubscriptionID_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_monitoring_SubscriptionID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubscriptionID_descriptor, + new java.lang.String[] { "SubsId", }); + internal_static_monitoring_SubsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_monitoring_SubsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsResponse_descriptor, + new java.lang.String[] { "SubsId", "KpiList", }); + internal_static_monitoring_SubsIDList_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_monitoring_SubsIDList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsIDList_descriptor, + new java.lang.String[] { "SubsList", }); + internal_static_monitoring_AlarmDescriptor_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_monitoring_AlarmDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmDescriptor_descriptor, + new java.lang.String[] { "AlarmDescription", "Name", "KpiId", "KpiValueRange", "Timestamp", }); + internal_static_monitoring_AlarmID_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_monitoring_AlarmID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmID_descriptor, + new java.lang.String[] { "AlarmId", }); + internal_static_monitoring_AlarmResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_monitoring_AlarmResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmResponse_descriptor, + new java.lang.String[] { "AlarmId", "Text", "KpiValue", }); + internal_static_monitoring_AlarmIDList_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_monitoring_AlarmIDList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmIDList_descriptor, + new java.lang.String[] { "AlarmList", }); + context.ContextOuterClass.getDescriptor(); + kpi_sample_types.KpiSampleTypes.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java new file mode 100644 index 0000000000000000000000000000000000000000..f826e1167d1ed56567fc470ba70cc09003617eda --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java @@ -0,0 +1,50 @@ +package monitoring; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public interface MonitoringService extends MutinyService { + + + io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request); + + io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request); + + io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request); + + io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request); + + io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request); + + io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request); + + io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request); + + io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request); + + io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request); + + io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request); + + io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request); + + io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request); + + io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request); + + + io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request); + + io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request); + + + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..c7f776e7bd0c56cabc7009e7b7bdb208669fb441 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java @@ -0,0 +1,165 @@ +package monitoring; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceBean extends MutinyMonitoringServiceGrpc.MonitoringServiceImplBase implements BindableService, MutinyBean { + + private final MonitoringService delegate; + + MonitoringServiceBean(@GrpcService MonitoringService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + try { + return delegate.createKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + try { + return delegate.editKpiDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + try { + return delegate.deleteKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + try { + return delegate.getKpiDescriptorList(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + try { + return delegate.createBundleKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + try { + return delegate.getKpiDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + try { + return delegate.includeKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + try { + return delegate.monitorKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + try { + return delegate.queryKpiData(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + try { + return delegate.getSubsDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + try { + return delegate.getSubscriptions(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + try { + return delegate.editKpiSubscription(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + try { + return delegate.createKpiAlarm(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + try { + return delegate.editKpiAlarm(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + try { + return delegate.getAlarms(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + try { + return delegate.getAlarmDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + try { + return delegate.subscribeKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + try { + return delegate.getAlarmResponseStream(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..35c98e8ff2c240e749e602c4d097c3bef81c8203 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java @@ -0,0 +1,98 @@ +package monitoring; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceClient implements MonitoringService, MutinyClient { + + private final MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub stub; + + public MonitoringServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyMonitoringServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + return stub.createKpi(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return stub.editKpiDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + return stub.deleteKpi(request); + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return stub.getKpiDescriptorList(request); + } + @Override + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return stub.createBundleKpi(request); + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return stub.getKpiDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + return stub.includeKpi(request); + } + @Override + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return stub.monitorKpi(request); + } + @Override + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + return stub.queryKpiData(request); + } + @Override + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return stub.getSubsDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + return stub.getSubscriptions(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return stub.editKpiSubscription(request); + } + @Override + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return stub.createKpiAlarm(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return stub.editKpiAlarm(request); + } + @Override + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + return stub.getAlarms(request); + } + @Override + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return stub.getAlarmDescriptor(request); + } + + @Override + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + return stub.subscribeKpi(request); + } + + @Override + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + return stub.getAlarmResponseStream(request); + } + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..d4ae3510a2f622b195854e4c7d197b8e3ff4d5fd --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java @@ -0,0 +1,1519 @@ +package monitoring; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: monitoring.proto") +public final class MonitoringServiceGrpc { + + private MonitoringServiceGrpc() {} + + public static final String SERVICE_NAME = "monitoring.MonitoringService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateKpi", + requestType = monitoring.Monitoring.KpiDescriptor.class, + responseType = monitoring.Monitoring.KpiId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateKpiMethod() { + io.grpc.MethodDescriptor getCreateKpiMethod; + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + MonitoringServiceGrpc.getCreateKpiMethod = getCreateKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateKpi")) + .build(); + } + } + } + return getCreateKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiDescriptor", + requestType = monitoring.Monitoring.EditedKpiDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiDescriptorMethod() { + io.grpc.MethodDescriptor getEditKpiDescriptorMethod; + if ((getEditKpiDescriptorMethod = MonitoringServiceGrpc.getEditKpiDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiDescriptorMethod = MonitoringServiceGrpc.getEditKpiDescriptorMethod) == null) { + MonitoringServiceGrpc.getEditKpiDescriptorMethod = getEditKpiDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiDescriptor")) + .build(); + } + } + } + return getEditKpiDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteKpi", + requestType = monitoring.Monitoring.KpiId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteKpiMethod() { + io.grpc.MethodDescriptor getDeleteKpiMethod; + if ((getDeleteKpiMethod = MonitoringServiceGrpc.getDeleteKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getDeleteKpiMethod = MonitoringServiceGrpc.getDeleteKpiMethod) == null) { + MonitoringServiceGrpc.getDeleteKpiMethod = getDeleteKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("DeleteKpi")) + .build(); + } + } + } + return getDeleteKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetKpiDescriptorListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetKpiDescriptorList", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.KpiDescriptorList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetKpiDescriptorListMethod() { + io.grpc.MethodDescriptor getGetKpiDescriptorListMethod; + if ((getGetKpiDescriptorListMethod = MonitoringServiceGrpc.getGetKpiDescriptorListMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetKpiDescriptorListMethod = MonitoringServiceGrpc.getGetKpiDescriptorListMethod) == null) { + MonitoringServiceGrpc.getGetKpiDescriptorListMethod = getGetKpiDescriptorListMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetKpiDescriptorList")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptorList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetKpiDescriptorList")) + .build(); + } + } + } + return getGetKpiDescriptorListMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateBundleKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBundleKpi", + requestType = monitoring.Monitoring.BundleKpiDescriptor.class, + responseType = monitoring.Monitoring.KpiId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateBundleKpiMethod() { + io.grpc.MethodDescriptor getCreateBundleKpiMethod; + if ((getCreateBundleKpiMethod = MonitoringServiceGrpc.getCreateBundleKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateBundleKpiMethod = MonitoringServiceGrpc.getCreateBundleKpiMethod) == null) { + MonitoringServiceGrpc.getCreateBundleKpiMethod = getCreateBundleKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBundleKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateBundleKpi")) + .build(); + } + } + } + return getCreateBundleKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetKpiDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetKpiDescriptor", + requestType = monitoring.Monitoring.KpiId.class, + responseType = monitoring.Monitoring.KpiDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetKpiDescriptorMethod() { + io.grpc.MethodDescriptor getGetKpiDescriptorMethod; + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetKpiDescriptorMethod = getGetKpiDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetKpiDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetKpiDescriptor")) + .build(); + } + } + } + return getGetKpiDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getIncludeKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "IncludeKpi", + requestType = monitoring.Monitoring.Kpi.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getIncludeKpiMethod() { + io.grpc.MethodDescriptor getIncludeKpiMethod; + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + MonitoringServiceGrpc.getIncludeKpiMethod = getIncludeKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "IncludeKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.Kpi.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("IncludeKpi")) + .build(); + } + } + } + return getIncludeKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getMonitorKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MonitorKpi", + requestType = monitoring.Monitoring.MonitorKpiRequest.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getMonitorKpiMethod() { + io.grpc.MethodDescriptor getMonitorKpiMethod; + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + MonitoringServiceGrpc.getMonitorKpiMethod = getMonitorKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MonitorKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("MonitorKpi")) + .build(); + } + } + } + return getMonitorKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getQueryKpiDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "QueryKpiData", + requestType = monitoring.Monitoring.KpiQuery.class, + responseType = monitoring.Monitoring.KpiList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getQueryKpiDataMethod() { + io.grpc.MethodDescriptor getQueryKpiDataMethod; + if ((getQueryKpiDataMethod = MonitoringServiceGrpc.getQueryKpiDataMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getQueryKpiDataMethod = MonitoringServiceGrpc.getQueryKpiDataMethod) == null) { + MonitoringServiceGrpc.getQueryKpiDataMethod = getQueryKpiDataMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryKpiData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiQuery.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("QueryKpiData")) + .build(); + } + } + } + return getQueryKpiDataMethod; + } + + private static volatile io.grpc.MethodDescriptor getSubscribeKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SubscribeKpi", + requestType = monitoring.Monitoring.SubsDescriptor.class, + responseType = monitoring.Monitoring.KpiList.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getSubscribeKpiMethod() { + io.grpc.MethodDescriptor getSubscribeKpiMethod; + if ((getSubscribeKpiMethod = MonitoringServiceGrpc.getSubscribeKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getSubscribeKpiMethod = MonitoringServiceGrpc.getSubscribeKpiMethod) == null) { + MonitoringServiceGrpc.getSubscribeKpiMethod = getSubscribeKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribeKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("SubscribeKpi")) + .build(); + } + } + } + return getSubscribeKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSubsDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSubsDescriptor", + requestType = monitoring.Monitoring.SubscriptionID.class, + responseType = monitoring.Monitoring.SubsDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSubsDescriptorMethod() { + io.grpc.MethodDescriptor getGetSubsDescriptorMethod; + if ((getGetSubsDescriptorMethod = MonitoringServiceGrpc.getGetSubsDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetSubsDescriptorMethod = MonitoringServiceGrpc.getGetSubsDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetSubsDescriptorMethod = getGetSubsDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubsDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubscriptionID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetSubsDescriptor")) + .build(); + } + } + } + return getGetSubsDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSubscriptions", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.SubsIDList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSubscriptionsMethod() { + io.grpc.MethodDescriptor getGetSubscriptionsMethod; + if ((getGetSubscriptionsMethod = MonitoringServiceGrpc.getGetSubscriptionsMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetSubscriptionsMethod = MonitoringServiceGrpc.getGetSubscriptionsMethod) == null) { + MonitoringServiceGrpc.getGetSubscriptionsMethod = getGetSubscriptionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsIDList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetSubscriptions")) + .build(); + } + } + } + return getGetSubscriptionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiSubscription", + requestType = monitoring.Monitoring.SubsDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiSubscriptionMethod() { + io.grpc.MethodDescriptor getEditKpiSubscriptionMethod; + if ((getEditKpiSubscriptionMethod = MonitoringServiceGrpc.getEditKpiSubscriptionMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiSubscriptionMethod = MonitoringServiceGrpc.getEditKpiSubscriptionMethod) == null) { + MonitoringServiceGrpc.getEditKpiSubscriptionMethod = getEditKpiSubscriptionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiSubscription")) + .build(); + } + } + } + return getEditKpiSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateKpiAlarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateKpiAlarm", + requestType = monitoring.Monitoring.AlarmDescriptor.class, + responseType = monitoring.Monitoring.AlarmID.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateKpiAlarmMethod() { + io.grpc.MethodDescriptor getCreateKpiAlarmMethod; + if ((getCreateKpiAlarmMethod = MonitoringServiceGrpc.getCreateKpiAlarmMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateKpiAlarmMethod = MonitoringServiceGrpc.getCreateKpiAlarmMethod) == null) { + MonitoringServiceGrpc.getCreateKpiAlarmMethod = getCreateKpiAlarmMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateKpiAlarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateKpiAlarm")) + .build(); + } + } + } + return getCreateKpiAlarmMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiAlarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiAlarm", + requestType = monitoring.Monitoring.AlarmDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiAlarmMethod() { + io.grpc.MethodDescriptor getEditKpiAlarmMethod; + if ((getEditKpiAlarmMethod = MonitoringServiceGrpc.getEditKpiAlarmMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiAlarmMethod = MonitoringServiceGrpc.getEditKpiAlarmMethod) == null) { + MonitoringServiceGrpc.getEditKpiAlarmMethod = getEditKpiAlarmMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiAlarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiAlarm")) + .build(); + } + } + } + return getEditKpiAlarmMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarms", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.AlarmIDList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAlarmsMethod() { + io.grpc.MethodDescriptor getGetAlarmsMethod; + if ((getGetAlarmsMethod = MonitoringServiceGrpc.getGetAlarmsMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmsMethod = MonitoringServiceGrpc.getGetAlarmsMethod) == null) { + MonitoringServiceGrpc.getGetAlarmsMethod = getGetAlarmsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmIDList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarms")) + .build(); + } + } + } + return getGetAlarmsMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarmDescriptor", + requestType = monitoring.Monitoring.AlarmID.class, + responseType = monitoring.Monitoring.AlarmDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAlarmDescriptorMethod() { + io.grpc.MethodDescriptor getGetAlarmDescriptorMethod; + if ((getGetAlarmDescriptorMethod = MonitoringServiceGrpc.getGetAlarmDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmDescriptorMethod = MonitoringServiceGrpc.getGetAlarmDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetAlarmDescriptorMethod = getGetAlarmDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarmDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarmDescriptor")) + .build(); + } + } + } + return getGetAlarmDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarmResponseStream", + requestType = monitoring.Monitoring.AlarmID.class, + responseType = monitoring.Monitoring.AlarmResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod() { + io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod; + if ((getGetAlarmResponseStreamMethod = MonitoringServiceGrpc.getGetAlarmResponseStreamMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmResponseStreamMethod = MonitoringServiceGrpc.getGetAlarmResponseStreamMethod) == null) { + MonitoringServiceGrpc.getGetAlarmResponseStreamMethod = getGetAlarmResponseStreamMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarmResponseStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmResponse.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarmResponseStream")) + .build(); + } + } + } + return getGetAlarmResponseStreamMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MonitoringServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + }; + return MonitoringServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MonitoringServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + }; + return MonitoringServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MonitoringServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + }; + return MonitoringServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateKpiMethod(), responseObserver); + } + + /** + */ + public void editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiDescriptorMethod(), responseObserver); + } + + /** + */ + public void deleteKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteKpiMethod(), responseObserver); + } + + /** + */ + public void getKpiDescriptorList(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetKpiDescriptorListMethod(), responseObserver); + } + + /** + */ + public void createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateBundleKpiMethod(), responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetKpiDescriptorMethod(), responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIncludeKpiMethod(), responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMonitorKpiMethod(), responseObserver); + } + + /** + */ + public void queryKpiData(monitoring.Monitoring.KpiQuery request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getQueryKpiDataMethod(), responseObserver); + } + + /** + */ + public void subscribeKpi(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscribeKpiMethod(), responseObserver); + } + + /** + */ + public void getSubsDescriptor(monitoring.Monitoring.SubscriptionID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSubsDescriptorMethod(), responseObserver); + } + + /** + */ + public void getSubscriptions(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSubscriptionsMethod(), responseObserver); + } + + /** + */ + public void editKpiSubscription(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiSubscriptionMethod(), responseObserver); + } + + /** + */ + public void createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateKpiAlarmMethod(), responseObserver); + } + + /** + */ + public void editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiAlarmMethod(), responseObserver); + } + + /** + */ + public void getAlarms(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmsMethod(), responseObserver); + } + + /** + */ + public void getAlarmDescriptor(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmDescriptorMethod(), responseObserver); + } + + /** + */ + public void getAlarmResponseStream(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmResponseStreamMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI))) + .addMethod( + getEditKpiDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.EditedKpiDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_DESCRIPTOR))) + .addMethod( + getDeleteKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_KPI))) + .addMethod( + getGetKpiDescriptorListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.KpiDescriptorList>( + this, METHODID_GET_KPI_DESCRIPTOR_LIST))) + .addMethod( + getCreateBundleKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.BundleKpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_BUNDLE_KPI))) + .addMethod( + getGetKpiDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR))) + .addMethod( + getIncludeKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI))) + .addMethod( + getMonitorKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI))) + .addMethod( + getQueryKpiDataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiQuery, + monitoring.Monitoring.KpiList>( + this, METHODID_QUERY_KPI_DATA))) + .addMethod( + getSubscribeKpiMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + monitoring.Monitoring.KpiList>( + this, METHODID_SUBSCRIBE_KPI))) + .addMethod( + getGetSubsDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubscriptionID, + monitoring.Monitoring.SubsDescriptor>( + this, METHODID_GET_SUBS_DESCRIPTOR))) + .addMethod( + getGetSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.SubsIDList>( + this, METHODID_GET_SUBSCRIPTIONS))) + .addMethod( + getEditKpiSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_SUBSCRIPTION))) + .addMethod( + getCreateKpiAlarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + monitoring.Monitoring.AlarmID>( + this, METHODID_CREATE_KPI_ALARM))) + .addMethod( + getEditKpiAlarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_ALARM))) + .addMethod( + getGetAlarmsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.AlarmIDList>( + this, METHODID_GET_ALARMS))) + .addMethod( + getGetAlarmDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmDescriptor>( + this, METHODID_GET_ALARM_DESCRIPTOR))) + .addMethod( + getGetAlarmResponseStreamMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmResponse>( + this, METHODID_GET_ALARM_RESPONSE_STREAM))) + .build(); + } + } + + /** + */ + public static final class MonitoringServiceStub extends io.grpc.stub.AbstractAsyncStub { + private MonitoringServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getKpiDescriptorList(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetKpiDescriptorListMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBundleKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void queryKpiData(monitoring.Monitoring.KpiQuery request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getQueryKpiDataMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void subscribeKpi(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getSubscribeKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSubsDescriptor(monitoring.Monitoring.SubscriptionID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSubsDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSubscriptions(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSubscriptionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiSubscription(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiSubscriptionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateKpiAlarmMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiAlarmMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarms(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAlarmsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarmDescriptor(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAlarmDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarmResponseStream(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetAlarmResponseStreamMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class MonitoringServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private MonitoringServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + + /** + */ + public monitoring.Monitoring.KpiId createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateKpiMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty deleteKpi(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiDescriptorList getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetKpiDescriptorListMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiId createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBundleKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetKpiDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty includeKpi(monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getIncludeKpiMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMonitorKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiList queryKpiData(monitoring.Monitoring.KpiQuery request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getQueryKpiDataMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator subscribeKpi( + monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getSubscribeKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.SubsDescriptor getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSubsDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.SubsIDList getSubscriptions(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSubscriptionsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiSubscriptionMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmID createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateKpiAlarmMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiAlarmMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmIDList getAlarms(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAlarmsMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmDescriptor getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAlarmDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getAlarmResponseStream( + monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetAlarmResponseStreamMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class MonitoringServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private MonitoringServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createKpi( + monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiDescriptor( + monitoring.Monitoring.EditedKpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteKpi( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getKpiDescriptorList( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetKpiDescriptorListMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createBundleKpi( + monitoring.Monitoring.BundleKpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBundleKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getKpiDescriptor( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture includeKpi( + monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture monitorKpi( + monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture queryKpiData( + monitoring.Monitoring.KpiQuery request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getQueryKpiDataMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSubsDescriptor( + monitoring.Monitoring.SubscriptionID request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSubsDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSubscriptions( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSubscriptionsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiSubscription( + monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiSubscriptionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createKpiAlarm( + monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateKpiAlarmMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiAlarm( + monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiAlarmMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getAlarms( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAlarmsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getAlarmDescriptor( + monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAlarmDescriptorMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_EDIT_KPI_DESCRIPTOR = 1; + private static final int METHODID_DELETE_KPI = 2; + private static final int METHODID_GET_KPI_DESCRIPTOR_LIST = 3; + private static final int METHODID_CREATE_BUNDLE_KPI = 4; + private static final int METHODID_GET_KPI_DESCRIPTOR = 5; + private static final int METHODID_INCLUDE_KPI = 6; + private static final int METHODID_MONITOR_KPI = 7; + private static final int METHODID_QUERY_KPI_DATA = 8; + private static final int METHODID_SUBSCRIBE_KPI = 9; + private static final int METHODID_GET_SUBS_DESCRIPTOR = 10; + private static final int METHODID_GET_SUBSCRIPTIONS = 11; + private static final int METHODID_EDIT_KPI_SUBSCRIPTION = 12; + private static final int METHODID_CREATE_KPI_ALARM = 13; + private static final int METHODID_EDIT_KPI_ALARM = 14; + private static final int METHODID_GET_ALARMS = 15; + private static final int METHODID_GET_ALARM_DESCRIPTOR = 16; + private static final int METHODID_GET_ALARM_RESPONSE_STREAM = 17; + + 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 MonitoringServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MonitoringServiceImplBase 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_CREATE_KPI: + serviceImpl.createKpi((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_DESCRIPTOR: + serviceImpl.editKpiDescriptor((monitoring.Monitoring.EditedKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_KPI: + serviceImpl.deleteKpi((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_KPI_DESCRIPTOR_LIST: + serviceImpl.getKpiDescriptorList((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BUNDLE_KPI: + serviceImpl.createBundleKpi((monitoring.Monitoring.BundleKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_KPI_DESCRIPTOR: + serviceImpl.getKpiDescriptor((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INCLUDE_KPI: + serviceImpl.includeKpi((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MONITOR_KPI: + serviceImpl.monitorKpi((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_QUERY_KPI_DATA: + serviceImpl.queryKpiData((monitoring.Monitoring.KpiQuery) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SUBSCRIBE_KPI: + serviceImpl.subscribeKpi((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SUBS_DESCRIPTOR: + serviceImpl.getSubsDescriptor((monitoring.Monitoring.SubscriptionID) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SUBSCRIPTIONS: + serviceImpl.getSubscriptions((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_SUBSCRIPTION: + serviceImpl.editKpiSubscription((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_KPI_ALARM: + serviceImpl.createKpiAlarm((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_ALARM: + serviceImpl.editKpiAlarm((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARMS: + serviceImpl.getAlarms((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARM_DESCRIPTOR: + serviceImpl.getAlarmDescriptor((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARM_RESPONSE_STREAM: + serviceImpl.getAlarmResponseStream((monitoring.Monitoring.AlarmID) 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 MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MonitoringServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return monitoring.Monitoring.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MonitoringService"); + } + } + + private static final class MonitoringServiceFileDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier { + MonitoringServiceFileDescriptorSupplier() {} + } + + private static final class MonitoringServiceMethodDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MonitoringServiceMethodDescriptorSupplier(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 (MonitoringServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MonitoringServiceFileDescriptorSupplier()) + .addMethod(getCreateKpiMethod()) + .addMethod(getEditKpiDescriptorMethod()) + .addMethod(getDeleteKpiMethod()) + .addMethod(getGetKpiDescriptorListMethod()) + .addMethod(getCreateBundleKpiMethod()) + .addMethod(getGetKpiDescriptorMethod()) + .addMethod(getIncludeKpiMethod()) + .addMethod(getMonitorKpiMethod()) + .addMethod(getQueryKpiDataMethod()) + .addMethod(getSubscribeKpiMethod()) + .addMethod(getGetSubsDescriptorMethod()) + .addMethod(getGetSubscriptionsMethod()) + .addMethod(getEditKpiSubscriptionMethod()) + .addMethod(getCreateKpiAlarmMethod()) + .addMethod(getEditKpiAlarmMethod()) + .addMethod(getGetAlarmsMethod()) + .addMethod(getGetAlarmDescriptorMethod()) + .addMethod(getGetAlarmResponseStreamMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..46f442b743ee176a83a416fe13711beda6baf937 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java @@ -0,0 +1,528 @@ +package monitoring; + +import static monitoring.MonitoringServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public final class MutinyMonitoringServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyMonitoringServiceGrpc() {} + + public static MutinyMonitoringServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyMonitoringServiceStub(channel); + } + + + public static final class MutinyMonitoringServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub { + private MonitoringServiceGrpc.MonitoringServiceStub delegateStub; + + private MutinyMonitoringServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = MonitoringServiceGrpc.newStub(channel); + } + + private MutinyMonitoringServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = MonitoringServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyMonitoringServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyMonitoringServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createKpi); + } + + + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiDescriptor); + } + + + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::deleteKpi); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getKpiDescriptorList); + } + + + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createBundleKpi); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getKpiDescriptor); + } + + + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::includeKpi); + } + + + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::monitorKpi); + } + + + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::queryKpiData); + } + + + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSubsDescriptor); + } + + + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSubscriptions); + } + + + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiSubscription); + } + + + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createKpiAlarm); + } + + + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiAlarm); + } + + + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getAlarms); + } + + + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getAlarmDescriptor); + } + + + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::subscribeKpi); + } + + + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getAlarmResponseStream); + } + + } + + + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public MonitoringServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.EditedKpiDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getDeleteKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetKpiDescriptorListMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.KpiDescriptorList>( + this, METHODID_GET_KPI_DESCRIPTOR_LIST, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateBundleKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.BundleKpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_BUNDLE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetKpiDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getIncludeKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getMonitorKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getQueryKpiDataMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiQuery, + monitoring.Monitoring.KpiList>( + this, METHODID_QUERY_KPI_DATA, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getSubscribeKpiMethod(), + asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + monitoring.Monitoring.KpiList>( + this, METHODID_SUBSCRIBE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetSubsDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubscriptionID, + monitoring.Monitoring.SubsDescriptor>( + this, METHODID_GET_SUBS_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetSubscriptionsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.SubsIDList>( + this, METHODID_GET_SUBSCRIPTIONS, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiSubscriptionMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_SUBSCRIPTION, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateKpiAlarmMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + monitoring.Monitoring.AlarmID>( + this, METHODID_CREATE_KPI_ALARM, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiAlarmMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_ALARM, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.AlarmIDList>( + this, METHODID_GET_ALARMS, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmDescriptor>( + this, METHODID_GET_ALARM_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmResponseStreamMethod(), + asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmResponse>( + this, METHODID_GET_ALARM_RESPONSE_STREAM, compression))) + .build(); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_EDIT_KPI_DESCRIPTOR = 1; + private static final int METHODID_DELETE_KPI = 2; + private static final int METHODID_GET_KPI_DESCRIPTOR_LIST = 3; + private static final int METHODID_CREATE_BUNDLE_KPI = 4; + private static final int METHODID_GET_KPI_DESCRIPTOR = 5; + private static final int METHODID_INCLUDE_KPI = 6; + private static final int METHODID_MONITOR_KPI = 7; + private static final int METHODID_QUERY_KPI_DATA = 8; + private static final int METHODID_SUBSCRIBE_KPI = 9; + private static final int METHODID_GET_SUBS_DESCRIPTOR = 10; + private static final int METHODID_GET_SUBSCRIPTIONS = 11; + private static final int METHODID_EDIT_KPI_SUBSCRIPTION = 12; + private static final int METHODID_CREATE_KPI_ALARM = 13; + private static final int METHODID_EDIT_KPI_ALARM = 14; + private static final int METHODID_GET_ALARMS = 15; + private static final int METHODID_GET_ALARM_DESCRIPTOR = 16; + private static final int METHODID_GET_ALARM_RESPONSE_STREAM = 17; + + 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 MonitoringServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(MonitoringServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createKpi); + break; + case METHODID_EDIT_KPI_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.EditedKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiDescriptor); + break; + case METHODID_DELETE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::deleteKpi); + break; + case METHODID_GET_KPI_DESCRIPTOR_LIST: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getKpiDescriptorList); + break; + case METHODID_CREATE_BUNDLE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.BundleKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createBundleKpi); + break; + case METHODID_GET_KPI_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getKpiDescriptor); + break; + case METHODID_INCLUDE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::includeKpi); + break; + case METHODID_MONITOR_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::monitorKpi); + break; + case METHODID_QUERY_KPI_DATA: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiQuery) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::queryKpiData); + break; + case METHODID_SUBSCRIBE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::subscribeKpi); + break; + case METHODID_GET_SUBS_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.SubscriptionID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSubsDescriptor); + break; + case METHODID_GET_SUBSCRIPTIONS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSubscriptions); + break; + case METHODID_EDIT_KPI_SUBSCRIPTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiSubscription); + break; + case METHODID_CREATE_KPI_ALARM: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createKpiAlarm); + break; + case METHODID_EDIT_KPI_ALARM: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiAlarm); + break; + case METHODID_GET_ALARMS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarms); + break; + case METHODID_GET_ALARM_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarmDescriptor); + break; + case METHODID_GET_ALARM_RESPONSE_STREAM: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarmResponseStream); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke(io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/automation/target/kubernetes/kubernetes.yml b/src/automation/target/kubernetes/kubernetes.yml index 73d19dc1f9e0c6f12b7d660dde71927dda7c07cc..f5cea3757989504c02ee45db20a1a2ef80b28f98 100644 --- a/src/automation/target/kubernetes/kubernetes.yml +++ b/src/automation/target/kubernetes/kubernetes.yml @@ -3,11 +3,10 @@ apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479 + app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000 labels: app.kubernetes.io/name: automationservice - app.kubernetes.io/version: 0.0.1 app: automationservice name: automationservice spec: @@ -15,40 +14,36 @@ spec: - name: http port: 8080 targetPort: 8080 - - name: grpc-server - port: 9999 - targetPort: 9999 + - name: grpc + port: 5050 + targetPort: 5050 selector: app.kubernetes.io/name: automationservice - app.kubernetes.io/version: 0.0.1 - type: NodePort + type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479 + app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice - app.kubernetes.io/version: 0.0.1 name: automationservice spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: automationservice - app.kubernetes.io/version: 0.0.1 template: metadata: annotations: - app.quarkus.io/commit-id: 6b96f471f66e6bb59357856c635f8d7e1ce98a5c - app.quarkus.io/build-timestamp: 2021-11-19 - 15:03:07 +0000 + app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479 + app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice - app.kubernetes.io/version: 0.0.1 spec: containers: - env: @@ -56,11 +51,11 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - - name: DEVICE_SERVICE_HOST - value: DeviceService - name: CONTEXT_SERVICE_HOST value: ContextService - image: registry.gitlab.com/teraflow-h2020/controller/automation:0.0.1 + - name: DEVICE_SERVICE_HOST + value: DeviceService + image: registry.gitlab.com/teraflow-h2020/controller/automation:0.2.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -68,8 +63,8 @@ spec: path: /q/health/live port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 name: automationservice @@ -77,8 +72,8 @@ spec: - containerPort: 8080 name: http protocol: TCP - - containerPort: 9999 - name: grpc-server + - containerPort: 5050 + name: grpc protocol: TCP readinessProbe: failureThreshold: 3 @@ -86,7 +81,7 @@ spec: path: /q/health/ready port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 diff --git a/src/l3_distributedattackdetector/genproto.sh b/src/automation/util/set_version.sh old mode 100644 new mode 100755 similarity index 51% rename from src/l3_distributedattackdetector/genproto.sh rename to src/automation/util/set_version.sh index 9ca93e30e45fbdc89eb4837fcf2e9fb8cbd2f3ee..9022286a9359b908b9fa3764a21df080ec08ffb2 --- a/src/l3_distributedattackdetector/genproto.sh +++ b/src/automation/util/set_version.sh @@ -1,6 +1,5 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC +#!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,16 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e +set -eu -# Make folder containing the script the root folder for its execution -cd $(dirname $0) +if (( $# != 1 )); then + echo "Usage: set_version.sh " >&2 + exit 1 +fi -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py +version="$1" -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto +if [ "$(git status --untracked-files=no --porcelain)" ]; then + printf "Uncommitted changes in tracked files.\nPlease commit first and then run the script!\n" + exit 0; +fi -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2_grpc.py +./mvnw versions:set versions:commit -DnewVersion="${version}" +git commit -am "release(automation): ${version}" diff --git a/src/build.sh b/src/build.sh index 19f4e6ed2ef9fe597cb8ba7fd46a7f1b305a6546..297ab196faad327eba279d3acc7065832edfbdd1 100755 --- a/src/build.sh +++ b/src/build.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # Make folder containing the script the root folder for its execution cd $(dirname $0) diff --git a/src/centralizedattackdetector/.gitlab-ci.yml b/src/centralizedattackdetector/.gitlab-ci.yml deleted file mode 100644 index c2e4d7a4d360b90fc7e8cedef83aae69c1d07d5d..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/.gitlab-ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry -build centralizedattackdetector: - variables: - IMAGE_NAME: 'centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'centralizedattackdetector-test' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: build - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - rules: - - changes: - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test centralizedattackdetector: - variables: - IMAGE_NAME: 'centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'centralizedattackdetector-test' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: unit_test - needs: - - build centralizedattackdetector - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - script: - - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run -d -p 10000:10000 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a - - sleep 5 - - docker ps -a - - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" - after_script: - - docker stop $IMAGE_NAME - - docker rm $IMAGE_NAME - rules: - - changes: - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Deployment of the service in Kubernetes Cluster -deploy centralizedattackdetector: - stage: deploy - needs: - - build centralizedattackdetector - - unit_test centralizedattackdetector - - dependencies all - - integ_test execute - script: - - kubectl version - - kubectl get all - - kubectl apply -f "manifests/centralizedattackdetectorservice.yaml" - - kubectl delete pods --selector app=centralizedattackdetectorservice - - kubectl get all diff --git a/src/centralizedattackdetector/Config.py b/src/centralizedattackdetector/Config.py deleted file mode 100644 index 3a122c7590bdda97f7be1cc4ec331cb86b5f8dd4..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/Config.py +++ /dev/null @@ -1,12 +0,0 @@ -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 10000 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 diff --git a/src/centralizedattackdetector/Dockerfile b/src/centralizedattackdetector/Dockerfile deleted file mode 100644 index f683a8c853f1741ee3dbb1031a6df4aa00419d42..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM python:3-slim - -# Install dependencies -RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ - rm -rf /var/lib/apt/lists/* - -# Set Python to show logs as they occur -ENV PYTHONUNBUFFERED=0 - -# Download the gRPC health probe -RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ - wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ - chmod +x /bin/grpc_health_probe - -# Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools - -# Set working directory -WORKDIR /var/teraflow - -# Create module sub-folders -RUN mkdir -p /var/teraflow/centralizedcybersecurity - -# Get Python packages per module -COPY centralizedattackdetector/requirements.in centralizedattackdetector/requirements.in -RUN pip-compile --output-file=centralizedattackdetector/requirements.txt centralizedattackdetector/requirements.in -RUN python3 -m pip install -r centralizedattackdetector/requirements.txt - -# Add files into working directory -COPY common/. common -COPY centralizedattackdetector/. centralizedattackdetector - -# Start centralizedattackdetector service -ENTRYPOINT ["python", "-m", "centralizedattackdetector.service"] diff --git a/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py b/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py deleted file mode 100644 index da367972af24601500bf9844e26891cbd7bcc35b..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/client/CentralizedAttackDetectorClient.py +++ /dev/null @@ -1,55 +0,0 @@ -import grpc, logging -from common.tools.client.RetryDecorator import retry, delay_exponential -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import KpiList -from centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import CentralizedAttackDetectorServiceStub - -LOGGER = logging.getLogger(__name__) -MAX_RETRIES = 15 -DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) - -class CentralizedAttackDetectorClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) - LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) - self.channel = None - self.stub = None - self.connect() - LOGGER.debug('Channel created') - - def connect(self): - self.channel = grpc.insecure_channel(self.endpoint) - self.stub = CentralizedAttackDetectorServiceStub(self.channel) - - def close(self): - if(self.channel is not None): self.channel.close() - self.channel = None - self.stub = None - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def NotifyServiceUpdate(self, request : Service) -> Empty: - LOGGER.debug('NotifyServiceUpdate request: {:s}'.format(str(request))) - response = self.stub.NotifyServiceUpdate(request) - LOGGER.debug('NotifyServiceUpdate result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def DetectAttack(self, request : Empty) -> Empty: - LOGGER.debug('DetectAttack request: {:s}'.format(str(request))) - response = self.stub.DetectAttack(request) - LOGGER.debug('DetectAttack result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def ReportSummarizedKpi(self, request : KpiList) -> Empty: - LOGGER.debug('ReportSummarizedKpi request: {:s}'.format(str(request))) - response = self.stub.ReportSummarizedKpi(request) - LOGGER.debug('ReportSummarizedKpi result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def ReportKpi(self, request : KpiList) -> Empty: - LOGGER.debug('ReportKpi request: {:s}'.format(str(request))) - response = self.stub.ReportKpi(request) - LOGGER.debug('ReportKpi result: {:s}'.format(str(response))) - return response diff --git a/src/centralizedattackdetector/genproto.sh b/src/centralizedattackdetector/genproto.sh deleted file mode 100755 index 548428f37721abde24d35780207343208aa8f4b9..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/genproto.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -# building protos of services used -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto - -rm proto/context_pb2_grpc.py -rm proto/service_pb2_grpc.py -rm proto/monitoring_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py - -# building current service protos -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto centralized_attack_detector.proto - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/centralized_attack_detector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/centralized_attack_detector_pb2_grpc.py diff --git a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py b/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py deleted file mode 100644 index a8a6d000f7627238b39986f0f7e9911f0d4cf1e7..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: centralized_attack_detector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='centralized_attack_detector.proto', - package='centralized_attack_detector', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n!centralized_attack_detector.proto\x12\x1b\x63\x65ntralized_attack_detector\x1a\rcontext.proto\x1a\x10monitoring.proto2\x81\x02\n CentralizedAttackDetectorService\x12\x39\n\x13NotifyServiceUpdate\x12\x10.context.Service\x1a\x0e.context.Empty\"\x00\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12<\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_CENTRALIZEDATTACKDETECTORSERVICE = _descriptor.ServiceDescriptor( - name='CentralizedAttackDetectorService', - full_name='centralized_attack_detector.CentralizedAttackDetectorService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=100, - serialized_end=357, - methods=[ - _descriptor.MethodDescriptor( - name='NotifyServiceUpdate', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.NotifyServiceUpdate', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DetectAttack', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.DetectAttack', - index=1, - containing_service=None, - input_type=context__pb2._EMPTY, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ReportSummarizedKpi', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.ReportSummarizedKpi', - index=2, - containing_service=None, - input_type=monitoring__pb2._KPILIST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ReportKpi', - full_name='centralized_attack_detector.CentralizedAttackDetectorService.ReportKpi', - index=3, - containing_service=None, - input_type=monitoring__pb2._KPILIST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CENTRALIZEDATTACKDETECTORSERVICE) - -DESCRIPTOR.services_by_name['CentralizedAttackDetectorService'] = _CENTRALIZEDATTACKDETECTORSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py b/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py deleted file mode 100644 index 418acbf19eb1a2a43889234626adb20d5dce1186..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/centralized_attack_detector_pb2_grpc.py +++ /dev/null @@ -1,168 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -class CentralizedAttackDetectorServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.NotifyServiceUpdate = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/NotifyServiceUpdate', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.DetectAttack = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/DetectAttack', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportSummarizedKpi = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/ReportSummarizedKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.ReportKpi = channel.unary_unary( - '/centralized_attack_detector.CentralizedAttackDetectorService/ReportKpi', - request_serializer=monitoring__pb2.KpiList.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - - -class CentralizedAttackDetectorServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def NotifyServiceUpdate(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DetectAttack(self, request, context): - """rpc that triggers the attack detection loop - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportSummarizedKpi(self, request, context): - """rpc called by the distributed component to report KPIs - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ReportKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_CentralizedAttackDetectorServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'NotifyServiceUpdate': grpc.unary_unary_rpc_method_handler( - servicer.NotifyServiceUpdate, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'DetectAttack': grpc.unary_unary_rpc_method_handler( - servicer.DetectAttack, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportSummarizedKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'ReportKpi': grpc.unary_unary_rpc_method_handler( - servicer.ReportKpi, - request_deserializer=monitoring__pb2.KpiList.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'centralized_attack_detector.CentralizedAttackDetectorService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class CentralizedAttackDetectorService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def NotifyServiceUpdate(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.CentralizedAttackDetectorService/NotifyServiceUpdate', - context__pb2.Service.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DetectAttack(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.CentralizedAttackDetectorService/DetectAttack', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportSummarizedKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.CentralizedAttackDetectorService/ReportSummarizedKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ReportKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.CentralizedAttackDetectorService/ReportKpi', - monitoring__pb2.KpiList.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/centralizedattackdetector/proto/context_pb2.py b/src/centralizedattackdetector/proto/context_pb2.py deleted file mode 100644 index 8b4848bc33bfb0eba76590c8a3a627b2db84ca9f..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/context_pb2.py +++ /dev/null @@ -1,2535 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"K\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' -) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3468, - serialized_end=3574, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3577, - serialized_end=3774, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3777, - serialized_end=3920, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3923, - serialized_end=4052, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4055, - serialized_end=4191, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4193, - serialized_end=4286, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=26, - serialized_end=33, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=35, - serialized_end=55, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=57, - serialized_end=127, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=129, - serialized_end=177, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=180, - serialized_end=362, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=364, - serialized_end=420, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=422, - serialized_end=471, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=473, - serialized_end=558, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=560, - serialized_end=650, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=652, - serialized_end=778, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=780, - serialized_end=839, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=841, - serialized_end=894, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=896, - serialized_end=984, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=986, - serialized_end=1032, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1035, - serialized_end=1317, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1319, - serialized_end=1376, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1378, - serialized_end=1431, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1433, - serialized_end=1479, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1481, - serialized_end=1563, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1565, - serialized_end=1607, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1609, - serialized_end=1697, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1699, - serialized_end=1746, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1748, - serialized_end=1788, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1790, - serialized_end=1866, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1868, - serialized_end=1956, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1959, - serialized_end=2253, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2255, - serialized_end=2322, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2324, - serialized_end=2382, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2384, - serialized_end=2440, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2442, - serialized_end=2491, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2493, - serialized_end=2578, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2581, - serialized_end=2711, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2713, - serialized_end=2788, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2790, - serialized_end=2891, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2893, - serialized_end=2956, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2958, - serialized_end=3012, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3015, - serialized_end=3156, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3158, - serialized_end=3223, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3225, - serialized_end=3283, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3285, - serialized_end=3379, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3381, - serialized_end=3466, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4289, - serialized_end=5990, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/monitoring_pb2.py b/src/centralizedattackdetector/proto/monitoring_pb2.py deleted file mode 100644 index 0a5e4d990fb3ea82734080e4fde8086977bdedbb..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/monitoring_pb2.py +++ /dev/null @@ -1,656 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"\x84\x01\n\x10\x43reateKpiRequest\x12\x16\n\x0ekpiDescription\x18\x01 \x01(\t\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12\x32\n\x0fkpi_sample_type\x18\x03 \x01(\x0e\x32\x19.monitoring.KpiSampleType\"h\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"i\n\x17MonitorDeviceKpiRequest\x12\x1c\n\x03kpi\x18\x01 \x01(\x0b\x32\x0f.monitoring.Kpi\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"s\n\x11IncludeKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x12\n\ntime_stamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x03 \x01(\x0b\x32\x14.monitoring.KpiValue\"\xd6\x01\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\x12\x32\n\x0fkpi_sample_type\x18\x05 \x01(\x0e\x32\x19.monitoring.KpiSampleType\x12$\n\tdevice_id\x18\x06 \x01(\x0b\x32\x11.context.DeviceId\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value*x\n\rKpiSampleType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\x13PACKETS_TRANSMITTED\x10\x65\x12\x14\n\x10PACKETS_RECEIVED\x10\x66\x12\x16\n\x11\x42YTES_TRANSMITTED\x10\xc9\x01\x12\x13\n\x0e\x42YTES_RECEIVED\x10\xca\x01\x32\x8b\x03\n\x11MonitoringService\x12>\n\tCreateKpi\x12\x1c.monitoring.CreateKpiRequest\x1a\x11.monitoring.KpiId\"\x00\x12=\n\nIncludeKpi\x12\x1d.monitoring.IncludeKpiRequest\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12I\n\x10MonitorDeviceKpi\x12#.monitoring.MonitorDeviceKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='monitoring.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=979, - serialized_end=1099, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -UNKNOWN = 0 -PACKETS_TRANSMITTED = 101 -PACKETS_RECEIVED = 102 -BYTES_TRANSMITTED = 201 -BYTES_RECEIVED = 202 - - - -_CREATEKPIREQUEST = _descriptor.Descriptor( - name='CreateKpiRequest', - full_name='monitoring.CreateKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpiDescription', full_name='monitoring.CreateKpiRequest.kpiDescription', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.CreateKpiRequest.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.CreateKpiRequest.kpi_sample_type', index=2, - number=3, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=48, - serialized_end=180, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='connexion_time_s', full_name='monitoring.MonitorKpiRequest.connexion_time_s', index=1, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sample_rate_ms', full_name='monitoring.MonitorKpiRequest.sample_rate_ms', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=182, - serialized_end=286, -) - - -_MONITORDEVICEKPIREQUEST = _descriptor.Descriptor( - name='MonitorDeviceKpiRequest', - full_name='monitoring.MonitorDeviceKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi', full_name='monitoring.MonitorDeviceKpiRequest.kpi', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='connexion_time_s', full_name='monitoring.MonitorDeviceKpiRequest.connexion_time_s', index=1, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sample_rate_ms', full_name='monitoring.MonitorDeviceKpiRequest.sample_rate_ms', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=288, - serialized_end=393, -) - - -_INCLUDEKPIREQUEST = _descriptor.Descriptor( - name='IncludeKpiRequest', - full_name='monitoring.IncludeKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.IncludeKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_stamp', full_name='monitoring.IncludeKpiRequest.time_stamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.IncludeKpiRequest.kpi_value', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=395, - serialized_end=510, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpiDescription', full_name='monitoring.Kpi.kpiDescription', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.Kpi.kpi_sample_type', index=4, - number=5, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.Kpi.device_id', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=513, - serialized_end=727, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=729, - serialized_end=767, -) - - -_KPIDEVICE = _descriptor.Descriptor( - name='KpiDevice', - full_name='monitoring.KpiDevice', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiDevice.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.KpiDevice.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=769, - serialized_end=853, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpiList', full_name='monitoring.KpiList.kpiList', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=855, - serialized_end=898, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='boolVal', full_name='monitoring.KpiValue.boolVal', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=900, - serialized_end=977, -) - -_CREATEKPIREQUEST.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_CREATEKPIREQUEST.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_MONITORDEVICEKPIREQUEST.fields_by_name['kpi'].message_type = _KPI -_INCLUDEKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_INCLUDEKPIREQUEST.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPI.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE -_KPI.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPIDEVICE.fields_by_name['kpi_id'].message_type = _KPIID -_KPIDEVICE.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPILIST.fields_by_name['kpiList'].message_type = _KPI -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -DESCRIPTOR.message_types_by_name['CreateKpiRequest'] = _CREATEKPIREQUEST -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['MonitorDeviceKpiRequest'] = _MONITORDEVICEKPIREQUEST -DESCRIPTOR.message_types_by_name['IncludeKpiRequest'] = _INCLUDEKPIREQUEST -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['KpiDevice'] = _KPIDEVICE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateKpiRequest = _reflection.GeneratedProtocolMessageType('CreateKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _CREATEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.CreateKpiRequest) - }) -_sym_db.RegisterMessage(CreateKpiRequest) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -MonitorDeviceKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorDeviceKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORDEVICEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorDeviceKpiRequest) - }) -_sym_db.RegisterMessage(MonitorDeviceKpiRequest) - -IncludeKpiRequest = _reflection.GeneratedProtocolMessageType('IncludeKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _INCLUDEKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.IncludeKpiRequest) - }) -_sym_db.RegisterMessage(IncludeKpiRequest) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), { - 'DESCRIPTOR' : _KPIDEVICE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDevice) - }) -_sym_db.RegisterMessage(KpiDevice) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=1102, - serialized_end=1497, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_CREATEKPIREQUEST, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=1, - containing_service=None, - input_type=_INCLUDEKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=2, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorDeviceKpi', - full_name='monitoring.MonitoringService.MonitorDeviceKpi', - index=3, - containing_service=None, - input_type=_MONITORDEVICEKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/proto/service_pb2.py b/src/centralizedattackdetector/proto/service_pb2.py deleted file mode 100644 index 7a006915b8be39710a17faab075e382e322d918f..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/proto/service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='service.proto', - package='service', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_SERVICESERVICE = _descriptor.ServiceDescriptor( - name='ServiceService', - full_name='service.ServiceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=42, - serialized_end=295, - methods=[ - _descriptor.MethodDescriptor( - name='CreateService', - full_name='service.ServiceService.CreateService', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UpdateService', - full_name='service.ServiceService.UpdateService', - index=1, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteService', - full_name='service.ServiceService.DeleteService', - index=2, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_SERVICESERVICE) - -DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/centralizedattackdetector/requirements.in b/src/centralizedattackdetector/requirements.in deleted file mode 100644 index 25abdad1b5767117956a88b816399635348884c7..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/requirements.in +++ /dev/null @@ -1,6 +0,0 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis diff --git a/src/centralizedattackdetector/requirements.txt b/src/centralizedattackdetector/requirements.txt deleted file mode 100644 index f15fc23535b22452219448d5a4f3525996b58a75..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: -# -# pip-compile -# -attrs==21.2.0 - # via pytest -grpcio==1.41.0 - # via - # -r requirements.in - # grpcio-health-checking -grpcio-health-checking==1.41.0 - # via -r requirements.in -iniconfig==1.1.1 - # via pytest -packaging==21.0 - # via pytest -pluggy==1.0.0 - # via pytest -prometheus-client==0.11.0 - # via -r requirements.in -protobuf==3.18.0 - # via grpcio-health-checking -py==1.10.0 - # via pytest -py-cpuinfo==8.0.0 - # via pytest-benchmark -pyparsing==2.4.7 - # via packaging -pytest==6.2.5 - # via - # -r requirements.in - # pytest-benchmark -pytest-benchmark==3.4.1 - # via -r requirements.in -redis==3.5.3 - # via -r requirements.in -six==1.16.0 - # via grpcio -toml==0.10.2 - # via pytest diff --git a/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py b/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py deleted file mode 100644 index 16c8841c9e09325e21f092ccece5aad84e7f53d6..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/CentralizedAttackDetectorService.py +++ /dev/null @@ -1,58 +0,0 @@ -import grpc -import logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import ( - add_CentralizedAttackDetectorServiceServicer_to_server) -from centralizedattackdetector.service.CentralizedAttackDetectorServiceServicerImpl import ( - CentralizedAttackDetectorServiceServicerImpl) -from centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class CentralizedAttackDetectorService: - def __init__( - self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.centralized_attack_detector_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.debug('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.centralized_attack_detector_servicer = CentralizedAttackDetectorServiceServicerImpl() - add_CentralizedAttackDetectorServiceServicer_to_server(self.centralized_attack_detector_servicer, self.server) - - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(self.endpoint)) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py b/src/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py deleted file mode 100644 index 1f5fbdcb9655cda3351580b50c19eddf2c0d192a..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/CentralizedAttackDetectorServiceServicerImpl.py +++ /dev/null @@ -1,34 +0,0 @@ -import grpc, logging -from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import KpiList -from centralizedattackdetector.proto.centralized_attack_detector_pb2_grpc import ( - CentralizedAttackDetectorServiceServicer) - -LOGGER = logging.getLogger(__name__) - -SERVICE_NAME = 'CentralizedAttackDetector' -METHOD_NAMES = ['NotifyServiceUpdate', 'DetectAttack', 'ReportSummarizedKpi', 'ReportKpi'] -METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) - -class CentralizedAttackDetectorServiceServicerImpl(CentralizedAttackDetectorServiceServicer): - - def __init__(self): - LOGGER.debug('Creating Servicer...') - LOGGER.debug('Servicer Created') - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def NotifyServiceUpdate(self, request : Service, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def DetectAttack(self, request : Empty, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def ReportSummarizedKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: - return Empty() - - @safe_and_metered_rpc_method(METRICS, LOGGER) - def ReportKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: - return Empty() diff --git a/src/centralizedattackdetector/service/__main__.py b/src/centralizedattackdetector/service/__main__.py deleted file mode 100644 index 5737402c0318fa58123c5fdf00296c237f09aeb8..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/service/__main__.py +++ /dev/null @@ -1,50 +0,0 @@ -import logging, signal, sys, threading -from prometheus_client import start_http_server -from common.Settings import get_setting -from centralizedattackdetector.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT) -from centralizedattackdetector.service.CentralizedAttackDetectorService import CentralizedAttackDetectorService - -terminate = threading.Event() -LOGGER = None - -def signal_handler(signal, frame): # pylint: disable=redefined-outer-name - LOGGER.warning('Terminate signal received') - terminate.set() - -def main(): - global LOGGER # pylint: disable=global-statement - - service_port = get_setting('CENTRALIZEDATTACKDETECTORSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - - logging.basicConfig(level=log_level) - LOGGER = logging.getLogger(__name__) - - signal.signal(signal.SIGINT, signal_handler) - signal.signal(signal.SIGTERM, signal_handler) - - LOGGER.info('Starting...') - - # Start metrics server - start_http_server(metrics_port) - - # Starting CentralizedCybersecurity service - grpc_service = CentralizedAttackDetectorService( - port=service_port, max_workers=max_workers, grace_period=grace_period) - grpc_service.start() - - # Wait for Ctrl+C or termination signal - while not terminate.wait(timeout=0.1): pass - - LOGGER.info('Terminating...') - grpc_service.stop() - - LOGGER.info('Bye') - return 0 - -if __name__ == '__main__': - sys.exit(main()) diff --git a/src/centralizedattackdetector/tests/test_unitary.py b/src/centralizedattackdetector/tests/test_unitary.py deleted file mode 100644 index 177e03080157dc59bdd0f71caa0430ec83fdd5c9..0000000000000000000000000000000000000000 --- a/src/centralizedattackdetector/tests/test_unitary.py +++ /dev/null @@ -1,41 +0,0 @@ -import logging, pytest -from centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from centralizedattackdetector.client.CentralizedAttackDetectorClient import CentralizedAttackDetectorClient -from centralizedattackdetector.proto.context_pb2 import Empty, Service -from centralizedattackdetector.proto.monitoring_pb2 import Kpi, KpiList -from centralizedattackdetector.service.CentralizedAttackDetectorService import CentralizedAttackDetectorService - -port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -@pytest.fixture(scope='session') -def centralized_attack_detector_service(): - _service = CentralizedAttackDetectorService( - port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def centralized_attack_detector_client(centralized_attack_detector_service): - _client = CentralizedAttackDetectorClient(address='127.0.0.1', port=port) - yield _client - _client.close() - -def test_notify_service_update(centralized_attack_detector_client: CentralizedAttackDetectorClient): - service = Service() - centralized_attack_detector_client.NotifyServiceUpdate(service) - -def test_detect_attack(centralized_attack_detector_client: CentralizedAttackDetectorClient): - request = Empty() - centralized_attack_detector_client.DetectAttack(request) - -def test_report_summarized_kpi(centralized_attack_detector_client: CentralizedAttackDetectorClient): - kpi_list = KpiList() - centralized_attack_detector_client.ReportSummarizedKpi(kpi_list) - -def test_report_kpi(centralized_attack_detector_client: CentralizedAttackDetectorClient): - kpi_list = KpiList() - centralized_attack_detector_client.ReportKpi(kpi_list) diff --git a/src/clean.sh b/src/clean.sh index 9c96b6e12be0818bdc8a5d21ec7d37c5b1356115..fa0dce2b24a333ef2c10b792d856c590c2d84161 100755 --- a/src/clean.sh +++ b/src/clean.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + docker rm --force monitoring docker network remove teraflowbridge diff --git a/src/common/Constants.py b/src/common/Constants.py index 2595a1606631fcea4152d43fdf32e7db0dbb560a..f18d4384035f2310355d7a16c5a709720b5b07e9 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -1,2 +1,80 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from enum import Enum + +# Default logging level +DEFAULT_LOG_LEVEL = logging.WARNING + +# Default gRPC server settings +DEFAULT_GRPC_BIND_ADDRESS = '0.0.0.0' +DEFAULT_GRPC_MAX_WORKERS = 10 +DEFAULT_GRPC_GRACE_PERIOD = 60 + +# Default HTTP server settings +DEFAULT_HTTP_BIND_ADDRESS = '0.0.0.0' + +# Default Prometheus settings +DEFAULT_METRICS_PORT = 9192 + +# Default context and topology UUIDs DEFAULT_CONTEXT_UUID = 'admin' DEFAULT_TOPOLOGY_UUID = 'admin' + +# Default service names +class ServiceNameEnum(Enum): + CONTEXT = 'context' + DEVICE = 'device' + SERVICE = 'service' + SLICE = 'slice' + AUTOMATION = 'automation' + POLICY = 'policy' + MONITORING = 'monitoring' + DLT = 'dlt' + COMPUTE = 'compute' + CYBERSECURITY = 'cybersecurity' + INTERDOMAIN = 'interdomain' + PATHCOMP = 'pathcomp' + WEBUI = 'webui' + +# Default gRPC service ports +DEFAULT_SERVICE_GRPC_PORTS = { + ServiceNameEnum.CONTEXT .value : 1010, + ServiceNameEnum.DEVICE .value : 2020, + ServiceNameEnum.SERVICE .value : 3030, + ServiceNameEnum.SLICE .value : 4040, + ServiceNameEnum.AUTOMATION .value : 5050, + ServiceNameEnum.POLICY .value : 6060, + ServiceNameEnum.MONITORING .value : 7070, + ServiceNameEnum.DLT .value : 8080, + ServiceNameEnum.COMPUTE .value : 9090, + ServiceNameEnum.CYBERSECURITY.value : 10000, + ServiceNameEnum.INTERDOMAIN .value : 10010, + ServiceNameEnum.PATHCOMP .value : 10020, +} + +# Default HTTP/REST-API service ports +DEFAULT_SERVICE_HTTP_PORTS = { + ServiceNameEnum.CONTEXT .value : 8080, + ServiceNameEnum.COMPUTE .value : 8080, + ServiceNameEnum.WEBUI .value : 8004, +} + +# Default HTTP/REST-API service base URLs +DEFAULT_SERVICE_HTTP_BASEURLS = { + ServiceNameEnum.CONTEXT .value : '/api', + ServiceNameEnum.COMPUTE .value : '/restconf/data', + ServiceNameEnum.WEBUI .value : None, +} diff --git a/src/common/DeviceTypes.py b/src/common/DeviceTypes.py new file mode 100644 index 0000000000000000000000000000000000000000..bf871a2d5afa6a73f1c9dd39431c64a7f31bbd7e --- /dev/null +++ b/src/common/DeviceTypes.py @@ -0,0 +1,26 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from enum import Enum + +class DeviceTypeEnum(Enum): + EMULATED_OPTICAL_LINE_SYSTEM = 'emu-optical-line-system' + EMULATED_PACKET_ROUTER = 'emu-packet-router' + MICROVAWE_RADIO_SYSTEM = 'microwave-radio-system' + OPTICAL_ROADM = 'optical-roadm' + OPTICAL_TRANDPONDER = 'optical-trandponder' + OPTICAL_LINE_SYSTEM = 'optical-line-system' + PACKET_ROUTER = 'packet-router' + PACKET_SWITCH = 'packet-switch' + P4_SWITCH = 'p4-switch' diff --git a/src/common/Settings.py b/src/common/Settings.py index 73508da50cf1ccad34e82bbea0b4b42c57c9eda9..e9d5f406d2acad0d31ae94b604183c129d28f146 100644 --- a/src/common/Settings.py +++ b/src/common/Settings.py @@ -1,4 +1,52 @@ -import os +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, os, time +from typing import List +from common.Constants import ( + DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, + DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, + DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum +) + +LOGGER = logging.getLogger(__name__) + +DEFAULT_RESTART_DELAY = 5.0 # seconds + +ENVVAR_KUBERNETES_PORT = 'KUBERNETES_PORT' +ENVVAR_GRPC_BIND_ADDRESS = 'GRPC_BIND_ADDRESS' +ENVVAR_GRPC_MAX_WORKERS = 'GRPC_MAX_WORKERS' +ENVVAR_GRPC_GRACE_PERIOD = 'GRPC_GRACE_PERIOD' +ENVVAR_HTTP_BIND_ADDRESS = 'HTTP_BIND_ADDRESS' +ENVVAR_LOG_LEVEL = 'LOG_LEVEL' +ENVVAR_METRICS_PORT = 'METRICS_PORT' + +ENVVAR_SUFIX_SERVICE_BASEURL_HTTP = 'SERVICE_BASEURL_HTTP' +ENVVAR_SUFIX_SERVICE_HOST = 'SERVICE_HOST' +ENVVAR_SUFIX_SERVICE_PORT_GRPC = 'SERVICE_PORT_GRPC' +ENVVAR_SUFIX_SERVICE_PORT_HTTP = 'SERVICE_PORT_HTTP' + +def wait_for_environment_variables( + required_environment_variables : List[str] = [], wait_delay_seconds : float = DEFAULT_RESTART_DELAY +): + if ENVVAR_KUBERNETES_PORT not in os.environ: return # We're not running in Kubernetes, nothing to wait for + missing_variables = set(required_environment_variables).difference(set(os.environ.keys())) + if len(missing_variables) == 0: return # We have all environment variables defined + msg = 'Variables({:s}) are missing in Environment({:s}), restarting in {:f} seconds...' + LOGGER.error(msg.format(str(missing_variables), str(os.environ), wait_delay_seconds)) + time.sleep(wait_delay_seconds) + raise Exception('Restarting...') def get_setting(name, **kwargs): value = os.environ.get(name) @@ -6,4 +54,45 @@ def get_setting(name, **kwargs): value = kwargs['settings'].pop(name, value) if value is not None: return value if 'default' in kwargs: return kwargs['default'] - raise Exception('Setting({}) not specified in environment or configuration'.format(name)) + raise Exception('Setting({:s}) not specified in environment or configuration'.format(str(name))) + +def get_env_var_name(service_name : ServiceNameEnum, env_var_group): + return ('{:s}SERVICE_{:s}'.format(service_name.value, env_var_group)).upper() + +def get_service_host(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_HOST) + default_value = ('{:s}service'.format(service_name.value)) + return get_setting(envvar_name, default=default_value) + +def get_service_port_grpc(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_PORT_GRPC) + default_value = DEFAULT_SERVICE_GRPC_PORTS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_service_port_http(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_PORT_HTTP) + default_value = DEFAULT_SERVICE_HTTP_PORTS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_service_baseurl_http(service_name : ServiceNameEnum): + envvar_name = get_env_var_name(service_name, ENVVAR_SUFIX_SERVICE_BASEURL_HTTP) + default_value = DEFAULT_SERVICE_HTTP_BASEURLS.get(service_name.value) + return get_setting(envvar_name, default=default_value) + +def get_log_level(): + return get_setting(ENVVAR_LOG_LEVEL, default=DEFAULT_LOG_LEVEL) + +def get_metrics_port(): + return get_setting(ENVVAR_METRICS_PORT, default=DEFAULT_METRICS_PORT) + +def get_grpc_bind_address(): + return get_setting(ENVVAR_GRPC_BIND_ADDRESS, default=DEFAULT_GRPC_BIND_ADDRESS) + +def get_grpc_max_workers(): + return get_setting(ENVVAR_GRPC_MAX_WORKERS, default=DEFAULT_GRPC_MAX_WORKERS) + +def get_grpc_grace_period(): + return get_setting(ENVVAR_GRPC_GRACE_PERIOD, default=DEFAULT_GRPC_GRACE_PERIOD) + +def get_http_bind_address(): + return get_setting(ENVVAR_HTTP_BIND_ADDRESS, default=DEFAULT_HTTP_BIND_ADDRESS) diff --git a/src/common/__init__.py b/src/common/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/__init__.py +++ b/src/common/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/database/api/context/slice/SliceStatus.py b/src/common/database/api/context/slice/SliceStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..d97b3944999e58cc2ad54f28ed6e22232b5fcd71 --- /dev/null +++ b/src/common/database/api/context/slice/SliceStatus.py @@ -0,0 +1,31 @@ +from enum import Enum + +class SliceStatus(Enum): + PLANNED = 0 + INIT = 1 + ACTIVE = 2 + DEINIT = 3 + +ANY_TO_ENUM = { + 0: SliceStatus.PLANNED, + 1: SliceStatus.INIT, + 2: SliceStatus.ACTIVE, + 3: SliceStatus.DEINIT, + + '0': SliceStatus.PLANNED, + '1': SliceStatus.INIT, + '2': SliceStatus.ACTIVE, + '3': SliceStatus.DEINIT, + + 'planned': SliceStatus.PLANNED, + 'init': SliceStatus.INIT, + 'active': SliceStatus.ACTIVE, + 'deinit': SliceStatus.DEINIT, +} + +def slicestatus_enum_values(): + return {m.value for m in SliceStatus.__members__.values()} + +def to_slicestatus_enum(int_or_str): + if isinstance(int_or_str, str): int_or_str = int_or_str.lower() + return ANY_TO_ENUM.get(int_or_str) diff --git a/src/centralizedattackdetector/proto/__init__.py b/src/common/database/api/context/slice/__init__.py similarity index 100% rename from src/centralizedattackdetector/proto/__init__.py rename to src/common/database/api/context/slice/__init__.py diff --git a/src/common/logger.py b/src/common/logger.py index a0e9997cd9459015e60b073dafead854fdf6c943..c90e0bcf30c41d6dab1d4f63cbb475ab544a019a 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright 2018 Google LLC +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/common/message_broker/Constants.py b/src/common/message_broker/Constants.py index 671f11add119bf5103258af0c07df60e0e3afd0d..d3f5190742303b9948b6d973eb2d5030a17a89cc 100644 --- a/src/common/message_broker/Constants.py +++ b/src/common/message_broker/Constants.py @@ -1 +1,15 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + CONSUME_TIMEOUT = 0.1 # seconds diff --git a/src/common/message_broker/Factory.py b/src/common/message_broker/Factory.py index a2ea36435c717835bf4b7c89c2522878e67074c9..a64913df02805dabc9c1924ea16966e43454b7b5 100644 --- a/src/common/message_broker/Factory.py +++ b/src/common/message_broker/Factory.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, os from typing import Optional, Union from .backend._Backend import _Backend diff --git a/src/common/message_broker/Message.py b/src/common/message_broker/Message.py index ee527dc9f46855b3d806f9188a7d5640c34f416b..484c795e77cf9699057a65a85a7df73c53779523 100644 --- a/src/common/message_broker/Message.py +++ b/src/common/message_broker/Message.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import NamedTuple class Message(NamedTuple): diff --git a/src/common/message_broker/MessageBroker.py b/src/common/message_broker/MessageBroker.py index 53697db2d0062a8290be44991990ee7f217e2c25..2a561727573247042b0d1755175d0730a97ef1d4 100644 --- a/src/common/message_broker/MessageBroker.py +++ b/src/common/message_broker/MessageBroker.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Iterator, Set from .backend._Backend import _Backend diff --git a/src/common/message_broker/__init__.py b/src/common/message_broker/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/message_broker/__init__.py +++ b/src/common/message_broker/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/message_broker/backend/BackendEnum.py b/src/common/message_broker/backend/BackendEnum.py index 9ee482477e489fff25ed0538330e33d378cbd251..bf95f176479fb227503dd04a9dde2b81789ec006 100644 --- a/src/common/message_broker/backend/BackendEnum.py +++ b/src/common/message_broker/backend/BackendEnum.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from enum import Enum class BackendEnum(Enum): diff --git a/src/common/message_broker/backend/_Backend.py b/src/common/message_broker/backend/_Backend.py index a6461d2538a1794e6bdec597ac0ad611eec6d484..1e03b2bd27f4949f65d7df839bc5ba6d4da9df0d 100644 --- a/src/common/message_broker/backend/_Backend.py +++ b/src/common/message_broker/backend/_Backend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import Iterator, Set, Tuple class _Backend: diff --git a/src/common/message_broker/backend/__init__.py b/src/common/message_broker/backend/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/message_broker/backend/__init__.py +++ b/src/common/message_broker/backend/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/message_broker/backend/inmemory/InMemoryBackend.py b/src/common/message_broker/backend/inmemory/InMemoryBackend.py index 9b0e758724deb280f9cc8a1ba3eb20e6f4c57356..c0a87c667b2bf6d48d8a482c601e48289de7bc90 100644 --- a/src/common/message_broker/backend/inmemory/InMemoryBackend.py +++ b/src/common/message_broker/backend/inmemory/InMemoryBackend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # InMemeory MessageBroker Backend # ------------------------------- # - WARNING: DESIGNED AND BUILT FOR UNIT TESTING AND INTEGRATION TESTING PURPOSES ONLY !!! diff --git a/src/common/message_broker/backend/inmemory/__init__.py b/src/common/message_broker/backend/inmemory/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/message_broker/backend/inmemory/__init__.py +++ b/src/common/message_broker/backend/inmemory/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/message_broker/backend/redis/RedisBackend.py b/src/common/message_broker/backend/redis/RedisBackend.py index 0e8be0f30d77dcf6db5dbebcacba06591d1dbdff..41490913cbc8363ae86a031e9d7e703713349368 100644 --- a/src/common/message_broker/backend/redis/RedisBackend.py +++ b/src/common/message_broker/backend/redis/RedisBackend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, threading from typing import Any, Dict, Iterator, Set, Tuple from redis.client import Redis diff --git a/src/common/message_broker/backend/redis/__init__.py b/src/common/message_broker/backend/redis/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/message_broker/backend/redis/__init__.py +++ b/src/common/message_broker/backend/redis/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/message_broker/tests/__init__.py b/src/common/message_broker/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/message_broker/tests/__init__.py +++ b/src/common/message_broker/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/message_broker/tests/test_unitary.py b/src/common/message_broker/tests/test_unitary.py index c5ff5c77ff55be558858e98b262c912e7db9e3ef..925fcc83e163e9888494dcdc3cddaeaeec1d04fc 100644 --- a/src/common/message_broker/tests/test_unitary.py +++ b/src/common/message_broker/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, os, pytest, threading, time from typing import List, Set from common.message_broker.Factory import get_messagebroker_backend diff --git a/src/common/orm/Database.py b/src/common/orm/Database.py index 81c18aec1699a6c356739b4fc7f8a5ae97edac95..e5ec7b0a93164595e2f75f9059c223044b171701 100644 --- a/src/common/orm/Database.py +++ b/src/common/orm/Database.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import List, Set, Tuple from .backend._Backend import _Backend diff --git a/src/common/orm/Exceptions.py b/src/common/orm/Exceptions.py index eea0b564e1918cb6a2da0553641c9492a32b1425..cf91bd2f7a628a86fa45f7eb687b3292e00d0f8e 100644 --- a/src/common/orm/Exceptions.py +++ b/src/common/orm/Exceptions.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + class ConstraintException(Exception): pass diff --git a/src/common/orm/Factory.py b/src/common/orm/Factory.py index 6ef0e11ccdd7b2f0f9e3fde62903fef522cb9f7a..15940ce7cc565c3966e3abfe2604ebd245d2adfc 100644 --- a/src/common/orm/Factory.py +++ b/src/common/orm/Factory.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, os from typing import Optional, Union from .backend._Backend import _Backend diff --git a/src/common/orm/HighLevel.py b/src/common/orm/HighLevel.py index 7e2e9e49ea22861d3d96bcac70acc86e2f50db35..a5bdeae3e9607767b5215f6ff87cb0d8624918d0 100644 --- a/src/common/orm/HighLevel.py +++ b/src/common/orm/HighLevel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import Any, Dict, List, Optional, Set, Tuple from common.rpc_method_wrapper.ServiceExceptions import NotFoundException from common.orm.Database import Database diff --git a/src/common/orm/__init__.py b/src/common/orm/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/__init__.py +++ b/src/common/orm/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/backend/BackendEnum.py b/src/common/orm/backend/BackendEnum.py index 7699262f468b63044b160b9f0649432668002023..0297ca7be6c3bd13c2ee7d3cabe75efe23ead51f 100644 --- a/src/common/orm/backend/BackendEnum.py +++ b/src/common/orm/backend/BackendEnum.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from enum import Enum class BackendEnum(Enum): diff --git a/src/common/orm/backend/Tools.py b/src/common/orm/backend/Tools.py index 8152e1a768e9a824fb6ce8a30ac4a09409fc47da..30223feac8c98c4272e56de841c1abafb792c5a6 100644 --- a/src/common/orm/backend/Tools.py +++ b/src/common/orm/backend/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import List, Union def key_to_str(key : Union[str, List[str]], separator : str = '/') -> str: diff --git a/src/common/orm/backend/_Backend.py b/src/common/orm/backend/_Backend.py index ead206354b12b0a39b0868c9bc853c17ac976325..08b346ea746a4cf1fda393de069c4ab63549973d 100644 --- a/src/common/orm/backend/_Backend.py +++ b/src/common/orm/backend/_Backend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import Any, Dict, List, Optional, Set, Tuple class _Backend: diff --git a/src/common/orm/backend/__init__.py b/src/common/orm/backend/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/backend/__init__.py +++ b/src/common/orm/backend/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/backend/inmemory/InMemoryBackend.py b/src/common/orm/backend/inmemory/InMemoryBackend.py index c960a17094c6b8e07ef6823fcef123c092add94a..4930d59571bed319f61918f1af6ea5666e54e140 100644 --- a/src/common/orm/backend/inmemory/InMemoryBackend.py +++ b/src/common/orm/backend/inmemory/InMemoryBackend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # InMemeory Database Backend # -------------------------- # - Concurrency is limited to 1 operation at a time diff --git a/src/common/orm/backend/inmemory/Tools.py b/src/common/orm/backend/inmemory/Tools.py index fe10506556de36d6f40665c6f59119cbf540d8a4..9f8e2b5c956f953d45d2ab5a41d7874262ec675c 100644 --- a/src/common/orm/backend/inmemory/Tools.py +++ b/src/common/orm/backend/inmemory/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from typing import Dict, List, Set, Union def get_dict(keys : Dict[str, Union[Dict, List, Set]], str_key : str) -> Dict: diff --git a/src/common/orm/backend/inmemory/__init__.py b/src/common/orm/backend/inmemory/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/backend/inmemory/__init__.py +++ b/src/common/orm/backend/inmemory/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/backend/redis/Mutex.py b/src/common/orm/backend/redis/Mutex.py index 55d52d8d5ff558b096958aefd85d926b46716db9..6424b7a79076bdcc42aafe46fd9d7dfe75683a4a 100644 --- a/src/common/orm/backend/redis/Mutex.py +++ b/src/common/orm/backend/redis/Mutex.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import random, time, uuid from typing import Set, Tuple, Union from redis.client import Redis diff --git a/src/common/orm/backend/redis/RedisBackend.py b/src/common/orm/backend/redis/RedisBackend.py index edd73917315322803a102142c69f59dc305955a5..30225eaa29b4b7bfd69c4c277ee513192d923b7a 100644 --- a/src/common/orm/backend/redis/RedisBackend.py +++ b/src/common/orm/backend/redis/RedisBackend.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, uuid from typing import Any, Dict, List, Optional, Set, Tuple from redis.client import Redis diff --git a/src/common/orm/backend/redis/__init__.py b/src/common/orm/backend/redis/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/backend/redis/__init__.py +++ b/src/common/orm/backend/redis/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/fields/BooleanField.py b/src/common/orm/fields/BooleanField.py index 3bfbed17fb8cee7962ae86df2416c64369f9127d..ae9ac8eafa5803217dc3e7554683a737134bc4e5 100644 --- a/src/common/orm/fields/BooleanField.py +++ b/src/common/orm/fields/BooleanField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from typing import Union from common.type_checkers.Checkers import chk_boolean diff --git a/src/common/orm/fields/EnumeratedField.py b/src/common/orm/fields/EnumeratedField.py index 37e95bd338f736c7473055d9952eaa4ce4a334ea..f684649e10bbb985f787ae6f4cb6f4660b5cd943 100644 --- a/src/common/orm/fields/EnumeratedField.py +++ b/src/common/orm/fields/EnumeratedField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from enum import Enum from typing import Union diff --git a/src/common/orm/fields/Field.py b/src/common/orm/fields/Field.py index aa1a9e4352658ce3219abe24abdfb87183508eb5..68d868cf740bc00e22bc951cd8bab843d28db21d 100644 --- a/src/common/orm/fields/Field.py +++ b/src/common/orm/fields/Field.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, List, Set, Tuple, Union diff --git a/src/common/orm/fields/FloatField.py b/src/common/orm/fields/FloatField.py index e88b10a21c3f556e5ca0501d484aa5ab36311a76..8d006e77347e3c440a31bd13f59e08267daa5e63 100644 --- a/src/common/orm/fields/FloatField.py +++ b/src/common/orm/fields/FloatField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from typing import Optional, Union from common.type_checkers.Checkers import chk_float diff --git a/src/common/orm/fields/ForeignKeyField.py b/src/common/orm/fields/ForeignKeyField.py index 21815d97c930128ef2f75e3105ca6309a13d524e..12e720d17952d6b09d0d4911105b156e8593f33b 100644 --- a/src/common/orm/fields/ForeignKeyField.py +++ b/src/common/orm/fields/ForeignKeyField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from typing import TYPE_CHECKING from common.type_checkers.Checkers import chk_issubclass, chk_type diff --git a/src/common/orm/fields/IntegerField.py b/src/common/orm/fields/IntegerField.py index 591d90b83ea24054712ee2f03ebf09039ce4816f..87ddab4646d5426c462ea96f18368e3e49be06c1 100644 --- a/src/common/orm/fields/IntegerField.py +++ b/src/common/orm/fields/IntegerField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from typing import Optional, Union from common.type_checkers.Checkers import chk_integer diff --git a/src/common/orm/fields/PrimaryKeyField.py b/src/common/orm/fields/PrimaryKeyField.py index 1e567f0361236194819198b726f3d32029072adc..86fdc7e2466f10d3c16cf733fedbfc15fe62f31f 100644 --- a/src/common/orm/fields/PrimaryKeyField.py +++ b/src/common/orm/fields/PrimaryKeyField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations from typing import TYPE_CHECKING from .StringField import StringField diff --git a/src/common/orm/fields/StringField.py b/src/common/orm/fields/StringField.py index 0034c69baf2b4bbe0de16ade38244d19262cfe80..ead8487eaf60542079b2ca3745f04aba2c0d6de9 100644 --- a/src/common/orm/fields/StringField.py +++ b/src/common/orm/fields/StringField.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations import re from typing import Optional, Pattern, Union diff --git a/src/common/orm/fields/__init__.py b/src/common/orm/fields/__init__.py index b97f0f08a646c23d51b98b03bf7fe29f9c7d8bb8..2a4cccb63a28eda573b16e4cef7da3ae58ac9d54 100644 --- a/src/common/orm/fields/__init__.py +++ b/src/common/orm/fields/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from .BooleanField import BooleanField from .Field import Field from .FloatField import FloatField diff --git a/src/common/orm/model/Model.py b/src/common/orm/model/Model.py index cf66a859f16302e9e746b612791fd0dacc07b996..ffb9571142942de0a23982c990db3670a27bc670 100644 --- a/src/common/orm/model/Model.py +++ b/src/common/orm/model/Model.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import annotations import logging, re from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union @@ -106,11 +120,13 @@ class Model(metaclass=MetaModel): @property def instance_key(self) -> str: return self._instance_key - def lock(self, extra_keys : List[List[str]] = []): - lock_keys = Model.get_backend_key_locks( - [self._instance_key, self._instances_key, self._references_key] + extra_keys) - acquired,self._owner_key = self._backend.lock(lock_keys, owner_key=self._owner_key) - if acquired: return + def lock(self, extra_keys : List[List[str]] = [], blocking : bool = True): + while True: + lock_keys = Model.get_backend_key_locks( + [self._instance_key, self._instances_key, self._references_key] + extra_keys) + acquired,self._owner_key = self._backend.lock(lock_keys, owner_key=self._owner_key) + if acquired: return + if not blocking: break raise MutexException('Unable to lock keys {:s} using owner_key {:s}'.format( str(lock_keys), str(self._owner_key))) diff --git a/src/common/orm/model/Tools.py b/src/common/orm/model/Tools.py index 3ebf63ae35a9e27d083a533ace3d1805197f166c..aed6a14bc2668017e312f0659ccb08c8c185ea90 100644 --- a/src/common/orm/model/Tools.py +++ b/src/common/orm/model/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from collections import OrderedDict class NoDupOrderedDict(OrderedDict): diff --git a/src/common/orm/model/__init__.py b/src/common/orm/model/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/model/__init__.py +++ b/src/common/orm/model/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/tests/__init__.py b/src/common/orm/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/orm/tests/__init__.py +++ b/src/common/orm/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/orm/tests/test_unitary.py b/src/common/orm/tests/test_unitary.py index b6f58b9a33d474b2574099870c7a8f6f51682b76..586a9623574a104c58b6ae4762fa13fc6ab02871 100644 --- a/src/common/orm/tests/test_unitary.py +++ b/src/common/orm/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, pytest from enum import Enum from common.orm.Exceptions import ConstraintException diff --git a/src/common/proto b/src/common/proto new file mode 120000 index 0000000000000000000000000000000000000000..0ae252a7824cad03d85fa60224b87d8c779f1588 --- /dev/null +++ b/src/common/proto @@ -0,0 +1 @@ +../../proto/src/python \ No newline at end of file diff --git a/src/common/rpc_method_wrapper/Decorator.py b/src/common/rpc_method_wrapper/Decorator.py index cfbc76ff86810740ed8cc83eff95863ffd823604..31dc4b82bdaa8762b1dee5af247b3f8b7b9af2af 100644 --- a/src/common/rpc_method_wrapper/Decorator.py +++ b/src/common/rpc_method_wrapper/Decorator.py @@ -1,8 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from enum import Enum from typing import Dict, List from prometheus_client import Counter, Histogram from prometheus_client.metrics import MetricWrapperBase +from common.tools.grpc.Tools import grpc_message_to_json_string from .ServiceExceptions import ServiceException class RequestConditionEnum(Enum): @@ -48,14 +63,16 @@ def safe_and_metered_rpc_method(metrics : Dict[str, MetricWrapperBase], logger : def inner_wrapper(self, request, grpc_context : grpc.ServicerContext): COUNTER_STARTED.inc() try: - logger.debug('{:s} request: {:s}'.format(function_name, str(request))) + logger.debug('{:s} request: {:s}'.format(function_name, grpc_message_to_json_string(request))) reply = func(self, request, grpc_context) - logger.debug('{:s} reply: {:s}'.format(function_name, str(reply))) + logger.debug('{:s} reply: {:s}'.format(function_name, grpc_message_to_json_string(reply))) COUNTER_COMPLETED.inc() return reply except ServiceException as e: # pragma: no cover (ServiceException not thrown) - logger.exception('{:s} exception'.format(function_name)) - COUNTER_FAILED.inc() + if e.code not in [grpc.StatusCode.NOT_FOUND, grpc.StatusCode.ALREADY_EXISTS]: + # Assume not found or already exists is just a condition, not an error + logger.exception('{:s} exception'.format(function_name)) + COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover, pylint: disable=broad-except logger.exception('{:s} exception'.format(function_name)) diff --git a/src/common/rpc_method_wrapper/ServiceExceptions.py b/src/common/rpc_method_wrapper/ServiceExceptions.py index fb3979c6c216d9361ced706b4fabd5ba5bbcffb2..f4f0a64cad79c96dc069bd37e8d2c2be5f011c53 100644 --- a/src/common/rpc_method_wrapper/ServiceExceptions.py +++ b/src/common/rpc_method_wrapper/ServiceExceptions.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc from typing import Iterable, Union diff --git a/src/common/rpc_method_wrapper/__init__.py b/src/common/rpc_method_wrapper/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/rpc_method_wrapper/__init__.py +++ b/src/common/rpc_method_wrapper/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/rpc_method_wrapper/tests/__init__.py b/src/common/rpc_method_wrapper/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/rpc_method_wrapper/tests/__init__.py +++ b/src/common/rpc_method_wrapper/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/rpc_method_wrapper/tests/test_unitary.py b/src/common/rpc_method_wrapper/tests/test_unitary.py index 816b9dae859017a05f27055a14cb97db6d8e034f..c8fc7a2aa187dcb905a8c230b047ffb1171d2ccd 100644 --- a/src/common/rpc_method_wrapper/tests/test_unitary.py +++ b/src/common/rpc_method_wrapper/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging, time from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method diff --git a/src/common/tests/EventTools.py b/src/common/tests/EventTools.py new file mode 100644 index 0000000000000000000000000000000000000000..ceff4d60e597690b29d5f1bcac894c081eb88a56 --- /dev/null +++ b/src/common/tests/EventTools.py @@ -0,0 +1,101 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json, logging +from typing import Dict, List, Tuple +from common.proto.context_pb2 import ( + ConnectionEvent, ContextEvent, DeviceEvent, EventTypeEnum, LinkEvent, ServiceEvent, TopologyEvent) +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.EventsCollector import EventsCollector + +LOGGER = logging.getLogger(__name__) + +EVENT_CREATE = EventTypeEnum.EVENTTYPE_CREATE +EVENT_UPDATE = EventTypeEnum.EVENTTYPE_UPDATE +EVENT_REMOVE = EventTypeEnum.EVENTTYPE_REMOVE + +def class_to_classname(klass): return klass.__name__ +def instance_to_classname(instance): return type(instance).__name__ + +CLASSNAME_CONTEXT_EVENT = class_to_classname(ContextEvent) +CLASSNAME_TOPOLOGY_EVENT = class_to_classname(TopologyEvent) +CLASSNAME_DEVICE_EVENT = class_to_classname(DeviceEvent) +CLASSNAME_LINK_EVENT = class_to_classname(LinkEvent) +CLASSNAME_SERVICE_EVENT = class_to_classname(ServiceEvent) +CLASSNAME_CONNECTION_EVENT = class_to_classname(ConnectionEvent) + +EVENT_CLASS_NAME__TO__ENTITY_ID_SELECTOR = { + CLASSNAME_CONTEXT_EVENT : lambda event: event.context_id, + CLASSNAME_TOPOLOGY_EVENT : lambda event: event.topology_id, + CLASSNAME_DEVICE_EVENT : lambda event: event.device_id, + CLASSNAME_LINK_EVENT : lambda event: event.link_id, + CLASSNAME_SERVICE_EVENT : lambda event: event.service_id, + CLASSNAME_CONNECTION_EVENT: lambda event: event.connection_id, +} + +def event_to_key(event): + event_class_name = instance_to_classname(event) + entity_id_selector_function = EVENT_CLASS_NAME__TO__ENTITY_ID_SELECTOR.get(event_class_name) + entity_id = entity_id_selector_function(event) + return (event_class_name, event.event.event_type, grpc_message_to_json_string(entity_id)) + +def check_events( + events_collector : EventsCollector, expected_events : List[Tuple[str, int, Dict]], + fail_if_missing_events : bool = True, fail_if_unexpected_events : bool = False, + timeout_per_event = 1.0, max_wait_time = 30.0 +) -> None: + expected_events_map = {} + num_expected_events = 0 + for event_classname, event_type_id, event_ids in expected_events: + event_key = (event_classname, event_type_id, json.dumps(event_ids, sort_keys=True)) + event_count = expected_events_map.get(event_key, 0) + expected_events_map[event_key] = event_count + 1 + num_expected_events += 1 + + i, wait_time = 0, 0 + while num_expected_events > 0: + event_received = events_collector.get_event(block=True, timeout=timeout_per_event) + if event_received is None: + wait_time += timeout_per_event + if wait_time > max_wait_time: break + continue + LOGGER.info('event_received[{:d}] = {:s}'.format(i, str(event_received))) + event_key = event_to_key(event_received) + event_count = expected_events_map.pop(event_key, 0) + if event_count > 0: num_expected_events -= 1 + event_count -= 1 + if event_count != 0: expected_events_map[event_key] = event_count + + if len(expected_events_map) == 0: + LOGGER.info('EventsCheck passed') + else: + missing_events = {} + unexpected_events = {} + for event_key,event_count in expected_events_map.items(): + if event_count > 0: + missing_events[event_key] = event_count + if event_count < 0: + unexpected_events[event_key] = -event_count + msg_except = ['EventCheck failed:'] + msg_logger = ['EventCheck:'] + if len(missing_events) > 0: + msg = 'missing_events={:s}'.format(str(missing_events)) + if fail_if_missing_events: msg_except.append(msg) + msg_logger.append(msg) + if len(unexpected_events) > 0: + msg = 'unexpected_events={:s}'.format(str(unexpected_events)) + if fail_if_unexpected_events: msg_except.append(msg) + msg_logger.append(msg) + if len(msg_logger) > 1: LOGGER.warning(' '.join(msg_logger)) + if len(msg_except) > 1: raise Exception(' '.join(msg_except)) diff --git a/src/common/tests/MockServicerImpl_Context.py b/src/common/tests/MockServicerImpl_Context.py new file mode 100644 index 0000000000000000000000000000000000000000..9f80fdbcab0419072a4299f908a7b637038c2a1b --- /dev/null +++ b/src/common/tests/MockServicerImpl_Context.py @@ -0,0 +1,279 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from typing import Any, Dict, Iterator, List +from common.proto.context_pb2 import ( + Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, + Context, ContextEvent, ContextId, ContextIdList, ContextList, + Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, + Empty, + Link, LinkEvent, LinkId, LinkIdList, LinkList, + Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, + Slice, SliceEvent, SliceId, SliceIdList, SliceList, + Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) +from common.proto.context_pb2_grpc import ContextServiceServicer +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) + +def get_container(database : Dict[str, Dict[str, Any]], container_name : str) -> Dict[str, Any]: + return database.setdefault(container_name, {}) + +def get_entries(database : Dict[str, Dict[str, Any]], container_name : str) -> List[Any]: + container = get_container(database, container_name) + return [container[entry_uuid] for entry_uuid in sorted(container.keys())] + +def get_entry( + context : grpc.ServicerContext, database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str +) -> Any: + LOGGER.debug('[get_entry] AFTER database={:s}'.format(str(database))) + container = get_container(database, container_name) + if entry_uuid not in container: + context.abort(grpc.StatusCode.NOT_FOUND, str('{:s}({:s}) not found'.format(container_name, entry_uuid))) + return container[entry_uuid] + +def set_entry(database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str, entry : Any) -> Any: + container = get_container(database, container_name) + LOGGER.debug('[set_entry] BEFORE database={:s}'.format(str(database))) + container[entry_uuid] = entry + LOGGER.debug('[set_entry] AFTER database={:s}'.format(str(database))) + return entry + +def del_entry( + context : grpc.ServicerContext, database : Dict[str, Dict[str, Any]], container_name : str, entry_uuid : str +) -> Any: + container = get_container(database, container_name) + if entry_uuid not in container: + context.abort(grpc.StatusCode.NOT_FOUND, str('{:s}({:s}) not found'.format(container_name, entry_uuid))) + del container[entry_uuid] + return Empty() + +class MockServicerImpl_Context(ContextServiceServicer): + def __init__(self): + LOGGER.info('[__init__] Creating Servicer...') + self.database : Dict[str, Any] = {} + LOGGER.info('[__init__] Servicer Created') + + # ----- Context ---------------------------------------------------------------------------------------------------- + + def ListContextIds(self, request: Empty, context : grpc.ServicerContext) -> ContextIdList: + LOGGER.info('[ListContextIds] request={:s}'.format(grpc_message_to_json_string(request))) + return ContextIdList(context_ids=[context.context_id for context in get_entries(self.database, 'context')]) + + def ListContexts(self, request: Empty, context : grpc.ServicerContext) -> ContextList: + LOGGER.info('[ListContexts] request={:s}'.format(grpc_message_to_json_string(request))) + return ContextList(contexts=get_entries(self.database, 'context')) + + def GetContext(self, request: ContextId, context : grpc.ServicerContext) -> Context: + LOGGER.info('[GetContext] request={:s}'.format(grpc_message_to_json_string(request))) + return get_entry(context, self.database, 'context', request.context_uuid.uuid) + + def SetContext(self, request: Context, context : grpc.ServicerContext) -> ContextId: + LOGGER.info('[SetContext] request={:s}'.format(grpc_message_to_json_string(request))) + return set_entry(self.database, 'context', request.context_id.context_uuid.uuid, request).context_id + + def RemoveContext(self, request: ContextId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveContext] request={:s}'.format(grpc_message_to_json_string(request))) + return del_entry(context, self.database, 'context', request.context_uuid.uuid) + + def GetContextEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ContextEvent]: + LOGGER.info('[GetContextEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Topology --------------------------------------------------------------------------------------------------- + + def ListTopologyIds(self, request: ContextId, context : grpc.ServicerContext) -> TopologyIdList: + LOGGER.info('[ListTopologyIds] request={:s}'.format(grpc_message_to_json_string(request))) + topologies = get_entries(self.database, 'topology[{:s}]'.format(str(request.context_uuid.uuid))) + return TopologyIdList(topology_ids=[topology.topology_id for topology in topologies]) + + def ListTopologies(self, request: ContextId, context : grpc.ServicerContext) -> TopologyList: + LOGGER.info('[ListTopologies] request={:s}'.format(grpc_message_to_json_string(request))) + topologies = get_entries(self.database, 'topology[{:s}]'.format(str(request.context_uuid.uuid))) + return TopologyList(topologies=[topology for topology in topologies]) + + def GetTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Topology: + LOGGER.info('[GetTopology] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'topology[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return get_entry(context, self.database, container_name, request.topology_uuid.uuid) + + def SetTopology(self, request: Topology, context : grpc.ServicerContext) -> TopologyId: + LOGGER.info('[SetTopology] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'topology[{:s}]'.format(str(request.topology_id.context_id.context_uuid.uuid)) + return set_entry(self.database, container_name, request.topology_id.topology_uuid.uuid, request).topology_id + + def RemoveTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveTopology] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'topology[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return del_entry(context, self.database, container_name, request.topology_uuid.uuid) + + def GetTopologyEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[TopologyEvent]: + LOGGER.info('[GetTopologyEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Device ----------------------------------------------------------------------------------------------------- + + def ListDeviceIds(self, request: Empty, context : grpc.ServicerContext) -> DeviceIdList: + LOGGER.info('[ListDeviceIds] request={:s}'.format(grpc_message_to_json_string(request))) + return DeviceIdList(device_ids=[device.device_id for device in get_entries(self.database, 'device')]) + + def ListDevices(self, request: Empty, context : grpc.ServicerContext) -> DeviceList: + LOGGER.info('[ListDevices] request={:s}'.format(grpc_message_to_json_string(request))) + return DeviceList(devices=get_entries(self.database, 'device')) + + def GetDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Device: + LOGGER.info('[GetDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return get_entry(context, self.database, 'device', request.device_uuid.uuid) + + def SetDevice(self, request: Context, context : grpc.ServicerContext) -> DeviceId: + LOGGER.info('[SetDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return set_entry(self.database, 'device', request.device_id.device_uuid.uuid, request).device_id + + def RemoveDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return del_entry(context, self.database, 'device', request.device_uuid.uuid) + + def GetDeviceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[DeviceEvent]: + LOGGER.info('[GetDeviceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Link ------------------------------------------------------------------------------------------------------- + + def ListLinkIds(self, request: Empty, context : grpc.ServicerContext) -> LinkIdList: + LOGGER.info('[ListLinkIds] request={:s}'.format(grpc_message_to_json_string(request))) + return LinkIdList(link_ids=[link.link_id for link in get_entries(self.database, 'link')]) + + def ListLinks(self, request: Empty, context : grpc.ServicerContext) -> LinkList: + LOGGER.info('[ListLinks] request={:s}'.format(grpc_message_to_json_string(request))) + return LinkList(links=get_entries(self.database, 'link')) + + def GetLink(self, request: LinkId, context : grpc.ServicerContext) -> Link: + LOGGER.info('[GetLink] request={:s}'.format(grpc_message_to_json_string(request))) + return get_entry(context, self.database, 'link', request.link_uuid.uuid) + + def SetLink(self, request: Context, context : grpc.ServicerContext) -> LinkId: + LOGGER.info('[SetLink] request={:s}'.format(grpc_message_to_json_string(request))) + return set_entry(self.database, 'link', request.link_id.link_uuid.uuid, request).link_id + + def RemoveLink(self, request: LinkId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveLink] request={:s}'.format(grpc_message_to_json_string(request))) + return del_entry(context, self.database, 'link', request.link_uuid.uuid) + + def GetLinkEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[LinkEvent]: + LOGGER.info('[GetLinkEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Slice ------------------------------------------------------------------------------------------------------ + + def ListSliceIds(self, request: ContextId, context : grpc.ServicerContext) -> SliceIdList: + LOGGER.info('[ListSliceIds] request={:s}'.format(grpc_message_to_json_string(request))) + slices = get_entries(self.database, 'slice[{:s}]'.format(str(request.context_uuid.uuid))) + return SliceIdList(slice_ids=[slice.slice_id for slice in slices]) + + def ListSlices(self, request: ContextId, context : grpc.ServicerContext) -> SliceList: + LOGGER.info('[ListSlices] request={:s}'.format(grpc_message_to_json_string(request))) + slices = get_entries(self.database, 'slice[{:s}]'.format(str(request.context_uuid.uuid))) + return SliceList(slices=[slice for slice in slices]) + + def GetSlice(self, request: SliceId, context : grpc.ServicerContext) -> Slice: + LOGGER.info('[GetSlice] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'slice[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return get_entry(context, self.database, container_name, request.slice_uuid.uuid) + + def SetSlice(self, request: Slice, context : grpc.ServicerContext) -> SliceId: + LOGGER.info('[SetSlice] request={:s}'.format(grpc_message_to_json_string(request))) + return set_entry( + self.database, 'slice[{:s}]'.format(str(request.slice_id.context_id.context_uuid.uuid)), + request.slice_id.slice_uuid.uuid, request).slice_id + + def RemoveSlice(self, request: SliceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveSlice] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'slice[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return del_entry(context, self.database, container_name, request.slice_uuid.uuid) + + def GetSliceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[SliceEvent]: + LOGGER.info('[GetSliceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Service ---------------------------------------------------------------------------------------------------- + + def ListServiceIds(self, request: ContextId, context : grpc.ServicerContext) -> ServiceIdList: + LOGGER.info('[ListServiceIds] request={:s}'.format(grpc_message_to_json_string(request))) + services = get_entries(self.database, 'service[{:s}]'.format(str(request.context_uuid.uuid))) + return ServiceIdList(service_ids=[service.service_id for service in services]) + + def ListServices(self, request: ContextId, context : grpc.ServicerContext) -> ServiceList: + LOGGER.info('[ListServices] request={:s}'.format(grpc_message_to_json_string(request))) + services = get_entries(self.database, 'service[{:s}]'.format(str(request.context_uuid.uuid))) + return ServiceList(services=[service for service in services]) + + def GetService(self, request: ServiceId, context : grpc.ServicerContext) -> Service: + LOGGER.info('[GetService] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'service[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return get_entry(context, self.database, container_name, request.service_uuid.uuid) + + def SetService(self, request: Service, context : grpc.ServicerContext) -> ServiceId: + LOGGER.info('[SetService] request={:s}'.format(grpc_message_to_json_string(request))) + return set_entry( + self.database, 'service[{:s}]'.format(str(request.service_id.context_id.context_uuid.uuid)), + request.service_id.service_uuid.uuid, request).service_id + + def RemoveService(self, request: ServiceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveService] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'service[{:s}]'.format(str(request.context_id.context_uuid.uuid)) + return del_entry(context, self.database, container_name, request.service_uuid.uuid) + + def GetServiceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ServiceEvent]: + LOGGER.info('[GetServiceEvents] request={:s}'.format(grpc_message_to_json_string(request))) + + + # ----- Connection ------------------------------------------------------------------------------------------------- + + def ListConnectionIds(self, request: ServiceId, context : grpc.ServicerContext) -> ConnectionIdList: + LOGGER.info('[ListConnectionIds] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'service_connections[{:s}/{:s}]'.format( + str(request.context_id.context_uuid.uuid), str(request.service_uuid.uuid)) + return ConnectionIdList(connection_ids=[c.connection_id for c in get_entries(self.database, container_name)]) + + def ListConnections(self, request: ServiceId, context : grpc.ServicerContext) -> ConnectionList: + LOGGER.info('[ListConnections] request={:s}'.format(grpc_message_to_json_string(request))) + container_name = 'service_connections[{:s}/{:s}]'.format( + str(request.context_id.context_uuid.uuid), str(request.service_uuid.uuid)) + return ConnectionList(connections=get_entries(self.database, container_name)) + + def GetConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Connection: + LOGGER.info('[GetConnection] request={:s}'.format(grpc_message_to_json_string(request))) + return get_entry(context, self.database, 'connection', request.connection_uuid.uuid) + + def SetConnection(self, request: Connection, context : grpc.ServicerContext) -> ConnectionId: + LOGGER.info('[SetConnection] request={:s}'.format(grpc_message_to_json_string(request))) + service_connection__container_name = 'service_connection[{:s}/{:s}]'.format( + str(request.service_id.context_id.context_uuid.uuid), str(request.service_id.service_uuid.uuid)) + set_entry( + self.database, service_connection__container_name, request.connection_id.connection_uuid.uuid, request) + return set_entry( + self.database, 'connection', request.connection_id.connection_uuid.uuid, request).connection_id + + def RemoveConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[RemoveConnection] request={:s}'.format(grpc_message_to_json_string(request))) + connection = get_entry(context, self.database, 'connection', request.connection_uuid.uuid) + service_id = connection.service_id + service_connection__container_name = 'service_connection[{:s}/{:s}]'.format( + str(service_id.context_id.context_uuid.uuid), str(service_id.service_uuid.uuid)) + del_entry(context, self.database, service_connection__container_name, request.connection_uuid.uuid) + return del_entry(context, self.database, 'connection', request.connection_uuid.uuid) + + def GetConnectionEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ConnectionEvent]: + LOGGER.info('[GetConnectionEvents] request={:s}'.format(grpc_message_to_json_string(request))) diff --git a/src/common/tests/MockServicerImpl_Device.py b/src/common/tests/MockServicerImpl_Device.py new file mode 100644 index 0000000000000000000000000000000000000000..efb809b3c027800e9ebe38c7b18f79b5caca9ade --- /dev/null +++ b/src/common/tests/MockServicerImpl_Device.py @@ -0,0 +1,51 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Settings import get_setting +from common.proto.context_pb2 import Device, DeviceConfig, DeviceId, Empty +from common.proto.device_pb2 import MonitoringSettings +from common.proto.device_pb2_grpc import DeviceServiceServicer +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +class MockServicerImpl_Device(DeviceServiceServicer): + def __init__(self): + LOGGER.info('[__init__] Creating Servicer...') + self.context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), + get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + LOGGER.info('[__init__] Servicer Created') + + def AddDevice(self, request : Device, context : grpc.ServicerContext) -> DeviceId: + LOGGER.info('[AddDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.SetDevice(request) + + def ConfigureDevice(self, request : Device, context : grpc.ServicerContext) -> DeviceId: + LOGGER.info('[ConfigureDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.SetDevice(request) + + def DeleteDevice(self, request : DeviceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[DeleteDevice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.RemoveDevice(request) + + def GetInitialConfig(self, request : DeviceId, context : grpc.ServicerContext) -> DeviceConfig: + LOGGER.info('[GetInitialConfig] request={:s}'.format(grpc_message_to_json_string(request))) + return DeviceConfig() + + def MonitorDeviceKpi(self, request : MonitoringSettings, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[MonitorDeviceKpi] request={:s}'.format(grpc_message_to_json_string(request))) + return Empty() diff --git a/src/common/tests/MockServicerImpl_Monitoring.py b/src/common/tests/MockServicerImpl_Monitoring.py new file mode 100644 index 0000000000000000000000000000000000000000..3f82f22e300e6ddae15816da69de63c96d0fdd5b --- /dev/null +++ b/src/common/tests/MockServicerImpl_Monitoring.py @@ -0,0 +1,34 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +import grpc, logging +from queue import Queue +from common.proto.context_pb2 import Empty +from common.proto.monitoring_pb2 import Kpi +from common.proto.monitoring_pb2_grpc import MonitoringServiceServicer +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) + +class MockServicerImpl_Monitoring(MonitoringServiceServicer): + def __init__(self, queue_samples : Queue): + LOGGER.info('[__init__] Creating Servicer...') + self.queue_samples = queue_samples + LOGGER.info('[__init__] Servicer Created') + + def IncludeKpi(self, request : Kpi, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[IncludeKpi] request={:s}'.format(grpc_message_to_json_string(request))) + self.queue_samples.put(request) + return Empty() diff --git a/src/common/tests/MockServicerImpl_Service.py b/src/common/tests/MockServicerImpl_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..39ddc1119e2294b2b62c40da58b151648b25051c --- /dev/null +++ b/src/common/tests/MockServicerImpl_Service.py @@ -0,0 +1,45 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Settings import get_setting +from common.proto.context_pb2 import Empty, Service, ServiceId, ServiceStatusEnum +from common.proto.service_pb2_grpc import ServiceServiceServicer +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +class MockServicerImpl_Service(ServiceServiceServicer): + def __init__(self): + LOGGER.info('[__init__] Creating Servicer...') + self.context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), + get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + LOGGER.info('[__init__] Servicer Created') + + def CreateService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: + LOGGER.info('[CreateService] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.SetService(request) + + def UpdateService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: + LOGGER.info('[UpdateService] request={:s}'.format(grpc_message_to_json_string(request))) + service = Service() + service.CopyFrom(request) + service.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE #pylint: disable=no-member + return self.context_client.SetService(service) + + def DeleteService(self, request : ServiceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[DeleteService] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.RemoveService(request) diff --git a/src/common/tests/MockServicerImpl_Slice.py b/src/common/tests/MockServicerImpl_Slice.py new file mode 100644 index 0000000000000000000000000000000000000000..f6be3dd62dbbe0b3c307d88f27c0400a977f8adb --- /dev/null +++ b/src/common/tests/MockServicerImpl_Slice.py @@ -0,0 +1,45 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Settings import get_setting +from common.proto.context_pb2 import Empty, Slice, SliceId, SliceStatusEnum +from common.proto.slice_pb2_grpc import SliceServiceServicer +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +class MockServicerImpl_Slice(SliceServiceServicer): + def __init__(self): + LOGGER.info('[__init__] Creating Servicer...') + self.context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), + get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + LOGGER.info('[__init__] Servicer Created') + + def CreateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + LOGGER.info('[CreateSlice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.SetSlice(request) + + def UpdateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + LOGGER.info('[UpdateSlice] request={:s}'.format(grpc_message_to_json_string(request))) + slice_ = Slice() + slice_.CopyFrom(request) + slice_.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member + return self.context_client.SetSlice(slice_) + + def DeleteSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: + LOGGER.info('[DeleteSlice] request={:s}'.format(grpc_message_to_json_string(request))) + return self.context_client.RemoveSlice(request) diff --git a/src/common/tests/PytestGenerateTests.py b/src/common/tests/PytestGenerateTests.py new file mode 100644 index 0000000000000000000000000000000000000000..240570565f9f3df2905ee33efb15c3b6a147050c --- /dev/null +++ b/src/common/tests/PytestGenerateTests.py @@ -0,0 +1,56 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Create a set of tests enabling to run tests as follows ... +# from common.tests.PytestGenerateTests import pytest_generate_tests # pylint: disable=unused-import +# +# scenario1 = ('basic', {'attribute': 'value'}) +# scenario2 = ('advanced', {'attribute': 'value2'}) +# +# class TestSampleWithScenarios: +# scenarios = [scenario1, scenario2] +# +# def test_demo1(self, attribute): +# assert isinstance(attribute, str) +# +# def test_demo2(self, attribute): +# assert isinstance(attribute, str) +# +# ... and run them as: +# $ pytest --log-level=INFO --verbose my_test.py +# =================== test session starts =================== +# platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /home/.../.pyenv/.../bin/python3.9 +# cachedir: .pytest_cache +# benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 +# calibration_precision=10 warmup=False warmup_iterations=100000) +# rootdir: /home/.../tests +# plugins: benchmark-3.4.1 +# collected 4 items +# +# my_test.py::TestSampleWithScenarios::test_demo1[basic] PASSED [ 25%] +# my_test.py::TestSampleWithScenarios::test_demo2[basic] PASSED [ 50%] +# my_test.py::TestSampleWithScenarios::test_demo1[advanced] PASSED [ 75%] +# my_test.py::TestSampleWithScenarios::test_demo2[advanced] PASSED [100%] +# +# ==================== 4 passed in 0.02s ==================== + +def pytest_generate_tests(metafunc): + idlist = [] + argvalues = [] + for scenario in metafunc.cls.scenarios: + idlist.append(scenario[0]) + items = scenario[1].items() + argnames = [x[0] for x in items] + argvalues.append([x[1] for x in items]) + metafunc.parametrize(argnames, argvalues, ids=idlist, scope='class') diff --git a/src/common/tests/__init__.py b/src/common/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/__init__.py b/src/common/tools/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/tools/__init__.py +++ b/src/common/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/client/RetryDecorator.py b/src/common/tools/client/RetryDecorator.py index d3f7f3e38c3e8b16afd39628bcfa4196f82b077e..9a1c0d69fc5d86b8a64a5886884c31e73af27777 100644 --- a/src/common/tools/client/RetryDecorator.py +++ b/src/common/tools/client/RetryDecorator.py @@ -1,6 +1,20 @@ -# This decorator re-executes the decorated function when it raises an exception. It enables to control the exception -# classes that should trigger the re-execution, the maximum number of retries, the delay between retries, and set the -# execution of a preparation method before every retry. The delay is specfied by means of user-customizable functions. +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# This decorator re-executes the decorated function when it raises an exception. It enables to control the maximum +# number of retries, the delay between retries, and to set the execution of a preparation method before every retry. +# The delay is specfied by means of user-customizable functions. # # Delay functions should return a compute function with a single parameter, the number of retry. For instance: # delay_linear(initial=0, increment=0): @@ -16,10 +30,8 @@ # adds an increasing delay between retries, starting with 1 second, and incresing it exponentially by steps of 2 # seconds, up to 10 seconds, every time an exception is caught within the current execution. # E.g. 1.0, 2.0, 4.0, 8.0, 10.0, 10.0, 10.0, ... - +# # Arguments: -# - exceptions: defines the set of exception classes to be catched for reconnection. Others are re-raised. -# By default all exceptions are re-raised. # - max_retries: defines the maximum number of retries acceptable before giving up. By default, 0 retries are executed. # - delay_function: defines the delay computation method to be used. By default, delay_linear with a fixed delay of 0.1 # seconds is used. @@ -31,7 +43,10 @@ # - prepare_method_kwargs: defines the dictionary of keyword arguments to be provided to the preparation method. If no # preparation method is specified, the argument is silently ignored. By default, an empty dictionary is defined. -import time +import grpc, logging, time +from grpc._channel import _InactiveRpcError + +LOGGER = logging.getLogger(__name__) def delay_linear(initial=0, increment=0, maximum=None): def compute(num_try): @@ -42,12 +57,12 @@ def delay_linear(initial=0, increment=0, maximum=None): def delay_exponential(initial=1, increment=1, maximum=None): def compute(num_try): - delay = initial * (num_try - 1) ^ increment + delay = initial * pow(increment, (num_try - 1)) if maximum is not None: delay = max(delay, maximum) return delay return compute -def retry(exceptions=set(), max_retries=0, delay_function=delay_linear(initial=0, increment=0), +def retry(max_retries=0, delay_function=delay_linear(initial=0, increment=0), prepare_method_name=None, prepare_method_args=[], prepare_method_kwargs={}): def _reconnect(func): def wrapper(self, *args, **kwargs): @@ -58,14 +73,19 @@ def retry(exceptions=set(), max_retries=0, delay_function=delay_linear(initial=0 while not given_up: try: return func(self, *args, **kwargs) - except Exception as e: - if not isinstance(e, tuple(exceptions)): raise + except (grpc.RpcError, _InactiveRpcError) as e: + if e.code() not in [grpc.StatusCode.UNAVAILABLE]: raise num_try += 1 given_up = num_try > max_retries - if given_up: raise Exception('Giving up... {} tries failed'.format(max_retries)) - if delay_function is not None: time.sleep(delay_function(num_try)) + if given_up: raise Exception('Giving up... {:d} tries failed'.format(max_retries)) from e + if delay_function is not None: + delay = delay_function(num_try) + time.sleep(delay) + LOGGER.info('Retry {:d}/{:d} after {:f} seconds...'.format(num_try, max_retries, delay)) + else: + LOGGER.info('Retry {:d}/{:d} immediate...'.format(num_try, max_retries)) if prepare_method_name is not None: prepare_method(*prepare_method_args, **prepare_method_kwargs) - return(wrapper) - return(_reconnect) + return wrapper + return _reconnect diff --git a/src/common/tools/client/__init__.py b/src/common/tools/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/tools/client/__init__.py +++ b/src/common/tools/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/grpc/ConfigRules.py b/src/common/tools/grpc/ConfigRules.py new file mode 100644 index 0000000000000000000000000000000000000000..e109cb7a00086da8530c7677967d86e57df1457a --- /dev/null +++ b/src/common/tools/grpc/ConfigRules.py @@ -0,0 +1,62 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# RFC 8466 - L2VPN Service Model (L2SM) +# Ref: https://datatracker.ietf.org/doc/html/rfc8466 + + +import json +from typing import Any, Dict, Tuple +from common.proto.context_pb2 import ConfigActionEnum, ConfigRule +from common.tools.grpc.Tools import grpc_message_to_json_string + +def update_config_rule_custom(config_rules, resource_key : str, fields : Dict[str, Tuple[Any, bool]]) -> ConfigRule: + # fields: Dict[field_name : str, Tuple[field_value : Any, raise_if_differs : bool]] + + for config_rule in config_rules: + if config_rule.WhichOneof('config_rule') != 'custom': continue + if config_rule.custom.resource_key != resource_key: continue + json_resource_value = json.loads(config_rule.custom.resource_value) + break # found, end loop + else: + # not found, add it + config_rule = config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = resource_key + json_resource_value = {} + + for field_name,(field_value, raise_if_differs) in fields.items(): + if (field_name not in json_resource_value) or not raise_if_differs: + # missing or raise_if_differs=False, add/update it + json_resource_value[field_name] = field_value + elif json_resource_value[field_name] != field_value: + # exists, differs, and raise_if_differs=True + msg = 'Specified {:s}({:s}) differs existing value({:s})' + raise Exception(msg.format(str(field_name), str(field_value), str(json_resource_value[field_name]))) + + config_rule.custom.resource_value = json.dumps(json_resource_value, sort_keys=True) + +def copy_config_rules(source_config_rules, target_config_rules): + for source_config_rule in source_config_rules: + config_rule_kind = source_config_rule.WhichOneof('config_rule') + if config_rule_kind == 'custom': + custom = source_config_rule.custom + resource_key = custom.resource_key + resource_value = json.loads(custom.resource_value) + raise_if_differs = True + fields = {name:(value, raise_if_differs) for name,value in resource_value.items()} + update_config_rule_custom(target_config_rules, resource_key, fields) + + else: + raise NotImplementedError('ConfigRule({:s})'.format(grpc_message_to_json_string(source_config_rule))) diff --git a/src/common/tools/grpc/Constraints.py b/src/common/tools/grpc/Constraints.py new file mode 100644 index 0000000000000000000000000000000000000000..a9dd4f40cbd823752b8cc09936ac48ebe32ec1a5 --- /dev/null +++ b/src/common/tools/grpc/Constraints.py @@ -0,0 +1,164 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# RFC 8466 - L2VPN Service Model (L2SM) +# Ref: https://datatracker.ietf.org/doc/html/rfc8466 + + +import json +from typing import Any, Dict, Optional, Tuple +from common.proto.context_pb2 import Constraint, EndPointId +from common.tools.grpc.Tools import grpc_message_to_json_string + +def update_constraint_custom(constraints, constraint_type : str, fields : Dict[str, Tuple[Any, bool]]) -> Constraint: + # fields: Dict[field_name : str, Tuple[field_value : Any, raise_if_differs : bool]] + + for constraint in constraints: + if constraint.WhichOneof('constraint') != 'custom': continue + if constraint.custom.constraint_type != constraint_type: continue + json_constraint_value = json.loads(constraint.custom.constraint_value) + break # found, end loop + else: + # not found, add it + constraint = constraints.add() # pylint: disable=no-member + constraint.custom.constraint_type = constraint_type + json_constraint_value = {} + + for field_name,(field_value, raise_if_differs) in fields.items(): + if (field_name not in json_constraint_value) or not raise_if_differs: + # missing or raise_if_differs=False, add/update it + json_constraint_value[field_name] = field_value + elif json_constraint_value[field_name] != field_value: + # exists, differs, and raise_if_differs=True + msg = 'Specified {:s}({:s}) differs existing value({:s})' + raise Exception(msg.format(str(field_name), str(field_value), str(json_constraint_value[field_name]))) + + constraint.custom.constraint_value = json.dumps(json_constraint_value, sort_keys=True) + +def update_constraint_endpoint_location( + constraints, endpoint_id : EndPointId, + region : Optional[str] = None, gps_position : Optional[Tuple[float, float]] = None +) -> Constraint: + # gps_position: (latitude, longitude) + if region is not None and gps_position is not None: + raise Exception('Only one of region/gps_position can be provided') + + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + device_uuid = endpoint_id.device_id.device_uuid.uuid + topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + for constraint in constraints: + if constraint.WhichOneof('constraint') != 'endpoint_location': continue + _endpoint_id = constraint.endpoint_location.endpoint_id + if _endpoint_id.endpoint_uuid.uuid != endpoint_uuid: continue + if _endpoint_id.device_id.device_uuid.uuid != device_uuid: continue + if _endpoint_id.topology_id.topology_uuid.uuid != topology_uuid: continue + if _endpoint_id.topology_id.context_id.context_uuid.uuid != context_uuid: continue + break # found, end loop + else: + # not found, add it + constraint = constraints.add() # pylint: disable=no-member + _endpoint_id = constraint.endpoint_location.endpoint_id + _endpoint_id.endpoint_uuid.uuid = endpoint_uuid + _endpoint_id.device_id.device_uuid.uuid = device_uuid + _endpoint_id.topology_id.topology_uuid.uuid = topology_uuid + _endpoint_id.topology_id.context_id.context_uuid.uuid = context_uuid + + location = constraint.endpoint_location.location + if region is not None: + location.region = region + elif gps_position is not None: + location.gps_position.latitude = gps_position[0] + location.gps_position.longitude = gps_position[1] + return constraint + +def update_constraint_endpoint_priority(constraints, endpoint_id : EndPointId, priority : int) -> Constraint: + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + device_uuid = endpoint_id.device_id.device_uuid.uuid + topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + for constraint in constraints: + if constraint.WhichOneof('constraint') != 'endpoint_priority': continue + _endpoint_id = constraint.endpoint_priority.endpoint_id + if _endpoint_id.endpoint_uuid.uuid != endpoint_uuid: continue + if _endpoint_id.device_id.device_uuid.uuid != device_uuid: continue + if _endpoint_id.topology_id.topology_uuid.uuid != topology_uuid: continue + if _endpoint_id.topology_id.context_id.context_uuid.uuid != context_uuid: continue + break # found, end loop + else: + # not found, add it + constraint = constraints.add() # pylint: disable=no-member + _endpoint_id = constraint.endpoint_priority.endpoint_id + _endpoint_id.endpoint_uuid.uuid = endpoint_uuid + _endpoint_id.device_id.device_uuid.uuid = device_uuid + _endpoint_id.topology_id.topology_uuid.uuid = topology_uuid + _endpoint_id.topology_id.context_id.context_uuid.uuid = context_uuid + + constraint.endpoint_priority.priority = priority + return constraint + +def update_constraint_sla_availability(constraints, num_disjoint_paths : int, all_active : bool) -> Constraint: + for constraint in constraints: + if constraint.WhichOneof('constraint') != 'sla_availability': continue + break # found, end loop + else: + # not found, add it + constraint = constraints.add() # pylint: disable=no-member + + constraint.sla_availability.num_disjoint_paths = num_disjoint_paths + constraint.sla_availability.all_active = all_active + return constraint + + +def copy_constraints(source_constraints, target_constraints): + for source_constraint in source_constraints: + constraint_kind = source_constraint.WhichOneof('constraint') + if constraint_kind == 'custom': + custom = source_constraint.custom + constraint_type = custom.constraint_type + constraint_value = json.loads(custom.constraint_value) + raise_if_differs = True + fields = {name:(value, raise_if_differs) for name,value in constraint_value.items()} + update_constraint_custom(target_constraints, constraint_type, fields) + + elif constraint_kind == 'endpoint_location': + endpoint_id = source_constraint.endpoint_location.endpoint_id + location = source_constraint.endpoint_location.location + location_kind = location.WhichOneof('location') + if location_kind == 'region': + region = location.region + update_constraint_endpoint_location(target_constraints, endpoint_id, region=region) + elif location_kind == 'gps_position': + gps_position = location.gps_position + gps_position = (gps_position.latitude, gps_position.longitude) + update_constraint_endpoint_location(target_constraints, endpoint_id, gps_position=gps_position) + else: + str_constraint = grpc_message_to_json_string(source_constraint) + raise NotImplementedError('Constraint({:s}): Location({:s})'.format(str_constraint, constraint_kind)) + + elif constraint_kind == 'endpoint_priority': + endpoint_id = source_constraint.endpoint_priority.endpoint_id + priority = source_constraint.endpoint_priority.priority + update_constraint_endpoint_priority(target_constraints, endpoint_id, priority) + + elif constraint_kind == 'sla_availability': + sla_availability = source_constraint.sla_availability + num_disjoint_paths = sla_availability.num_disjoint_paths + all_active = sla_availability.all_active + update_constraint_sla_availability(target_constraints, num_disjoint_paths, all_active) + + else: + raise NotImplementedError('Constraint({:s})'.format(grpc_message_to_json_string(source_constraint))) diff --git a/src/common/tools/grpc/EndPointIds.py b/src/common/tools/grpc/EndPointIds.py new file mode 100644 index 0000000000000000000000000000000000000000..b3830d4c809bb6dc065e58bc8af0f1ad56c610f4 --- /dev/null +++ b/src/common/tools/grpc/EndPointIds.py @@ -0,0 +1,50 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# RFC 8466 - L2VPN Service Model (L2SM) +# Ref: https://datatracker.ietf.org/doc/html/rfc8466 + + +from typing import Optional +from common.proto.context_pb2 import EndPointId + +def update_endpoint_ids( + endpoint_ids, device_uuid : str, endpoint_uuid : str, + context_uuid : Optional[str] = None, topology_uuid : Optional[str] = None +) -> EndPointId: + for endpoint_id in endpoint_ids: + if endpoint_id.endpoint_uuid.uuid != endpoint_uuid: continue + if endpoint_id.device_id.device_uuid.uuid != device_uuid: continue + topology_id = endpoint_id.topology_id + if topology_uuid is not None and topology_id.topology_uuid.uuid != topology_uuid: continue + if context_uuid is not None and topology_id.context_id.context_uuid.uuid != context_uuid: continue + break # found, do nothing + else: + # not found, add it + endpoint_id = endpoint_ids.add() # pylint: disable=no-member + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + endpoint_id.device_id.device_uuid.uuid = device_uuid + if topology_uuid is not None: endpoint_id.topology_id.topology_uuid.uuid = topology_uuid + if context_uuid is not None: endpoint_id.topology_id.context_id.context_uuid.uuid = context_uuid + return endpoint_id + +def copy_endpoint_ids(source_endpoint_ids, target_endpoint_ids): + for source_endpoint_id in source_endpoint_ids: + device_uuid = source_endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = source_endpoint_id.endpoint_uuid.uuid + source_topology_id = source_endpoint_id.topology_id + context_uuid = source_topology_id.context_id.context_uuid.uuid + topology_uuid = source_topology_id.topology_uuid.uuid + update_endpoint_ids( + target_endpoint_ids, device_uuid, endpoint_uuid, context_uuid=context_uuid, topology_uuid=topology_uuid) diff --git a/src/common/tools/grpc/ServiceIds.py b/src/common/tools/grpc/ServiceIds.py new file mode 100644 index 0000000000000000000000000000000000000000..0e1073cab7c4e82e0f21584f2831d94a0b8a23ba --- /dev/null +++ b/src/common/tools/grpc/ServiceIds.py @@ -0,0 +1,37 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# RFC 8466 - L2VPN Service Model (L2SM) +# Ref: https://datatracker.ietf.org/doc/html/rfc8466 + + +from common.proto.context_pb2 import ServiceId + +def update_service_ids(service_ids, context_uuid : str, service_uuid : str) -> ServiceId: + for service_id in service_ids: + if service_id.service_uuid.uuid != service_uuid: continue + if service_id.context_id.context_uuid.uuid != context_uuid: continue + break # found, do nothing + else: + # not found, add it + service_id = service_ids.add() # pylint: disable=no-member + service_id.service_uuid.uuid = service_uuid + service_id.context_id.context_uuid.uuid = context_uuid + return service_id + +def copy_service_ids(source_service_ids, target_service_ids): + for source_service_id in source_service_ids: + context_uuid = source_service_id.context_id.context_uuid.uuid + service_uuid = source_service_id.service_uuid.uuid + update_service_ids(target_service_ids, context_uuid, service_uuid) diff --git a/src/common/tools/grpc/Tools.py b/src/common/tools/grpc/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..f0c72a36f18acf2c278f7204352055861b79216f --- /dev/null +++ b/src/common/tools/grpc/Tools.py @@ -0,0 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json +from google.protobuf.json_format import MessageToDict + +def grpc_message_to_json( + message, including_default_value_fields=True, preserving_proto_field_name=True, use_integers_for_enums=False + ): + if not hasattr(message, 'DESCRIPTOR'): return json.dumps(str(message), sort_keys=True) # not a gRPC message + return MessageToDict( + message, including_default_value_fields=including_default_value_fields, + preserving_proto_field_name=preserving_proto_field_name, use_integers_for_enums=use_integers_for_enums) + +def grpc_message_list_to_json(message_list): + if message_list is None: return None + return [grpc_message_to_json(message) for message in message_list] + +def grpc_message_to_json_string(message): + if message is None: return str(None) + return json.dumps(grpc_message_to_json(message), sort_keys=True) + +def grpc_message_list_to_json_string(message_list): + if message_list is None: return str(None) + return json.dumps(grpc_message_list_to_json(message_list), sort_keys=True) diff --git a/src/common/tools/grpc/__init__.py b/src/common/tools/grpc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tools/grpc/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/object_factory/ConfigRule.py b/src/common/tools/object_factory/ConfigRule.py new file mode 100644 index 0000000000000000000000000000000000000000..5d889ee7ef3a38f1e43c74addc75d95291370491 --- /dev/null +++ b/src/common/tools/object_factory/ConfigRule.py @@ -0,0 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json +from typing import Any, Dict, Union +from common.proto.context_pb2 import ConfigActionEnum + +def json_config_rule(action : ConfigActionEnum, resource_key : str, resource_value : Union[str, Dict[str, Any]]): + if not isinstance(resource_value, str): resource_value = json.dumps(resource_value, sort_keys=True) + return {'action': action, 'custom': {'resource_key': resource_key, 'resource_value': resource_value}} + +def json_config_rule_set(resource_key : str, resource_value : Union[str, Dict[str, Any]]): + return json_config_rule(ConfigActionEnum.CONFIGACTION_SET, resource_key, resource_value) + +def json_config_rule_delete(resource_key : str, resource_value : Union[str, Dict[str, Any]]): + return json_config_rule(ConfigActionEnum.CONFIGACTION_DELETE, resource_key, resource_value) diff --git a/src/common/tools/object_factory/Connection.py b/src/common/tools/object_factory/Connection.py new file mode 100644 index 0000000000000000000000000000000000000000..3f0207ae57901dc4775552b0a967d280077069bb --- /dev/null +++ b/src/common/tools/object_factory/Connection.py @@ -0,0 +1,32 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, List, Optional + +def json_connection_id(connection_uuid : str): + return {'connection_uuid': {'uuid': connection_uuid}} + +def json_connection( + connection_uuid : str, service_id : Optional[Dict] = None, path_hops_endpoint_ids : List[Dict] = [], + sub_service_ids : List[Dict] = [] + ): + + result = { + 'connection_id' : json_connection_id(connection_uuid), + 'path_hops_endpoint_ids': copy.deepcopy(path_hops_endpoint_ids), + 'sub_service_ids' : copy.deepcopy(sub_service_ids), + } + if service_id is not None: result['service_id'] = copy.deepcopy(service_id) + return result diff --git a/src/common/tools/object_factory/Constraint.py b/src/common/tools/object_factory/Constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..df290d4285330f1965608d710d9d48ca49131521 --- /dev/null +++ b/src/common/tools/object_factory/Constraint.py @@ -0,0 +1,20 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json +from typing import Any, Dict, Union + +def json_constraint(constraint_type : str, constraint_value : Union[str, Dict[str, Any]]): + if not isinstance(constraint_value, str): constraint_value = json.dumps(constraint_value, sort_keys=True) + return {'custom': {'constraint_type': constraint_type, 'constraint_value': constraint_value}} diff --git a/src/common/tools/object_factory/Context.py b/src/common/tools/object_factory/Context.py new file mode 100644 index 0000000000000000000000000000000000000000..d5d1bf9439dd12c67d77bcbe38f37fb29c89d948 --- /dev/null +++ b/src/common/tools/object_factory/Context.py @@ -0,0 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +def json_context_id(context_uuid : str): + return {'context_uuid': {'uuid': context_uuid}} + +def json_context(context_uuid : str): + return { + 'context_id' : json_context_id(context_uuid), + 'topology_ids': [], + 'service_ids' : [], + } diff --git a/src/common/tools/object_factory/Device.py b/src/common/tools/object_factory/Device.py new file mode 100644 index 0000000000000000000000000000000000000000..32baff9ae5cfb9a9a41d1d06bfec7df5fd5c0e4a --- /dev/null +++ b/src/common/tools/object_factory/Device.py @@ -0,0 +1,119 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, List, Tuple +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from common.tools.object_factory.ConfigRule import json_config_rule_set + +DEVICE_DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + +DEVICE_EMUOLS_TYPE = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value +DEVICE_EMUPR_TYPE = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVICE_EMU_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_UNDEFINED] +DEVICE_EMU_ADDRESS = '127.0.0.1' +DEVICE_EMU_PORT = '0' + +DEVICE_PR_TYPE = DeviceTypeEnum.PACKET_ROUTER.value +DEVICE_PR_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG] + +DEVICE_TAPI_TYPE = DeviceTypeEnum.OPTICAL_LINE_SYSTEM.value +DEVICE_TAPI_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API] + +# check which enum type and value assign to microwave device +DEVICE_MICROWAVE_TYPE = DeviceTypeEnum.MICROVAWE_RADIO_SYSTEM.value +DEVICE_MICROWAVE_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY] + +DEVICE_P4_TYPE = DeviceTypeEnum.P4_SWITCH.value +DEVICE_P4_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_P4] + +def json_device_id(device_uuid : str): + return {'device_uuid': {'uuid': device_uuid}} + +def json_device( + device_uuid : str, device_type : str, status : DeviceOperationalStatusEnum, endpoints : List[Dict] = [], + config_rules : List[Dict] = [], drivers : List[Dict] = [] + ): + return { + 'device_id' : json_device_id(device_uuid), + 'device_type' : device_type, + 'device_config' : {'config_rules': copy.deepcopy(config_rules)}, + 'device_operational_status': status, + 'device_drivers' : copy.deepcopy(drivers), + 'device_endpoints' : copy.deepcopy(endpoints), + } + +def json_device_emulated_packet_router_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_EMU_DRIVERS + ): + return json_device( + device_uuid, DEVICE_EMUPR_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, + drivers=drivers) + +def json_device_emulated_tapi_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_EMU_DRIVERS + ): + return json_device( + device_uuid, DEVICE_EMUOLS_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, + drivers=drivers) + +def json_device_packetrouter_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_PR_DRIVERS + ): + return json_device( + device_uuid, DEVICE_PR_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, drivers=drivers) + +def json_device_tapi_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_TAPI_DRIVERS + ): + return json_device( + device_uuid, DEVICE_TAPI_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, drivers=drivers) + +def json_device_microwave_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_MICROWAVE_DRIVERS + ): + return json_device( + device_uuid, DEVICE_MICROWAVE_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, + drivers=drivers) + +def json_device_p4_disabled( + device_uuid : str, endpoints : List[Dict] = [], config_rules : List[Dict] = [], + drivers : List[Dict] = DEVICE_P4_DRIVERS + ): + return json_device( + device_uuid, DEVICE_P4_TYPE, DEVICE_DISABLED, endpoints=endpoints, config_rules=config_rules, drivers=drivers) + +def json_device_connect_rules(address : str, port : int, settings : Dict = {}): + return [ + json_config_rule_set('_connect/address', address), + json_config_rule_set('_connect/port', port), + json_config_rule_set('_connect/settings', settings), + ] + +def json_device_emulated_connect_rules( + endpoint_descriptors : List[Tuple[str, str, List[int]]], address : str = DEVICE_EMU_ADDRESS, + port : int = DEVICE_EMU_PORT + ): + + settings = {'endpoints': [ + {'uuid': endpoint_uuid, 'type': endpoint_type, 'sample_types': sample_types} + for endpoint_uuid,endpoint_type,sample_types in endpoint_descriptors + ]} + return json_device_connect_rules(address, port, settings=settings) diff --git a/src/common/tools/object_factory/EndPoint.py b/src/common/tools/object_factory/EndPoint.py new file mode 100644 index 0000000000000000000000000000000000000000..9eca5e96371713d1e095eba4666ee806ad6cf71e --- /dev/null +++ b/src/common/tools/object_factory/EndPoint.py @@ -0,0 +1,51 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, List, Optional, Tuple + +def json_endpoint_id(device_id : Dict, endpoint_uuid : str, topology_id : Optional[Dict] = None): + result = {'device_id': copy.deepcopy(device_id), 'endpoint_uuid': {'uuid': endpoint_uuid}} + if topology_id is not None: result['topology_id'] = copy.deepcopy(topology_id) + return result + +def json_endpoint_ids( + device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]], topology_id : Optional[Dict] = None + ): + return [ + json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id) + for endpoint_uuid, _, _ in endpoint_descriptors + ] + +def json_endpoint( + device_id : Dict, endpoint_uuid : str, endpoint_type : str, topology_id : Optional[Dict] = None, + kpi_sample_types : List[int] = [] + ): + + result = { + 'endpoint_id': json_endpoint_id(device_id, endpoint_uuid, topology_id=topology_id), + 'endpoint_type': endpoint_type, + } + if len(kpi_sample_types) > 0: result['kpi_sample_types'] = copy.deepcopy(kpi_sample_types) + return result + +def json_endpoints( + device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]], topology_id : Optional[Dict] = None + ): + return [ + json_endpoint( + device_id, endpoint_uuid, endpoint_type, topology_id=topology_id, + kpi_sample_types=endpoint_sample_types) + for endpoint_uuid, endpoint_type, endpoint_sample_types in endpoint_descriptors + ] diff --git a/src/common/tools/object_factory/Link.py b/src/common/tools/object_factory/Link.py new file mode 100644 index 0000000000000000000000000000000000000000..922a39dbe24f4f4b635f378180ab13c80322801b --- /dev/null +++ b/src/common/tools/object_factory/Link.py @@ -0,0 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, List + +def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def json_link_id(link_uuid : str): + return {'link_uuid': {'uuid': link_uuid}} + +def json_link(link_uuid : str, endpoint_ids : List[Dict]): + return {'link_id': json_link_id(link_uuid), 'link_endpoint_ids': copy.deepcopy(endpoint_ids)} diff --git a/src/common/tools/object_factory/Service.py b/src/common/tools/object_factory/Service.py new file mode 100644 index 0000000000000000000000000000000000000000..51f75e6dbe5e430330e697da772d65703f7568c7 --- /dev/null +++ b/src/common/tools/object_factory/Service.py @@ -0,0 +1,53 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, List, Optional +from common.Constants import DEFAULT_CONTEXT_UUID +from common.proto.context_pb2 import ServiceStatusEnum, ServiceTypeEnum +from common.tools.object_factory.Context import json_context_id + +def get_service_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return 'svc:{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def json_service_id(service_uuid : str, context_id : Optional[Dict] = None): + result = {'service_uuid': {'uuid': service_uuid}} + if context_id is not None: result['context_id'] = copy.deepcopy(context_id) + return result + +def json_service( + service_uuid : str, service_type : ServiceTypeEnum, context_id : Optional[Dict] = None, + status : ServiceStatusEnum = ServiceStatusEnum.SERVICESTATUS_PLANNED, + endpoint_ids : List[Dict] = [], constraints : List[Dict] = [], config_rules : List[Dict] = []): + + return { + 'service_id' : json_service_id(service_uuid, context_id=context_id), + 'service_type' : service_type, + 'service_status' : {'service_status': status}, + 'service_endpoint_ids': copy.deepcopy(endpoint_ids), + 'service_constraints' : copy.deepcopy(constraints), + 'service_config' : {'config_rules': copy.deepcopy(config_rules)}, + } + +def json_service_l3nm_planned( + service_uuid : str, endpoint_ids : List[Dict] = [], constraints : List[Dict] = [], + config_rules : List[Dict] = [] + ): + + return json_service( + service_uuid, ServiceTypeEnum.SERVICETYPE_L3NM, context_id=json_context_id(DEFAULT_CONTEXT_UUID), + status=ServiceStatusEnum.SERVICESTATUS_PLANNED, endpoint_ids=endpoint_ids, constraints=constraints, + config_rules=config_rules) diff --git a/src/common/tools/object_factory/Topology.py b/src/common/tools/object_factory/Topology.py new file mode 100644 index 0000000000000000000000000000000000000000..7de4a1d577f1e46cfdf6545dde79b60808cd8afb --- /dev/null +++ b/src/common/tools/object_factory/Topology.py @@ -0,0 +1,28 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy +from typing import Dict, Optional + +def json_topology_id(topology_uuid : str, context_id : Optional[Dict] = None): + result = {'topology_uuid': {'uuid': topology_uuid}} + if context_id is not None: result['context_id'] = copy.deepcopy(context_id) + return result + +def json_topology(topology_uuid : str, context_id : Optional[Dict] = None): + return { + 'topology_id': json_topology_id(topology_uuid, context_id=context_id), + 'device_ids' : [], + 'link_ids' : [], + } diff --git a/src/common/tools/object_factory/__init__.py b/src/common/tools/object_factory/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tools/object_factory/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/service/GenericGrpcService.py b/src/common/tools/service/GenericGrpcService.py new file mode 100644 index 0000000000000000000000000000000000000000..61fccdb02b5a6cbd23600093bcba4c69bf142d83 --- /dev/null +++ b/src/common/tools/service/GenericGrpcService.py @@ -0,0 +1,71 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Optional, Union +import grpc, logging +from concurrent import futures +from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH +from grpc_health.v1.health_pb2 import HealthCheckResponse +from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +from common.Settings import get_grpc_bind_address, get_grpc_grace_period, get_grpc_max_workers + +class GenericGrpcService: + def __init__( + self, bind_port : Union[str, int], bind_address : Optional[str] = None, max_workers : Optional[int] = None, + grace_period : Optional[int] = None, enable_health_servicer : bool = True, cls_name : str = __name__ + ) -> None: + self.logger = logging.getLogger(cls_name) + self.bind_port = bind_port + self.bind_address = get_grpc_bind_address() if bind_address is None else bind_address + self.max_workers = get_grpc_max_workers() if max_workers is None else max_workers + self.grace_period = get_grpc_grace_period() if grace_period is None else grace_period + self.enable_health_servicer = enable_health_servicer + self.endpoint = None + self.health_servicer = None + self.pool = None + self.server = None + + def install_servicers(self): + pass + + def start(self): + self.endpoint = '{:s}:{:s}'.format(str(self.bind_address), str(self.bind_port)) + self.logger.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( + str(self.endpoint), str(self.max_workers))) + + self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) + self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) + + self.install_servicers() + + if self.enable_health_servicer: + self.health_servicer = HealthServicer( + experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) + add_HealthServicer_to_server(self.health_servicer, self.server) + + self.bind_port = self.server.add_insecure_port(self.endpoint) + self.endpoint = '{:s}:{:s}'.format(str(self.bind_address), str(self.bind_port)) + self.logger.info('Listening on {:s}...'.format(str(self.endpoint))) + self.server.start() + if self.enable_health_servicer: + self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member + + self.logger.debug('Service started') + + def stop(self): + self.logger.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) + if self.enable_health_servicer: + self.health_servicer.enter_graceful_shutdown() + self.server.stop(self.grace_period) + self.logger.debug('Service stopped') diff --git a/src/common/tools/service/GenericRestServer.py b/src/common/tools/service/GenericRestServer.py new file mode 100644 index 0000000000000000000000000000000000000000..4325fe1dbc0169665a1281b27e6993670add337c --- /dev/null +++ b/src/common/tools/service/GenericRestServer.py @@ -0,0 +1,59 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, logging, threading, time +from typing import Optional, Union +from flask import Flask, request +from flask_restful import Api, Resource +from werkzeug.serving import make_server +from common.Settings import get_http_bind_address + +logging.getLogger('werkzeug').setLevel(logging.WARNING) + + +def log_request(logger, response): + timestamp = time.strftime('[%Y-%b-%d %H:%M]') + logger.info('%s %s %s %s %s', timestamp, request.remote_addr, request.method, request.full_path, response.status) + return response + +class GenericRestServer(threading.Thread): + def __init__( + self, bind_port : Union[str, int], base_url : str, bind_address : Optional[str] = None, + cls_name : str = __name__ + ) -> None: + threading.Thread.__init__(self, daemon=True) + self.logger = logging.getLogger(cls_name) + self.bind_port = bind_port + self.base_url = base_url + self.bind_address = get_http_bind_address() if bind_address is None else bind_address + self.endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.bind_address), str(self.bind_port), str(self.base_url)) + self.srv = None + self.ctx = None + self.app = Flask(__name__) + self.app.after_request(functools.partial(log_request, self.logger)) + self.api = Api(self.app, prefix=self.base_url) + + def add_resource(self, resource : Resource, *urls, **kwargs): + self.api.add_resource(resource, *urls, **kwargs) + + def run(self): + self.srv = make_server(self.bind_address, self.bind_port, self.app, threaded=True) + self.ctx = self.app.app_context() + self.ctx.push() + + self.logger.info('Listening on {:s}...'.format(str(self.endpoint))) + self.srv.serve_forever() + + def shutdown(self): + self.srv.shutdown() diff --git a/src/common/tools/service/__init__.py b/src/common/tools/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tools/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/tools/timestamp/Converters.py b/src/common/tools/timestamp/Converters.py new file mode 100644 index 0000000000000000000000000000000000000000..46a1bcb01a83f1ff4fc2d54cd8fb606dbe7f2bcc --- /dev/null +++ b/src/common/tools/timestamp/Converters.py @@ -0,0 +1,26 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +import dateutil.parser +from datetime import datetime, timezone + +def timestamp_string_to_float(str_timestamp : str) -> float: + return datetime.timestamp(dateutil.parser.isoparse(str_timestamp)) + +def timestamp_float_to_string(flt_timestamp : float) -> str: + return datetime.utcfromtimestamp(flt_timestamp).isoformat() + 'Z' + +def timestamp_utcnow_to_float() -> float: + return datetime.timestamp(datetime.now(tz=timezone.utc)) diff --git a/src/common/tools/timestamp/__init__.py b/src/common/tools/timestamp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/common/tools/timestamp/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/common/type_checkers/Assertions.py b/src/common/type_checkers/Assertions.py index f0618fbd848447dfb60c1e86298a5e042646e2fb..20ffa9ad619a40d6da4f3830c202d1a545545b51 100644 --- a/src/common/type_checkers/Assertions.py +++ b/src/common/type_checkers/Assertions.py @@ -1,5 +1,20 @@ -# ----- Enumerations --------------------------------------------------------------------------------------------------- +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Dict +# ----- Enumerations --------------------------------------------------------------------------------------------------- def validate_config_action_enum(message): assert isinstance(message, str) assert message in [ @@ -65,15 +80,26 @@ def validate_uuid(message, allow_empty=False): if allow_empty: return assert len(message['uuid']) > 1 +CONFIG_RULE_TYPES = { + 'custom', + 'acl', +} def validate_config_rule(message): assert isinstance(message, dict) - assert len(message.keys()) == 3 + assert len(message.keys()) == 2 assert 'action' in message validate_config_action_enum(message['action']) - assert 'resource_key' in message - assert isinstance(message['resource_key'], str) - assert 'resource_value' in message - assert isinstance(message['resource_value'], str) + other_keys = set(list(message.keys())) + other_keys.discard('action') + config_rule_type = other_keys.pop() + assert config_rule_type in CONFIG_RULE_TYPES + assert config_rule_type == 'custom', 'ConfigRule Type Validator for {:s} not implemented'.format(config_rule_type) + custom : Dict = message['custom'] + assert len(custom.keys()) == 2 + assert 'resource_key' in custom + assert isinstance(custom['resource_key'], str) + assert 'resource_value' in custom + assert isinstance(custom['resource_value'], str) def validate_config_rules(message): assert isinstance(message, dict) @@ -81,13 +107,28 @@ def validate_config_rules(message): assert 'config_rules' in message for config_rule in message['config_rules']: validate_config_rule(config_rule) +CONSTRAINT_TYPES = { + 'custom', + 'schedule', + 'endpoint_location', + 'sla_capacity', + 'sla_latency', + 'sla_availability', + 'sla_isolation', +} def validate_constraint(message): assert isinstance(message, dict) - assert len(message.keys()) == 2 - assert 'constraint_type' in message - assert isinstance(message['constraint_type'], str) - assert 'constraint_value' in message - assert isinstance(message['constraint_value'], str) + assert len(message.keys()) == 1 + other_keys = list(message.keys()) + constraint_type = other_keys[0] + assert constraint_type in CONSTRAINT_TYPES + assert constraint_type == 'custom', 'Constraint Type Validator for {:s} not implemented'.format(constraint_type) + custom : Dict = message['custom'] + assert len(custom.keys()) == 2 + assert 'constraint_type' in custom + assert isinstance(custom['constraint_type'], str) + assert 'constraint_value' in custom + assert isinstance(custom['constraint_value'], str) # ----- Identifiers ---------------------------------------------------------------------------------------------------- @@ -138,6 +179,12 @@ def validate_endpoint_id(message): assert 'endpoint_uuid' in message validate_uuid(message['endpoint_uuid']) +def validate_connection_id(message): + assert isinstance(message, dict) + assert len(message.keys()) == 1 + assert 'connection_uuid' in message + validate_uuid(message['connection_uuid']) + # ----- Lists of Identifiers ------------------------------------------------------------------------------------------- @@ -176,6 +223,13 @@ def validate_link_ids(message): assert isinstance(message['link_ids'], list) for link_id in message['link_ids']: validate_link_id(link_id) +def validate_connection_ids(message): + assert isinstance(message, dict) + assert len(message.keys()) == 1 + assert 'connection_ids' in message + assert isinstance(message['connection_ids'], list) + for connection_id in message['connection_ids']: validate_connection_id(connection_id) + # ----- Objects -------------------------------------------------------------------------------------------------------- @@ -268,6 +322,20 @@ def validate_link(message): assert isinstance(message['link_endpoint_ids'], list) for endpoint_id in message['link_endpoint_ids']: validate_endpoint_id(endpoint_id) +def validate_connection(message): + assert isinstance(message, dict) + assert len(message.keys()) == 4 + assert 'connection_id' in message + validate_connection_id(message['connection_id']) + assert 'service_id' in message + validate_service_id(message['service_id']) + assert 'path_hops_endpoint_ids' in message + assert isinstance(message['path_hops_endpoint_ids'], list) + for endpoint_id in message['path_hops_endpoint_ids']: validate_endpoint_id(endpoint_id) + assert 'sub_service_ids' in message + assert isinstance(message['sub_service_ids'], list) + for sub_service_id in message['sub_service_ids']: validate_service_id(sub_service_id) + # ----- Lists of Objects ----------------------------------------------------------------------------------------------- @@ -305,3 +373,10 @@ def validate_links(message): assert 'links' in message assert isinstance(message['links'], list) for link in message['links']: validate_link(link) + +def validate_connections(message): + assert isinstance(message, dict) + assert len(message.keys()) == 1 + assert 'connections' in message + assert isinstance(message['connections'], list) + for connection in message['connections']: validate_connection(connection) diff --git a/src/common/type_checkers/Checkers.py b/src/common/type_checkers/Checkers.py index d0eddcf213143c4c3d99c9edfafd1305384e777b..0bf36cb79fddb827743c2f7529b4ae3a9040d506 100644 --- a/src/common/type_checkers/Checkers.py +++ b/src/common/type_checkers/Checkers.py @@ -1,5 +1,19 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import re -from typing import Any, Container, List, Optional, Pattern, Set, Sized, Tuple, Union +from typing import Any, Container, Dict, List, Optional, Pattern, Set, Sized, Tuple, Union def chk_none(name : str, value : Any, reason=None) -> Any: if value is None: return value @@ -11,6 +25,11 @@ def chk_not_none(name : str, value : Any, reason=None) -> Any: if reason is None: reason = 'must not be None.' raise ValueError('{}({}) {}'.format(str(name), str(value), str(reason))) +def chk_attribute(name : str, container : Dict, container_name : str, **kwargs): + if name in container: return container[name] + if 'default' in kwargs: return kwargs['default'] + raise AttributeError('Missing object({:s}) in container({:s})'.format(str(name), str(container_name))) + def chk_type(name : str, value : Any, type_or_types : Union[type, Set[type]] = set()) -> Any: if isinstance(value, type_or_types): return value msg = '{}({}) is of a wrong type({}). Accepted type_or_types({}).' diff --git a/src/common/type_checkers/__init__.py b/src/common/type_checkers/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/common/type_checkers/__init__.py +++ b/src/common/type_checkers/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/.gitlab-ci.yml b/src/compute/.gitlab-ci.yml index 948092ea3b896ce5e487bd7b9e42a6aff6743626..52b36e8196822c35503f3e644a0d57691fc5f5f0 100644 --- a/src/compute/.gitlab-ci.yml +++ b/src/compute/.gitlab-ci.yml @@ -1,4 +1,18 @@ -# Build, tag and push the Docker image to the GitLab registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build compute: variables: IMAGE_NAME: 'compute' # name of the microservice @@ -7,19 +21,21 @@ build compute: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -# after_script: -# - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -36,23 +52,32 @@ unit test compute: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 9090:9090 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 9090:9090 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy compute: @@ -64,10 +89,10 @@ deploy compute: - unit test compute # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/compute/Config.py b/src/compute/Config.py index e95740493fd16940cee2d1e780472a1e90801303..341ae77f506ce1d2488c3d494262ee26ca6dd7eb 100644 --- a/src/compute/Config.py +++ b/src/compute/Config.py @@ -1,16 +1,20 @@ -import logging +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -# General settings -LOG_LEVEL = logging.WARNING +from werkzeug.security import generate_password_hash -# gRPC settings -GRPC_SERVICE_PORT = 9090 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# REST-API settings -RESTAPI_SERVICE_PORT = 8080 -RESTAPI_BASE_URL = '/api' - -# Prometheus settings -METRICS_PORT = 9192 +# REST-API users +RESTAPI_USERS = { # TODO: implement a database of credentials and permissions + 'admin': generate_password_hash('admin'), +} diff --git a/src/compute/Dockerfile b/src/compute/Dockerfile index 83e4fad35704dd8febb8aa627936d54c02e89f68..bdc07584c5bd8f08fdef6f997cc18dcfd9eeb3e6 100644 --- a/src/compute/Dockerfile +++ b/src/compute/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,22 +28,44 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/compute +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY compute/requirements.in compute/requirements.in -RUN pip-compile --output-file=compute/requirements.txt compute/requirements.in -RUN python3 -m pip install -r compute/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY compute/. compute +# Create component sub-folder, get specific Python packages +RUN mkdir -p /var/teraflow/compute +WORKDIR /var/teraflow/compute +COPY src/compute/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/compute/. compute/ +COPY src/context/. context/ +COPY src/service/. service/ +COPY src/slice/. slice/ -# Start compute service +# Start the service ENTRYPOINT ["python", "-m", "compute.service"] diff --git a/src/compute/__init__.py b/src/compute/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/compute/__init__.py +++ b/src/compute/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/client/ComputeClient.py b/src/compute/client/ComputeClient.py index 19a26b943c3c0d1cb6d6dbcbb1bb33faaa5e3174..2ee1ecd9769791257bb9423203ef1408f383df07 100644 --- a/src/compute/client/ComputeClient.py +++ b/src/compute/client/ComputeClient.py @@ -1,16 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging -from common.tools.client.RetryDecorator import retry, delay_exponential -from compute.proto.compute_pb2_grpc import ComputeServiceStub -from compute.proto.context_pb2 import ( +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.compute_pb2_grpc import ComputeServiceStub +from common.proto.context_pb2 import ( AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController) +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ComputeClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.COMPUTE) + if not port: port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None @@ -22,55 +42,55 @@ class ComputeClient: self.stub = ComputeServiceStub(self.channel) def close(self): - if(self.channel is not None): self.channel.close() + if self.channel is not None: self.channel.close() self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def CheckCredentials(self, request : TeraFlowController) -> AuthenticationResult: - LOGGER.debug('CheckCredentials request: {:s}'.format(str(request))) + LOGGER.debug('CheckCredentials request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CheckCredentials(request) - LOGGER.debug('CheckCredentials result: {:s}'.format(str(response))) + LOGGER.debug('CheckCredentials result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetConnectivityServiceStatus(self, request : ServiceId) -> ServiceStatus: - LOGGER.debug('GetConnectivityServiceStatus request: {:s}'.format(str(request))) + LOGGER.debug('GetConnectivityServiceStatus request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetConnectivityServiceStatus(request) - LOGGER.debug('GetConnectivityServiceStatus result: {:s}'.format(str(response))) + LOGGER.debug('GetConnectivityServiceStatus result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def CreateConnectivityService(self, request : Service) -> ServiceId: - LOGGER.debug('CreateConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('CreateConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CreateConnectivityService(request) - LOGGER.debug('CreateConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('CreateConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def EditConnectivityService(self, request : Service) -> ServiceId: - LOGGER.debug('EditConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('EditConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.EditConnectivityService(request) - LOGGER.debug('EditConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('EditConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def DeleteConnectivityService(self, request : Service) -> Empty: - LOGGER.debug('DeleteConnectivityService request: {:s}'.format(str(request))) + LOGGER.debug('DeleteConnectivityService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteConnectivityService(request) - LOGGER.debug('DeleteConnectivityService result: {:s}'.format(str(response))) + LOGGER.debug('DeleteConnectivityService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetAllActiveConnectivityServices(self, request : Empty) -> ServiceIdList: - LOGGER.debug('GetAllActiveConnectivityServices request: {:s}'.format(str(request))) + LOGGER.debug('GetAllActiveConnectivityServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetAllActiveConnectivityServices(request) - LOGGER.debug('GetAllActiveConnectivityServices result: {:s}'.format(str(response))) + LOGGER.debug('GetAllActiveConnectivityServices result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ClearAllConnectivityServices(self, request : Empty) -> Empty: - LOGGER.debug('ClearAllConnectivityServices request: {:s}'.format(str(request))) + LOGGER.debug('ClearAllConnectivityServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ClearAllConnectivityServices(request) - LOGGER.debug('ClearAllConnectivityServices result: {:s}'.format(str(response))) + LOGGER.debug('ClearAllConnectivityServices result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/compute/client/__init__.py b/src/compute/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/compute/client/__init__.py +++ b/src/compute/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/genproto.sh b/src/compute/genproto.sh deleted file mode 100755 index c991aaf01610a0d54c96683cb4c4cb49490d74a1..0000000000000000000000000000000000000000 --- a/src/compute/genproto.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto compute.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -rm proto/context_pb2_grpc.py -rm proto/service_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2_grpc.py diff --git a/src/compute/proto/compute_pb2.py b/src/compute/proto/compute_pb2.py deleted file mode 100644 index 364e0978e204730462c8aa8dbf6fab0ebc9e5d29..0000000000000000000000000000000000000000 --- a/src/compute/proto/compute_pb2.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: compute.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='compute.proto', - package='compute', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcompute.proto\x12\x07\x63ompute\x1a\rcontext.proto2\x89\x04\n\x0e\x43omputeService\x12P\n\x10\x43heckCredentials\x12\x1b.context.TeraFlowController\x1a\x1d.context.AuthenticationResult\"\x00\x12L\n\x1cGetConnectivityServiceStatus\x12\x12.context.ServiceId\x1a\x16.context.ServiceStatus\"\x00\x12\x43\n\x19\x43reateConnectivityService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x41\n\x17\x45\x64itConnectivityService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12?\n\x19\x44\x65leteConnectivityService\x12\x10.context.Service\x1a\x0e.context.Empty\"\x00\x12L\n GetAllActiveConnectivityServices\x12\x0e.context.Empty\x1a\x16.context.ServiceIdList\"\x00\x12@\n\x1c\x43learAllConnectivityServices\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_COMPUTESERVICE = _descriptor.ServiceDescriptor( - name='ComputeService', - full_name='compute.ComputeService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=42, - serialized_end=563, - methods=[ - _descriptor.MethodDescriptor( - name='CheckCredentials', - full_name='compute.ComputeService.CheckCredentials', - index=0, - containing_service=None, - input_type=context__pb2._TERAFLOWCONTROLLER, - output_type=context__pb2._AUTHENTICATIONRESULT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectivityServiceStatus', - full_name='compute.ComputeService.GetConnectivityServiceStatus', - index=1, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._SERVICESTATUS, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='CreateConnectivityService', - full_name='compute.ComputeService.CreateConnectivityService', - index=2, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='EditConnectivityService', - full_name='compute.ComputeService.EditConnectivityService', - index=3, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteConnectivityService', - full_name='compute.ComputeService.DeleteConnectivityService', - index=4, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetAllActiveConnectivityServices', - full_name='compute.ComputeService.GetAllActiveConnectivityServices', - index=5, - containing_service=None, - input_type=context__pb2._EMPTY, - output_type=context__pb2._SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ClearAllConnectivityServices', - full_name='compute.ComputeService.ClearAllConnectivityServices', - index=6, - containing_service=None, - input_type=context__pb2._EMPTY, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_COMPUTESERVICE) - -DESCRIPTOR.services_by_name['ComputeService'] = _COMPUTESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/compute/proto/compute_pb2_grpc.py b/src/compute/proto/compute_pb2_grpc.py deleted file mode 100644 index c882034b4c4e17e5252c679e3822a93b5659c5de..0000000000000000000000000000000000000000 --- a/src/compute/proto/compute_pb2_grpc.py +++ /dev/null @@ -1,264 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 - - -class ComputeServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CheckCredentials = channel.unary_unary( - '/compute.ComputeService/CheckCredentials', - request_serializer=context__pb2.TeraFlowController.SerializeToString, - response_deserializer=context__pb2.AuthenticationResult.FromString, - ) - self.GetConnectivityServiceStatus = channel.unary_unary( - '/compute.ComputeService/GetConnectivityServiceStatus', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.ServiceStatus.FromString, - ) - self.CreateConnectivityService = channel.unary_unary( - '/compute.ComputeService/CreateConnectivityService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.ServiceId.FromString, - ) - self.EditConnectivityService = channel.unary_unary( - '/compute.ComputeService/EditConnectivityService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.ServiceId.FromString, - ) - self.DeleteConnectivityService = channel.unary_unary( - '/compute.ComputeService/DeleteConnectivityService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetAllActiveConnectivityServices = channel.unary_unary( - '/compute.ComputeService/GetAllActiveConnectivityServices', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.ServiceIdList.FromString, - ) - self.ClearAllConnectivityServices = channel.unary_unary( - '/compute.ComputeService/ClearAllConnectivityServices', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - - -class ComputeServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def CheckCredentials(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetConnectivityServiceStatus(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateConnectivityService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def EditConnectivityService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteConnectivityService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetAllActiveConnectivityServices(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ClearAllConnectivityServices(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ComputeServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CheckCredentials': grpc.unary_unary_rpc_method_handler( - servicer.CheckCredentials, - request_deserializer=context__pb2.TeraFlowController.FromString, - response_serializer=context__pb2.AuthenticationResult.SerializeToString, - ), - 'GetConnectivityServiceStatus': grpc.unary_unary_rpc_method_handler( - servicer.GetConnectivityServiceStatus, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.ServiceStatus.SerializeToString, - ), - 'CreateConnectivityService': grpc.unary_unary_rpc_method_handler( - servicer.CreateConnectivityService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.ServiceId.SerializeToString, - ), - 'EditConnectivityService': grpc.unary_unary_rpc_method_handler( - servicer.EditConnectivityService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.ServiceId.SerializeToString, - ), - 'DeleteConnectivityService': grpc.unary_unary_rpc_method_handler( - servicer.DeleteConnectivityService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetAllActiveConnectivityServices': grpc.unary_unary_rpc_method_handler( - servicer.GetAllActiveConnectivityServices, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.ServiceIdList.SerializeToString, - ), - 'ClearAllConnectivityServices': grpc.unary_unary_rpc_method_handler( - servicer.ClearAllConnectivityServices, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'compute.ComputeService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ComputeService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CheckCredentials(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/CheckCredentials', - context__pb2.TeraFlowController.SerializeToString, - context__pb2.AuthenticationResult.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetConnectivityServiceStatus(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/GetConnectivityServiceStatus', - context__pb2.ServiceId.SerializeToString, - context__pb2.ServiceStatus.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def CreateConnectivityService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/CreateConnectivityService', - context__pb2.Service.SerializeToString, - context__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def EditConnectivityService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/EditConnectivityService', - context__pb2.Service.SerializeToString, - context__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteConnectivityService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/DeleteConnectivityService', - context__pb2.Service.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetAllActiveConnectivityServices(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/GetAllActiveConnectivityServices', - context__pb2.Empty.SerializeToString, - context__pb2.ServiceIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ClearAllConnectivityServices(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/compute.ComputeService/ClearAllConnectivityServices', - context__pb2.Empty.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/compute/proto/context_pb2.py b/src/compute/proto/context_pb2.py deleted file mode 100644 index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..0000000000000000000000000000000000000000 --- a/src/compute/proto/context_pb2.py +++ /dev/null @@ -1,2545 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3552, - serialized_end=3658, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3661, - serialized_end=3858, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3861, - serialized_end=4004, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4007, - serialized_end=4136, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4139, - serialized_end=4275, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4277, - serialized_end=4370, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2605, - serialized_end=2735, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2738, - serialized_end=2872, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2874, - serialized_end=2975, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2977, - serialized_end=3040, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3042, - serialized_end=3096, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3099, - serialized_end=3240, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3242, - serialized_end=3307, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3309, - serialized_end=3367, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3369, - serialized_end=3463, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3550, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/compute/proto/kpi_sample_types_pb2.py b/src/compute/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/compute/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/compute/proto/service_pb2.py b/src/compute/proto/service_pb2.py deleted file mode 100644 index 7a006915b8be39710a17faab075e382e322d918f..0000000000000000000000000000000000000000 --- a/src/compute/proto/service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='service.proto', - package='service', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_SERVICESERVICE = _descriptor.ServiceDescriptor( - name='ServiceService', - full_name='service.ServiceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=42, - serialized_end=295, - methods=[ - _descriptor.MethodDescriptor( - name='CreateService', - full_name='service.ServiceService.CreateService', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UpdateService', - full_name='service.ServiceService.UpdateService', - index=1, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteService', - full_name='service.ServiceService.DeleteService', - index=2, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_SERVICESERVICE) - -DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/compute/requirements.in b/src/compute/requirements.in index 1da334a54b1c42b01eb8f731d8fd5bd975edd2cf..906615e54488056e3f8e8801bbfd333eab1c23b7 100644 --- a/src/compute/requirements.in +++ b/src/compute/requirements.in @@ -1,5 +1,5 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark +Flask==2.1.3 +Flask-HTTPAuth==4.5.0 +Flask-RESTful==0.3.9 +jsonschema==4.4.0 +requests==2.27.1 diff --git a/src/compute/service/ComputeService.py b/src/compute/service/ComputeService.py index 36d43283c43c82faff1748428943cb9a9687c840..e8d038c43b58a3adae4871cc7f5397fe60461727 100644 --- a/src/compute/service/ComputeService.py +++ b/src/compute/service/ComputeService.py @@ -1,53 +1,28 @@ -import grpc, logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from compute.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.compute_pb2_grpc import add_ComputeServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService from compute.service.ComputeServiceServicerImpl import ComputeServiceServicerImpl -from compute.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class ComputeService: - def __init__(self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.compute_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{}:{}'.format(self.address, self.port) - LOGGER.debug('Starting Service (tentative endpoint: {}, max_workers: {})...'.format( - self.endpoint, self.max_workers)) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) +class ComputeService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.COMPUTE) + super().__init__(port, cls_name=cls_name) self.compute_servicer = ComputeServiceServicerImpl() - add_ComputeServiceServicer_to_server(self.compute_servicer, self.server) - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{}:{}'.format(self.address, port) - LOGGER.info('Listening on {}...'.format(self.endpoint)) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {} seconds)...'.format(self.grace_period)) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') + def install_servicers(self): + add_ComputeServiceServicer_to_server(self.compute_servicer, self.server) diff --git a/src/compute/service/ComputeServiceServicerImpl.py b/src/compute/service/ComputeServiceServicerImpl.py index cfde0c3d9798283fe9affd95be36bb3d9d1bcad8..f8ffd912f065ddc11829f8e9e85559b13576a222 100644 --- a/src/compute/service/ComputeServiceServicerImpl.py +++ b/src/compute/service/ComputeServiceServicerImpl.py @@ -1,8 +1,22 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging -from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method -from compute.proto.compute_pb2_grpc import ComputeServiceServicer -from compute.proto.context_pb2 import ( +from common.proto.context_pb2 import ( AuthenticationResult, Empty, Service, ServiceId, ServiceIdList, ServiceStatus, TeraFlowController) +from common.proto.compute_pb2_grpc import ComputeServiceServicer +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method LOGGER = logging.getLogger(__name__) diff --git a/src/compute/service/__init__.py b/src/compute/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/compute/service/__init__.py +++ b/src/compute/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/service/__main__.py b/src/compute/service/__main__.py index f45af374c471222bb4fdb089860418c5895d6321..345b2fdd6950ecda802e8bd1c86e1421b5c60d84 100644 --- a/src/compute/service/__main__.py +++ b/src/compute/service/__main__.py @@ -1,12 +1,26 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting -from compute.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL, - METRICS_PORT) -from compute.service.ComputeService import ComputeService -from compute.service.rest_server.Server import Server -from compute.service.rest_server.resources.Compute import Compute +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .ComputeService import ComputeService +from .rest_server.RestServer import RestServer +from .rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn terminate = threading.Event() LOGGER = None @@ -18,32 +32,30 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('COMPUTESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - restapi_service_port = get_setting('RESTAPI_SERVICE_PORT', default=RESTAPI_SERVICE_PORT) - restapi_base_url = get_setting('RESTAPI_BASE_URL', default=RESTAPI_BASE_URL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Starting compute service - grpc_service = ComputeService(port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = ComputeService() grpc_service.start() - rest_server = Server(port=restapi_service_port, base_url=restapi_base_url) - rest_server.add_resource( - Compute, '/restconf/config/compute', endpoint='api.compute') + rest_server = RestServer() + register_ietf_l2vpn(rest_server) rest_server.start() # Wait for Ctrl+C or termination signal diff --git a/src/compute/service/rest_server/RestServer.py b/src/compute/service/rest_server/RestServer.py new file mode 100644 index 0000000000000000000000000000000000000000..d9b6cd9157a77f61f6e3349de690e3314a2b41d9 --- /dev/null +++ b/src/compute/service/rest_server/RestServer.py @@ -0,0 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_baseurl_http, get_service_port_http +from common.tools.service.GenericRestServer import GenericRestServer + +class RestServer(GenericRestServer): + def __init__(self, cls_name: str = __name__) -> None: + bind_port = get_service_port_http(ServiceNameEnum.COMPUTE) + base_url = get_service_baseurl_http(ServiceNameEnum.COMPUTE) + super().__init__(bind_port, base_url, cls_name=cls_name) diff --git a/src/compute/service/rest_server/Server.py b/src/compute/service/rest_server/Server.py deleted file mode 100644 index c68515e915a6de82b3b08525d3383ac21b6c25b2..0000000000000000000000000000000000000000 --- a/src/compute/service/rest_server/Server.py +++ /dev/null @@ -1,34 +0,0 @@ -import logging, threading -from flask import Flask -from flask_restful import Api -from werkzeug.serving import make_server -from compute.Config import RESTAPI_BASE_URL, RESTAPI_SERVICE_PORT - -logging.getLogger('werkzeug').setLevel(logging.WARNING) - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class Server(threading.Thread): - def __init__(self, host=BIND_ADDRESS, port=RESTAPI_SERVICE_PORT, base_url=RESTAPI_BASE_URL): - threading.Thread.__init__(self, daemon=True) - self.host = host - self.port = port - self.base_url = base_url - self.app = Flask(__name__) - self.api = Api(self.app, prefix=self.base_url) - - def add_resource(self, resource, *urls, **kwargs): - self.api.add_resource(resource, *urls, **kwargs) - - def run(self): - self.srv = make_server(self.host, self.port, self.app, threaded=True) - self.ctx = self.app.app_context() - self.ctx.push() - - endpoint = 'http://{:s}:{:s}{:s}'.format(str(self.host), str(self.port), str(self.base_url)) - LOGGER.info('Listening on {:s}...'.format(str(endpoint))) - self.srv.serve_forever() - - def shutdown(self): - self.srv.shutdown() diff --git a/src/compute/service/rest_server/__init__.py b/src/compute/service/rest_server/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/compute/service/rest_server/__init__.py +++ b/src/compute/service/rest_server/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/service/rest_server/nbi_plugins/__init__.py b/src/compute/service/rest_server/nbi_plugins/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py new file mode 100644 index 0000000000000000000000000000000000000000..d432e5605cfebaa01c2a8faf0cbffcff110d7dbe --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/Constants.py @@ -0,0 +1,54 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +DEFAULT_MTU = 1512 +DEFAULT_ADDRESS_FAMILIES = ['IPV4'] +DEFAULT_BGP_AS = 65000 +DEFAULT_BGP_ROUTE_TARGET = '{:d}:{:d}'.format(DEFAULT_BGP_AS, 333) + +# Bearer mappings: +# device_uuid:endpoint_uuid => ( +# device_uuid, endpoint_uuid, router_id, route_distinguisher, sub_if_index, address_ip, address_prefix) +BEARER_MAPPINGS = { + 'R1-EMU:13/1/2': ('R1-EMU', '13/1/2', '10.10.10.1', '65000:100', 400, '3.3.2.1', 24), + 'R2-EMU:13/1/2': ('R2-EMU', '13/1/2', '12.12.12.1', '65000:120', 450, '3.4.2.1', 24), + 'R3-EMU:13/1/2': ('R3-EMU', '13/1/2', '20.20.20.1', '65000:200', 500, '3.3.1.1', 24), + 'R4-EMU:13/1/2': ('R4-EMU', '13/1/2', '22.22.22.1', '65000:220', 550, '3.4.1.1', 24), + + 'R1@D1:3/1': ('R1@D1', '3/1', '10.0.1.1', '65001:101', 100, '1.1.3.1', 24), + 'R1@D1:3/2': ('R1@D1', '3/2', '10.0.1.1', '65001:101', 100, '1.1.3.2', 24), + 'R1@D1:3/3': ('R1@D1', '3/3', '10.0.1.1', '65001:101', 100, '1.1.3.3', 24), + 'R2@D1:3/1': ('R2@D1', '3/1', '10.0.1.2', '65001:102', 100, '1.2.3.1', 24), + 'R2@D1:3/2': ('R2@D1', '3/2', '10.0.1.2', '65001:102', 100, '1.2.3.2', 24), + 'R2@D1:3/3': ('R2@D1', '3/3', '10.0.1.2', '65001:102', 100, '1.2.3.3', 24), + 'R3@D1:3/1': ('R3@D1', '3/1', '10.0.1.3', '65001:103', 100, '1.3.3.1', 24), + 'R3@D1:3/2': ('R3@D1', '3/2', '10.0.1.3', '65001:103', 100, '1.3.3.2', 24), + 'R3@D1:3/3': ('R3@D1', '3/3', '10.0.1.3', '65001:103', 100, '1.3.3.3', 24), + 'R4@D1:3/1': ('R4@D1', '3/1', '10.0.1.4', '65001:104', 100, '1.4.3.1', 24), + 'R4@D1:3/2': ('R4@D1', '3/2', '10.0.1.4', '65001:104', 100, '1.4.3.2', 24), + 'R4@D1:3/3': ('R4@D1', '3/3', '10.0.1.4', '65001:104', 100, '1.4.3.3', 24), + + 'R1@D2:3/1': ('R1@D2', '3/1', '10.0.2.1', '65002:101', 100, '2.1.3.1', 24), + 'R1@D2:3/2': ('R1@D2', '3/2', '10.0.2.1', '65002:101', 100, '2.1.3.2', 24), + 'R1@D2:3/3': ('R1@D2', '3/3', '10.0.2.1', '65002:101', 100, '2.1.3.3', 24), + 'R2@D2:3/1': ('R2@D2', '3/1', '10.0.2.2', '65002:102', 100, '2.2.3.1', 24), + 'R2@D2:3/2': ('R2@D2', '3/2', '10.0.2.2', '65002:102', 100, '2.2.3.2', 24), + 'R2@D2:3/3': ('R2@D2', '3/3', '10.0.2.2', '65002:102', 100, '2.2.3.3', 24), + 'R3@D2:3/1': ('R3@D2', '3/1', '10.0.2.3', '65002:103', 100, '2.3.3.1', 24), + 'R3@D2:3/2': ('R3@D2', '3/2', '10.0.2.3', '65002:103', 100, '2.3.3.2', 24), + 'R3@D2:3/3': ('R3@D2', '3/3', '10.0.2.3', '65002:103', 100, '2.3.3.3', 24), + 'R4@D2:3/1': ('R4@D2', '3/1', '10.0.2.4', '65002:104', 100, '2.4.3.1', 24), + 'R4@D2:3/2': ('R4@D2', '3/2', '10.0.2.4', '65002:104', 100, '2.4.3.2', 24), + 'R4@D2:3/3': ('R4@D2', '3/3', '10.0.2.4', '65002:104', 100, '2.4.3.3', 24), +} diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..c77d714a94fa8d2d4ee9cd2c3db06949665a489c --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Service.py @@ -0,0 +1,83 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from flask import request +from flask.json import jsonify +from flask_restful import Resource +from common.Constants import DEFAULT_CONTEXT_UUID +from common.proto.context_pb2 import ServiceId, ServiceStatusEnum, SliceStatusEnum +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient +from .tools.Authentication import HTTP_AUTH +from .tools.ContextMethods import get_service, get_slice +from .tools.HttpStatusCodes import HTTP_GATEWAYTIMEOUT, HTTP_NOCONTENT, HTTP_OK, HTTP_SERVERERROR + +LOGGER = logging.getLogger(__name__) + +class L2VPN_Service(Resource): + @HTTP_AUTH.login_required + def get(self, vpn_id : str): + LOGGER.debug('VPN_Id: {:s}'.format(str(vpn_id))) + LOGGER.debug('Request: {:s}'.format(str(request))) + + response = jsonify({}) + try: + context_client = ContextClient() + + target = get_service(context_client, vpn_id) + if target is not None: + if target.service_id.service_uuid.uuid != vpn_id: # pylint: disable=no-member + raise Exception('Service retrieval failed. Wrong Service Id was returned') + service_ready_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE + service_status = target.service_status.service_status # pylint: disable=no-member + response.status_code = HTTP_OK if service_status == service_ready_status else HTTP_GATEWAYTIMEOUT + return response + + target = get_slice(context_client, vpn_id) + if target is not None: + if target.slice_id.slice_uuid.uuid != vpn_id: # pylint: disable=no-member + raise Exception('Slice retrieval failed. Wrong Slice Id was returned') + slice_ready_status = SliceStatusEnum.SLICESTATUS_ACTIVE + slice_status = target.slice_status.slice_status # pylint: disable=no-member + response.status_code = HTTP_OK if slice_status == slice_ready_status else HTTP_GATEWAYTIMEOUT + return response + + raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Retrieving VPN({:s})'.format(str(request))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response + + @HTTP_AUTH.login_required + def delete(self, vpn_id : str): + LOGGER.debug('VPN_Id: {:s}'.format(str(vpn_id))) + LOGGER.debug('Request: {:s}'.format(str(request))) + + # pylint: disable=no-member + service_id_request = ServiceId() + service_id_request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID + service_id_request.service_uuid.uuid = vpn_id + + try: + service_client = ServiceClient() + service_client.DeleteService(service_id_request) + response = jsonify({}) + response.status_code = HTTP_NOCONTENT + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Deleting Service {:s}'.format(str(request))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py new file mode 100644 index 0000000000000000000000000000000000000000..7b959b2895d0f0acd27058fcb5e9a571cf6553d2 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_Services.py @@ -0,0 +1,78 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from typing import Dict, List +from flask import request +from flask.json import jsonify +from flask_restful import Resource +from werkzeug.exceptions import UnsupportedMediaType +from common.Constants import DEFAULT_CONTEXT_UUID +from common.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum, SliceStatusEnum, Slice +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient +from .schemas.vpn_service import SCHEMA_VPN_SERVICE +from .tools.Authentication import HTTP_AUTH +from .tools.HttpStatusCodes import HTTP_CREATED, HTTP_SERVERERROR +from .tools.Validator import validate_message + +LOGGER = logging.getLogger(__name__) + +class L2VPN_Services(Resource): + @HTTP_AUTH.login_required + def get(self): + return {} + + @HTTP_AUTH.login_required + def post(self): + if not request.is_json: raise UnsupportedMediaType('JSON payload is required') + request_data : Dict = request.json + LOGGER.debug('Request: {:s}'.format(str(request_data))) + validate_message(SCHEMA_VPN_SERVICE, request_data) + + vpn_services : List[Dict] = request_data['ietf-l2vpn-svc:vpn-service'] + for vpn_service in vpn_services: + try: + vpn_service_type = vpn_service['vpn-svc-type'] + if vpn_service_type == 'vpws': + # pylint: disable=no-member + service_request = Service() + service_request.service_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID + service_request.service_id.service_uuid.uuid = vpn_service['vpn-id'] + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + service_client = ServiceClient() + service_reply = service_client.CreateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service creation failed. Wrong Service Id was returned') + elif vpn_service_type == 'vpls': + # pylint: disable=no-member + slice_request = Slice() + slice_request.slice_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID + slice_request.slice_id.slice_uuid.uuid = vpn_service['vpn-id'] + slice_request.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_PLANNED + + slice_client = SliceClient() + slice_reply = slice_client.CreateSlice(slice_request) + if slice_reply != slice_request.slice_id: # pylint: disable=no-member + raise Exception('Slice creation failed. Wrong Slice Id was returned') + + response = jsonify({}) + response.status_code = HTTP_CREATED + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Something went wrong Creating Service {:s}'.format(str(request))) + response = jsonify({'error': str(e)}) + response.status_code = HTTP_SERVERERROR + return response diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py new file mode 100644 index 0000000000000000000000000000000000000000..8be63895b813d7411b76ddeb33902babbf4c9743 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/L2VPN_SiteNetworkAccesses.py @@ -0,0 +1,224 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from ctypes import Union +import json, logging +from typing import Dict +from flask import request +from flask.json import jsonify +from flask.wrappers import Response +from flask_restful import Resource +from werkzeug.exceptions import UnsupportedMediaType +from common.proto.context_pb2 import ConfigActionEnum, Service, Slice +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient +from .schemas.site_network_access import SCHEMA_SITE_NETWORK_ACCESS +from .tools.Authentication import HTTP_AUTH +from .tools.ContextMethods import get_service, get_slice +from .tools.HttpStatusCodes import HTTP_NOCONTENT, HTTP_SERVERERROR +from .tools.Validator import validate_message +from .Constants import BEARER_MAPPINGS, DEFAULT_ADDRESS_FAMILIES, DEFAULT_BGP_AS, DEFAULT_BGP_ROUTE_TARGET, DEFAULT_MTU + +LOGGER = logging.getLogger(__name__) + +def process_site_network_access(context_client : ContextClient, site_network_access : Dict) -> Service: + vpn_id = site_network_access['vpn-attachment']['vpn-id'] + cvlan_id = site_network_access['connection']['tagged-interface']['dot1q-vlan-tagged']['cvlan-id'] + bearer_reference = site_network_access['bearer']['bearer-reference'] + + mapping = BEARER_MAPPINGS.get(bearer_reference) + if mapping is None: + msg = 'Specified Bearer({:s}) is not configured.' + raise Exception(msg.format(str(bearer_reference))) + device_uuid,endpoint_uuid,router_id,route_distinguisher,sub_if_index,address_ip,address_prefix = mapping + + target : Union[Service, Slice, None] = None + if target is None: target = get_service(context_client, vpn_id) + if target is None: target = get_slice (context_client, vpn_id) + if target is None: raise Exception('VPN({:s}) not found in database'.format(str(vpn_id))) + + # pylint: disable=no-member + endpoint_ids = target.service_endpoint_ids if isinstance(target, Service) else target.slice_endpoint_ids + + for endpoint_id in endpoint_ids: + if endpoint_id.device_id.device_uuid.uuid != device_uuid: continue + if endpoint_id.endpoint_uuid.uuid != endpoint_uuid: continue + break # found, do nothing + else: + # not found, add it + endpoint_id = endpoint_ids.add() + endpoint_id.device_id.device_uuid.uuid = device_uuid + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + + if isinstance(target, Slice): return target + + for config_rule in target.service_config.config_rules: # pylint: disable=no-member + if config_rule.WhichOneof('config_rule') != 'custom': continue + if config_rule.custom.resource_key != '/settings': continue + json_settings = json.loads(config_rule.custom.resource_value) + + if 'mtu' not in json_settings: # missing, add it + json_settings['mtu'] = DEFAULT_MTU + elif json_settings['mtu'] != DEFAULT_MTU: # differs, raise exception + msg = 'Specified MTU({:s}) differs from Service MTU({:s})' + raise Exception(msg.format(str(json_settings['mtu']), str(DEFAULT_MTU))) + + if 'address_families' not in json_settings: # missing, add it + json_settings['address_families'] = DEFAULT_ADDRESS_FAMILIES + elif json_settings['address_families'] != DEFAULT_ADDRESS_FAMILIES: # differs, raise exception + msg = 'Specified AddressFamilies({:s}) differs from Service AddressFamilies({:s})' + raise Exception(msg.format(str(json_settings['address_families']), str(DEFAULT_ADDRESS_FAMILIES))) + + if 'bgp_as' not in json_settings: # missing, add it + json_settings['bgp_as'] = DEFAULT_BGP_AS + elif json_settings['bgp_as'] != DEFAULT_BGP_AS: # differs, raise exception + msg = 'Specified BgpAs({:s}) differs from Service BgpAs({:s})' + raise Exception(msg.format(str(json_settings['bgp_as']), str(DEFAULT_BGP_AS))) + + if 'bgp_route_target' not in json_settings: # missing, add it + json_settings['bgp_route_target'] = DEFAULT_BGP_ROUTE_TARGET + elif json_settings['bgp_route_target'] != DEFAULT_BGP_ROUTE_TARGET: # differs, raise exception + msg = 'Specified BgpRouteTarget({:s}) differs from Service BgpRouteTarget({:s})' + raise Exception(msg.format(str(json_settings['bgp_route_target']), str(DEFAULT_BGP_ROUTE_TARGET))) + + config_rule.custom.resource_value = json.dumps(json_settings, sort_keys=True) + break + else: + # not found, add it + config_rule = target.service_config.config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '/settings' + config_rule.custom.resource_value = json.dumps({ + 'mtu' : DEFAULT_MTU, + 'address_families': DEFAULT_ADDRESS_FAMILIES, + 'bgp_as' : DEFAULT_BGP_AS, + 'bgp_route_target': DEFAULT_BGP_ROUTE_TARGET, + }, sort_keys=True) + + endpoint_settings_key = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + for config_rule in target.service_config.config_rules: # pylint: disable=no-member + if config_rule.WhichOneof('config_rule') != 'custom': continue + if config_rule.custom.resource_key != endpoint_settings_key: continue + json_settings = json.loads(config_rule.custom.resource_value) + + if 'router_id' not in json_settings: # missing, add it + json_settings['router_id'] = router_id + elif json_settings['router_id'] != router_id: # differs, raise exception + msg = 'Specified RouterId({:s}) differs from Service RouterId({:s})' + raise Exception(msg.format(str(json_settings['router_id']), str(router_id))) + + if 'route_distinguisher' not in json_settings: # missing, add it + json_settings['route_distinguisher'] = route_distinguisher + elif json_settings['route_distinguisher'] != route_distinguisher: # differs, raise exception + msg = 'Specified RouteDistinguisher({:s}) differs from Service RouteDistinguisher({:s})' + raise Exception(msg.format(str(json_settings['route_distinguisher']), str(route_distinguisher))) + + if 'sub_interface_index' not in json_settings: # missing, add it + json_settings['sub_interface_index'] = sub_if_index + elif json_settings['sub_interface_index'] != sub_if_index: # differs, raise exception + msg = 'Specified SubInterfaceIndex({:s}) differs from Service SubInterfaceIndex({:s})' + raise Exception(msg.format( + str(json_settings['sub_interface_index']), str(sub_if_index))) + + if 'vlan_id' not in json_settings: # missing, add it + json_settings['vlan_id'] = cvlan_id + elif json_settings['vlan_id'] != cvlan_id: # differs, raise exception + msg = 'Specified VLANId({:s}) differs from Service VLANId({:s})' + raise Exception(msg.format( + str(json_settings['vlan_id']), str(cvlan_id))) + + if 'address_ip' not in json_settings: # missing, add it + json_settings['address_ip'] = address_ip + elif json_settings['address_ip'] != address_ip: # differs, raise exception + msg = 'Specified AddressIP({:s}) differs from Service AddressIP({:s})' + raise Exception(msg.format( + str(json_settings['address_ip']), str(address_ip))) + + if 'address_prefix' not in json_settings: # missing, add it + json_settings['address_prefix'] = address_prefix + elif json_settings['address_prefix'] != address_prefix: # differs, raise exception + msg = 'Specified AddressPrefix({:s}) differs from Service AddressPrefix({:s})' + raise Exception(msg.format( + str(json_settings['address_prefix']), str(address_prefix))) + + config_rule.custom.resource_value = json.dumps(json_settings, sort_keys=True) + break + else: + # not found, add it + config_rule = target.service_config.config_rules.add() # pylint: disable=no-member + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = endpoint_settings_key + config_rule.custom.resource_value = json.dumps({ + 'router_id': router_id, + 'route_distinguisher': route_distinguisher, + 'sub_interface_index': sub_if_index, + 'vlan_id': cvlan_id, + 'address_ip': address_ip, + 'address_prefix': address_prefix, + }, sort_keys=True) + + return target + +def process_list_site_network_access( + context_client : ContextClient, service_client : ServiceClient, slice_client : SliceClient, + request_data : Dict + ) -> Response: + + LOGGER.debug('Request: {:s}'.format(str(request_data))) + validate_message(SCHEMA_SITE_NETWORK_ACCESS, request_data) + + errors = [] + for site_network_access in request_data['ietf-l2vpn-svc:site-network-access']: + sna_request = process_site_network_access(context_client, site_network_access) + LOGGER.debug('sna_request = {:s}'.format(grpc_message_to_json_string(sna_request))) + try: + if isinstance(sna_request, Service): + sna_reply = service_client.UpdateService(sna_request) + if sna_reply != sna_request.service_id: # pylint: disable=no-member + raise Exception('Service update failed. Wrong Service Id was returned') + elif isinstance(sna_request, Slice): + sna_reply = slice_client.UpdateSlice(sna_request) + if sna_reply != sna_request.slice_id: # pylint: disable=no-member + raise Exception('Slice update failed. Wrong Slice Id was returned') + else: + raise NotImplementedError('Support for Class({:s}) not implemented'.format(str(type(sna_request)))) + except Exception as e: # pylint: disable=broad-except + msg = 'Something went wrong Updating Service {:s}' + LOGGER.exception(msg.format(grpc_message_to_json_string(sna_request))) + errors.append({'error': str(e)}) + + response = jsonify(errors) + response.status_code = HTTP_NOCONTENT if len(errors) == 0 else HTTP_SERVERERROR + return response + +class L2VPN_SiteNetworkAccesses(Resource): + @HTTP_AUTH.login_required + def post(self, site_id : str): + if not request.is_json: raise UnsupportedMediaType('JSON payload is required') + LOGGER.debug('Site_Id: {:s}'.format(str(site_id))) + context_client = ContextClient() + service_client = ServiceClient() + slice_client = SliceClient() + return process_list_site_network_access(context_client, service_client, slice_client, request.json) + + @HTTP_AUTH.login_required + def put(self, site_id : str): + if not request.is_json: raise UnsupportedMediaType('JSON payload is required') + LOGGER.debug('Site_Id: {:s}'.format(str(site_id))) + context_client = ContextClient() + service_client = ServiceClient() + slice_client = SliceClient() + return process_list_site_network_access(context_client, service_client, slice_client, request.json) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c8b23bcee09bb7f16d75bde02e6f3a7f4ca66b4d --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/__init__.py @@ -0,0 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# RFC 8466 - L2VPN Service Model (L2SM) +# Ref: https://datatracker.ietf.org/doc/html/rfc8466 + +from flask_restful import Resource +from compute.service.rest_server.RestServer import RestServer +from .L2VPN_Services import L2VPN_Services +from .L2VPN_Service import L2VPN_Service +from .L2VPN_SiteNetworkAccesses import L2VPN_SiteNetworkAccesses + +URL_PREFIX = '/ietf-l2vpn-svc:l2vpn-svc' + +def _add_resource(rest_server : RestServer, resource : Resource, *urls, **kwargs): + urls = [(URL_PREFIX + url) for url in urls] + rest_server.add_resource(resource, *urls, **kwargs) + +def register_ietf_l2vpn(rest_server : RestServer): + _add_resource(rest_server, L2VPN_Services, + '/vpn-services') + _add_resource(rest_server, L2VPN_Service, + '/vpn-services/vpn-service=', '/vpn-services/vpn-service=/') + _add_resource(rest_server, L2VPN_SiteNetworkAccesses, + '/sites/site=/site-network-accesses', '/sites/site=/site-network-accesses/') diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py new file mode 100644 index 0000000000000000000000000000000000000000..30755bbce5910ac05a9572b232f5ae907cf0ae18 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/Common.py @@ -0,0 +1,16 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# String pattern for UUIDs such as '3fd942ee-2dc3-41d1-aeec-65aa85d117b2' +REGEX_UUID = r'[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12}' diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py new file mode 100644 index 0000000000000000000000000000000000000000..165973190b46c68e750516796b22ed6d09b470b0 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/site_network_access.py @@ -0,0 +1,80 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Example request: +# request = {'ietf-l2vpn-svc:site-network-access': [{ +# 'network-access-id': '3fd942ee-2dc3-41d1-aeec-65aa85d117b2', +# 'vpn-attachment': {'vpn-id': '954b1b53-4a8c-406d-9eff-750ec2c9a258', +# 'site-role': 'any-to-any-role'}, +# 'connection': {'encapsulation-type': 'dot1q-vlan-tagged', 'tagged-interface': { +# 'dot1q-vlan-tagged': {'cvlan-id': 1234}}}, +# 'bearer': {'bearer-reference': '1a'} +# }]} + +from .Common import REGEX_UUID + +SCHEMA_SITE_NETWORK_ACCESS = { + '$schema': 'https://json-schema.org/draft/2020-12/schema', + 'type': 'object', + 'required': ['ietf-l2vpn-svc:site-network-access'], + 'properties': { + 'ietf-l2vpn-svc:site-network-access': { + 'type': 'array', + 'minItems': 1, + 'maxItems': 1, # by now we do not support multiple site-network-access in the same message + 'items': { + 'type': 'object', + 'required': ['network-access-id', 'vpn-attachment', 'connection', 'bearer'], + 'properties': { + 'network-access-id': {'type': 'string', 'pattern': REGEX_UUID}, + 'vpn-attachment': { + 'type': 'object', + 'required': ['vpn-id', 'site-role'], + 'properties': { + 'vpn-id': {'type': 'string', 'pattern': REGEX_UUID}, + 'site-role': {'type': 'string', 'minLength': 1}, + }, + }, + 'connection': { + 'type': 'object', + 'required': ['encapsulation-type', 'tagged-interface'], + 'properties': { + 'encapsulation-type': {'enum': ['dot1q-vlan-tagged']}, + 'tagged-interface': { + 'type': 'object', + 'required': ['dot1q-vlan-tagged'], + 'properties': { + 'dot1q-vlan-tagged': { + 'type': 'object', + 'required': ['cvlan-id'], + 'properties': { + 'cvlan-id': {'type': 'integer', 'minimum': 1, 'maximum': 4094}, + }, + }, + }, + }, + }, + }, + 'bearer': { + 'type': 'object', + 'required': ['bearer-reference'], + 'properties': { + 'bearer-reference': {'type': 'string', 'minLength': 1}, + }, + }, + }, + }, + }, + }, +} diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py new file mode 100644 index 0000000000000000000000000000000000000000..9dd8eea3d711a2d5ea22ac8e0fc3e4d7140493b1 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/schemas/vpn_service.py @@ -0,0 +1,46 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Example request: +# request = {'ietf-l2vpn-svc:vpn-service': [{ +# 'vpn-id': 'c6270231-f1de-4687-b2ed-7b58f9105775', +# 'vpn-svc-type': 'vpws', +# 'svc-topo': 'any-to-any', +# 'customer-name': 'osm' +# }]} + +from .Common import REGEX_UUID + +SCHEMA_VPN_SERVICE = { + '$schema': 'https://json-schema.org/draft/2020-12/schema', + 'type': 'object', + 'required': ['ietf-l2vpn-svc:vpn-service'], + 'properties': { + 'ietf-l2vpn-svc:vpn-service': { + 'type': 'array', + 'minItems': 1, + 'maxItems': 1, # by now we do not support multiple vpn-service in the same message + 'items': { + 'type': 'object', + 'required': ['vpn-id', 'vpn-svc-type', 'svc-topo', 'customer-name'], + 'properties': { + 'vpn-id': {'type': 'string', 'pattern': REGEX_UUID}, + 'vpn-svc-type': {'enum': ['vpws', 'vpls']}, + 'svc-topo': {'enum': ['any-to-any']}, + 'customer-name': {'const': 'osm'}, + }, + } + } + }, +} diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Authentication.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Authentication.py new file mode 100644 index 0000000000000000000000000000000000000000..ebeeda4c81d7ef6b3c3203cb014e85f629d2046b --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Authentication.py @@ -0,0 +1,25 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask_httpauth import HTTPBasicAuth +from werkzeug.security import check_password_hash +from compute.Config import RESTAPI_USERS + +HTTP_AUTH = HTTPBasicAuth() + +@HTTP_AUTH.verify_password +def verify_password(username, password): + if username not in RESTAPI_USERS: return None + if not check_password_hash(RESTAPI_USERS[username], password): return None + return username diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py new file mode 100644 index 0000000000000000000000000000000000000000..ac9e6fe4a5c138d00bc80fd953de2cc21d4677b5 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/ContextMethods.py @@ -0,0 +1,39 @@ +import grpc, logging +from typing import Optional +from common.Constants import DEFAULT_CONTEXT_UUID +from common.proto.context_pb2 import Service, ServiceId, Slice, SliceId +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +def get_service( + context_client : ContextClient, service_uuid : str, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> Optional[Service]: + try: + # pylint: disable=no-member + service_id = ServiceId() + service_id.context_id.context_uuid.uuid = context_uuid + service_id.service_uuid.uuid = service_uuid + service_readonly = context_client.GetService(service_id) + service = Service() + service.CopyFrom(service_readonly) + return service + except grpc.RpcError: + #LOGGER.exception('Unable to get service({:s} / {:s})'.format(str(context_uuid), str(service_uuid))) + return None + +def get_slice( + context_client : ContextClient, slice_uuid : str, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> Optional[Slice]: + try: + # pylint: disable=no-member + slice_id = SliceId() + slice_id.context_id.context_uuid.uuid = context_uuid + slice_id.slice_uuid.uuid = slice_uuid + slice_readonly = context_client.GetSlice(slice_id) + slice_ = Slice() + slice_.CopyFrom(slice_readonly) + return slice_ + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s} / {:s})'.format(str(context_uuid), str(slice_uuid))) + return None diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/HttpStatusCodes.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/HttpStatusCodes.py new file mode 100644 index 0000000000000000000000000000000000000000..0a98b9e76068a20ce5c78966ede600df84196194 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/HttpStatusCodes.py @@ -0,0 +1,20 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +HTTP_OK = 200 +HTTP_CREATED = 201 +HTTP_NOCONTENT = 204 +HTTP_BADREQUEST = 400 +HTTP_SERVERERROR = 500 +HTTP_GATEWAYTIMEOUT = 504 \ No newline at end of file diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Validator.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Validator.py new file mode 100644 index 0000000000000000000000000000000000000000..b83a0f929769559d7870657cae30ee374962a296 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/Validator.py @@ -0,0 +1,35 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import List +from flask.json import jsonify +from jsonschema import _utils +from jsonschema.validators import validator_for +from jsonschema.protocols import Validator +from jsonschema.exceptions import ValidationError +from werkzeug.exceptions import BadRequest +from .HttpStatusCodes import HTTP_BADREQUEST + +def validate_message(schema, message): + validator_class = validator_for(schema) + validator : Validator = validator_class(schema) + errors : List[ValidationError] = sorted(validator.iter_errors(message), key=str) + if len(errors) == 0: return + response = jsonify([ + {'message': str(error.message), 'schema': str(error.schema), 'validator': str(error.validator), + 'where': str(_utils.format_as_index(container='message', indices=error.relative_path))} + for error in errors + ]) + response.status_code = HTTP_BADREQUEST + raise BadRequest(response=response) diff --git a/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/__init__.py b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/ietf_l2vpn/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/service/rest_server/resources/Compute.py b/src/compute/service/rest_server/resources/Compute.py deleted file mode 100644 index 4b845be2edd20c512bd0669739d402207d71fa94..0000000000000000000000000000000000000000 --- a/src/compute/service/rest_server/resources/Compute.py +++ /dev/null @@ -1,52 +0,0 @@ -import logging -from flask.json import jsonify -from flask_restful import Resource -from common.Settings import get_setting -from common.Constants import DEFAULT_CONTEXT_UUID -from service.client.ServiceClient import ServiceClient -from service.proto.context_pb2 import Service, ServiceStatusEnum, ServiceTypeEnum - -LOGGER = logging.getLogger(__name__) - -class Compute(Resource): - def __init__(self) -> None: - super().__init__() - - def get(self): - # Here implement HTTP GET method - raise NotImplementedError() - - def post(self): - # Here implement HTTP POST method - - # Retrieve required data from request - new_service_context_id = DEFAULT_CONTEXT_UUID - new_service_id = 'my-service-id' - - # Find Service address/port from environment and instantiate client - service_host = get_setting('SERVICESERVICE_SERVICE_HOST') - service_port = get_setting('SERVICESERVICE_SERVICE_PORT_GRPC') - service_client = ServiceClient(service_host, service_port) - - # Compose a dummy CreateService request - request = Service() - request.service_id.context_id.context_uuid.uuid = new_service_context_id - request.service_id.service_uuid.uuid = new_service_id - request.service_type = ServiceTypeEnum.SERVICETYPE_L2NM - request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED - - try: - # Issue gRPC request to Service component - reply = service_client.CreateService(request) - - # Parse CreateService reply, here we check that obtained service Id and context are the expected ones. - reply_context_uuid = reply.context_id.context_uuid.uuid - reply_service_uuid = reply.service_uuid.uuid - #succeeded = (reply_context_uuid == new_service_context_id) and (reply_service_uuid == new_service_id) - succeeded = True - reply = {'succeeded': succeeded} - except Exception as e: - LOGGER.exception('Something went wrong Creating Service {:s}'.format(str(request))) - reply = {'succeeded': False, 'error': str(e)} - - return jsonify(reply) diff --git a/src/compute/service/rest_server/resources/__init__.py b/src/compute/service/rest_server/resources/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/compute/tests/Constants.py b/src/compute/tests/Constants.py new file mode 100644 index 0000000000000000000000000000000000000000..640124b07fd8e5dc0dff0635175b1499544f1b2d --- /dev/null +++ b/src/compute/tests/Constants.py @@ -0,0 +1,85 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +# Ref: https://osm.etsi.org/wikipub/index.php/WIM +WIM_MAPPING = [ + { + 'device-id' : 'dev-1', # pop_switch_dpid + #'device_interface_id' : ??, # pop_switch_port + 'service_endpoint_id' : 'ep-1', # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': 'R1-EMU:13/1/2'}, + 'site-id': '1', + }, + #'switch_dpid' : ??, # wan_switch_dpid + #'switch_port' : ??, # wan_switch_port + #'datacenter_id' : ??, # vim_account + }, + { + 'device-id' : 'dev-2', # pop_switch_dpid + #'device_interface_id' : ??, # pop_switch_port + 'service_endpoint_id' : 'ep-2', # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': 'R2-EMU:13/1/2'}, + 'site-id': '2', + }, + #'switch_dpid' : ??, # wan_switch_dpid + #'switch_port' : ??, # wan_switch_port + #'datacenter_id' : ??, # vim_account + }, + { + 'device-id' : 'dev-3', # pop_switch_dpid + #'device_interface_id' : ??, # pop_switch_port + 'service_endpoint_id' : 'ep-3', # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': 'R3-EMU:13/1/2'}, + 'site-id': '3', + }, + #'switch_dpid' : ??, # wan_switch_dpid + #'switch_port' : ??, # wan_switch_port + #'datacenter_id' : ??, # vim_account + }, + { + 'device-id' : 'dev-4', # pop_switch_dpid + #'device_interface_id' : ??, # pop_switch_port + 'service_endpoint_id' : 'ep-4', # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': 'R4-EMU:13/1/2'}, + 'site-id': '4', + }, + #'switch_dpid' : ??, # wan_switch_dpid + #'switch_port' : ??, # wan_switch_port + #'datacenter_id' : ??, # vim_account + }, +] + +SERVICE_TYPE = 'ELINE' + +SERVICE_CONNECTION_POINTS_1 = [ + {'service_endpoint_id': 'ep-1', + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': 1234}}, + {'service_endpoint_id': 'ep-2', + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': 1234}}, +] + +SERVICE_CONNECTION_POINTS_2 = [ + {'service_endpoint_id': 'ep-3', + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': 1234}}, +] diff --git a/src/compute/tests/MockService_Dependencies.py b/src/compute/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..5ed9d4da9fa23ff43bbd72eb021ae4e4fecd9b9b --- /dev/null +++ b/src/compute/tests/MockService_Dependencies.py @@ -0,0 +1,58 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +from common.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Service import MockServicerImpl_Service +from common.tests.MockServicerImpl_Slice import MockServicerImpl_Slice +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_SERVICE = ServiceNameEnum.SERVICE +SERVICE_SLICE = ServiceNameEnum.SLICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context, Service and Slice to simplify unitary tests of Compute + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.service_servicer = MockServicerImpl_Service() + add_ServiceServiceServicer_to_server(self.service_servicer, self.server) + + self.slice_servicer = MockServicerImpl_Slice() + add_SliceServiceServicer_to_server(self.slice_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_SLICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/compute/tests/PrepareTestScenario.py b/src/compute/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..d534a4a28280c80964096a9cb7291c498ebe6b93 --- /dev/null +++ b/src/compute/tests/PrepareTestScenario.py @@ -0,0 +1,52 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os, pytest, time +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, get_service_port_http) +from compute.service.rest_server.RestServer import RestServer +from compute.service.rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn +from compute.tests.MockService_Dependencies import MockService_Dependencies +from .mock_osm.MockOSM import MockOSM +from .Constants import WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +COMPUTE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_http(ServiceNameEnum.COMPUTE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.COMPUTE, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(COMPUTE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def compute_service_rest(mock_service): # pylint: disable=redefined-outer-name + _rest_server = RestServer() + register_ietf_l2vpn(_rest_server) + _rest_server.start() + time.sleep(1) # bring time for the server to start + yield _rest_server + _rest_server.shutdown() + _rest_server.join() + +@pytest.fixture(scope='session') +def osm_wim(compute_service_rest): # pylint: disable=redefined-outer-name + wim_url = 'http://{:s}:{:d}'.format(LOCAL_HOST, COMPUTE_SERVICE_PORT) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/compute/tests/__init__.py b/src/compute/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/compute/tests/__init__.py +++ b/src/compute/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/tests/mock_osm/MockOSM.py b/src/compute/tests/mock_osm/MockOSM.py new file mode 100644 index 0000000000000000000000000000000000000000..b4e629d5845fd7115fa0fa2c0887eca1c7c816c4 --- /dev/null +++ b/src/compute/tests/mock_osm/MockOSM.py @@ -0,0 +1,62 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from .WimconnectorIETFL2VPN import WimconnectorIETFL2VPN + +LOGGER = logging.getLogger(__name__) + +class MockOSM: + def __init__(self, url, mapping, username, password): + wim = {'wim_url': url} + wim_account = {'user': username, 'password': password} + config = {'mapping_not_needed': False, 'service_endpoint_mapping': mapping} + self.wim = WimconnectorIETFL2VPN(wim, wim_account, config=config) + self.conn_info = {} # internal database emulating OSM storage provided to WIM Connectors + + def create_connectivity_service(self, service_type, connection_points): + LOGGER.info('[create_connectivity_service] service_type={:s}'.format(str(service_type))) + LOGGER.info('[create_connectivity_service] connection_points={:s}'.format(str(connection_points))) + self.wim.check_credentials() + result = self.wim.create_connectivity_service(service_type, connection_points) + LOGGER.info('[create_connectivity_service] result={:s}'.format(str(result))) + service_uuid, conn_info = result + self.conn_info[service_uuid] = conn_info + return service_uuid + + def get_connectivity_service_status(self, service_uuid): + LOGGER.info('[get_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[get_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.check_credentials() + result = self.wim.get_connectivity_service_status(service_uuid, conn_info=conn_info) + LOGGER.info('[get_connectivity_service] result={:s}'.format(str(result))) + return result + + def edit_connectivity_service(self, service_uuid, connection_points): + LOGGER.info('[edit_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + LOGGER.info('[edit_connectivity_service] connection_points={:s}'.format(str(connection_points))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[edit_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.edit_connectivity_service(service_uuid, conn_info=conn_info, connection_points=connection_points) + + def delete_connectivity_service(self, service_uuid): + LOGGER.info('[delete_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[delete_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.check_credentials() + self.wim.delete_connectivity_service(service_uuid, conn_info=conn_info) diff --git a/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py b/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py new file mode 100644 index 0000000000000000000000000000000000000000..b9639e8046593c1dbf4017cff963ceb7c51d0532 --- /dev/null +++ b/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py @@ -0,0 +1,504 @@ +# -*- coding: utf-8 -*- +## +# Copyright 2018 Telefonica +# All Rights Reserved. +# +# Contributors: Oscar Gonzalez de Dios, Manuel Lopez Bravo, Guillermo Pajares Martin +# 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. +# +# This work has been performed in the context of the Metro-Haul project - +# funded by the European Commission under Grant number 761727 through the +# Horizon 2020 program. +## +"""The SDN/WIM connector is responsible for establishing wide area network +connectivity. + +This SDN/WIM connector implements the standard IETF RFC 8466 "A YANG Data + Model for Layer 2 Virtual Private Network (L2VPN) Service Delivery" + +It receives the endpoints and the necessary details to request +the Layer 2 service. +""" +import requests +import uuid +import logging +#from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError +from .sdnconn import SdnConnectorBase, SdnConnectorError + +"""Check layer where we move it""" + + +class WimconnectorIETFL2VPN(SdnConnectorBase): + def __init__(self, wim, wim_account, config=None, logger=None): + """IETF L2VPN WIM connector + + Arguments: (To be completed) + wim (dict): WIM record, as stored in the database + wim_account (dict): WIM account record, as stored in the database + """ + self.logger = logging.getLogger("ro.sdn.ietfl2vpn") + super().__init__(wim, wim_account, config, logger) + self.headers = {"Content-Type": "application/json"} + self.mappings = { + m["service_endpoint_id"]: m for m in self.service_endpoint_mapping + } + self.user = wim_account.get("user") + self.passwd = wim_account.get("password") # replace "passwordd" -> "password" + + if self.user and self.passwd is not None: + self.auth = (self.user, self.passwd) + else: + self.auth = None + + self.logger.info("IETFL2VPN Connector Initialized.") + + def check_credentials(self): + endpoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + + try: + response = requests.get(endpoint, auth=self.auth) + http_code = response.status_code + except requests.exceptions.RequestException as e: + raise SdnConnectorError(e.message, http_code=503) + + if http_code != 200: + raise SdnConnectorError("Failed while authenticating", http_code=http_code) + + self.logger.info("Credentials checked") + + def get_connectivity_service_status(self, service_uuid, conn_info=None): + """Monitor the status of the connectivity service stablished + + Arguments: + service_uuid: Connectivity service unique identifier + + Returns: + Examples:: + {'sdn_status': 'ACTIVE'} + {'sdn_status': 'INACTIVE'} + {'sdn_status': 'DOWN'} + {'sdn_status': 'ERROR'} + """ + try: + self.logger.info("Sending get connectivity service stuatus") + servicepoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services/vpn-service={}/".format( + self.wim["wim_url"], service_uuid + ) + response = requests.get(servicepoint, auth=self.auth) + self.logger.warning('response.status_code={:s}'.format(str(response.status_code))) + if response.status_code != requests.codes.ok: + raise SdnConnectorError( + "Unable to obtain connectivity servcice status", + http_code=response.status_code, + ) + + service_status = {"sdn_status": "ACTIVE"} + + return service_status + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def search_mapp(self, connection_point): + id = connection_point["service_endpoint_id"] + if id not in self.mappings: + raise SdnConnectorError("Endpoint {} not located".format(str(id))) + else: + return self.mappings[id] + + def create_connectivity_service(self, service_type, connection_points, **kwargs): + """Stablish WAN connectivity between the endpoints + + Arguments: + service_type (str): ``ELINE`` (L2), ``ELAN`` (L2), ``ETREE`` (L2), + ``L3``. + connection_points (list): each point corresponds to + an entry point from the DC to the transport network. One + connection point serves to identify the specific access and + some other service parameters, such as encapsulation type. + Represented by a dict as follows:: + + { + "service_endpoint_id": ..., (str[uuid]) + "service_endpoint_encapsulation_type": ..., + (enum: none, dot1q, ...) + "service_endpoint_encapsulation_info": { + ... (dict) + "vlan": ..., (int, present if encapsulation is dot1q) + "vni": ... (int, present if encapsulation is vxlan), + "peers": [(ipv4_1), (ipv4_2)] + (present if encapsulation is vxlan) + } + } + + The service endpoint ID should be previously informed to the WIM + engine in the RO when the WIM port mapping is registered. + + Keyword Arguments: + bandwidth (int): value in kilobytes + latency (int): value in milliseconds + + Other QoS might be passed as keyword arguments. + + Returns: + tuple: ``(service_id, conn_info)`` containing: + - *service_uuid* (str): UUID of the established connectivity + service + - *conn_info* (dict or None): Information to be stored at the + database (or ``None``). This information will be provided to + the :meth:`~.edit_connectivity_service` and :obj:`~.delete`. + **MUST** be JSON/YAML-serializable (plain data structures). + + Raises: + SdnConnectorException: In case of error. + """ + SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type + 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service + 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + } + settings = SETTINGS.get(service_type) + if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) + min_endpoints, max_endpoints, vpn_service_type = settings + + if max_endpoints is not None and len(connection_points) > max_endpoints: + msg = "Connections between more than {:d} endpoints are not supported for service_type {:s}" + raise SdnConnectorError(msg.format(max_endpoints, service_type)) + + if min_endpoints is not None and len(connection_points) < min_endpoints: + msg = "Connections must be of at least {:d} endpoints for service_type {:s}" + raise SdnConnectorError(msg.format(min_endpoints, service_type)) + + """First step, create the vpn service""" + uuid_l2vpn = str(uuid.uuid4()) + vpn_service = {} + vpn_service["vpn-id"] = uuid_l2vpn + vpn_service["vpn-svc-type"] = vpn_service_type + vpn_service["svc-topo"] = "any-to-any" + vpn_service["customer-name"] = "osm" + vpn_service_list = [] + vpn_service_list.append(vpn_service) + vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} + response_service_creation = None + conn_info = [] + self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + + try: + endpoint_service_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response_service_creation = requests.post( + endpoint_service_creation, + headers=self.headers, + json=vpn_service_l, + auth=self.auth, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError( + "Request to create service Timeout", http_code=408 + ) + + if response_service_creation.status_code == 409: + raise SdnConnectorError( + "Service already exists", + http_code=response_service_creation.status_code, + ) + elif response_service_creation.status_code != requests.codes.created: + raise SdnConnectorError( + "Request to create service not accepted", + http_code=response_service_creation.status_code, + ) + + """Second step, create the connections and vpn attachments""" + for connection_point in connection_points: + connection_point_wan_info = self.search_mapp(connection_point) + site_network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if ( + connection_point["service_endpoint_encapsulation_type"] + == "dot1q" + ): + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") + + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + self.logger.info("Sending connection:{}".format(connection)) + vpn_attach = {} + vpn_attach["vpn-id"] = uuid_l2vpn + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) + uuid_sna = str(uuid.uuid4()) + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + conn_info_d = {} + conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + conn_info_d["site-network-access-id"] = site_network_access[ + "network-access-id" + ] + conn_info_d["mapping"] = None + conn_info.append(conn_info_d) + + try: + endpoint_site_network_access_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"][ + "site-id" + ], + ) + ) + response_endpoint_site_network_access_creation = requests.post( + endpoint_site_network_access_creation, + headers=self.headers, + json=site_network_accesses, + auth=self.auth, + ) + + if ( + response_endpoint_site_network_access_creation.status_code + == 409 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site_Network_Access with ID '{}' already exists".format( + site_network_access["network-access-id"] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + == 400 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site {} does not exist".format( + connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + != requests.codes.created + and response_endpoint_site_network_access_creation.status_code + != requests.codes.no_content + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Request no accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError("Request Timeout", http_code=408) + + return uuid_l2vpn, conn_info + + def delete_connectivity_service(self, service_uuid, conn_info=None): + """Disconnect multi-site endpoints previously connected + + This method should receive as the first argument the UUID generated by + the ``create_connectivity_service`` + """ + try: + self.logger.info("Sending delete") + servicepoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services/vpn-service={}/".format( + self.wim["wim_url"], service_uuid + ) + response = requests.delete(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.no_content: + raise SdnConnectorError( + "Error in the request", http_code=response.status_code + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def edit_connectivity_service( + self, service_uuid, conn_info=None, connection_points=None, **kwargs + ): + """Change an existing connectivity service, see + ``create_connectivity_service``""" + # sites = {"sites": {}} + # site_list = [] + vpn_service = {} + vpn_service["svc-topo"] = "any-to-any" + counter = 0 + + for connection_point in connection_points: + site_network_access = {} + connection_point_wan_info = self.search_mapp(connection_point) + params_site = {} + params_site["site-id"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + params_site["site-vpn-flavor"] = "site-vpn-flavor-single" + device_site = {} + device_site["device-id"] = connection_point_wan_info["device-id"] + params_site["devices"] = device_site + # network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if connection_point["service_endpoint_encapsulation_type"] == "dot1q": + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") + + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + vpn_attach = {} + vpn_attach["vpn-id"] = service_uuid + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + uuid_sna = conn_info[counter]["site-network-access-id"] + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + + try: + endpoint_site_network_access_edit = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"]["site-id"], + ) + ) + response_endpoint_site_network_access_creation = requests.put( + endpoint_site_network_access_edit, + headers=self.headers, + json=site_network_accesses, + auth=self.auth, + ) + + if response_endpoint_site_network_access_creation.status_code == 400: + raise SdnConnectorError( + "Service does not exist", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code != 201 + and response_endpoint_site_network_access_creation.status_code + != 204 + ): + raise SdnConnectorError( + "Request no accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + counter += 1 + + return None + + def clear_all_connectivity_services(self): + """Delete all WAN Links corresponding to a WIM""" + try: + self.logger.info("Sending clear all connectivity services") + servicepoint = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response = requests.delete(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.no_content: + raise SdnConnectorError( + "Unable to clear all connectivity services", + http_code=response.status_code, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def get_all_active_connectivity_services(self): + """Provide information about all active connections provisioned by a + WIM + """ + try: + self.logger.info("Sending get all connectivity services") + servicepoint = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response = requests.get(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.ok: + raise SdnConnectorError( + "Unable to get all connectivity services", + http_code=response.status_code, + ) + + return response + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) diff --git a/src/compute/tests/mock_osm/__init__.py b/src/compute/tests/mock_osm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/compute/tests/mock_osm/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/compute/tests/mock_osm/acknowledgements.txt b/src/compute/tests/mock_osm/acknowledgements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b7ce926dd006d9bc8afaffbed212d90fb05adbef --- /dev/null +++ b/src/compute/tests/mock_osm/acknowledgements.txt @@ -0,0 +1,3 @@ +MockOSM is based on source code taken from: +https://osm.etsi.org/gitlab/osm/ro/-/blob/master/RO-plugin/osm_ro_plugin/sdnconn.py +https://osm.etsi.org/gitlab/osm/ro/-/blob/master/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py diff --git a/src/compute/tests/mock_osm/sdnconn.py b/src/compute/tests/mock_osm/sdnconn.py new file mode 100644 index 0000000000000000000000000000000000000000..a1849c9ef3e1a1260ff42bbadabc99f91a6435d7 --- /dev/null +++ b/src/compute/tests/mock_osm/sdnconn.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +## +# Copyright 2018 University of Bristol - High Performance Networks Research +# Group +# All Rights Reserved. +# +# Contributors: Anderson Bravalheri, Dimitrios Gkounis, Abubakar Siddique +# Muqaddas, Navdeep Uniyal, Reza Nejabati and Dimitra Simeonidou +# +# 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. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: +# +# Neither the name of the University of Bristol nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# This work has been performed in the context of DCMS UK 5G Testbeds +# & Trials Programme and in the framework of the Metro-Haul project - +# funded by the European Commission under Grant number 761727 through the +# Horizon 2020 and 5G-PPP programmes. +## +"""The SDN connector is responsible for establishing both wide area network connectivity (WIM) +and intranet SDN connectivity. + +It receives information from ports to be connected . +""" + +import logging +from http import HTTPStatus + + +class SdnConnectorError(Exception): + """Base Exception for all connector related errors + provide the parameter 'http_code' (int) with the error code: + Bad_Request = 400 + Unauthorized = 401 (e.g. credentials are not valid) + Not_Found = 404 (e.g. try to edit or delete a non existing connectivity service) + Forbidden = 403 + Method_Not_Allowed = 405 + Not_Acceptable = 406 + Request_Timeout = 408 (e.g timeout reaching server, or cannot reach the server) + Conflict = 409 + Service_Unavailable = 503 + Internal_Server_Error = 500 + """ + + def __init__(self, message, http_code=HTTPStatus.INTERNAL_SERVER_ERROR.value): + Exception.__init__(self, message) + self.http_code = http_code + + +class SdnConnectorBase(object): + """Abstract base class for all the SDN connectors + + Arguments: + wim (dict): WIM record, as stored in the database + wim_account (dict): WIM account record, as stored in the database + config + The arguments of the constructor are converted to object attributes. + An extra property, ``service_endpoint_mapping`` is created from ``config``. + """ + + def __init__(self, wim, wim_account, config=None, logger=None): + """ + :param wim: (dict). Contains among others 'wim_url' + :param wim_account: (dict). Contains among others 'uuid' (internal id), 'name', + 'sdn' (True if is intended for SDN-assist or False if intended for WIM), 'user', 'password'. + :param config: (dict or None): Particular information of plugin. These keys if present have a common meaning: + 'mapping_not_needed': (bool) False by default or if missing, indicates that mapping is not needed. + 'service_endpoint_mapping': (list) provides the internal endpoint mapping. The meaning is: + KEY meaning for WIM meaning for SDN assist + -------- -------- -------- + device_id pop_switch_dpid compute_id + device_interface_id pop_switch_port compute_pci_address + service_endpoint_id wan_service_endpoint_id SDN_service_endpoint_id + service_mapping_info wan_service_mapping_info SDN_service_mapping_info + contains extra information if needed. Text in Yaml format + switch_dpid wan_switch_dpid SDN_switch_dpid + switch_port wan_switch_port SDN_switch_port + datacenter_id vim_account vim_account + id: (internal, do not use) + wim_id: (internal, do not use) + :param logger (logging.Logger): optional logger object. If none is passed 'openmano.sdn.sdnconn' is used. + """ + self.logger = logger or logging.getLogger("ro.sdn") + self.wim = wim + self.wim_account = wim_account + self.config = config or {} + self.service_endpoint_mapping = self.config.get("service_endpoint_mapping", []) + + def check_credentials(self): + """Check if the connector itself can access the SDN/WIM with the provided url (wim.wim_url), + user (wim_account.user), and password (wim_account.password) + + Raises: + SdnConnectorError: Issues regarding authorization, access to + external URLs, etc are detected. + """ + raise NotImplementedError + + def get_connectivity_service_status(self, service_uuid, conn_info=None): + """Monitor the status of the connectivity service established + + Arguments: + service_uuid (str): UUID of the connectivity service + conn_info (dict or None): Information returned by the connector + during the service creation/edition and subsequently stored in + the database. + + Returns: + dict: JSON/YAML-serializable dict that contains a mandatory key + ``sdn_status`` associated with one of the following values:: + + {'sdn_status': 'ACTIVE'} + # The service is up and running. + + {'sdn_status': 'INACTIVE'} + # The service was created, but the connector + # cannot determine yet if connectivity exists + # (ideally, the caller needs to wait and check again). + + {'sdn_status': 'DOWN'} + # Connection was previously established, + # but an error/failure was detected. + + {'sdn_status': 'ERROR'} + # An error occurred when trying to create the service/ + # establish the connectivity. + + {'sdn_status': 'BUILD'} + # Still trying to create the service, the caller + # needs to wait and check again. + + Additionally ``error_msg``(**str**) and ``sdn_info``(**dict**) + keys can be used to provide additional status explanation or + new information available for the connectivity service. + """ + raise NotImplementedError + + def create_connectivity_service(self, service_type, connection_points, **kwargs): + """ + Establish SDN/WAN connectivity between the endpoints + :param service_type: (str): ``ELINE`` (L2), ``ELAN`` (L2), ``ETREE`` (L2), ``L3``. + :param connection_points: (list): each point corresponds to + an entry point to be connected. For WIM: from the DC to the transport network. + For SDN: Compute/PCI to the transport network. One + connection point serves to identify the specific access and + some other service parameters, such as encapsulation type. + Each item of the list is a dict with: + "service_endpoint_id": (str)(uuid) Same meaning that for 'service_endpoint_mapping' (see __init__) + In case the config attribute mapping_not_needed is True, this value is not relevant. In this case + it will contain the string "device_id:device_interface_id" + "service_endpoint_encapsulation_type": None, "dot1q", ... + "service_endpoint_encapsulation_info": (dict) with: + "vlan": ..., (int, present if encapsulation is dot1q) + "vni": ... (int, present if encapsulation is vxlan), + "peers": [(ipv4_1), (ipv4_2)] (present if encapsulation is vxlan) + "mac": ... + "device_id": ..., same meaning that for 'service_endpoint_mapping' (see __init__) + "device_interface_id": same meaning that for 'service_endpoint_mapping' (see __init__) + "switch_dpid": ..., present if mapping has been found for this device_id,device_interface_id + "swith_port": ... present if mapping has been found for this device_id,device_interface_id + "service_mapping_info": present if mapping has been found for this device_id,device_interface_id + :param kwargs: For future versions: + bandwidth (int): value in kilobytes + latency (int): value in milliseconds + Other QoS might be passed as keyword arguments. + :return: tuple: ``(service_id, conn_info)`` containing: + - *service_uuid* (str): UUID of the established connectivity service + - *conn_info* (dict or None): Information to be stored at the database (or ``None``). + This information will be provided to the :meth:`~.edit_connectivity_service` and :obj:`~.delete`. + **MUST** be JSON/YAML-serializable (plain data structures). + :raises: SdnConnectorException: In case of error. Nothing should be created in this case. + Provide the parameter http_code + """ + raise NotImplementedError + + def delete_connectivity_service(self, service_uuid, conn_info=None): + """ + Disconnect multi-site endpoints previously connected + + :param service_uuid: The one returned by create_connectivity_service + :param conn_info: The one returned by last call to 'create_connectivity_service' or 'edit_connectivity_service' + if they do not return None + :return: None + :raises: SdnConnectorException: In case of error. The parameter http_code must be filled + """ + raise NotImplementedError + + def edit_connectivity_service( + self, service_uuid, conn_info=None, connection_points=None, **kwargs + ): + """Change an existing connectivity service. + + This method's arguments and return value follow the same convention as + :meth:`~.create_connectivity_service`. + + :param service_uuid: UUID of the connectivity service. + :param conn_info: (dict or None): Information previously returned by last call to create_connectivity_service + or edit_connectivity_service + :param connection_points: (list): If provided, the old list of connection points will be replaced. + :param kwargs: Same meaning that create_connectivity_service + :return: dict or None: Information to be updated and stored at the database. + When ``None`` is returned, no information should be changed. + When an empty dict is returned, the database record will be deleted. + **MUST** be JSON/YAML-serializable (plain data structures). + Raises: + SdnConnectorException: In case of error. + """ + + def clear_all_connectivity_services(self): + """Delete all WAN Links in a WIM. + + This method is intended for debugging only, and should delete all the + connections controlled by the WIM/SDN, not only the connections that + a specific RO is aware of. + + Raises: + SdnConnectorException: In case of error. + """ + raise NotImplementedError + + def get_all_active_connectivity_services(self): + """Provide information about all active connections provisioned by a + WIM. + + Raises: + SdnConnectorException: In case of error. + """ + raise NotImplementedError diff --git a/src/compute/tests/test_unitary.py b/src/compute/tests/test_unitary.py index 689e6038251d0a371833b34cd9e5158af2fcc0e6..05c45c1b3554d21084a4a20cac6856b049fe7ca3 100644 --- a/src/compute/tests/test_unitary.py +++ b/src/compute/tests/test_unitary.py @@ -1,76 +1,39 @@ -import logging, os, pytest, requests, time -from google.protobuf.json_format import MessageToDict -from common.type_checkers.Assertions import validate_service_id -from compute.client.ComputeClient import ComputeClient -from compute.proto.context_pb2 import Service -from compute.service.ComputeService import ComputeService -from compute.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL) -from compute.service.rest_server.Server import Server -from compute.service.rest_server.resources.Compute import Compute -from service.service.ServiceService import ServiceService -from service.Config import ( - GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as SERVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as SERVICE_GRPC_GRACE_PERIOD) - -compute_grpc_port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports -compute_restapi_port = 10000 + RESTAPI_SERVICE_PORT # avoid privileged ports -service_grpc_port = 10000 + SERVICE_GRPC_SERVICE_PORT # avoid privileged ports - -os.environ['SERVICESERVICE_SERVICE_HOST'] = '127.0.0.1' -os.environ['SERVICESERVICE_SERVICE_PORT_GRPC'] = str(service_grpc_port) +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from .mock_osm.MockOSM import MockOSM +from .Constants import SERVICE_CONNECTION_POINTS_1, SERVICE_CONNECTION_POINTS_2, SERVICE_TYPE +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, compute_service_rest, osm_wim) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -@pytest.fixture(scope='session') -def service_service(): - _service = ServiceService( - port=service_grpc_port, max_workers=SERVICE_GRPC_MAX_WORKERS, grace_period=SERVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def compute_service(service_service : ServiceService): - _service = ComputeService(port=compute_grpc_port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() -@pytest.fixture(scope='session') -def compute_service_rest(): - _rest_server = Server(port=compute_restapi_port, base_url=RESTAPI_BASE_URL) - _rest_server.add_resource( - Compute, '/restconf/config/compute', endpoint='api.compute') - _rest_server.start() - time.sleep(1) # bring time for the server to start - yield _rest_server - _rest_server.shutdown() - _rest_server.join() +def test_compute_create_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + osm_wim.create_connectivity_service(SERVICE_TYPE, SERVICE_CONNECTION_POINTS_1) -@pytest.fixture(scope='session') -def compute_client(compute_service): - _client = ComputeClient(address='127.0.0.1', port=compute_grpc_port) - yield _client - _client.close() +def test_compute_get_connectivity_service_status_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.get_connectivity_service_status(service_uuid) -def test_dummy_create_connectivity_service(compute_client : ComputeClient): - # dummy test: should fail with assertion error - with pytest.raises(AssertionError): - validate_service_id(MessageToDict( - compute_client.CreateConnectivityService(Service()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) +def test_compute_edit_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.edit_connectivity_service(service_uuid, SERVICE_CONNECTION_POINTS_2) -def test_dummy_create_connectivity_service_rest_api(compute_service_rest : Server): - # should work - request_url = 'http://127.0.0.1:{:s}{:s}/restconf/config/compute' - request_url = request_url.format(str(compute_restapi_port), RESTAPI_BASE_URL) - reply = requests.post(request_url, json={ - # here add context of POST request body as JSON - }) - json_reply = reply.json() - LOGGER.info('json_reply = {:s}'.format(str(json_reply))) - assert 'succeeded' in json_reply - assert json_reply['succeeded'] +def test_compute_delete_connectivity_service_rest_api(osm_wim : MockOSM): # pylint: disable=redefined-outer-name + service_uuid = list(osm_wim.conn_info.keys())[0] # this test adds a single service + osm_wim.delete_connectivity_service(service_uuid) diff --git a/src/context/.gitlab-ci.yml b/src/context/.gitlab-ci.yml index 23949213fed4941813b38ab39255648b8ad9364b..0da2b582edf879f793341887adef9cef5ad4fff2 100644 --- a/src/context/.gitlab-ci.yml +++ b/src/context/.gitlab-ci.yml @@ -1,4 +1,18 @@ -# Build, tag and push the Docker image to the GitLab registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build context: variables: IMAGE_NAME: 'context' # name of the microservice @@ -7,19 +21,21 @@ build context: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -# after_script: -# - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -38,25 +54,34 @@ unit test context: script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker pull "redis:6.2" - - docker run --name redis -d --network=teraflowbridge --rm redis:6.2 - - docker run --name $IMAGE_NAME -d -p 1010:1010 --env "DB_BACKEND=redis" --env "REDIS_SERVICE_HOST=redis" --env "REDIS_SERVICE_PORT=6379" --env "REDIS_DATABASE_ID=0" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name redis -d --network=teraflowbridge redis:6.2 - sleep 10 + - docker run --name $IMAGE_NAME -d -p 1010:1010 --env "DB_BACKEND=redis" --env "REDIS_SERVICE_HOST=redis" --env "REDIS_SERVICE_PORT=6379" --env "REDIS_DATABASE_ID=0" -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - docker rm -f redis - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy context: @@ -68,10 +93,10 @@ deploy context: - unit test context # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/context/Config.py b/src/context/Config.py index 1854d83bbe6f8015e7749de2c747e823ce573d95..6f5d1dc0b347dc5db27a2cfae973a4e5bdf7b4cc 100644 --- a/src/context/Config.py +++ b/src/context/Config.py @@ -1,19 +1,16 @@ -import logging - -# General settings -LOG_LEVEL = logging.INFO - -# gRPC settings -GRPC_SERVICE_PORT = 1010 -GRPC_MAX_WORKERS = 200 # multiple clients might keep connections alive for Get*Events() RPC methods -GRPC_GRACE_PERIOD = 60 - -# REST-API settings -RESTAPI_SERVICE_PORT = 8080 -RESTAPI_BASE_URL = '/api' - -# Prometheus settings -METRICS_PORT = 9192 +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. # Autopopulate the component with fake data for testing purposes? POPULATE_FAKE_DATA = False diff --git a/src/context/Dockerfile b/src/context/Dockerfile index 57175a3ab66df2ff96dc8964be9b93ab4a159913..97aa46964c65773e8e14401b044ff2e331f16c03 100644 --- a/src/context/Dockerfile +++ b/src/context/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,22 +28,41 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/context +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY context/requirements.in context/requirements.in -RUN pip-compile --output-file=context/requirements.txt context/requirements.in -RUN python3 -m pip install -r context/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY context/. context +# Create component sub-folder, get specific Python packages +RUN mkdir -p /var/teraflow/context +WORKDIR /var/teraflow/context +COPY src/context/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ -# Start context service +# Start the service ENTRYPOINT ["python", "-m", "context.service"] diff --git a/src/context/__init__.py b/src/context/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/__init__.py +++ b/src/context/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/client/ContextClient.py b/src/context/client/ContextClient.py index c3e3c76fc43fbdc9a215703fdcdc55cb488d0171..6e8cbac6a28c1b24d1999b0d8db1240905b10f2c 100644 --- a/src/context/client/ContextClient.py +++ b/src/context/client/ContextClient.py @@ -1,23 +1,45 @@ -from typing import Iterator +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging +from typing import Iterator +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import retry, delay_exponential -from context.proto.context_pb2 import \ - Context, ContextEvent, ContextId, ContextIdList, ContextList, \ - Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, \ - Empty, \ - Link, LinkEvent, LinkId, LinkIdList, LinkList, \ - Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, \ - Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList -from context.proto.context_pb2_grpc import ContextServiceStub +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.proto.context_pb2 import ( + Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, + Context, ContextEvent, ContextId, ContextIdList, ContextList, + Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, + Empty, + Link, LinkEvent, LinkId, LinkIdList, LinkList, + Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, + Slice, SliceEvent, SliceId, SliceIdList, SliceList, + Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) +from common.proto.context_pb2_grpc import ContextServiceStub LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ContextClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) - LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.CONTEXT) + if not port: port = get_service_port_grpc(ServiceNameEnum.CONTEXT) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None self.connect() @@ -32,212 +54,296 @@ class ContextClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListContextIds(self, request: Empty) -> ContextIdList: - LOGGER.debug('ListContextIds request: {:s}'.format(str(request))) + LOGGER.debug('ListContextIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListContextIds(request) - LOGGER.debug('ListContextIds result: {:s}'.format(str(response))) + LOGGER.debug('ListContextIds result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListContexts(self, request: Empty) -> ContextList: - LOGGER.debug('ListContexts request: {:s}'.format(str(request))) + LOGGER.debug('ListContexts request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListContexts(request) - LOGGER.debug('ListContexts result: {:s}'.format(str(response))) + LOGGER.debug('ListContexts result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetContext(self, request: ContextId) -> Context: - LOGGER.debug('GetContext request: {:s}'.format(str(request))) + LOGGER.debug('GetContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetContext(request) - LOGGER.debug('GetContext result: {:s}'.format(str(response))) + LOGGER.debug('GetContext result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SetContext(self, request: Context) -> ContextId: - LOGGER.debug('SetContext request: {:s}'.format(str(request))) + LOGGER.debug('SetContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetContext(request) - LOGGER.debug('SetContext result: {:s}'.format(str(response))) + LOGGER.debug('SetContext result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def RemoveContext(self, request: ContextId) -> Empty: - LOGGER.debug('RemoveContext request: {:s}'.format(str(request))) + LOGGER.debug('RemoveContext request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveContext(request) - LOGGER.debug('RemoveContext result: {:s}'.format(str(response))) + LOGGER.debug('RemoveContext result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetContextEvents(self, request: Empty) -> Iterator[ContextEvent]: - LOGGER.debug('GetContextEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetContextEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetContextEvents(request) - LOGGER.debug('GetContextEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetContextEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListTopologyIds(self, request: ContextId) -> TopologyIdList: - LOGGER.debug('ListTopologyIds request: {:s}'.format(str(request))) + LOGGER.debug('ListTopologyIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListTopologyIds(request) - LOGGER.debug('ListTopologyIds result: {:s}'.format(str(response))) + LOGGER.debug('ListTopologyIds result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListTopologies(self, request: ContextId) -> TopologyList: - LOGGER.debug('ListTopologies request: {:s}'.format(str(request))) + LOGGER.debug('ListTopologies request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListTopologies(request) - LOGGER.debug('ListTopologies result: {:s}'.format(str(response))) + LOGGER.debug('ListTopologies result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetTopology(self, request: TopologyId) -> Topology: - LOGGER.debug('GetTopology request: {:s}'.format(str(request))) + LOGGER.debug('GetTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetTopology(request) - LOGGER.debug('GetTopology result: {:s}'.format(str(response))) + LOGGER.debug('GetTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SetTopology(self, request: Topology) -> TopologyId: - LOGGER.debug('SetTopology request: {:s}'.format(str(request))) + LOGGER.debug('SetTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetTopology(request) - LOGGER.debug('SetTopology result: {:s}'.format(str(response))) + LOGGER.debug('SetTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def RemoveTopology(self, request: TopologyId) -> Empty: - LOGGER.debug('RemoveTopology request: {:s}'.format(str(request))) + LOGGER.debug('RemoveTopology request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveTopology(request) - LOGGER.debug('RemoveTopology result: {:s}'.format(str(response))) + LOGGER.debug('RemoveTopology result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetTopologyEvents(self, request: Empty) -> Iterator[TopologyEvent]: - LOGGER.debug('GetTopologyEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetTopologyEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetTopologyEvents(request) - LOGGER.debug('GetTopologyEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetTopologyEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListDeviceIds(self, request: Empty) -> DeviceIdList: - LOGGER.debug('ListDeviceIds request: {:s}'.format(str(request))) + LOGGER.debug('ListDeviceIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListDeviceIds(request) - LOGGER.debug('ListDeviceIds result: {:s}'.format(str(response))) + LOGGER.debug('ListDeviceIds result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListDevices(self, request: Empty) -> DeviceList: - LOGGER.debug('ListDevices request: {:s}'.format(str(request))) + LOGGER.debug('ListDevices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListDevices(request) - LOGGER.debug('ListDevices result: {:s}'.format(str(response))) + LOGGER.debug('ListDevices result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetDevice(self, request: DeviceId) -> Device: - LOGGER.debug('GetDevice request: {:s}'.format(str(request))) + LOGGER.debug('GetDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetDevice(request) - LOGGER.debug('GetDevice result: {:s}'.format(str(response))) + LOGGER.debug('GetDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SetDevice(self, request: Device) -> DeviceId: - LOGGER.debug('SetDevice request: {:s}'.format(str(request))) + LOGGER.debug('SetDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetDevice(request) - LOGGER.debug('SetDevice result: {:s}'.format(str(response))) + LOGGER.debug('SetDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def RemoveDevice(self, request: DeviceId) -> Empty: - LOGGER.debug('RemoveDevice request: {:s}'.format(str(request))) + LOGGER.debug('RemoveDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveDevice(request) - LOGGER.debug('RemoveDevice result: {:s}'.format(str(response))) + LOGGER.debug('RemoveDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetDeviceEvents(self, request: Empty) -> Iterator[DeviceEvent]: - LOGGER.debug('GetDeviceEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetDeviceEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetDeviceEvents(request) - LOGGER.debug('GetDeviceEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetDeviceEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListLinkIds(self, request: Empty) -> LinkIdList: - LOGGER.debug('ListLinkIds request: {:s}'.format(str(request))) + LOGGER.debug('ListLinkIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListLinkIds(request) - LOGGER.debug('ListLinkIds result: {:s}'.format(str(response))) + LOGGER.debug('ListLinkIds result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListLinks(self, request: Empty) -> LinkList: - LOGGER.debug('ListLinks request: {:s}'.format(str(request))) + LOGGER.debug('ListLinks request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListLinks(request) - LOGGER.debug('ListLinks result: {:s}'.format(str(response))) + LOGGER.debug('ListLinks result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetLink(self, request: LinkId) -> Link: - LOGGER.debug('GetLink request: {:s}'.format(str(request))) + LOGGER.debug('GetLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetLink(request) - LOGGER.debug('GetLink result: {:s}'.format(str(response))) + LOGGER.debug('GetLink result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SetLink(self, request: Link) -> LinkId: - LOGGER.debug('SetLink request: {:s}'.format(str(request))) + LOGGER.debug('SetLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetLink(request) - LOGGER.debug('SetLink result: {:s}'.format(str(response))) + LOGGER.debug('SetLink result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def RemoveLink(self, request: LinkId) -> Empty: - LOGGER.debug('RemoveLink request: {:s}'.format(str(request))) + LOGGER.debug('RemoveLink request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveLink(request) - LOGGER.debug('RemoveLink result: {:s}'.format(str(response))) + LOGGER.debug('RemoveLink result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetLinkEvents(self, request: Empty) -> Iterator[LinkEvent]: - LOGGER.debug('GetLinkEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetLinkEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetLinkEvents(request) - LOGGER.debug('GetLinkEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetLinkEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListServiceIds(self, request: ContextId) -> ServiceIdList: - LOGGER.debug('ListServiceIds request: {:s}'.format(str(request))) + LOGGER.debug('ListServiceIds request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListServiceIds(request) - LOGGER.debug('ListServiceIds result: {:s}'.format(str(response))) + LOGGER.debug('ListServiceIds result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ListServices(self, request: ContextId) -> ServiceList: - LOGGER.debug('ListServices request: {:s}'.format(str(request))) + LOGGER.debug('ListServices request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ListServices(request) - LOGGER.debug('ListServices result: {:s}'.format(str(response))) + LOGGER.debug('ListServices result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetService(self, request: ServiceId) -> Service: - LOGGER.debug('GetService request: {:s}'.format(str(request))) + LOGGER.debug('GetService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetService(request) - LOGGER.debug('GetService result: {:s}'.format(str(response))) + LOGGER.debug('GetService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SetService(self, request: Service) -> ServiceId: - LOGGER.debug('SetService request: {:s}'.format(str(request))) + LOGGER.debug('SetService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.SetService(request) - LOGGER.debug('SetService result: {:s}'.format(str(response))) + LOGGER.debug('SetService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def RemoveService(self, request: ServiceId) -> Empty: - LOGGER.debug('RemoveService request: {:s}'.format(str(request))) + LOGGER.debug('RemoveService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.RemoveService(request) - LOGGER.debug('RemoveService result: {:s}'.format(str(response))) + LOGGER.debug('RemoveService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetServiceEvents(self, request: Empty) -> Iterator[ServiceEvent]: - LOGGER.debug('GetServiceEvents request: {:s}'.format(str(request))) + LOGGER.debug('GetServiceEvents request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetServiceEvents(request) - LOGGER.debug('GetServiceEvents result: {:s}'.format(str(response))) + LOGGER.debug('GetServiceEvents result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListSliceIds(self, request: ContextId) -> SliceIdList: + LOGGER.debug('ListSliceIds request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListSliceIds(request) + LOGGER.debug('ListSliceIds result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListSlices(self, request: ContextId) -> SliceList: + LOGGER.debug('ListSlices request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListSlices(request) + LOGGER.debug('ListSlices result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSlice(self, request: SliceId) -> Slice: + LOGGER.debug('GetSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSlice(request) + LOGGER.debug('GetSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetSlice(self, request: Slice) -> SliceId: + LOGGER.debug('SetSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetSlice(request) + LOGGER.debug('SetSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RemoveSlice(self, request: SliceId) -> Empty: + LOGGER.debug('RemoveSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RemoveSlice(request) + LOGGER.debug('RemoveSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSliceEvents(self, request: Empty) -> Iterator[SliceEvent]: + LOGGER.debug('GetSliceEvents request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSliceEvents(request) + LOGGER.debug('GetSliceEvents result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListConnectionIds(self, request: ServiceId) -> ConnectionIdList: + LOGGER.debug('ListConnectionIds request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListConnectionIds(request) + LOGGER.debug('ListConnectionIds result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def ListConnections(self, request: ServiceId) -> ConnectionList: + LOGGER.debug('ListConnections request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.ListConnections(request) + LOGGER.debug('ListConnections result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetConnection(self, request: ConnectionId) -> Connection: + LOGGER.debug('GetConnection request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetConnection(request) + LOGGER.debug('GetConnection result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetConnection(self, request: Connection) -> ConnectionId: + LOGGER.debug('SetConnection request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetConnection(request) + LOGGER.debug('SetConnection result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RemoveConnection(self, request: ConnectionId) -> Empty: + LOGGER.debug('RemoveConnection request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RemoveConnection(request) + LOGGER.debug('RemoveConnection result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetConnectionEvents(self, request: Empty) -> Iterator[ConnectionEvent]: + LOGGER.debug('GetConnectionEvents request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetConnectionEvents(request) + LOGGER.debug('GetConnectionEvents result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/context/client/EventsCollector.py b/src/context/client/EventsCollector.py new file mode 100644 index 0000000000000000000000000000000000000000..14a297231f757771beb2c01bc557e5e3de0defb0 --- /dev/null +++ b/src/context/client/EventsCollector.py @@ -0,0 +1,100 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging, queue, threading +from common.proto.context_pb2 import Empty +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +class EventsCollector: + def __init__( + self, context_client_grpc : ContextClient, log_events_received=False + ) -> None: + self._events_queue = queue.Queue() + self._log_events_received = log_events_received + + self._context_stream = context_client_grpc.GetContextEvents(Empty()) + self._topology_stream = context_client_grpc.GetTopologyEvents(Empty()) + self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) + self._link_stream = context_client_grpc.GetLinkEvents(Empty()) + self._service_stream = context_client_grpc.GetServiceEvents(Empty()) + self._slice_stream = context_client_grpc.GetSliceEvents(Empty()) + self._connection_stream = context_client_grpc.GetConnectionEvents(Empty()) + + self._context_thread = threading.Thread(target=self._collect, args=(self._context_stream ,), daemon=False) + self._topology_thread = threading.Thread(target=self._collect, args=(self._topology_stream ,), daemon=False) + self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) + self._link_thread = threading.Thread(target=self._collect, args=(self._link_stream ,), daemon=False) + self._service_thread = threading.Thread(target=self._collect, args=(self._service_stream ,), daemon=False) + self._slice_thread = threading.Thread(target=self._collect, args=(self._slice_stream ,), daemon=False) + self._connection_thread = threading.Thread(target=self._collect, args=(self._connection_stream,), daemon=False) + + def _collect(self, events_stream) -> None: + try: + for event in events_stream: + if self._log_events_received: + LOGGER.info('[_collect] event: {:s}'.format(grpc_message_to_json_string(event))) + self._events_queue.put_nowait(event) + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.CANCELLED: # pylint: disable=no-member + raise # pragma: no cover + + def start(self): + self._context_thread.start() + self._topology_thread.start() + self._device_thread.start() + self._link_thread.start() + self._service_thread.start() + self._slice_thread.start() + self._connection_thread.start() + + def get_event(self, block : bool = True, timeout : float = 0.1): + try: + return self._events_queue.get(block=block, timeout=timeout) + except queue.Empty: # pylint: disable=catching-non-exception + return None + + def get_events(self, block : bool = True, timeout : float = 0.1, count : int = None): + events = [] + if count is None: + while True: + event = self.get_event(block=block, timeout=timeout) + if event is None: break + events.append(event) + else: + for _ in range(count): + event = self.get_event(block=block, timeout=timeout) + if event is None: continue + events.append(event) + return sorted(events, key=lambda e: e.event.timestamp.timestamp) + + def stop(self): + self._context_stream.cancel() + self._topology_stream.cancel() + self._device_stream.cancel() + self._link_stream.cancel() + self._service_stream.cancel() + self._slice_stream.cancel() + self._connection_stream.cancel() + + self._context_thread.join() + self._topology_thread.join() + self._device_thread.join() + self._link_thread.join() + self._service_thread.join() + self._slice_thread.join() + self._connection_thread.join() diff --git a/src/context/client/__init__.py b/src/context/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/client/__init__.py +++ b/src/context/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/genproto.sh b/src/context/genproto.sh deleted file mode 100755 index 8302d355019b0423f20b0ee426cf270c553c9b30..0000000000000000000000000000000000000000 --- a/src/context/genproto.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -rm proto/kpi_sample_types_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2_grpc.py diff --git a/src/context/proto/__init__.py b/src/context/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/context/proto/context_pb2.py b/src/context/proto/context_pb2.py deleted file mode 100644 index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..0000000000000000000000000000000000000000 --- a/src/context/proto/context_pb2.py +++ /dev/null @@ -1,2545 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3552, - serialized_end=3658, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3661, - serialized_end=3858, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3861, - serialized_end=4004, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4007, - serialized_end=4136, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4139, - serialized_end=4275, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4277, - serialized_end=4370, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2605, - serialized_end=2735, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2738, - serialized_end=2872, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2874, - serialized_end=2975, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2977, - serialized_end=3040, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3042, - serialized_end=3096, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3099, - serialized_end=3240, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3242, - serialized_end=3307, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3309, - serialized_end=3367, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3369, - serialized_end=3463, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3550, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/context/proto/context_pb2_grpc.py b/src/context/proto/context_pb2_grpc.py deleted file mode 100644 index 63a7edb530ab138e7f2d6c2ba2d6075db52e2fee..0000000000000000000000000000000000000000 --- a/src/context/proto/context_pb2_grpc.py +++ /dev/null @@ -1,1023 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 - - -class ContextServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListContextIds = channel.unary_unary( - '/context.ContextService/ListContextIds', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.ContextIdList.FromString, - ) - self.ListContexts = channel.unary_unary( - '/context.ContextService/ListContexts', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.ContextList.FromString, - ) - self.GetContext = channel.unary_unary( - '/context.ContextService/GetContext', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.Context.FromString, - ) - self.SetContext = channel.unary_unary( - '/context.ContextService/SetContext', - request_serializer=context__pb2.Context.SerializeToString, - response_deserializer=context__pb2.ContextId.FromString, - ) - self.RemoveContext = channel.unary_unary( - '/context.ContextService/RemoveContext', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetContextEvents = channel.unary_stream( - '/context.ContextService/GetContextEvents', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.ContextEvent.FromString, - ) - self.ListTopologyIds = channel.unary_unary( - '/context.ContextService/ListTopologyIds', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.TopologyIdList.FromString, - ) - self.ListTopologies = channel.unary_unary( - '/context.ContextService/ListTopologies', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.TopologyList.FromString, - ) - self.GetTopology = channel.unary_unary( - '/context.ContextService/GetTopology', - request_serializer=context__pb2.TopologyId.SerializeToString, - response_deserializer=context__pb2.Topology.FromString, - ) - self.SetTopology = channel.unary_unary( - '/context.ContextService/SetTopology', - request_serializer=context__pb2.Topology.SerializeToString, - response_deserializer=context__pb2.TopologyId.FromString, - ) - self.RemoveTopology = channel.unary_unary( - '/context.ContextService/RemoveTopology', - request_serializer=context__pb2.TopologyId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetTopologyEvents = channel.unary_stream( - '/context.ContextService/GetTopologyEvents', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.TopologyEvent.FromString, - ) - self.ListDeviceIds = channel.unary_unary( - '/context.ContextService/ListDeviceIds', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.DeviceIdList.FromString, - ) - self.ListDevices = channel.unary_unary( - '/context.ContextService/ListDevices', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.DeviceList.FromString, - ) - self.GetDevice = channel.unary_unary( - '/context.ContextService/GetDevice', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=context__pb2.Device.FromString, - ) - self.SetDevice = channel.unary_unary( - '/context.ContextService/SetDevice', - request_serializer=context__pb2.Device.SerializeToString, - response_deserializer=context__pb2.DeviceId.FromString, - ) - self.RemoveDevice = channel.unary_unary( - '/context.ContextService/RemoveDevice', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetDeviceEvents = channel.unary_stream( - '/context.ContextService/GetDeviceEvents', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.DeviceEvent.FromString, - ) - self.ListLinkIds = channel.unary_unary( - '/context.ContextService/ListLinkIds', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.LinkIdList.FromString, - ) - self.ListLinks = channel.unary_unary( - '/context.ContextService/ListLinks', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.LinkList.FromString, - ) - self.GetLink = channel.unary_unary( - '/context.ContextService/GetLink', - request_serializer=context__pb2.LinkId.SerializeToString, - response_deserializer=context__pb2.Link.FromString, - ) - self.SetLink = channel.unary_unary( - '/context.ContextService/SetLink', - request_serializer=context__pb2.Link.SerializeToString, - response_deserializer=context__pb2.LinkId.FromString, - ) - self.RemoveLink = channel.unary_unary( - '/context.ContextService/RemoveLink', - request_serializer=context__pb2.LinkId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetLinkEvents = channel.unary_stream( - '/context.ContextService/GetLinkEvents', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.LinkEvent.FromString, - ) - self.ListServiceIds = channel.unary_unary( - '/context.ContextService/ListServiceIds', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.ServiceIdList.FromString, - ) - self.ListServices = channel.unary_unary( - '/context.ContextService/ListServices', - request_serializer=context__pb2.ContextId.SerializeToString, - response_deserializer=context__pb2.ServiceList.FromString, - ) - self.GetService = channel.unary_unary( - '/context.ContextService/GetService', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.Service.FromString, - ) - self.SetService = channel.unary_unary( - '/context.ContextService/SetService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.ServiceId.FromString, - ) - self.RemoveService = channel.unary_unary( - '/context.ContextService/RemoveService', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetServiceEvents = channel.unary_stream( - '/context.ContextService/GetServiceEvents', - request_serializer=context__pb2.Empty.SerializeToString, - response_deserializer=context__pb2.ServiceEvent.FromString, - ) - - -class ContextServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def ListContextIds(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListContexts(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetContext(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetContext(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveContext(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetContextEvents(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListTopologyIds(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListTopologies(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetTopology(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetTopology(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveTopology(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetTopologyEvents(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListDeviceIds(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListDevices(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDeviceEvents(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListLinkIds(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListLinks(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetLink(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetLink(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveLink(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetLinkEvents(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListServiceIds(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListServices(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetServiceEvents(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ContextServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'ListContextIds': grpc.unary_unary_rpc_method_handler( - servicer.ListContextIds, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.ContextIdList.SerializeToString, - ), - 'ListContexts': grpc.unary_unary_rpc_method_handler( - servicer.ListContexts, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.ContextList.SerializeToString, - ), - 'GetContext': grpc.unary_unary_rpc_method_handler( - servicer.GetContext, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.Context.SerializeToString, - ), - 'SetContext': grpc.unary_unary_rpc_method_handler( - servicer.SetContext, - request_deserializer=context__pb2.Context.FromString, - response_serializer=context__pb2.ContextId.SerializeToString, - ), - 'RemoveContext': grpc.unary_unary_rpc_method_handler( - servicer.RemoveContext, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetContextEvents': grpc.unary_stream_rpc_method_handler( - servicer.GetContextEvents, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.ContextEvent.SerializeToString, - ), - 'ListTopologyIds': grpc.unary_unary_rpc_method_handler( - servicer.ListTopologyIds, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.TopologyIdList.SerializeToString, - ), - 'ListTopologies': grpc.unary_unary_rpc_method_handler( - servicer.ListTopologies, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.TopologyList.SerializeToString, - ), - 'GetTopology': grpc.unary_unary_rpc_method_handler( - servicer.GetTopology, - request_deserializer=context__pb2.TopologyId.FromString, - response_serializer=context__pb2.Topology.SerializeToString, - ), - 'SetTopology': grpc.unary_unary_rpc_method_handler( - servicer.SetTopology, - request_deserializer=context__pb2.Topology.FromString, - response_serializer=context__pb2.TopologyId.SerializeToString, - ), - 'RemoveTopology': grpc.unary_unary_rpc_method_handler( - servicer.RemoveTopology, - request_deserializer=context__pb2.TopologyId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetTopologyEvents': grpc.unary_stream_rpc_method_handler( - servicer.GetTopologyEvents, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.TopologyEvent.SerializeToString, - ), - 'ListDeviceIds': grpc.unary_unary_rpc_method_handler( - servicer.ListDeviceIds, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.DeviceIdList.SerializeToString, - ), - 'ListDevices': grpc.unary_unary_rpc_method_handler( - servicer.ListDevices, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.DeviceList.SerializeToString, - ), - 'GetDevice': grpc.unary_unary_rpc_method_handler( - servicer.GetDevice, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=context__pb2.Device.SerializeToString, - ), - 'SetDevice': grpc.unary_unary_rpc_method_handler( - servicer.SetDevice, - request_deserializer=context__pb2.Device.FromString, - response_serializer=context__pb2.DeviceId.SerializeToString, - ), - 'RemoveDevice': grpc.unary_unary_rpc_method_handler( - servicer.RemoveDevice, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetDeviceEvents': grpc.unary_stream_rpc_method_handler( - servicer.GetDeviceEvents, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.DeviceEvent.SerializeToString, - ), - 'ListLinkIds': grpc.unary_unary_rpc_method_handler( - servicer.ListLinkIds, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.LinkIdList.SerializeToString, - ), - 'ListLinks': grpc.unary_unary_rpc_method_handler( - servicer.ListLinks, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.LinkList.SerializeToString, - ), - 'GetLink': grpc.unary_unary_rpc_method_handler( - servicer.GetLink, - request_deserializer=context__pb2.LinkId.FromString, - response_serializer=context__pb2.Link.SerializeToString, - ), - 'SetLink': grpc.unary_unary_rpc_method_handler( - servicer.SetLink, - request_deserializer=context__pb2.Link.FromString, - response_serializer=context__pb2.LinkId.SerializeToString, - ), - 'RemoveLink': grpc.unary_unary_rpc_method_handler( - servicer.RemoveLink, - request_deserializer=context__pb2.LinkId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetLinkEvents': grpc.unary_stream_rpc_method_handler( - servicer.GetLinkEvents, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.LinkEvent.SerializeToString, - ), - 'ListServiceIds': grpc.unary_unary_rpc_method_handler( - servicer.ListServiceIds, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.ServiceIdList.SerializeToString, - ), - 'ListServices': grpc.unary_unary_rpc_method_handler( - servicer.ListServices, - request_deserializer=context__pb2.ContextId.FromString, - response_serializer=context__pb2.ServiceList.SerializeToString, - ), - 'GetService': grpc.unary_unary_rpc_method_handler( - servicer.GetService, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.Service.SerializeToString, - ), - 'SetService': grpc.unary_unary_rpc_method_handler( - servicer.SetService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.ServiceId.SerializeToString, - ), - 'RemoveService': grpc.unary_unary_rpc_method_handler( - servicer.RemoveService, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetServiceEvents': grpc.unary_stream_rpc_method_handler( - servicer.GetServiceEvents, - request_deserializer=context__pb2.Empty.FromString, - response_serializer=context__pb2.ServiceEvent.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'context.ContextService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ContextService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def ListContextIds(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListContextIds', - context__pb2.Empty.SerializeToString, - context__pb2.ContextIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListContexts(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListContexts', - context__pb2.Empty.SerializeToString, - context__pb2.ContextList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetContext(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetContext', - context__pb2.ContextId.SerializeToString, - context__pb2.Context.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetContext(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetContext', - context__pb2.Context.SerializeToString, - context__pb2.ContextId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RemoveContext(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveContext', - context__pb2.ContextId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetContextEvents(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetContextEvents', - context__pb2.Empty.SerializeToString, - context__pb2.ContextEvent.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListTopologyIds(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListTopologyIds', - context__pb2.ContextId.SerializeToString, - context__pb2.TopologyIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListTopologies(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListTopologies', - context__pb2.ContextId.SerializeToString, - context__pb2.TopologyList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetTopology(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetTopology', - context__pb2.TopologyId.SerializeToString, - context__pb2.Topology.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetTopology(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetTopology', - context__pb2.Topology.SerializeToString, - context__pb2.TopologyId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RemoveTopology(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveTopology', - context__pb2.TopologyId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetTopologyEvents(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetTopologyEvents', - context__pb2.Empty.SerializeToString, - context__pb2.TopologyEvent.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListDeviceIds(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListDeviceIds', - context__pb2.Empty.SerializeToString, - context__pb2.DeviceIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListDevices(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListDevices', - context__pb2.Empty.SerializeToString, - context__pb2.DeviceList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetDevice', - context__pb2.DeviceId.SerializeToString, - context__pb2.Device.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetDevice', - context__pb2.Device.SerializeToString, - context__pb2.DeviceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RemoveDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveDevice', - context__pb2.DeviceId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetDeviceEvents(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetDeviceEvents', - context__pb2.Empty.SerializeToString, - context__pb2.DeviceEvent.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListLinkIds(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListLinkIds', - context__pb2.Empty.SerializeToString, - context__pb2.LinkIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListLinks(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListLinks', - context__pb2.Empty.SerializeToString, - context__pb2.LinkList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetLink(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetLink', - context__pb2.LinkId.SerializeToString, - context__pb2.Link.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetLink(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetLink', - context__pb2.Link.SerializeToString, - context__pb2.LinkId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RemoveLink(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveLink', - context__pb2.LinkId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetLinkEvents(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetLinkEvents', - context__pb2.Empty.SerializeToString, - context__pb2.LinkEvent.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListServiceIds(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListServiceIds', - context__pb2.ContextId.SerializeToString, - context__pb2.ServiceIdList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListServices(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/ListServices', - context__pb2.ContextId.SerializeToString, - context__pb2.ServiceList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetService', - context__pb2.ServiceId.SerializeToString, - context__pb2.Service.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/SetService', - context__pb2.Service.SerializeToString, - context__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def RemoveService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/context.ContextService/RemoveService', - context__pb2.ServiceId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetServiceEvents(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/context.ContextService/GetServiceEvents', - context__pb2.Empty.SerializeToString, - context__pb2.ServiceEvent.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/context/proto/kpi_sample_types_pb2.py b/src/context/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/context/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/context/requirements.in b/src/context/requirements.in index e80c645fc94eb240a3290e762db22557e94cdae0..9cc7e71f2428fbb42693f47c911340e5f3f2dbc1 100644 --- a/src/context/requirements.in +++ b/src/context/requirements.in @@ -1,8 +1,4 @@ -flask-restful -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis -requests +Flask==2.1.3 +Flask-RESTful==0.3.9 +redis==4.1.2 +requests==2.27.1 diff --git a/src/context/service/Populate.py b/src/context/service/Populate.py index eea593d90a608b57db0bd1fa801eef11abee5b03..ffb739988d163d30e9426da54b990f66015e70a1 100644 --- a/src/context/service/Populate.py +++ b/src/context/service/Populate.py @@ -1,34 +1,49 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import copy +from common.proto.context_pb2 import Connection, Context, Device, Link, Service, Topology from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import Context, Device, Link, Service, Topology -from context.tests.example_objects import ( - CONTEXT, TOPOLOGY, - DEVICE1, DEVICE1_ID, DEVICE2, DEVICE2_ID, DEVICE3, DEVICE3_ID, - LINK_DEV1_DEV2, LINK_DEV1_DEV2_ID, LINK_DEV1_DEV3, LINK_DEV1_DEV3_ID, LINK_DEV2_DEV3, LINK_DEV2_DEV3_ID, - SERVICE_DEV1_DEV2, SERVICE_DEV1_DEV3, SERVICE_DEV2_DEV3) +from context.tests.Objects import ( + CONNECTION_R1_R3, CONTEXT, TOPOLOGY, DEVICE_R1, DEVICE_R1_ID, DEVICE_R2, DEVICE_R2_ID, DEVICE_R3, DEVICE_R3_ID, + LINK_R1_R2, LINK_R1_R2_ID, LINK_R1_R3, LINK_R1_R3_ID, LINK_R2_R3, LINK_R2_R3_ID, SERVICE_R1_R2, SERVICE_R1_R3, + SERVICE_R2_R3) -def populate(address, port): - client = ContextClient(address=address, port=port) +def populate(host=None, port=None): + client = ContextClient(host=host, port=port) client.SetContext(Context(**CONTEXT)) client.SetTopology(Topology(**TOPOLOGY)) - client.SetDevice(Device(**DEVICE1)) - client.SetDevice(Device(**DEVICE2)) - client.SetDevice(Device(**DEVICE3)) + client.SetDevice(Device(**DEVICE_R1)) + client.SetDevice(Device(**DEVICE_R2)) + client.SetDevice(Device(**DEVICE_R3)) - client.SetLink(Link(**LINK_DEV1_DEV2)) - client.SetLink(Link(**LINK_DEV1_DEV3)) - client.SetLink(Link(**LINK_DEV2_DEV3)) + client.SetLink(Link(**LINK_R1_R2)) + client.SetLink(Link(**LINK_R1_R3)) + client.SetLink(Link(**LINK_R2_R3)) TOPOLOGY_WITH_DEVICES_AND_LINKS = copy.deepcopy(TOPOLOGY) - TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE1_ID) - TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE2_ID) - TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE3_ID) - TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_DEV1_DEV2_ID) - TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_DEV1_DEV3_ID) - TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_DEV2_DEV3_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE_R1_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE_R2_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['device_ids'].append(DEVICE_R3_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_R1_R2_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_R1_R3_ID) + TOPOLOGY_WITH_DEVICES_AND_LINKS['link_ids'].append(LINK_R2_R3_ID) client.SetTopology(Topology(**TOPOLOGY_WITH_DEVICES_AND_LINKS)) - client.SetService(Service(**SERVICE_DEV1_DEV2)) - client.SetService(Service(**SERVICE_DEV1_DEV3)) - client.SetService(Service(**SERVICE_DEV2_DEV3)) + client.SetService(Service(**SERVICE_R1_R2)) + client.SetService(Service(**SERVICE_R2_R3)) + + client.SetService(Service(**SERVICE_R1_R3)) + client.SetConnection(Connection(**CONNECTION_R1_R3)) diff --git a/src/context/service/__init__.py b/src/context/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/service/__init__.py +++ b/src/context/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/service/__main__.py b/src/context/service/__main__.py index 495c203c93ca7df2032cf54c44ba4cefa58d3324..53754caf4f9d2621ed8a6fdfd325d42f77f44a4f 100644 --- a/src/context/service/__main__.py +++ b/src/context/service/__main__.py @@ -1,17 +1,29 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting +from common.Settings import get_log_level, get_metrics_port, get_setting from common.orm.Database import Database from common.orm.Factory import get_database_backend from common.message_broker.Factory import get_messagebroker_backend from common.message_broker.MessageBroker import MessageBroker -from context.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, POPULATE_FAKE_DATA, RESTAPI_SERVICE_PORT, - RESTAPI_BASE_URL, METRICS_PORT) -from context.service.Populate import populate -from context.service.grpc_server.ContextService import ContextService -from context.service.rest_server.Server import Server -from context.service.rest_server.Resources import RESOURCES +from context.Config import POPULATE_FAKE_DATA +from .grpc_server.ContextService import ContextService +from .rest_server.Resources import RESOURCES +from .rest_server.RestServer import RestServer +from .Populate import populate terminate = threading.Event() LOGGER = None @@ -23,16 +35,7 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - restapi_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_HTTP', default=RESTAPI_SERVICE_PORT) - restapi_base_url = get_setting('RESTAPI_BASE_URL', default=RESTAPI_BASE_URL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - populate_fake_data = get_setting('POPULATE_FAKE_DATA', default=POPULATE_FAKE_DATA ) - if isinstance(populate_fake_data, str): populate_fake_data = (populate_fake_data.upper() in {'T', '1', 'TRUE'}) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) @@ -42,6 +45,7 @@ def main(): LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Get database instance @@ -51,18 +55,19 @@ def main(): messagebroker = MessageBroker(get_messagebroker_backend()) # Starting context service - grpc_service = ContextService( - database, messagebroker, port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = ContextService(database, messagebroker) grpc_service.start() - rest_server = Server(port=restapi_service_port, base_url=restapi_base_url) + rest_server = RestServer() for endpoint_name, resource_class, resource_url in RESOURCES: rest_server.add_resource(resource_class, resource_url, endpoint=endpoint_name, resource_class_args=(database,)) rest_server.start() + populate_fake_data = get_setting('POPULATE_FAKE_DATA', default=POPULATE_FAKE_DATA) + if isinstance(populate_fake_data, str): populate_fake_data = (populate_fake_data.upper() in {'T', '1', 'TRUE'}) if populate_fake_data: LOGGER.info('Populating fake data...') - populate('127.0.0.1', grpc_service_port) + populate(host='127.0.0.1', port=grpc_service.bind_port) LOGGER.info('Fake Data populated') # Wait for Ctrl+C or termination signal diff --git a/src/context/service/database/ConfigModel.py b/src/context/service/database/ConfigModel.py index d97cdb7dfe6594a59be10427ed52341346c19a97..bb2a37467ce3ad451bd29f824a5092ec1ad43cee 100644 --- a/src/context/service/database/ConfigModel.py +++ b/src/context/service/database/ConfigModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools, logging, operator from enum import Enum from typing import Dict, List, Optional, Tuple, Union @@ -10,7 +24,8 @@ from common.orm.fields.IntegerField import IntegerField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model -from context.proto.context_pb2 import ConfigActionEnum +from common.proto.context_pb2 import ConfigActionEnum +from common.tools.grpc.Tools import grpc_message_to_json_string from .Tools import fast_hasher, grpc_to_enum, remove_dict_key LOGGER = logging.getLogger(__name__) @@ -26,6 +41,11 @@ grpc_to_enum__config_action = functools.partial( class ConfigModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() + def delete(self) -> None: + db_config_rule_pks = self.references(ConfigRuleModel) + for pk,_ in db_config_rule_pks: ConfigRuleModel(self.database, pk).delete() + super().delete() + def dump(self) -> List[Dict]: db_config_rule_pks = self.references(ConfigRuleModel) config_rules = [ConfigRuleModel(self.database, pk).dump(include_position=True) for pk,_ in db_config_rule_pks] @@ -43,15 +63,17 @@ class ConfigRuleModel(Model): # pylint: disable=abstract-method def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ result = { 'action': self.action.value, - 'resource_key': self.key, - 'resource_value': self.value, + 'custom': { + 'resource_key': self.key, + 'resource_value': self.value, + }, } if include_position: result['position'] = self.position return result def set_config_rule( database : Database, db_config : ConfigModel, position : int, resource_key : str, resource_value : str - ) -> Tuple[ConfigRuleModel, bool]: +) -> Tuple[ConfigRuleModel, bool]: str_rule_key_hash = fast_hasher(resource_key) str_config_rule_key = key_to_str([db_config.pk, str_rule_key_hash], separator=':') @@ -63,7 +85,7 @@ def set_config_rule( def delete_config_rule( database : Database, db_config : ConfigModel, resource_key : str - ) -> None: +) -> None: str_rule_key_hash = fast_hasher(resource_key) str_config_rule_key = key_to_str([db_config.pk, str_rule_key_hash], separator=':') @@ -74,7 +96,7 @@ def delete_config_rule( def delete_all_config_rules( database : Database, db_config : ConfigModel - ) -> None: +) -> None: db_config_rule_pks = db_config.references(ConfigRuleModel) for pk,_ in db_config_rule_pks: ConfigRuleModel(database, pk).delete() @@ -82,13 +104,17 @@ def delete_all_config_rules( def grpc_config_rules_to_raw(grpc_config_rules) -> List[Tuple[ORM_ConfigActionEnum, str, str]]: def translate(grpc_config_rule): action = grpc_to_enum__config_action(grpc_config_rule.action) - return action, grpc_config_rule.resource_key, grpc_config_rule.resource_value + config_rule_type = str(grpc_config_rule.WhichOneof('config_rule')) + if config_rule_type != 'custom': + raise NotImplementedError('ConfigRule of type {:s} is not implemented: {:s}'.format( + config_rule_type, grpc_message_to_json_string(grpc_config_rule))) + return action, grpc_config_rule.custom.resource_key, grpc_config_rule.custom.resource_value return [translate(grpc_config_rule) for grpc_config_rule in grpc_config_rules] def update_config( database : Database, db_parent_pk : str, config_name : str, raw_config_rules : List[Tuple[ORM_ConfigActionEnum, str, str]] - ) -> List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]]: +) -> List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]]: str_config_key = key_to_str([db_parent_pk, config_name], separator=':') result : Tuple[ConfigModel, bool] = get_or_create_object(database, ConfigModel, str_config_key) diff --git a/src/context/service/database/ConnectionModel.py b/src/context/service/database/ConnectionModel.py new file mode 100644 index 0000000000000000000000000000000000000000..4cbed43a40f3538633216f09060f8a2483fe5e1f --- /dev/null +++ b/src/context/service/database/ConnectionModel.py @@ -0,0 +1,153 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, operator +from typing import Dict, List, Optional, Set, Tuple, Union +from common.orm.Database import Database +from common.orm.backend.Tools import key_to_str +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.IntegerField import IntegerField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_object, get_or_create_object, get_related_objects, update_or_create_object +from common.proto.context_pb2 import EndPointId +from .EndPointModel import EndPointModel +from .ServiceModel import ServiceModel +from .Tools import remove_dict_key + +LOGGER = logging.getLogger(__name__) + +class PathModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + + def delete(self) -> None: + for db_path_hop_pk,_ in self.references(PathHopModel): + PathHopModel(self.database, db_path_hop_pk).delete() + super().delete() + + def dump(self) -> List[Dict]: + db_path_hop_pks = self.references(PathHopModel) + path_hops = [PathHopModel(self.database, pk).dump(include_position=True) for pk,_ in db_path_hop_pks] + path_hops = sorted(path_hops, key=operator.itemgetter('position')) + return [remove_dict_key(path_hop, 'position') for path_hop in path_hops] + +class PathHopModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + path_fk = ForeignKeyField(PathModel) + position = IntegerField(min_value=0, required=True) + endpoint_fk = ForeignKeyField(EndPointModel) + + def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ + db_endpoint : EndPointModel = EndPointModel(self.database, self.endpoint_fk) + result = db_endpoint.dump_id() + if include_position: result['position'] = self.position + return result + +class ConnectionModel(Model): + pk = PrimaryKeyField() + connection_uuid = StringField(required=True, allow_empty=False) + service_fk = ForeignKeyField(ServiceModel, required=False) + path_fk = ForeignKeyField(PathModel, required=True) + + def delete(self) -> None: + # pylint: disable=import-outside-toplevel + from .RelationModels import ConnectionSubServiceModel + + # Do not remove sub-services automatically. They are supported by real services, so Service component should + # deal with the correct removal workflow to deconfigure the devices. + for db_connection_sub_service_pk,_ in self.references(ConnectionSubServiceModel): + ConnectionSubServiceModel(self.database, db_connection_sub_service_pk).delete() + + super().delete() + PathModel(self.database, self.path_fk).delete() + + def dump_id(self) -> Dict: + return { + 'connection_uuid': {'uuid': self.connection_uuid}, + } + + def dump_path_hops_endpoint_ids(self) -> List[Dict]: + return PathModel(self.database, self.path_fk).dump() + + def dump_sub_service_ids(self) -> List[Dict]: + from .RelationModels import ConnectionSubServiceModel # pylint: disable=import-outside-toplevel + db_sub_services = get_related_objects(self, ConnectionSubServiceModel, 'sub_service_fk') + return [db_sub_service.dump_id() for db_sub_service in sorted(db_sub_services, key=operator.attrgetter('pk'))] + + def dump(self, include_path=True, include_sub_service_ids=True) -> Dict: # pylint: disable=arguments-differ + result = {'connection_id': self.dump_id()} + if self.service_fk is not None: + result['service_id'] = ServiceModel(self.database, self.service_fk).dump_id() + if include_path: result['path_hops_endpoint_ids'] = self.dump_path_hops_endpoint_ids() + if include_sub_service_ids: result['sub_service_ids'] = self.dump_sub_service_ids() + return result + +def set_path_hop( + database : Database, db_path : PathModel, position : int, db_endpoint : EndPointModel + ) -> Tuple[PathHopModel, bool]: + + str_path_hop_key = key_to_str([db_path.pk, db_endpoint.pk], separator=':') + result : Tuple[PathHopModel, bool] = update_or_create_object(database, PathHopModel, str_path_hop_key, { + 'path_fk': db_path, 'position': position, 'endpoint_fk': db_endpoint}) + db_path_hop, updated = result + return db_path_hop, updated + +def delete_path_hop( + database : Database, db_path : PathModel, db_path_hop_pk : str + ) -> None: + + db_path_hop : Optional[PathHopModel] = get_object(database, PathHopModel, db_path_hop_pk, raise_if_not_found=False) + if db_path_hop is None: return + db_path_hop.delete() + +def delete_all_path_hops( + database : Database, db_path : PathHopModel + ) -> None: + + db_path_hop_pks = db_path.references(PathHopModel) + for pk,_ in db_path_hop_pks: PathHopModel(database, pk).delete() + +def set_path( + database : Database, connection_uuid : str, raw_endpoint_ids : List[EndPointId], path_name : str = '' + ) -> List[Union[PathModel, PathHopModel]]: + + str_path_key = connection_uuid if len(path_name) == 0 else key_to_str([connection_uuid, path_name], separator=':') + result : Tuple[PathModel, bool] = get_or_create_object(database, PathModel, str_path_key) + db_path, created = result # pylint: disable=unused-variable + + db_path_hop_pks : Set[str] = set(map(operator.itemgetter(0), db_path.references(PathHopModel))) + db_objects : List[Tuple[Union[PathModel, PathHopModel], bool]] = [db_path] + + for position,endpoint_id in enumerate(raw_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(database, EndPointModel, str_endpoint_key) + + result : Tuple[PathHopModel, bool] = set_path_hop(database, db_path, position, db_endpoint) + db_path_hop, updated = result # pylint: disable=unused-variable + db_objects.append(db_path_hop) + db_path_hop_pks.discard(db_path_hop.instance_key) + + for db_path_hop_pk in db_path_hop_pks: delete_path_hop(database, db_path, db_path_hop_pk) + + return db_objects diff --git a/src/context/service/database/ConstraintModel.py b/src/context/service/database/ConstraintModel.py index 4d11b123193e9cb4ce2c03cbfac6a3604947fbe2..a35ec250d8a62a8a2534e9f27ddecac801db6eff 100644 --- a/src/context/service/database/ConstraintModel.py +++ b/src/context/service/database/ConstraintModel.py @@ -1,61 +1,244 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, operator -from typing import Dict, List, Tuple, Union +from enum import Enum +from typing import Dict, List, Optional, Tuple, Type, Union from common.orm.Database import Database -from common.orm.HighLevel import get_or_create_object, update_or_create_object +from common.orm.HighLevel import get_object, get_or_create_object, update_or_create_object from common.orm.backend.Tools import key_to_str +from common.orm.fields.BooleanField import BooleanField +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.FloatField import FloatField from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.IntegerField import IntegerField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model -from context.proto.context_pb2 import Constraint -from context.service.database.Tools import fast_hasher, remove_dict_key +from common.proto.context_pb2 import Constraint +from common.tools.grpc.Tools import grpc_message_to_json_string +from .EndPointModel import EndPointModel, get_endpoint +from .Tools import fast_hasher, remove_dict_key LOGGER = logging.getLogger(__name__) class ConstraintsModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() + def delete(self) -> None: + db_constraint_pks = self.references(ConstraintModel) + for pk,_ in db_constraint_pks: ConstraintModel(self.database, pk).delete() + super().delete() + def dump(self) -> List[Dict]: db_constraint_pks = self.references(ConstraintModel) constraints = [ConstraintModel(self.database, pk).dump(include_position=True) for pk,_ in db_constraint_pks] constraints = sorted(constraints, key=operator.itemgetter('position')) return [remove_dict_key(constraint, 'position') for constraint in constraints] +class ConstraintCustomModel(Model): # pylint: disable=abstract-method + constraint_type = StringField(required=True, allow_empty=False) + constraint_value = StringField(required=True, allow_empty=False) + + def dump(self) -> Dict: # pylint: disable=arguments-differ + return {'custom': {'constraint_type': self.constraint_type, 'constraint_value': self.constraint_value}} + +Union_ConstraintEndpoint = Union[ + 'ConstraintEndpointLocationGpsPositionModel', 'ConstraintEndpointLocationRegionModel', + 'ConstraintEndpointPriorityModel' +] +def dump_endpoint_id(endpoint_constraint : Union_ConstraintEndpoint): + db_endpoints_pks = list(endpoint_constraint.references(EndPointModel)) + num_endpoints = len(db_endpoints_pks) + if num_endpoints != 1: + raise Exception('Wrong number({:d}) of associated Endpoints with constraint'.format(num_endpoints)) + db_endpoint = EndPointModel(endpoint_constraint.database, db_endpoints_pks[0]) + return db_endpoint.dump_id() + +class ConstraintEndpointLocationRegionModel(Model): # pylint: disable=abstract-method + endpoint_fk = ForeignKeyField(EndPointModel) + region = StringField(required=True, allow_empty=False) + + def dump(self) -> Dict: # pylint: disable=arguments-differ + return {'endpoint_location': {'endpoint_id': dump_endpoint_id(self), 'region': self.region}} + +class ConstraintEndpointLocationGpsPositionModel(Model): # pylint: disable=abstract-method + endpoint_fk = ForeignKeyField(EndPointModel) + latitude = FloatField(required=True, min_value=-90.0, max_value=90.0) + longitude = FloatField(required=True, min_value=-180.0, max_value=180.0) + + def dump(self) -> Dict: # pylint: disable=arguments-differ + gps_position = {'latitude': self.latitude, 'longitude': self.longitude} + return {'endpoint_location': {'endpoint_id': dump_endpoint_id(self), 'gps_position': gps_position}} + +class ConstraintEndpointPriorityModel(Model): # pylint: disable=abstract-method + endpoint_fk = ForeignKeyField(EndPointModel) + priority = FloatField(required=True) + + def dump(self) -> Dict: # pylint: disable=arguments-differ + return {'endpoint_priority': {'endpoint_id': dump_endpoint_id(self), 'priority': self.priority}} + +class ConstraintSlaAvailabilityModel(Model): # pylint: disable=abstract-method + num_disjoint_paths = IntegerField(required=True, min_value=1) + all_active = BooleanField(required=True) + + def dump(self) -> Dict: # pylint: disable=arguments-differ + return {'sla_availability': {'num_disjoint_paths': self.num_disjoint_paths, 'all_active': self.all_active}} + +# enum values should match name of field in ConstraintModel +class ConstraintKindEnum(Enum): + CUSTOM = 'custom' + ENDPOINT_LOCATION_REGION = 'ep_loc_region' + ENDPOINT_LOCATION_GPSPOSITION = 'ep_loc_gpspos' + ENDPOINT_PRIORITY = 'ep_priority' + SLA_AVAILABILITY = 'sla_avail' + +Union_SpecificConstraint = Union[ + ConstraintCustomModel, ConstraintEndpointLocationRegionModel, ConstraintEndpointLocationGpsPositionModel, + ConstraintEndpointPriorityModel, ConstraintSlaAvailabilityModel, +] + class ConstraintModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() constraints_fk = ForeignKeyField(ConstraintsModel) + kind = EnumeratedField(ConstraintKindEnum) position = IntegerField(min_value=0, required=True) - constraint_type = StringField(required=True, allow_empty=False) - constraint_value = StringField(required=True, allow_empty=False) + constraint_custom_fk = ForeignKeyField(ConstraintCustomModel, required=False) + constraint_ep_loc_region_fk = ForeignKeyField(ConstraintEndpointLocationRegionModel, required=False) + constraint_ep_loc_gpspos_fk = ForeignKeyField(ConstraintEndpointLocationGpsPositionModel, required=False) + constraint_ep_priority_fk = ForeignKeyField(ConstraintEndpointPriorityModel, required=False) + constraint_sla_avail_fk = ForeignKeyField(ConstraintSlaAvailabilityModel, required=False) + + def delete(self) -> None: + field_name = 'constraint_{:s}_fk'.format(str(self.kind.value)) + specific_fk_value : Optional[ForeignKeyField] = getattr(self, field_name, None) + if specific_fk_value is None: + raise Exception('Unable to find constraint key for field_name({:s})'.format(field_name)) + specific_fk_class = getattr(ConstraintModel, field_name, None) + foreign_model_class : Model = specific_fk_class.foreign_model + super().delete() + get_object(self.database, foreign_model_class, str(specific_fk_value)).delete() def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ - result = { - 'constraint_type': self.constraint_type, - 'constraint_value': self.constraint_value, - } + field_name = 'constraint_{:s}_fk'.format(str(self.kind.value)) + specific_fk_value : Optional[ForeignKeyField] = getattr(self, field_name, None) + if specific_fk_value is None: + raise Exception('Unable to find constraint key for field_name({:s})'.format(field_name)) + specific_fk_class = getattr(ConstraintModel, field_name, None) + foreign_model_class : Model = specific_fk_class.foreign_model + constraint : Union_SpecificConstraint = get_object(self.database, foreign_model_class, str(specific_fk_value)) + result = constraint.dump() if include_position: result['position'] = self.position return result +Tuple_ConstraintSpecs = Tuple[Type, str, Dict, ConstraintKindEnum] +def parse_constraint_custom(database : Database, grpc_constraint) -> Tuple_ConstraintSpecs: + constraint_class = ConstraintCustomModel + str_constraint_id = grpc_constraint.custom.constraint_type + constraint_data = { + 'constraint_type' : grpc_constraint.custom.constraint_type, + 'constraint_value': grpc_constraint.custom.constraint_value, + } + return constraint_class, str_constraint_id, constraint_data, ConstraintKindEnum.CUSTOM + +def parse_constraint_endpoint_location(database : Database, grpc_constraint) -> Tuple_ConstraintSpecs: + grpc_endpoint_id = grpc_constraint.endpoint_location.endpoint_id + str_endpoint_key, db_endpoint = get_endpoint(database, grpc_endpoint_id) + + str_constraint_id = str_endpoint_key + constraint_data = {'endpoint_fk': db_endpoint} + + grpc_location = grpc_constraint.endpoint_location.location + location_kind = str(grpc_location.WhichOneof('location')) + if location_kind == 'region': + constraint_class = ConstraintEndpointLocationRegionModel + constraint_data.update({'region': grpc_location.region}) + return constraint_class, str_constraint_id, constraint_data, ConstraintKindEnum.ENDPOINT_LOCATION_REGION + elif location_kind == 'gps_position': + constraint_class = ConstraintEndpointLocationGpsPositionModel + gps_position = grpc_location.gps_position + constraint_data.update({'latitude': gps_position.latitude, 'longitude': gps_position.longitude}) + return constraint_class, str_constraint_id, constraint_data, ConstraintKindEnum.ENDPOINT_LOCATION_GPSPOSITION + else: + MSG = 'Location kind {:s} in Constraint of kind endpoint_location is not implemented: {:s}' + raise NotImplementedError(MSG.format(location_kind, grpc_message_to_json_string(grpc_constraint))) + +def parse_constraint_endpoint_priority(database : Database, grpc_constraint) -> Tuple_ConstraintSpecs: + grpc_endpoint_id = grpc_constraint.endpoint_priority.endpoint_id + str_endpoint_key, db_endpoint = get_endpoint(database, grpc_endpoint_id) + + constraint_class = ConstraintEndpointPriorityModel + str_constraint_id = str_endpoint_key + priority = grpc_constraint.endpoint_priority.priority + constraint_data = {'endpoint_fk': db_endpoint, 'priority': priority} + + return constraint_class, str_constraint_id, constraint_data, ConstraintKindEnum.ENDPOINT_PRIORITY + +def parse_constraint_sla_availability(database : Database, grpc_constraint) -> Tuple_ConstraintSpecs: + constraint_class = ConstraintSlaAvailabilityModel + str_constraint_id = '' + constraint_data = { + 'num_disjoint_paths' : grpc_constraint.sla_availability.num_disjoint_paths, + 'all_active': grpc_constraint.sla_availability.all_active, + } + return constraint_class, str_constraint_id, constraint_data, ConstraintKindEnum.SLA_AVAILABILITY + +CONSTRAINT_PARSERS = { + 'custom' : parse_constraint_custom, + 'endpoint_location' : parse_constraint_endpoint_location, + 'endpoint_priority' : parse_constraint_endpoint_priority, + 'sla_availability' : parse_constraint_sla_availability, +} + +Union_ConstraintModel = Union[ + ConstraintCustomModel, ConstraintEndpointLocationGpsPositionModel, ConstraintEndpointLocationRegionModel, + ConstraintEndpointPriorityModel, ConstraintSlaAvailabilityModel +] + def set_constraint( - database : Database, db_constraints : ConstraintsModel, grpc_constraint, position : int - ) -> Tuple[Constraint, bool]: + database : Database, db_constraints : ConstraintsModel, grpc_constraint : Constraint, position : int +) -> Tuple[Union_ConstraintModel, bool]: + grpc_constraint_kind = str(grpc_constraint.WhichOneof('constraint')) - str_constraint_key_hash = fast_hasher(grpc_constraint.constraint_type) + parser = CONSTRAINT_PARSERS.get(grpc_constraint_kind) + if parser is None: + raise NotImplementedError('Constraint of kind {:s} is not implemented: {:s}'.format( + grpc_constraint_kind, grpc_message_to_json_string(grpc_constraint))) + + # create specific constraint + constraint_class, str_constraint_id, constraint_data, constraint_kind = parser(database, grpc_constraint) + str_constraint_key_hash = fast_hasher(':'.join([constraint_kind.value, str_constraint_id])) str_constraint_key = key_to_str([db_constraints.pk, str_constraint_key_hash], separator=':') + result : Tuple[Union_ConstraintModel, bool] = update_or_create_object( + database, constraint_class, str_constraint_key, constraint_data) + db_specific_constraint, updated = result + + # create generic constraint + constraint_fk_field_name = 'constraint_{:s}_fk'.format(constraint_kind.value) + constraint_data = { + 'constraints_fk': db_constraints, 'position': position, 'kind': constraint_kind, + constraint_fk_field_name: db_specific_constraint + } + result : Tuple[ConstraintModel, bool] = update_or_create_object( + database, ConstraintModel, str_constraint_key, constraint_data) + db_constraint, updated = result - result : Tuple[ConstraintModel, bool] = update_or_create_object(database, ConstraintModel, str_constraint_key, { - 'constraints_fk' : db_constraints, - 'position' : position, - 'constraint_type' : grpc_constraint.constraint_type, - 'constraint_value': grpc_constraint.constraint_value, - }) - db_config_rule, updated = result - return db_config_rule, updated + return db_constraint, updated def set_constraints( database : Database, db_parent_pk : str, constraints_name : str, grpc_constraints - ) -> List[Tuple[Union[ConstraintsModel, ConstraintModel], bool]]: +) -> List[Tuple[Union[ConstraintsModel, ConstraintModel], bool]]: str_constraints_key = key_to_str([db_parent_pk, constraints_name], separator=':') result : Tuple[ConstraintsModel, bool] = get_or_create_object(database, ConstraintsModel, str_constraints_key) @@ -64,7 +247,8 @@ def set_constraints( db_objects = [(db_constraints, created)] for position,grpc_constraint in enumerate(grpc_constraints): - result : Tuple[ConstraintModel, bool] = set_constraint(database, db_constraints, grpc_constraint, position) + result : Tuple[ConstraintModel, bool] = set_constraint( + database, db_constraints, grpc_constraint, position) db_constraint, updated = result db_objects.append((db_constraint, updated)) diff --git a/src/context/service/database/ContextModel.py b/src/context/service/database/ContextModel.py index 77243c29f5306b0137c75f71b435a3fc8036353e..a12e6669dbd9c506655fd3e2265dab7b25ca90dd 100644 --- a/src/context/service/database/ContextModel.py +++ b/src/context/service/database/ContextModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Dict, List from common.orm.fields.PrimaryKeyField import PrimaryKeyField diff --git a/src/context/service/database/DeviceModel.py b/src/context/service/database/DeviceModel.py index d005292acfd4cf20619548dbfa5b48a08780ec2f..0d42326793b44473d8aef3da2c3e9ce8464bd1c4 100644 --- a/src/context/service/database/DeviceModel.py +++ b/src/context/service/database/DeviceModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools, logging from enum import Enum from typing import Dict, List @@ -8,7 +22,7 @@ from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model -from context.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from common.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum from .ConfigModel import ConfigModel from .Tools import grpc_to_enum @@ -40,6 +54,24 @@ class DeviceModel(Model): device_config_fk = ForeignKeyField(ConfigModel) device_operational_status = EnumeratedField(ORM_DeviceOperationalStatusEnum, required=True) + def delete(self) -> None: + # pylint: disable=import-outside-toplevel + from .EndPointModel import EndPointModel + from .RelationModels import TopologyDeviceModel + + for db_endpoint_pk,_ in self.references(EndPointModel): + EndPointModel(self.database, db_endpoint_pk).delete() + + for db_topology_device_pk,_ in self.references(TopologyDeviceModel): + TopologyDeviceModel(self.database, db_topology_device_pk).delete() + + for db_driver_pk,_ in self.references(DriverModel): + DriverModel(self.database, db_driver_pk).delete() + + super().delete() + + ConfigModel(self.database, self.device_config_fk).delete() + def dump_id(self) -> Dict: return {'device_uuid': {'uuid': self.device_uuid}} diff --git a/src/context/service/database/EndPointModel.py b/src/context/service/database/EndPointModel.py index f1239ac124df42a74575e15d247c98b6dd2a88bb..aeef91b654dfaaaaf14d53f625126632b7303741 100644 --- a/src/context/service/database/EndPointModel.py +++ b/src/context/service/database/EndPointModel.py @@ -1,12 +1,28 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging -from typing import Dict, List +from typing import Dict, List, Optional, Tuple from common.orm.Database import Database +from common.orm.HighLevel import get_object from common.orm.backend.Tools import key_to_str from common.orm.fields.EnumeratedField import EnumeratedField from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model +from common.proto.context_pb2 import EndPointId from .DeviceModel import DeviceModel from .KpiSampleType import ORM_KpiSampleTypeEnum, grpc_to_enum__kpi_sample_type from .TopologyModel import TopologyModel @@ -20,6 +36,11 @@ class EndPointModel(Model): endpoint_uuid = StringField(required=True, allow_empty=False) endpoint_type = StringField() + def delete(self) -> None: + for db_kpi_sample_type_pk,_ in self.references(KpiSampleTypeModel): + KpiSampleTypeModel(self.database, db_kpi_sample_type_pk).delete() + super().delete() + def dump_id(self) -> Dict: device_id = DeviceModel(self.database, self.device_fk).dump_id() result = { @@ -61,3 +82,31 @@ def set_kpi_sample_types(database : Database, db_endpoint : EndPointModel, grpc_ db_endpoint_kpi_sample_type.endpoint_fk = db_endpoint db_endpoint_kpi_sample_type.kpi_sample_type = orm_kpi_sample_type db_endpoint_kpi_sample_type.save() + +def get_endpoint( + database : Database, grpc_endpoint_id : EndPointId, + validate_topology_exists : bool = True, validate_device_in_topology : bool = True +) -> Tuple[str, EndPointModel]: + endpoint_uuid = grpc_endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = grpc_endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = grpc_endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = grpc_endpoint_id.topology_id.context_id.context_uuid.uuid + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + # check topology exists + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + if validate_topology_exists: + from .TopologyModel import TopologyModel + get_object(database, TopologyModel, str_topology_key) + + # check device is in topology + str_topology_device_key = key_to_str([str_topology_key, endpoint_device_uuid], separator='--') + if validate_device_in_topology: + from .RelationModels import TopologyDeviceModel + get_object(database, TopologyDeviceModel, str_topology_device_key) + + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(database, EndPointModel, str_endpoint_key) + return str_endpoint_key, db_endpoint diff --git a/src/context/service/database/Events.py b/src/context/service/database/Events.py index 2737b9fb7d400d54e2aad9e943ee1c29461e82ff..46b1d36c4a40a48cf2928f1e1c80822443e3cf28 100644 --- a/src/context/service/database/Events.py +++ b/src/context/service/database/Events.py @@ -1,13 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import json, time from typing import Dict from common.message_broker.Message import Message from common.message_broker.MessageBroker import MessageBroker -from context.proto.context_pb2 import EventTypeEnum +from common.proto.context_pb2 import EventTypeEnum def notify_event( messagebroker : MessageBroker, topic_name : str, event_type : EventTypeEnum, fields : Dict[str, str]) -> None: - event = {'event': {'timestamp': time.time(), 'event_type': event_type}} + event = {'event': {'timestamp': {'timestamp': time.time()}, 'event_type': event_type}} for field_name, field_value in fields.items(): event[field_name] = field_value messagebroker.publish(Message(topic_name, json.dumps(event))) diff --git a/src/context/service/database/KpiSampleType.py b/src/context/service/database/KpiSampleType.py index 50cbcd8a6641f1a598b2153cac840d6259462f96..0a2015b3fdeaceeed8b01619805f55f2a9267468 100644 --- a/src/context/service/database/KpiSampleType.py +++ b/src/context/service/database/KpiSampleType.py @@ -1,6 +1,20 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools from enum import Enum -from context.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.kpi_sample_types_pb2 import KpiSampleType from .Tools import grpc_to_enum class ORM_KpiSampleTypeEnum(Enum): diff --git a/src/context/service/database/LinkModel.py b/src/context/service/database/LinkModel.py index 48d67bfa6134818d3ba24fd304507b7d14a37e0f..8f1d971c3127371e0d9a1a401d885a02269bd8dd 100644 --- a/src/context/service/database/LinkModel.py +++ b/src/context/service/database/LinkModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, operator from typing import Dict, List from common.orm.fields.PrimaryKeyField import PrimaryKeyField @@ -11,6 +25,18 @@ class LinkModel(Model): pk = PrimaryKeyField() link_uuid = StringField(required=True, allow_empty=False) + def delete(self) -> None: + #pylint: disable=import-outside-toplevel + from .RelationModels import LinkEndPointModel, TopologyLinkModel + + for db_link_endpoint_pk,_ in self.references(LinkEndPointModel): + LinkEndPointModel(self.database, db_link_endpoint_pk).delete() + + for db_topology_link_pk,_ in self.references(TopologyLinkModel): + TopologyLinkModel(self.database, db_topology_link_pk).delete() + + super().delete() + def dump_id(self) -> Dict: return {'link_uuid': {'uuid': self.link_uuid}} diff --git a/src/context/service/database/RelationModels.py b/src/context/service/database/RelationModels.py index 4531e0594f3f213f4a00b1fe70dfb2d8dc0a0f5e..98b077a774616f69f4ae6a620e53a1592bb4f6e2 100644 --- a/src/context/service/database/RelationModels.py +++ b/src/context/service/database/RelationModels.py @@ -1,15 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.model.Model import Model +from .ConnectionModel import ConnectionModel from .DeviceModel import DeviceModel from .EndPointModel import EndPointModel from .LinkModel import LinkModel from .ServiceModel import ServiceModel +from .SliceModel import SliceModel from .TopologyModel import TopologyModel LOGGER = logging.getLogger(__name__) +class ConnectionSubServiceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + connection_fk = ForeignKeyField(ConnectionModel) + sub_service_fk = ForeignKeyField(ServiceModel) + class LinkEndPointModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() link_fk = ForeignKeyField(LinkModel) @@ -20,6 +41,21 @@ class ServiceEndPointModel(Model): # pylint: disable=abstract-method service_fk = ForeignKeyField(ServiceModel) endpoint_fk = ForeignKeyField(EndPointModel) +class SliceEndPointModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + endpoint_fk = ForeignKeyField(EndPointModel) + +class SliceServiceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + service_fk = ForeignKeyField(ServiceModel) + +class SliceSubSliceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + slice_fk = ForeignKeyField(SliceModel) + sub_slice_fk = ForeignKeyField(SliceModel) + class TopologyDeviceModel(Model): # pylint: disable=abstract-method pk = PrimaryKeyField() topology_fk = ForeignKeyField(TopologyModel) diff --git a/src/context/service/database/ServiceModel.py b/src/context/service/database/ServiceModel.py index f6bd2e9c47f77538fac6d65aa0e02ca720126abb..8b32d1cc9eeec248d1097f972df93dbd2c0882fa 100644 --- a/src/context/service/database/ServiceModel.py +++ b/src/context/service/database/ServiceModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools, logging, operator from enum import Enum from typing import Dict, List @@ -7,7 +21,7 @@ from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model from common.orm.HighLevel import get_related_objects -from context.proto.context_pb2 import ServiceStatusEnum, ServiceTypeEnum +from common.proto.context_pb2 import ServiceStatusEnum, ServiceTypeEnum from .ConfigModel import ConfigModel from .ConstraintModel import ConstraintsModel from .ContextModel import ContextModel @@ -42,6 +56,18 @@ class ServiceModel(Model): service_status = EnumeratedField(ORM_ServiceStatusEnum, required=True) service_config_fk = ForeignKeyField(ConfigModel) + def delete(self) -> None: + #pylint: disable=import-outside-toplevel + from .RelationModels import ServiceEndPointModel + + for db_service_endpoint_pk,_ in self.references(ServiceEndPointModel): + ServiceEndPointModel(self.database, db_service_endpoint_pk).delete() + + super().delete() + + ConfigModel(self.database, self.service_config_fk).delete() + ConstraintsModel(self.database, self.service_constraints_fk).delete() + def dump_id(self) -> Dict: context_id = ContextModel(self.database, self.context_fk).dump_id() return { diff --git a/src/context/service/database/SliceModel.py b/src/context/service/database/SliceModel.py new file mode 100644 index 0000000000000000000000000000000000000000..bc00ada43758c9c5ffefbb88a87134aa46fbd73a --- /dev/null +++ b/src/context/service/database/SliceModel.py @@ -0,0 +1,109 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, logging, operator +from enum import Enum +from typing import Dict, List +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_related_objects +from common.proto.context_pb2 import SliceStatusEnum +from .ConfigModel import ConfigModel +from .ConstraintModel import ConstraintsModel +from .ContextModel import ContextModel +from .Tools import grpc_to_enum + +LOGGER = logging.getLogger(__name__) + +class ORM_SliceStatusEnum(Enum): + UNDEFINED = SliceStatusEnum.SLICESTATUS_UNDEFINED + PLANNED = SliceStatusEnum.SLICESTATUS_PLANNED + INIT = SliceStatusEnum.SLICESTATUS_INIT + ACTIVE = SliceStatusEnum.SLICESTATUS_ACTIVE + DEINIT = SliceStatusEnum.SLICESTATUS_DEINIT + +grpc_to_enum__slice_status = functools.partial( + grpc_to_enum, SliceStatusEnum, ORM_SliceStatusEnum) + +class SliceModel(Model): + pk = PrimaryKeyField() + context_fk = ForeignKeyField(ContextModel) + slice_uuid = StringField(required=True, allow_empty=False) + slice_constraints_fk = ForeignKeyField(ConstraintsModel) + slice_status = EnumeratedField(ORM_SliceStatusEnum, required=True) + slice_config_fk = ForeignKeyField(ConfigModel) + + def delete(self) -> None: + # pylint: disable=import-outside-toplevel + from .RelationModels import SliceEndPointModel, SliceServiceModel, SliceSubSliceModel + + for db_slice_endpoint_pk,_ in self.references(SliceEndPointModel): + SliceEndPointModel(self.database, db_slice_endpoint_pk).delete() + + for db_slice_service_pk,_ in self.references(SliceServiceModel): + SliceServiceModel(self.database, db_slice_service_pk).delete() + + for db_slice_subslice_pk,_ in self.references(SliceSubSliceModel): + SliceSubSliceModel(self.database, db_slice_subslice_pk).delete() + + super().delete() + + ConfigModel(self.database, self.slice_config_fk).delete() + ConstraintsModel(self.database, self.slice_constraints_fk).delete() + + def dump_id(self) -> Dict: + context_id = ContextModel(self.database, self.context_fk).dump_id() + return { + 'context_id': context_id, + 'slice_uuid': {'uuid': self.slice_uuid}, + } + + def dump_endpoint_ids(self) -> List[Dict]: + from .RelationModels import SliceEndPointModel # pylint: disable=import-outside-toplevel + db_endpoints = get_related_objects(self, SliceEndPointModel, 'endpoint_fk') + return [db_endpoint.dump_id() for db_endpoint in sorted(db_endpoints, key=operator.attrgetter('pk'))] + + def dump_constraints(self) -> List[Dict]: + return ConstraintsModel(self.database, self.slice_constraints_fk).dump() + + def dump_config(self) -> Dict: + return ConfigModel(self.database, self.slice_config_fk).dump() + + def dump_service_ids(self) -> List[Dict]: + from .RelationModels import SliceServiceModel # pylint: disable=import-outside-toplevel + db_services = get_related_objects(self, SliceServiceModel, 'service_fk') + return [db_service.dump_id() for db_service in sorted(db_services, key=operator.attrgetter('pk'))] + + def dump_subslice_ids(self) -> List[Dict]: + from .RelationModels import SliceSubSliceModel # pylint: disable=import-outside-toplevel + db_subslices = get_related_objects(self, SliceSubSliceModel, 'sub_slice_fk') + return [db_subslice.dump_id() for db_subslice in sorted(db_subslices, key=operator.attrgetter('pk'))] + + def dump( # pylint: disable=arguments-differ + self, include_endpoint_ids=True, include_constraints=True, include_config_rules=True, + include_service_ids=True, include_subslice_ids=True + ) -> Dict: + result = { + 'slice_id': self.dump_id(), + 'slice_status': {'slice_status': self.slice_status.value}, + } + if include_endpoint_ids: result['slice_endpoint_ids'] = self.dump_endpoint_ids() + if include_constraints: result['slice_constraints'] = self.dump_constraints() + if include_config_rules: result.setdefault('slice_config', {})['config_rules'] = self.dump_config() + if include_service_ids: result['slice_service_ids'] = self.dump_service_ids() + if include_subslice_ids: result['slice_subslice_ids'] = self.dump_subslice_ids() + return result diff --git a/src/context/service/database/Tools.py b/src/context/service/database/Tools.py index 36ffbcd46fcf686371b0799445ce4f9ce5b75838..43bb71bd90582644c67d3ca528611eae937b6460 100644 --- a/src/context/service/database/Tools.py +++ b/src/context/service/database/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import hashlib, re from enum import Enum from typing import Dict, List, Tuple, Union diff --git a/src/context/service/database/TopologyModel.py b/src/context/service/database/TopologyModel.py index fc1f2d241e71a4e14511756928ed0b97a0499209..5909c7a2c63d05f2cbde7f0d8555e63587e96682 100644 --- a/src/context/service/database/TopologyModel.py +++ b/src/context/service/database/TopologyModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, operator from typing import Dict, List from common.orm.fields.ForeignKeyField import ForeignKeyField diff --git a/src/context/service/database/__init__.py b/src/context/service/database/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/service/database/__init__.py +++ b/src/context/service/database/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/service/grpc_server/Constants.py b/src/context/service/grpc_server/Constants.py index 80ff198de86644e53d4d8cc6a693efae237f450f..9d7c886c725d22308f33dc274234ad17f595633d 100644 --- a/src/context/service/grpc_server/Constants.py +++ b/src/context/service/grpc_server/Constants.py @@ -1,9 +1,25 @@ -TOPIC_CONTEXT = 'context' -TOPIC_TOPOLOGY = 'topology' -TOPIC_DEVICE = 'device' -TOPIC_LINK = 'link' -TOPIC_SERVICE = 'service' +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -TOPICS = {TOPIC_CONTEXT, TOPIC_TOPOLOGY, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE} +TOPIC_CONNECTION = 'connection' +TOPIC_CONTEXT = 'context' +TOPIC_TOPOLOGY = 'topology' +TOPIC_DEVICE = 'device' +TOPIC_LINK = 'link' +TOPIC_SERVICE = 'service' +TOPIC_SLICE = 'slice' + +TOPICS = {TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_TOPOLOGY, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE} CONSUME_TIMEOUT = 0.5 # seconds diff --git a/src/context/service/grpc_server/ContextService.py b/src/context/service/grpc_server/ContextService.py index 9f1028dc9eed4d172c49f9b9f916572093c850f0..1b54ec5400c93cba3882dccb197479b75bb699af 100644 --- a/src/context/service/grpc_server/ContextService.py +++ b/src/context/service/grpc_server/ContextService.py @@ -1,58 +1,33 @@ -import grpc -import logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from context.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.message_broker.MessageBroker import MessageBroker +from common.orm.Database import Database +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService from .ContextServiceServicerImpl import ContextServiceServicerImpl -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) +# Custom gRPC settings +GRPC_MAX_WORKERS = 200 # multiple clients might keep connections alive for Get*Events() RPC methods -class ContextService: - def __init__( - self, database, messagebroker, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): +class ContextService(GenericGrpcService): + def __init__(self, database : Database, messagebroker : MessageBroker, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.CONTEXT) + super().__init__(port, max_workers=GRPC_MAX_WORKERS, cls_name=cls_name) + self.context_servicer = ContextServiceServicerImpl(database, messagebroker) - self.database = database - self.messagebroker = messagebroker - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.context_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.context_servicer = ContextServiceServicerImpl(self.database, self.messagebroker) + def install_servicers(self): add_ContextServiceServicer_to_server(self.context_servicer, self.server) - - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/context/service/grpc_server/ContextServiceServicerImpl.py b/src/context/service/grpc_server/ContextServiceServicerImpl.py index 3d03babb47161cfd84fe164c2a8061b598489466..4c8f957ecb70765cbd36032fca7bfacc27f9b5ae 100644 --- a/src/context/service/grpc_server/ContextServiceServicerImpl.py +++ b/src/context/service/grpc_server/ContextServiceServicerImpl.py @@ -1,48 +1,73 @@ -import grpc, json, logging, operator +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, json, logging, operator, threading from typing import Iterator, List, Set, Tuple from common.message_broker.MessageBroker import MessageBroker from common.orm.Database import Database from common.orm.HighLevel import ( get_all_objects, get_object, get_or_create_object, get_related_objects, update_or_create_object) from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import ( + Connection, ConnectionEvent, ConnectionId, ConnectionIdList, ConnectionList, + Context, ContextEvent, ContextId, ContextIdList, ContextList, + Device, DeviceEvent, DeviceId, DeviceIdList, DeviceList, + Empty, EventTypeEnum, + Link, LinkEvent, LinkId, LinkIdList, LinkList, + Service, ServiceEvent, ServiceId, ServiceIdList, ServiceList, + Slice, SliceEvent, SliceId, SliceIdList, SliceList, + Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) +from common.proto.context_pb2_grpc import ContextServiceServicer from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException -from context.proto.context_pb2 import ( - Context, ContextEvent, ContextId, ContextIdList, ContextList, Device, DeviceEvent, DeviceId, DeviceIdList, - DeviceList, Empty, EventTypeEnum, Link, LinkEvent, LinkId, LinkIdList, LinkList, Service, ServiceEvent, ServiceId, - ServiceIdList, ServiceList, Topology, TopologyEvent, TopologyId, TopologyIdList, TopologyList) -from context.proto.context_pb2_grpc import ContextServiceServicer -from context.service.database.ConfigModel import ConfigModel, ConfigRuleModel, grpc_config_rules_to_raw, update_config -from context.service.database.ConstraintModel import ConstraintModel, ConstraintsModel, set_constraints +from context.service.database.ConfigModel import grpc_config_rules_to_raw, update_config +from context.service.database.ConnectionModel import ConnectionModel, set_path +from context.service.database.ConstraintModel import set_constraints from context.service.database.ContextModel import ContextModel -from context.service.database.DeviceModel import ( - DeviceModel, DriverModel, grpc_to_enum__device_operational_status, set_drivers) -from context.service.database.EndPointModel import EndPointModel, KpiSampleTypeModel, set_kpi_sample_types +from context.service.database.DeviceModel import DeviceModel, grpc_to_enum__device_operational_status, set_drivers +from context.service.database.EndPointModel import EndPointModel, set_kpi_sample_types from context.service.database.Events import notify_event from context.service.database.LinkModel import LinkModel from context.service.database.RelationModels import ( - LinkEndPointModel, ServiceEndPointModel, TopologyDeviceModel, TopologyLinkModel) + ConnectionSubServiceModel, LinkEndPointModel, ServiceEndPointModel, SliceEndPointModel, SliceServiceModel, + SliceSubSliceModel, TopologyDeviceModel, TopologyLinkModel) from context.service.database.ServiceModel import ( ServiceModel, grpc_to_enum__service_status, grpc_to_enum__service_type) +from context.service.database.SliceModel import SliceModel, grpc_to_enum__slice_status from context.service.database.TopologyModel import TopologyModel -from context.service.grpc_server.Constants import ( - CONSUME_TIMEOUT, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_TOPOLOGY) +from .Constants import ( + CONSUME_TIMEOUT, TOPIC_CONNECTION, TOPIC_CONTEXT, TOPIC_DEVICE, TOPIC_LINK, TOPIC_SERVICE, TOPIC_SLICE, + TOPIC_TOPOLOGY) LOGGER = logging.getLogger(__name__) SERVICE_NAME = 'Context' METHOD_NAMES = [ - 'ListContextIds', 'ListContexts', 'GetContext', 'SetContext', 'RemoveContext', 'GetContextEvents', - 'ListTopologyIds', 'ListTopologies', 'GetTopology', 'SetTopology', 'RemoveTopology', 'GetTopologyEvents', - 'ListDeviceIds', 'ListDevices', 'GetDevice', 'SetDevice', 'RemoveDevice', 'GetDeviceEvents', - 'ListLinkIds', 'ListLinks', 'GetLink', 'SetLink', 'RemoveLink', 'GetLinkEvents', - 'ListServiceIds', 'ListServices', 'GetService', 'SetService', 'RemoveService', 'GetServiceEvents', + 'ListConnectionIds', 'ListConnections', 'GetConnection', 'SetConnection', 'RemoveConnection', 'GetConnectionEvents', + 'ListContextIds', 'ListContexts', 'GetContext', 'SetContext', 'RemoveContext', 'GetContextEvents', + 'ListTopologyIds', 'ListTopologies', 'GetTopology', 'SetTopology', 'RemoveTopology', 'GetTopologyEvents', + 'ListDeviceIds', 'ListDevices', 'GetDevice', 'SetDevice', 'RemoveDevice', 'GetDeviceEvents', + 'ListLinkIds', 'ListLinks', 'GetLink', 'SetLink', 'RemoveLink', 'GetLinkEvents', + 'ListServiceIds', 'ListServices', 'GetService', 'SetService', 'RemoveService', 'GetServiceEvents', + 'ListSliceIds', 'ListSlices', 'GetSlice', 'SetSlice', 'RemoveSlice', 'GetSliceEvents', ] METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) class ContextServiceServicerImpl(ContextServiceServicer): def __init__(self, database : Database, messagebroker : MessageBroker): LOGGER.debug('Creating Servicer...') + self.lock = threading.Lock() self.database = database self.messagebroker = messagebroker LOGGER.debug('Servicer Created') @@ -52,71 +77,76 @@ class ContextServiceServicerImpl(ContextServiceServicer): @safe_and_metered_rpc_method(METRICS, LOGGER) def ListContextIds(self, request: Empty, context : grpc.ServicerContext) -> ContextIdList: - db_contexts : List[ContextModel] = get_all_objects(self.database, ContextModel) - db_contexts = sorted(db_contexts, key=operator.attrgetter('pk')) - return ContextIdList(context_ids=[db_context.dump_id() for db_context in db_contexts]) + with self.lock: + db_contexts : List[ContextModel] = get_all_objects(self.database, ContextModel) + db_contexts = sorted(db_contexts, key=operator.attrgetter('pk')) + return ContextIdList(context_ids=[db_context.dump_id() for db_context in db_contexts]) @safe_and_metered_rpc_method(METRICS, LOGGER) def ListContexts(self, request: Empty, context : grpc.ServicerContext) -> ContextList: - db_contexts : List[ContextModel] = get_all_objects(self.database, ContextModel) - db_contexts = sorted(db_contexts, key=operator.attrgetter('pk')) - return ContextList(contexts=[db_context.dump() for db_context in db_contexts]) + with self.lock: + db_contexts : List[ContextModel] = get_all_objects(self.database, ContextModel) + db_contexts = sorted(db_contexts, key=operator.attrgetter('pk')) + return ContextList(contexts=[db_context.dump() for db_context in db_contexts]) @safe_and_metered_rpc_method(METRICS, LOGGER) def GetContext(self, request: ContextId, context : grpc.ServicerContext) -> Context: - context_uuid = request.context_uuid.uuid - db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) - return Context(**db_context.dump(include_services=True, include_topologies=True)) + with self.lock: + context_uuid = request.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + return Context(**db_context.dump(include_services=True, include_topologies=True)) @safe_and_metered_rpc_method(METRICS, LOGGER) def SetContext(self, request: Context, context : grpc.ServicerContext) -> ContextId: - context_uuid = request.context_id.context_uuid.uuid - - for i,topology_id in enumerate(request.topology_ids): - topology_context_uuid = topology_id.context_id.context_uuid.uuid - if topology_context_uuid != context_uuid: - raise InvalidArgumentException( - 'request.topology_ids[{:d}].context_id.context_uuid.uuid'.format(i), topology_context_uuid, - ['should be == {:s}({:s})'.format('request.context_id.context_uuid.uuid', context_uuid)]) - - for i,service_id in enumerate(request.service_ids): - service_context_uuid = service_id.context_id.context_uuid.uuid - if service_context_uuid != context_uuid: - raise InvalidArgumentException( - 'request.service_ids[{:d}].context_id.context_uuid.uuid'.format(i), service_context_uuid, - ['should be == {:s}({:s})'.format('request.context_id.context_uuid.uuid', context_uuid)]) - - result : Tuple[ContextModel, bool] = update_or_create_object( - self.database, ContextModel, context_uuid, {'context_uuid': context_uuid}) - db_context, updated = result - - for i,topology_id in enumerate(request.topology_ids): - topology_context_uuid = topology_id.context_id.context_uuid.uuid - topology_uuid = topology_id.topology_uuid.uuid - get_object(self.database, TopologyModel, [context_uuid, topology_uuid]) # just to confirm it exists - - for i,service_id in enumerate(request.service_ids): - service_context_uuid = service_id.context_id.context_uuid.uuid - service_uuid = service_id.service_uuid.uuid - get_object(self.database, ServiceModel, [context_uuid, service_uuid]) # just to confirm it exists - - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - dict_context_id = db_context.dump_id() - notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': dict_context_id}) - return ContextId(**dict_context_id) + with self.lock: + context_uuid = request.context_id.context_uuid.uuid + + for i,topology_id in enumerate(request.topology_ids): + topology_context_uuid = topology_id.context_id.context_uuid.uuid + if topology_context_uuid != context_uuid: + raise InvalidArgumentException( + 'request.topology_ids[{:d}].context_id.context_uuid.uuid'.format(i), topology_context_uuid, + ['should be == {:s}({:s})'.format('request.context_id.context_uuid.uuid', context_uuid)]) + + for i,service_id in enumerate(request.service_ids): + service_context_uuid = service_id.context_id.context_uuid.uuid + if service_context_uuid != context_uuid: + raise InvalidArgumentException( + 'request.service_ids[{:d}].context_id.context_uuid.uuid'.format(i), service_context_uuid, + ['should be == {:s}({:s})'.format('request.context_id.context_uuid.uuid', context_uuid)]) + + result : Tuple[ContextModel, bool] = update_or_create_object( + self.database, ContextModel, context_uuid, {'context_uuid': context_uuid}) + db_context, updated = result + + for i,topology_id in enumerate(request.topology_ids): + topology_context_uuid = topology_id.context_id.context_uuid.uuid + topology_uuid = topology_id.topology_uuid.uuid + get_object(self.database, TopologyModel, [context_uuid, topology_uuid]) # just to confirm it exists + + for i,service_id in enumerate(request.service_ids): + service_context_uuid = service_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid + get_object(self.database, ServiceModel, [context_uuid, service_uuid]) # just to confirm it exists + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_context_id = db_context.dump_id() + notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': dict_context_id}) + return ContextId(**dict_context_id) @safe_and_metered_rpc_method(METRICS, LOGGER) def RemoveContext(self, request: ContextId, context : grpc.ServicerContext) -> Empty: - context_uuid = request.context_uuid.uuid - db_context = ContextModel(self.database, context_uuid, auto_load=False) - found = db_context.load() - if not found: return Empty() - - dict_context_id = db_context.dump_id() - db_context.delete() - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': dict_context_id}) - return Empty() + with self.lock: + context_uuid = request.context_uuid.uuid + db_context = ContextModel(self.database, context_uuid, auto_load=False) + found = db_context.load() + if not found: return Empty() + + dict_context_id = db_context.dump_id() + db_context.delete() + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_CONTEXT, event_type, {'context_id': dict_context_id}) + return Empty() @safe_and_metered_rpc_method(METRICS, LOGGER) def GetContextEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ContextEvent]: @@ -128,74 +158,80 @@ class ContextServiceServicerImpl(ContextServiceServicer): @safe_and_metered_rpc_method(METRICS, LOGGER) def ListTopologyIds(self, request: ContextId, context : grpc.ServicerContext) -> TopologyIdList: - context_uuid = request.context_uuid.uuid - db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) - db_topologies : Set[TopologyModel] = get_related_objects(db_context, TopologyModel) - db_topologies = sorted(db_topologies, key=operator.attrgetter('pk')) - return TopologyIdList(topology_ids=[db_topology.dump_id() for db_topology in db_topologies]) + with self.lock: + context_uuid = request.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + db_topologies : Set[TopologyModel] = get_related_objects(db_context, TopologyModel) + db_topologies = sorted(db_topologies, key=operator.attrgetter('pk')) + return TopologyIdList(topology_ids=[db_topology.dump_id() for db_topology in db_topologies]) @safe_and_metered_rpc_method(METRICS, LOGGER) def ListTopologies(self, request: ContextId, context : grpc.ServicerContext) -> TopologyList: - context_uuid = request.context_uuid.uuid - db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) - db_topologies : Set[TopologyModel] = get_related_objects(db_context, TopologyModel) - db_topologies = sorted(db_topologies, key=operator.attrgetter('pk')) - return TopologyList(topologies=[db_topology.dump() for db_topology in db_topologies]) + with self.lock: + context_uuid = request.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + db_topologies : Set[TopologyModel] = get_related_objects(db_context, TopologyModel) + db_topologies = sorted(db_topologies, key=operator.attrgetter('pk')) + return TopologyList(topologies=[db_topology.dump() for db_topology in db_topologies]) @safe_and_metered_rpc_method(METRICS, LOGGER) def GetTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Topology: - str_key = key_to_str([request.context_id.context_uuid.uuid, request.topology_uuid.uuid]) - db_topology : TopologyModel = get_object(self.database, TopologyModel, str_key) - return Topology(**db_topology.dump(include_devices=True, include_links=True)) + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.topology_uuid.uuid]) + db_topology : TopologyModel = get_object(self.database, TopologyModel, str_key) + return Topology(**db_topology.dump(include_devices=True, include_links=True)) @safe_and_metered_rpc_method(METRICS, LOGGER) def SetTopology(self, request: Topology, context : grpc.ServicerContext) -> TopologyId: - context_uuid = request.topology_id.context_id.context_uuid.uuid - db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) - - topology_uuid = request.topology_id.topology_uuid.uuid - str_topology_key = key_to_str([context_uuid, topology_uuid]) - result : Tuple[TopologyModel, bool] = update_or_create_object( - self.database, TopologyModel, str_topology_key, {'context_fk': db_context, 'topology_uuid': topology_uuid}) - db_topology,updated = result - - for device_id in request.device_ids: - device_uuid = device_id.device_uuid.uuid - db_device = get_object(self.database, DeviceModel, device_uuid) - str_topology_device_key = key_to_str([str_topology_key, device_uuid], separator='--') - result : Tuple[TopologyDeviceModel, bool] = update_or_create_object( - self.database, TopologyDeviceModel, str_topology_device_key, - {'topology_fk': db_topology, 'device_fk': db_device}) - #db_topology_device,topology_device_updated = result - - for link_id in request.link_ids: - link_uuid = link_id.link_uuid.uuid - db_link = get_object(self.database, LinkModel, link_uuid) - - str_topology_link_key = key_to_str([str_topology_key, link_uuid], separator='--') - result : Tuple[TopologyLinkModel, bool] = update_or_create_object( - self.database, TopologyLinkModel, str_topology_link_key, - {'topology_fk': db_topology, 'link_fk': db_link}) - #db_topology_link,topology_link_updated = result - - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - dict_topology_id = db_topology.dump_id() - notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': dict_topology_id}) - return TopologyId(**dict_topology_id) + with self.lock: + context_uuid = request.topology_id.context_id.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + + topology_uuid = request.topology_id.topology_uuid.uuid + str_topology_key = key_to_str([context_uuid, topology_uuid]) + result : Tuple[TopologyModel, bool] = update_or_create_object( + self.database, TopologyModel, str_topology_key, { + 'context_fk': db_context, 'topology_uuid': topology_uuid}) + db_topology,updated = result + + for device_id in request.device_ids: + device_uuid = device_id.device_uuid.uuid + db_device = get_object(self.database, DeviceModel, device_uuid) + str_topology_device_key = key_to_str([str_topology_key, device_uuid], separator='--') + result : Tuple[TopologyDeviceModel, bool] = update_or_create_object( + self.database, TopologyDeviceModel, str_topology_device_key, + {'topology_fk': db_topology, 'device_fk': db_device}) + #db_topology_device,topology_device_updated = result + + for link_id in request.link_ids: + link_uuid = link_id.link_uuid.uuid + db_link = get_object(self.database, LinkModel, link_uuid) + + str_topology_link_key = key_to_str([str_topology_key, link_uuid], separator='--') + result : Tuple[TopologyLinkModel, bool] = update_or_create_object( + self.database, TopologyLinkModel, str_topology_link_key, + {'topology_fk': db_topology, 'link_fk': db_link}) + #db_topology_link,topology_link_updated = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_topology_id = db_topology.dump_id() + notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': dict_topology_id}) + return TopologyId(**dict_topology_id) @safe_and_metered_rpc_method(METRICS, LOGGER) def RemoveTopology(self, request: TopologyId, context : grpc.ServicerContext) -> Empty: - context_uuid = request.context_id.context_uuid.uuid - topology_uuid = request.topology_uuid.uuid - db_topology = TopologyModel(self.database, key_to_str([context_uuid, topology_uuid]), auto_load=False) - found = db_topology.load() - if not found: return Empty() - - dict_topology_id = db_topology.dump_id() - db_topology.delete() - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': dict_topology_id}) - return Empty() + with self.lock: + context_uuid = request.context_id.context_uuid.uuid + topology_uuid = request.topology_uuid.uuid + db_topology = TopologyModel(self.database, key_to_str([context_uuid, topology_uuid]), auto_load=False) + found = db_topology.load() + if not found: return Empty() + + dict_topology_id = db_topology.dump_id() + db_topology.delete() + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_TOPOLOGY, event_type, {'topology_id': dict_topology_id}) + return Empty() @safe_and_metered_rpc_method(METRICS, LOGGER) def GetTopologyEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[TopologyEvent]: @@ -207,118 +243,105 @@ class ContextServiceServicerImpl(ContextServiceServicer): @safe_and_metered_rpc_method(METRICS, LOGGER) def ListDeviceIds(self, request: Empty, context : grpc.ServicerContext) -> DeviceIdList: - db_devices : List[DeviceModel] = get_all_objects(self.database, DeviceModel) - db_devices = sorted(db_devices, key=operator.attrgetter('pk')) - return DeviceIdList(device_ids=[db_device.dump_id() for db_device in db_devices]) + with self.lock: + db_devices : List[DeviceModel] = get_all_objects(self.database, DeviceModel) + db_devices = sorted(db_devices, key=operator.attrgetter('pk')) + return DeviceIdList(device_ids=[db_device.dump_id() for db_device in db_devices]) @safe_and_metered_rpc_method(METRICS, LOGGER) def ListDevices(self, request: Empty, context : grpc.ServicerContext) -> DeviceList: - db_devices : List[DeviceModel] = get_all_objects(self.database, DeviceModel) - db_devices = sorted(db_devices, key=operator.attrgetter('pk')) - return DeviceList(devices=[db_device.dump() for db_device in db_devices]) + with self.lock: + db_devices : List[DeviceModel] = get_all_objects(self.database, DeviceModel) + db_devices = sorted(db_devices, key=operator.attrgetter('pk')) + return DeviceList(devices=[db_device.dump() for db_device in db_devices]) @safe_and_metered_rpc_method(METRICS, LOGGER) def GetDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Device: - device_uuid = request.device_uuid.uuid - db_device : DeviceModel = get_object(self.database, DeviceModel, device_uuid) - return Device(**db_device.dump( - include_config_rules=True, include_drivers=True, include_endpoints=True)) + with self.lock: + device_uuid = request.device_uuid.uuid + db_device : DeviceModel = get_object(self.database, DeviceModel, device_uuid) + return Device(**db_device.dump( + include_config_rules=True, include_drivers=True, include_endpoints=True)) @safe_and_metered_rpc_method(METRICS, LOGGER) def SetDevice(self, request: Device, context : grpc.ServicerContext) -> DeviceId: - device_uuid = request.device_id.device_uuid.uuid - - for i,endpoint in enumerate(request.device_endpoints): - endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid - if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid - if device_uuid != endpoint_device_uuid: - raise InvalidArgumentException( - 'request.device_endpoints[{:d}].device_id.device_uuid.uuid'.format(i), endpoint_device_uuid, - ['should be == {:s}({:s})'.format('request.device_id.device_uuid.uuid', device_uuid)]) - - config_rules = grpc_config_rules_to_raw(request.device_config.config_rules) - running_config_result = update_config(self.database, device_uuid, 'running', config_rules) - db_running_config = running_config_result[0][0] - - result : Tuple[DeviceModel, bool] = update_or_create_object(self.database, DeviceModel, device_uuid, { - 'device_uuid' : device_uuid, - 'device_type' : request.device_type, - 'device_operational_status': grpc_to_enum__device_operational_status(request.device_operational_status), - 'device_config_fk' : db_running_config, - }) - db_device, updated = result - - set_drivers(self.database, db_device, request.device_drivers) - - for i,endpoint in enumerate(request.device_endpoints): - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid - if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid - - str_endpoint_key = key_to_str([device_uuid, endpoint_uuid]) - endpoint_attributes = { - 'device_fk' : db_device, - 'endpoint_uuid': endpoint_uuid, - 'endpoint_type': endpoint.endpoint_type, - } - - endpoint_topology_context_uuid = endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid - endpoint_topology_uuid = endpoint.endpoint_id.topology_id.topology_uuid.uuid - if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: - str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) - db_topology : TopologyModel = get_object(self.database, TopologyModel, str_topology_key) - - str_topology_device_key = key_to_str([str_topology_key, device_uuid], separator='--') - result : Tuple[TopologyDeviceModel, bool] = get_or_create_object( - self.database, TopologyDeviceModel, str_topology_device_key, { - 'topology_fk': db_topology, 'device_fk': db_device}) - #db_topology_device, topology_device_created = result - - str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') - endpoint_attributes['topology_fk'] = db_topology - - result : Tuple[EndPointModel, bool] = update_or_create_object( - self.database, EndPointModel, str_endpoint_key, endpoint_attributes) - db_endpoint, endpoint_updated = result - - set_kpi_sample_types(self.database, db_endpoint, endpoint.kpi_sample_types) - - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - dict_device_id = db_device.dump_id() - notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': dict_device_id}) - return DeviceId(**dict_device_id) + with self.lock: + device_uuid = request.device_id.device_uuid.uuid + + for i,endpoint in enumerate(request.device_endpoints): + endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid + if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid + if device_uuid != endpoint_device_uuid: + raise InvalidArgumentException( + 'request.device_endpoints[{:d}].device_id.device_uuid.uuid'.format(i), endpoint_device_uuid, + ['should be == {:s}({:s})'.format('request.device_id.device_uuid.uuid', device_uuid)]) + + config_rules = grpc_config_rules_to_raw(request.device_config.config_rules) + running_config_result = update_config(self.database, device_uuid, 'running', config_rules) + db_running_config = running_config_result[0][0] + + result : Tuple[DeviceModel, bool] = update_or_create_object(self.database, DeviceModel, device_uuid, { + 'device_uuid' : device_uuid, + 'device_type' : request.device_type, + 'device_operational_status': grpc_to_enum__device_operational_status(request.device_operational_status), + 'device_config_fk' : db_running_config, + }) + db_device, updated = result + + set_drivers(self.database, db_device, request.device_drivers) + + for i,endpoint in enumerate(request.device_endpoints): + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid + if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid + + str_endpoint_key = key_to_str([device_uuid, endpoint_uuid]) + endpoint_attributes = { + 'device_fk' : db_device, + 'endpoint_uuid': endpoint_uuid, + 'endpoint_type': endpoint.endpoint_type, + } + + endpoint_topology_context_uuid = endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid + endpoint_topology_uuid = endpoint.endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + db_topology : TopologyModel = get_object(self.database, TopologyModel, str_topology_key) + + str_topology_device_key = key_to_str([str_topology_key, device_uuid], separator='--') + result : Tuple[TopologyDeviceModel, bool] = get_or_create_object( + self.database, TopologyDeviceModel, str_topology_device_key, { + 'topology_fk': db_topology, 'device_fk': db_device}) + #db_topology_device, topology_device_created = result + + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + endpoint_attributes['topology_fk'] = db_topology + + result : Tuple[EndPointModel, bool] = update_or_create_object( + self.database, EndPointModel, str_endpoint_key, endpoint_attributes) + db_endpoint, endpoint_updated = result + + set_kpi_sample_types(self.database, db_endpoint, endpoint.kpi_sample_types) + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_device_id = db_device.dump_id() + notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': dict_device_id}) + return DeviceId(**dict_device_id) @safe_and_metered_rpc_method(METRICS, LOGGER) def RemoveDevice(self, request: DeviceId, context : grpc.ServicerContext) -> Empty: - device_uuid = request.device_uuid.uuid - db_device = DeviceModel(self.database, device_uuid, auto_load=False) - found = db_device.load() - if not found: return Empty() - - dict_device_id = db_device.dump_id() + with self.lock: + device_uuid = request.device_uuid.uuid + db_device = DeviceModel(self.database, device_uuid, auto_load=False) + found = db_device.load() + if not found: return Empty() - for db_endpoint_pk,_ in db_device.references(EndPointModel): - db_endpoint = EndPointModel(self.database, db_endpoint_pk) - for db_kpi_sample_type_pk,_ in db_endpoint.references(KpiSampleTypeModel): - KpiSampleTypeModel(self.database, db_kpi_sample_type_pk).delete() - db_endpoint.delete() + dict_device_id = db_device.dump_id() + db_device.delete() - for db_topology_device_pk,_ in db_device.references(TopologyDeviceModel): - TopologyDeviceModel(self.database, db_topology_device_pk).delete() - - for db_driver_pk,_ in db_device.references(DriverModel): - DriverModel(self.database, db_driver_pk).delete() - - db_config = ConfigModel(self.database, db_device.device_config_fk) - for db_config_rule_pk,_ in db_config.references(ConfigRuleModel): - ConfigRuleModel(self.database, db_config_rule_pk).delete() - - db_device.delete() - db_config.delete() - - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': dict_device_id}) - return Empty() + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_DEVICE, event_type, {'device_id': dict_device_id}) + return Empty() @safe_and_metered_rpc_method(METRICS, LOGGER) def GetDeviceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[DeviceEvent]: @@ -330,84 +353,84 @@ class ContextServiceServicerImpl(ContextServiceServicer): @safe_and_metered_rpc_method(METRICS, LOGGER) def ListLinkIds(self, request: Empty, context : grpc.ServicerContext) -> LinkIdList: - db_links : List[LinkModel] = get_all_objects(self.database, LinkModel) - db_links = sorted(db_links, key=operator.attrgetter('pk')) - return LinkIdList(link_ids=[db_link.dump_id() for db_link in db_links]) + with self.lock: + db_links : List[LinkModel] = get_all_objects(self.database, LinkModel) + db_links = sorted(db_links, key=operator.attrgetter('pk')) + return LinkIdList(link_ids=[db_link.dump_id() for db_link in db_links]) @safe_and_metered_rpc_method(METRICS, LOGGER) def ListLinks(self, request: Empty, context : grpc.ServicerContext) -> LinkList: - db_links : List[LinkModel] = get_all_objects(self.database, LinkModel) - db_links = sorted(db_links, key=operator.attrgetter('pk')) - return LinkList(links=[db_link.dump() for db_link in db_links]) + with self.lock: + db_links : List[LinkModel] = get_all_objects(self.database, LinkModel) + db_links = sorted(db_links, key=operator.attrgetter('pk')) + return LinkList(links=[db_link.dump() for db_link in db_links]) @safe_and_metered_rpc_method(METRICS, LOGGER) def GetLink(self, request: LinkId, context : grpc.ServicerContext) -> Link: - link_uuid = request.link_uuid.uuid - db_link : LinkModel = get_object(self.database, LinkModel, link_uuid) - return Link(**db_link.dump()) + with self.lock: + link_uuid = request.link_uuid.uuid + db_link : LinkModel = get_object(self.database, LinkModel, link_uuid) + return Link(**db_link.dump()) @safe_and_metered_rpc_method(METRICS, LOGGER) def SetLink(self, request: Link, context : grpc.ServicerContext) -> LinkId: - link_uuid = request.link_id.link_uuid.uuid - result : Tuple[LinkModel, bool] = update_or_create_object( - self.database, LinkModel, link_uuid, {'link_uuid': link_uuid}) - db_link, updated = result - - for endpoint_id in request.link_endpoint_ids: - endpoint_uuid = endpoint_id.endpoint_uuid.uuid - endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid - endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid - endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid - - str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) - - db_topology = None - if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: - str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) - db_topology : TopologyModel = get_object(self.database, TopologyModel, str_topology_key) - str_topology_device_key = key_to_str([str_topology_key, endpoint_device_uuid], separator='--') - get_object(self.database, TopologyDeviceModel, str_topology_device_key) # check device is in topology - str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') - - db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) - - str_link_endpoint_key = key_to_str([link_uuid, endpoint_device_uuid], separator='--') - result : Tuple[LinkEndPointModel, bool] = get_or_create_object( - self.database, LinkEndPointModel, str_link_endpoint_key, { - 'link_fk': db_link, 'endpoint_fk': db_endpoint}) - #db_link_endpoint, link_endpoint_created = result - - if db_topology is not None: - str_topology_link_key = key_to_str([str_topology_key, link_uuid], separator='--') - result : Tuple[TopologyLinkModel, bool] = get_or_create_object( - self.database, TopologyLinkModel, str_topology_link_key, { - 'topology_fk': db_topology, 'link_fk': db_link}) - #db_topology_link, topology_link_created = result - - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - dict_link_id = db_link.dump_id() - notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': dict_link_id}) - return LinkId(**dict_link_id) + with self.lock: + link_uuid = request.link_id.link_uuid.uuid + result : Tuple[LinkModel, bool] = update_or_create_object( + self.database, LinkModel, link_uuid, {'link_uuid': link_uuid}) + db_link, updated = result + + for endpoint_id in request.link_endpoint_ids: + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + + db_topology = None + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + db_topology : TopologyModel = get_object(self.database, TopologyModel, str_topology_key) + str_topology_device_key = key_to_str([str_topology_key, endpoint_device_uuid], separator='--') + # check device is in topology + get_object(self.database, TopologyDeviceModel, str_topology_device_key) + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) + + str_link_endpoint_key = key_to_str([link_uuid, endpoint_device_uuid], separator='--') + result : Tuple[LinkEndPointModel, bool] = get_or_create_object( + self.database, LinkEndPointModel, str_link_endpoint_key, { + 'link_fk': db_link, 'endpoint_fk': db_endpoint}) + #db_link_endpoint, link_endpoint_created = result + + if db_topology is not None: + str_topology_link_key = key_to_str([str_topology_key, link_uuid], separator='--') + result : Tuple[TopologyLinkModel, bool] = get_or_create_object( + self.database, TopologyLinkModel, str_topology_link_key, { + 'topology_fk': db_topology, 'link_fk': db_link}) + #db_topology_link, topology_link_created = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_link_id = db_link.dump_id() + notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': dict_link_id}) + return LinkId(**dict_link_id) @safe_and_metered_rpc_method(METRICS, LOGGER) def RemoveLink(self, request: LinkId, context : grpc.ServicerContext) -> Empty: - link_uuid = request.link_uuid.uuid - db_link = LinkModel(self.database, link_uuid, auto_load=False) - found = db_link.load() - if not found: return Empty() - - dict_link_id = db_link.dump_id() + with self.lock: + link_uuid = request.link_uuid.uuid + db_link = LinkModel(self.database, link_uuid, auto_load=False) + found = db_link.load() + if not found: return Empty() - for db_link_endpoint_pk,_ in db_link.references(LinkEndPointModel): - LinkEndPointModel(self.database, db_link_endpoint_pk).delete() + dict_link_id = db_link.dump_id() + db_link.delete() - for db_topology_link_pk,_ in db_link.references(TopologyLinkModel): - TopologyLinkModel(self.database, db_topology_link_pk).delete() - - db_link.delete() - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': dict_link_id}) - return Empty() + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_LINK, event_type, {'link_id': dict_link_id}) + return Empty() @safe_and_metered_rpc_method(METRICS, LOGGER) def GetLinkEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[LinkEvent]: @@ -419,113 +442,322 @@ class ContextServiceServicerImpl(ContextServiceServicer): @safe_and_metered_rpc_method(METRICS, LOGGER) def ListServiceIds(self, request: ContextId, context : grpc.ServicerContext) -> ServiceIdList: - db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) - db_services : Set[ServiceModel] = get_related_objects(db_context, ServiceModel) - db_services = sorted(db_services, key=operator.attrgetter('pk')) - return ServiceIdList(service_ids=[db_service.dump_id() for db_service in db_services]) + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_services : Set[ServiceModel] = get_related_objects(db_context, ServiceModel) + db_services = sorted(db_services, key=operator.attrgetter('pk')) + return ServiceIdList(service_ids=[db_service.dump_id() for db_service in db_services]) @safe_and_metered_rpc_method(METRICS, LOGGER) def ListServices(self, request: ContextId, context : grpc.ServicerContext) -> ServiceList: - db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) - db_services : Set[ServiceModel] = get_related_objects(db_context, ServiceModel) - db_services = sorted(db_services, key=operator.attrgetter('pk')) - return ServiceList(services=[db_service.dump() for db_service in db_services]) + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_services : Set[ServiceModel] = get_related_objects(db_context, ServiceModel) + db_services = sorted(db_services, key=operator.attrgetter('pk')) + return ServiceList(services=[db_service.dump() for db_service in db_services]) @safe_and_metered_rpc_method(METRICS, LOGGER) def GetService(self, request: ServiceId, context : grpc.ServicerContext) -> Service: - str_key = key_to_str([request.context_id.context_uuid.uuid, request.service_uuid.uuid]) - db_service : ServiceModel = get_object(self.database, ServiceModel, str_key) - return Service(**db_service.dump( - include_endpoint_ids=True, include_constraints=True, include_config_rules=True)) + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.service_uuid.uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_key) + return Service(**db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)) @safe_and_metered_rpc_method(METRICS, LOGGER) def SetService(self, request: Service, context : grpc.ServicerContext) -> ServiceId: - context_uuid = request.service_id.context_id.context_uuid.uuid - db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) - - for i,endpoint_id in enumerate(request.service_endpoint_ids): - endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid - if len(endpoint_topology_context_uuid) > 0 and context_uuid != endpoint_topology_context_uuid: - raise InvalidArgumentException( - 'request.service_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), - endpoint_topology_context_uuid, - ['should be == {:s}({:s})'.format('request.service_id.context_id.context_uuid.uuid', context_uuid)]) - - service_uuid = request.service_id.service_uuid.uuid - str_service_key = key_to_str([context_uuid, service_uuid]) - - constraints_result = set_constraints( - self.database, str_service_key, 'constraints', request.service_constraints) - db_constraints = constraints_result[0][0] - - config_rules = grpc_config_rules_to_raw(request.service_config.config_rules) - running_config_result = update_config(self.database, str_service_key, 'running', config_rules) - db_running_config = running_config_result[0][0] - - result : Tuple[ServiceModel, bool] = update_or_create_object(self.database, ServiceModel, str_service_key, { - 'context_fk' : db_context, - 'service_uuid' : service_uuid, - 'service_type' : grpc_to_enum__service_type(request.service_type), - 'service_constraints_fk': db_constraints, - 'service_status' : grpc_to_enum__service_status(request.service_status.service_status), - 'service_config_fk' : db_running_config, - }) - db_service, updated = result - - for i,endpoint_id in enumerate(request.service_endpoint_ids): - endpoint_uuid = endpoint_id.endpoint_uuid.uuid - endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid - endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid - endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid - - str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) - if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: - str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) - str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') - - db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) - - str_service_endpoint_key = key_to_str([service_uuid, endpoint_device_uuid], separator='--') - result : Tuple[ServiceEndPointModel, bool] = get_or_create_object( - self.database, ServiceEndPointModel, str_service_endpoint_key, { - 'service_fk': db_service, 'endpoint_fk': db_endpoint}) - #db_service_endpoint, service_endpoint_created = result - - event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE - dict_service_id = db_service.dump_id() - notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': dict_service_id}) - return ServiceId(**dict_service_id) + with self.lock: + context_uuid = request.service_id.context_id.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + + for i,endpoint_id in enumerate(request.service_endpoint_ids): + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_topology_context_uuid) > 0 and context_uuid != endpoint_topology_context_uuid: + raise InvalidArgumentException( + 'request.service_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), + endpoint_topology_context_uuid, + ['should be == {:s}({:s})'.format( + 'request.service_id.context_id.context_uuid.uuid', context_uuid)]) + + service_uuid = request.service_id.service_uuid.uuid + str_service_key = key_to_str([context_uuid, service_uuid]) + + constraints_result = set_constraints( + self.database, str_service_key, 'constraints', request.service_constraints) + db_constraints = constraints_result[0][0] + + config_rules = grpc_config_rules_to_raw(request.service_config.config_rules) + running_config_result = update_config(self.database, str_service_key, 'running', config_rules) + db_running_config = running_config_result[0][0] + + result : Tuple[ServiceModel, bool] = update_or_create_object(self.database, ServiceModel, str_service_key, { + 'context_fk' : db_context, + 'service_uuid' : service_uuid, + 'service_type' : grpc_to_enum__service_type(request.service_type), + 'service_constraints_fk': db_constraints, + 'service_status' : grpc_to_enum__service_status(request.service_status.service_status), + 'service_config_fk' : db_running_config, + }) + db_service, updated = result + + for i,endpoint_id in enumerate(request.service_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) + + str_service_endpoint_key = key_to_str([service_uuid, str_endpoint_key], separator='--') + result : Tuple[ServiceEndPointModel, bool] = get_or_create_object( + self.database, ServiceEndPointModel, str_service_endpoint_key, { + 'service_fk': db_service, 'endpoint_fk': db_endpoint}) + #db_service_endpoint, service_endpoint_created = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_service_id = db_service.dump_id() + notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': dict_service_id}) + return ServiceId(**dict_service_id) @safe_and_metered_rpc_method(METRICS, LOGGER) def RemoveService(self, request: ServiceId, context : grpc.ServicerContext) -> Empty: - context_uuid = request.context_id.context_uuid.uuid - service_uuid = request.service_uuid.uuid - db_service = ServiceModel(self.database, key_to_str([context_uuid, service_uuid]), auto_load=False) - found = db_service.load() - if not found: return Empty() + with self.lock: + context_uuid = request.context_id.context_uuid.uuid + service_uuid = request.service_uuid.uuid + db_service = ServiceModel(self.database, key_to_str([context_uuid, service_uuid]), auto_load=False) + found = db_service.load() + if not found: return Empty() - dict_service_id = db_service.dump_id() + dict_service_id = db_service.dump_id() + db_service.delete() - for db_service_endpoint_pk,_ in db_service.references(ServiceEndPointModel): - ServiceEndPointModel(self.database, db_service_endpoint_pk).delete() + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': dict_service_id}) + return Empty() - db_config = ConfigModel(self.database, db_service.service_config_fk) - for db_config_rule_pk,_ in db_config.references(ConfigRuleModel): - ConfigRuleModel(self.database, db_config_rule_pk).delete() + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetServiceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ServiceEvent]: + for message in self.messagebroker.consume({TOPIC_SERVICE}, consume_timeout=CONSUME_TIMEOUT): + yield ServiceEvent(**json.loads(message.content)) - db_constraints = ConstraintsModel(self.database, db_service.service_constraints_fk) - for db_constraint_pk,_ in db_constraints.references(ConstraintModel): - ConstraintModel(self.database, db_constraint_pk).delete() - db_service.delete() - db_config.delete() - db_constraints.delete() + # ----- Slice ---------------------------------------------------------------------------------------------------- - event_type = EventTypeEnum.EVENTTYPE_REMOVE - notify_event(self.messagebroker, TOPIC_SERVICE, event_type, {'service_id': dict_service_id}) - return Empty() + @safe_and_metered_rpc_method(METRICS, LOGGER) + def ListSliceIds(self, request: ContextId, context : grpc.ServicerContext) -> SliceIdList: + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_slices : Set[SliceModel] = get_related_objects(db_context, SliceModel) + db_slices = sorted(db_slices, key=operator.attrgetter('pk')) + return SliceIdList(slice_ids=[db_slice.dump_id() for db_slice in db_slices]) @safe_and_metered_rpc_method(METRICS, LOGGER) - def GetServiceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ServiceEvent]: - for message in self.messagebroker.consume({TOPIC_SERVICE}, consume_timeout=CONSUME_TIMEOUT): - yield ServiceEvent(**json.loads(message.content)) + def ListSlices(self, request: ContextId, context : grpc.ServicerContext) -> SliceList: + with self.lock: + db_context : ContextModel = get_object(self.database, ContextModel, request.context_uuid.uuid) + db_slices : Set[SliceModel] = get_related_objects(db_context, SliceModel) + db_slices = sorted(db_slices, key=operator.attrgetter('pk')) + return SliceList(slices=[db_slice.dump() for db_slice in db_slices]) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetSlice(self, request: SliceId, context : grpc.ServicerContext) -> Slice: + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.slice_uuid.uuid]) + db_slice : SliceModel = get_object(self.database, SliceModel, str_key) + return Slice(**db_slice.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True, + include_service_ids=True, include_subslice_ids=True)) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def SetSlice(self, request: Slice, context : grpc.ServicerContext) -> SliceId: + with self.lock: + context_uuid = request.slice_id.context_id.context_uuid.uuid + db_context : ContextModel = get_object(self.database, ContextModel, context_uuid) + + for i,endpoint_id in enumerate(request.slice_endpoint_ids): + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + if len(endpoint_topology_context_uuid) > 0 and context_uuid != endpoint_topology_context_uuid: + raise InvalidArgumentException( + 'request.slice_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), + endpoint_topology_context_uuid, + ['should be == {:s}({:s})'.format( + 'request.slice_id.context_id.context_uuid.uuid', context_uuid)]) + + slice_uuid = request.slice_id.slice_uuid.uuid + str_slice_key = key_to_str([context_uuid, slice_uuid]) + + constraints_result = set_constraints( + self.database, str_slice_key, 'constraints', request.slice_constraints) + db_constraints = constraints_result[0][0] + + config_rules = grpc_config_rules_to_raw(request.slice_config.config_rules) + running_config_result = update_config(self.database, str_slice_key, 'running', config_rules) + db_running_config = running_config_result[0][0] + + result : Tuple[SliceModel, bool] = update_or_create_object(self.database, SliceModel, str_slice_key, { + 'context_fk' : db_context, + 'slice_uuid' : slice_uuid, + 'slice_constraints_fk': db_constraints, + 'slice_status' : grpc_to_enum__slice_status(request.slice_status.slice_status), + 'slice_config_fk' : db_running_config, + }) + db_slice, updated = result + + for i,endpoint_id in enumerate(request.slice_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + + db_endpoint : EndPointModel = get_object(self.database, EndPointModel, str_endpoint_key) + + str_slice_endpoint_key = key_to_str([slice_uuid, str_endpoint_key], separator='--') + result : Tuple[SliceEndPointModel, bool] = get_or_create_object( + self.database, SliceEndPointModel, str_slice_endpoint_key, { + 'slice_fk': db_slice, 'endpoint_fk': db_endpoint}) + #db_slice_endpoint, slice_endpoint_created = result + + for i,service_id in enumerate(request.slice_service_ids): + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + str_service_key = key_to_str([service_context_uuid, service_uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_service_key) + + str_slice_service_key = key_to_str([str_slice_key, str_service_key], separator='--') + result : Tuple[SliceServiceModel, bool] = get_or_create_object( + self.database, SliceServiceModel, str_slice_service_key, { + 'slice_fk': db_slice, 'service_fk': db_service}) + #db_slice_service, slice_service_created = result + + for i,subslice_id in enumerate(request.slice_subslice_ids): + subslice_uuid = subslice_id.slice_uuid.uuid + subslice_context_uuid = subslice_id.context_id.context_uuid.uuid + str_subslice_key = key_to_str([subslice_context_uuid, subslice_uuid]) + db_subslice : SliceModel = get_object(self.database, SliceModel, str_subslice_key) + + str_slice_subslice_key = key_to_str([str_slice_key, str_subslice_key], separator='--') + result : Tuple[SliceSubSliceModel, bool] = get_or_create_object( + self.database, SliceSubSliceModel, str_slice_subslice_key, { + 'slice_fk': db_slice, 'sub_slice_fk': db_subslice}) + #db_slice_subslice, slice_subslice_created = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_slice_id = db_slice.dump_id() + notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': dict_slice_id}) + return SliceId(**dict_slice_id) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def RemoveSlice(self, request: SliceId, context : grpc.ServicerContext) -> Empty: + with self.lock: + context_uuid = request.context_id.context_uuid.uuid + slice_uuid = request.slice_uuid.uuid + db_slice = SliceModel(self.database, key_to_str([context_uuid, slice_uuid]), auto_load=False) + found = db_slice.load() + if not found: return Empty() + + dict_slice_id = db_slice.dump_id() + db_slice.delete() + + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_SLICE, event_type, {'slice_id': dict_slice_id}) + return Empty() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetSliceEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[SliceEvent]: + for message in self.messagebroker.consume({TOPIC_SLICE}, consume_timeout=CONSUME_TIMEOUT): + yield SliceEvent(**json.loads(message.content)) + + + # ----- Connection ------------------------------------------------------------------------------------------------- + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def ListConnectionIds(self, request: ServiceId, context : grpc.ServicerContext) -> ConnectionIdList: + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.service_uuid.uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_key) + db_connections : Set[ConnectionModel] = get_related_objects(db_service, ConnectionModel) + db_connections = sorted(db_connections, key=operator.attrgetter('pk')) + return ConnectionIdList(connection_ids=[db_connection.dump_id() for db_connection in db_connections]) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def ListConnections(self, request: ContextId, context : grpc.ServicerContext) -> ServiceList: + with self.lock: + str_key = key_to_str([request.context_id.context_uuid.uuid, request.service_uuid.uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_key) + db_connections : Set[ConnectionModel] = get_related_objects(db_service, ConnectionModel) + db_connections = sorted(db_connections, key=operator.attrgetter('pk')) + return ConnectionList(connections=[db_connection.dump() for db_connection in db_connections]) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Connection: + with self.lock: + db_connection : ConnectionModel = get_object(self.database, ConnectionModel, request.connection_uuid.uuid) + return Connection(**db_connection.dump(include_path=True, include_sub_service_ids=True)) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def SetConnection(self, request: Connection, context : grpc.ServicerContext) -> ConnectionId: + with self.lock: + connection_uuid = request.connection_id.connection_uuid.uuid + + connection_attributes = {'connection_uuid': connection_uuid} + + service_context_uuid = request.service_id.context_id.context_uuid.uuid + service_uuid = request.service_id.service_uuid.uuid + if len(service_context_uuid) > 0 and len(service_uuid) > 0: + str_service_key = key_to_str([service_context_uuid, service_uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_service_key) + connection_attributes['service_fk'] = db_service + + path_hops_result = set_path(self.database, connection_uuid, request.path_hops_endpoint_ids, path_name = '') + db_path = path_hops_result[0] + connection_attributes['path_fk'] = db_path + + result : Tuple[ConnectionModel, bool] = update_or_create_object( + self.database, ConnectionModel, connection_uuid, connection_attributes) + db_connection, updated = result + + for sub_service_id in request.sub_service_ids: + sub_service_uuid = sub_service_id.service_uuid.uuid + sub_service_context_uuid = sub_service_id.context_id.context_uuid.uuid + str_sub_service_key = key_to_str([sub_service_context_uuid, sub_service_uuid]) + db_service : ServiceModel = get_object(self.database, ServiceModel, str_sub_service_key) + + str_connection_sub_service_key = key_to_str([connection_uuid, str_sub_service_key], separator='--') + result : Tuple[ConnectionSubServiceModel, bool] = get_or_create_object( + self.database, ConnectionSubServiceModel, str_connection_sub_service_key, { + 'connection_fk': db_connection, 'sub_service_fk': db_service}) + #db_connection_sub_service, connection_sub_service_created = result + + event_type = EventTypeEnum.EVENTTYPE_UPDATE if updated else EventTypeEnum.EVENTTYPE_CREATE + dict_connection_id = db_connection.dump_id() + notify_event(self.messagebroker, TOPIC_CONNECTION, event_type, {'connection_id': dict_connection_id}) + return ConnectionId(**dict_connection_id) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def RemoveConnection(self, request: ConnectionId, context : grpc.ServicerContext) -> Empty: + with self.lock: + db_connection = ConnectionModel(self.database, request.connection_uuid.uuid, auto_load=False) + found = db_connection.load() + if not found: return Empty() + + dict_connection_id = db_connection.dump_id() + db_connection.delete() + + event_type = EventTypeEnum.EVENTTYPE_REMOVE + notify_event(self.messagebroker, TOPIC_CONNECTION, event_type, {'connection_id': dict_connection_id}) + return Empty() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def GetConnectionEvents(self, request: Empty, context : grpc.ServicerContext) -> Iterator[ConnectionEvent]: + for message in self.messagebroker.consume({TOPIC_CONNECTION}, consume_timeout=CONSUME_TIMEOUT): + yield ConnectionEvent(**json.loads(message.content)) diff --git a/src/context/service/grpc_server/__init__.py b/src/context/service/grpc_server/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/service/grpc_server/__init__.py +++ b/src/context/service/grpc_server/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/service/rest_server/Resources.py b/src/context/service/rest_server/Resources.py index 54a21ed3984ced399d82f72b7ca7f77e447f0459..d1738edb20361dab70334bc026d94d37c654127a 100644 --- a/src/context/service/rest_server/Resources.py +++ b/src/context/service/rest_server/Resources.py @@ -1,20 +1,46 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask import make_response from flask.json import jsonify from flask_restful import Resource -from google.protobuf.json_format import MessageToDict -from common.message_broker.Factory import LOGGER from common.orm.Database import Database -from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, ServiceId, TopologyId +from common.proto.context_pb2 import ConnectionId, ContextId, DeviceId, Empty, LinkId, ServiceId, SliceId, TopologyId +from common.tools.grpc.Tools import grpc_message_to_json from context.service.grpc_server.ContextServiceServicerImpl import ContextServiceServicerImpl +def format_grpc_to_json(grpc_reply): + return jsonify(grpc_message_to_json(grpc_reply)) + +def grpc_connection_id(connection_uuid): + return ConnectionId(**{ + 'connection_uuid': {'uuid': connection_uuid} + }) + def grpc_context_id(context_uuid): return ContextId(**{ 'context_uuid': {'uuid': context_uuid} }) -def grpc_topology_id(context_uuid, topology_uuid): - return TopologyId(**{ - 'context_id': {'context_uuid': {'uuid': context_uuid}}, - 'topology_uuid': {'uuid': topology_uuid} +def grpc_device_id(device_uuid): + return DeviceId(**{ + 'device_uuid': {'uuid': device_uuid} + }) + +def grpc_link_id(link_uuid): + return LinkId(**{ + 'link_uuid': {'uuid': link_uuid} }) def grpc_service_id(context_uuid, service_uuid): @@ -23,21 +49,18 @@ def grpc_service_id(context_uuid, service_uuid): 'service_uuid': {'uuid': service_uuid} }) -def grpc_device_id(device_uuid): - return DeviceId(**{ - 'device_uuid': {'uuid': device_uuid} +def grpc_slice_id(context_uuid, slice_uuid): + return SliceId(**{ + 'context_id': {'context_uuid': {'uuid': context_uuid}}, + 'slice_uuid': {'uuid': slice_uuid} }) -def grpc_link_id(link_uuid): - return LinkId(**{ - 'link_uuid': {'uuid': link_uuid} +def grpc_topology_id(context_uuid, topology_uuid): + return TopologyId(**{ + 'context_id': {'context_uuid': {'uuid': context_uuid}}, + 'topology_uuid': {'uuid': topology_uuid} }) -def format_grpc_to_json(grpc_reply): - return jsonify(MessageToDict( - grpc_reply, including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - class _Resource(Resource): def __init__(self, database : Database) -> None: super().__init__() @@ -80,6 +103,18 @@ class Service(_Resource): def get(self, context_uuid : str, service_uuid : str): return format_grpc_to_json(self.servicer.GetService(grpc_service_id(context_uuid, service_uuid), None)) +class SliceIds(_Resource): + def get(self, context_uuid : str): + return format_grpc_to_json(self.servicer.ListSliceIds(grpc_context_id(context_uuid), None)) + +class Slices(_Resource): + def get(self, context_uuid : str): + return format_grpc_to_json(self.servicer.ListSlices(grpc_context_id(context_uuid), None)) + +class Slice(_Resource): + def get(self, context_uuid : str, slice_uuid : str): + return format_grpc_to_json(self.servicer.GetSlice(grpc_slice_id(context_uuid, slice_uuid), None)) + class DeviceIds(_Resource): def get(self): return format_grpc_to_json(self.servicer.ListDeviceIds(Empty(), None)) @@ -104,27 +139,86 @@ class Link(_Resource): def get(self, link_uuid : str): return format_grpc_to_json(self.servicer.GetLink(grpc_link_id(link_uuid), None)) +class ConnectionIds(_Resource): + def get(self, context_uuid : str, service_uuid : str): + return format_grpc_to_json(self.servicer.ListConnectionIds(grpc_service_id(context_uuid, service_uuid), None)) + +class Connections(_Resource): + def get(self, context_uuid : str, service_uuid : str): + return format_grpc_to_json(self.servicer.ListConnections(grpc_service_id(context_uuid, service_uuid), None)) + +class Connection(_Resource): + def get(self, connection_uuid : str): + return format_grpc_to_json(self.servicer.GetConnection(grpc_connection_id(connection_uuid), None)) + +class DumpText(Resource): + def __init__(self, database : Database) -> None: + super().__init__() + self.database = database + + def get(self): + db_entries = self.database.dump() + num_entries = len(db_entries) + response = ['----- Database Dump [{:3d} entries] -------------------------'.format(num_entries)] + for db_entry in db_entries: + response.append(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + response.append('-----------------------------------------------------------') + headers = {'Content-Type': 'text/plain'} + return make_response('\n'.join(response), 200, headers) + +class DumpHtml(Resource): + def __init__(self, database : Database) -> None: + super().__init__() + self.database = database + + def get(self): + db_entries = self.database.dump() + num_entries = len(db_entries) + response = [] + response.append('Database Dump [{:3d} entries]'.format(num_entries)) + response.append('

Database Dump [{:3d} entries]


'.format(num_entries)) + response.append('') + response.append('') + for db_entry in db_entries: + response.append(''.format(*db_entry)) + response.append('
TypeKeyValue
{:s}{:s}{:s}
') + + headers = {'Content-Type': 'text/html'} + return make_response(''.join(response), 200, headers) + + # Use 'path' type in Service and Sink because service_uuid and link_uuid might contain char '/' and Flask is unable to # recognize them in 'string' type. RESOURCES = [ # (endpoint_name, resource_class, resource_url) - ('api.context_ids', ContextIds, '/context_ids'), - ('api.contexts', Contexts, '/contexts'), - ('api.context', Context, '/context/'), + ('api.context_ids', ContextIds, '/context_ids'), + ('api.contexts', Contexts, '/contexts'), + ('api.context', Context, '/context/'), + + ('api.topology_ids', TopologyIds, '/context//topology_ids'), + ('api.topologies', Topologies, '/context//topologies'), + ('api.topology', Topology, '/context//topology/'), + + ('api.service_ids', ServiceIds, '/context//service_ids'), + ('api.services', Services, '/context//services'), + ('api.service', Service, '/context//service/'), + + ('api.slice_ids', SliceIds, '/context//slice_ids'), + ('api.slices', Slices, '/context//slices'), + ('api.slice', Slice, '/context//slice/'), - ('api.topology_ids', TopologyIds, '/context//topology_ids'), - ('api.topologies', Topologies, '/context//topologies'), - ('api.topology', Topology, '/context//topology/'), + ('api.device_ids', DeviceIds, '/device_ids'), + ('api.devices', Devices, '/devices'), + ('api.device', Device, '/device/'), - ('api.service_ids', ServiceIds, '/context//service_ids'), - ('api.services', Services, '/context//services'), - ('api.service', Service, '/context//service/'), + ('api.link_ids', LinkIds, '/link_ids'), + ('api.links', Links, '/links'), + ('api.link', Link, '/link/'), - ('api.device_ids', DeviceIds, '/device_ids'), - ('api.devices', Devices, '/devices'), - ('api.device', Device, '/device/'), + ('api.connection_ids', ConnectionIds, '/context//service//connection_ids'), + ('api.connections', Connections, '/context//service//connections'), + ('api.connection', Connection, '/connection/'), - ('api.link_ids', LinkIds, '/link_ids'), - ('api.links', Links, '/links'), - ('api.link', Link, '/link/'), + ('api.dump.text', DumpText, '/dump/text'), + ('api.dump.html', DumpHtml, '/dump/html'), ] diff --git a/src/context/service/rest_server/RestServer.py b/src/context/service/rest_server/RestServer.py new file mode 100644 index 0000000000000000000000000000000000000000..289e92a3c1b74e207a261b133130a551c3c55918 --- /dev/null +++ b/src/context/service/rest_server/RestServer.py @@ -0,0 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_baseurl_http, get_service_port_http +from common.tools.service.GenericRestServer import GenericRestServer + +class RestServer(GenericRestServer): + def __init__(self, cls_name: str = __name__) -> None: + bind_port = get_service_port_http(ServiceNameEnum.CONTEXT) + base_url = get_service_baseurl_http(ServiceNameEnum.CONTEXT) + super().__init__(bind_port, base_url, cls_name=cls_name) diff --git a/src/context/service/rest_server/Server.py b/src/context/service/rest_server/Server.py deleted file mode 100644 index 3095d77c48e756dd0c5d655b06a2b0625bcc89d5..0000000000000000000000000000000000000000 --- a/src/context/service/rest_server/Server.py +++ /dev/null @@ -1,36 +0,0 @@ -import logging, threading -from flask import Flask -from flask_restful import Api -from werkzeug.serving import make_server -from context.Config import RESTAPI_BASE_URL, RESTAPI_SERVICE_PORT - -logging.getLogger('werkzeug').setLevel(logging.WARNING) - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class Server(threading.Thread): - def __init__(self, host=BIND_ADDRESS, port=RESTAPI_SERVICE_PORT, base_url=RESTAPI_BASE_URL): - threading.Thread.__init__(self, daemon=True) - self.host = host - self.port = port - self.base_url = base_url - self.srv = None - self.ctx = None - self.app = Flask(__name__) - self.api = Api(self.app, prefix=self.base_url) - - def add_resource(self, resource, *urls, **kwargs): - self.api.add_resource(resource, *urls, **kwargs) - - def run(self): - self.srv = make_server(self.host, self.port, self.app, threaded=True) - self.ctx = self.app.app_context() - self.ctx.push() - - endpoint = 'http://{}:{}{}'.format(self.host, self.port, self.base_url) - LOGGER.info('Listening on {}...'.format(endpoint)) - self.srv.serve_forever() - - def shutdown(self): - self.srv.shutdown() diff --git a/src/context/service/rest_server/__init__.py b/src/context/service/rest_server/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/service/rest_server/__init__.py +++ b/src/context/service/rest_server/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/tests/Objects.py b/src/context/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..519a0093ac2733125487ed9daf0c61e0821910d5 --- /dev/null +++ b/src/context/tests/Objects.py @@ -0,0 +1,199 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Connection import json_connection, json_connection_id +from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import json_device_id, json_device_packetrouter_disabled +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Service import json_service_id, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) + + +# ----- KPI Sample Types ----------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + + +# ----- Device --------------------------------------------------------------------------------------------------------- +DEVICE_R1_UUID = 'R1' +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +DEVICE_R1_EPS = [ + json_endpoint(DEVICE_R1_ID, 'EP2', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R1_ID, 'EP3', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R1_ID, 'EP100', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), +] +DEVICE_R1_RULES = [ + json_config_rule_set('dev/rsrc1/value', 'value1'), + json_config_rule_set('dev/rsrc2/value', 'value2'), + json_config_rule_set('dev/rsrc3/value', 'value3'), +] +DEVICE_R1 = json_device_packetrouter_disabled( + DEVICE_R1_UUID, endpoints=DEVICE_R1_EPS, config_rules=DEVICE_R1_RULES) + + +DEVICE_R2_UUID = 'R2' +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +DEVICE_R2_EPS = [ + json_endpoint(DEVICE_R2_ID, 'EP1', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R2_ID, 'EP3', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R2_ID, 'EP100', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), +] +DEVICE_R2_RULES = [ + json_config_rule_set('dev/rsrc1/value', 'value4'), + json_config_rule_set('dev/rsrc2/value', 'value5'), + json_config_rule_set('dev/rsrc3/value', 'value6'), +] +DEVICE_R2 = json_device_packetrouter_disabled( + DEVICE_R2_UUID, endpoints=DEVICE_R2_EPS, config_rules=DEVICE_R2_RULES) + + +DEVICE_R3_UUID = 'R3' +DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) +DEVICE_R3_EPS = [ + json_endpoint(DEVICE_R3_ID, 'EP1', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R3_ID, 'EP2', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), + json_endpoint(DEVICE_R3_ID, 'EP100', '10G', topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES), +] +DEVICE_R3_RULES = [ + json_config_rule_set('dev/rsrc1/value', 'value4'), + json_config_rule_set('dev/rsrc2/value', 'value5'), + json_config_rule_set('dev/rsrc3/value', 'value6'), +] +DEVICE_R3 = json_device_packetrouter_disabled( + DEVICE_R3_UUID, endpoints=DEVICE_R3_EPS, config_rules=DEVICE_R3_RULES) + + +# ----- Link ----------------------------------------------------------------------------------------------------------- +LINK_R1_R2_UUID = 'R1/EP2-R2/EP1' +LINK_R1_R2_ID = json_link_id(LINK_R1_R2_UUID) +LINK_R1_R2_EPIDS = [ + json_endpoint_id(DEVICE_R1_ID, 'EP2', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R2_ID, 'EP1', topology_id=TOPOLOGY_ID), +] +LINK_R1_R2 = json_link(LINK_R1_R2_UUID, LINK_R1_R2_EPIDS) + + +LINK_R2_R3_UUID = 'R2/EP3-R3/EP2' +LINK_R2_R3_ID = json_link_id(LINK_R2_R3_UUID) +LINK_R2_R3_EPIDS = [ + json_endpoint_id(DEVICE_R2_ID, 'EP3', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP2', topology_id=TOPOLOGY_ID), +] +LINK_R2_R3 = json_link(LINK_R2_R3_UUID, LINK_R2_R3_EPIDS) + + +LINK_R1_R3_UUID = 'R1/EP3-R3/EP1' +LINK_R1_R3_ID = json_link_id(LINK_R1_R3_UUID) +LINK_R1_R3_EPIDS = [ + json_endpoint_id(DEVICE_R1_ID, 'EP3', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP1', topology_id=TOPOLOGY_ID), +] +LINK_R1_R3 = json_link(LINK_R1_R3_UUID, LINK_R1_R3_EPIDS) + + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_R1_R2_UUID = 'SVC:R1/EP100-R2/EP100' +SERVICE_R1_R2_ID = json_service_id(SERVICE_R1_R2_UUID, context_id=CONTEXT_ID) +SERVICE_R1_R2_EPIDS = [ + json_endpoint_id(DEVICE_R1_ID, 'EP100', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R2_ID, 'EP100', topology_id=TOPOLOGY_ID), +] +SERVICE_R1_R2_CONST = [ + json_constraint('latency_ms', '15.2'), + json_constraint('jitter_us', '1.2'), +] +SERVICE_R1_R2_RULES = [ + json_config_rule_set('svc/rsrc1/value', 'value7'), + json_config_rule_set('svc/rsrc2/value', 'value8'), + json_config_rule_set('svc/rsrc3/value', 'value9'), +] +SERVICE_R1_R2 = json_service_l3nm_planned( + SERVICE_R1_R2_UUID, endpoint_ids=SERVICE_R1_R2_EPIDS, constraints=SERVICE_R1_R2_CONST, + config_rules=SERVICE_R1_R2_RULES) + + +SERVICE_R1_R3_UUID = 'SVC:R1/EP100-R3/EP100' +SERVICE_R1_R3_ID = json_service_id(SERVICE_R1_R3_UUID, context_id=CONTEXT_ID) +SERVICE_R1_R3_EPIDS = [ + json_endpoint_id(DEVICE_R1_ID, 'EP100', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP100', topology_id=TOPOLOGY_ID), +] +SERVICE_R1_R3_CONST = [ + json_constraint('latency_ms', '5.8'), + json_constraint('jitter_us', '0.1'), +] +SERVICE_R1_R3_RULES = [ + json_config_rule_set('svc/rsrc1/value', 'value7'), + json_config_rule_set('svc/rsrc2/value', 'value8'), + json_config_rule_set('svc/rsrc3/value', 'value9'), +] +SERVICE_R1_R3 = json_service_l3nm_planned( + SERVICE_R1_R3_UUID, endpoint_ids=SERVICE_R1_R3_EPIDS, constraints=SERVICE_R1_R3_CONST, + config_rules=SERVICE_R1_R3_RULES) + + +SERVICE_R2_R3_UUID = 'SVC:R2/EP100-R3/EP100' +SERVICE_R2_R3_ID = json_service_id(SERVICE_R2_R3_UUID, context_id=CONTEXT_ID) +SERVICE_R2_R3_EPIDS = [ + json_endpoint_id(DEVICE_R2_ID, 'EP100', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP100', topology_id=TOPOLOGY_ID), +] +SERVICE_R2_R3_CONST = [ + json_constraint('latency_ms', '23.1'), + json_constraint('jitter_us', '3.4'), +] +SERVICE_R2_R3_RULES = [ + json_config_rule_set('svc/rsrc1/value', 'value7'), + json_config_rule_set('svc/rsrc2/value', 'value8'), + json_config_rule_set('svc/rsrc3/value', 'value9'), +] +SERVICE_R2_R3 = json_service_l3nm_planned( + SERVICE_R2_R3_UUID, endpoint_ids=SERVICE_R2_R3_EPIDS, constraints=SERVICE_R2_R3_CONST, + config_rules=SERVICE_R2_R3_RULES) + + +# ----- Connection ----------------------------------------------------------------------------------------------------- +CONNECTION_R1_R3_UUID = 'CON:R1/EP100-R3/EP100' +CONNECTION_R1_R3_ID = json_connection_id(CONNECTION_R1_R3_UUID) +CONNECTION_R1_R3_EPIDS = [ + json_endpoint_id(DEVICE_R1_ID, 'EP100', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R1_ID, 'EP2', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R2_ID, 'EP1', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R2_ID, 'EP3', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP2', topology_id=TOPOLOGY_ID), + json_endpoint_id(DEVICE_R3_ID, 'EP100', topology_id=TOPOLOGY_ID), +] +CONNECTION_R1_R3_SVCIDS = [SERVICE_R1_R2_ID, SERVICE_R2_R3_ID] +CONNECTION_R1_R3 = json_connection( + CONNECTION_R1_R3_UUID, service_id=SERVICE_R1_R3_ID, path_hops_endpoint_ids=CONNECTION_R1_R3_EPIDS, + sub_service_ids=CONNECTION_R1_R3_SVCIDS) diff --git a/src/context/tests/Tools.py b/src/context/tests/Tools.py deleted file mode 100644 index b4d1d8953126fb74b8ab17a71fbba3b19acba733..0000000000000000000000000000000000000000 --- a/src/context/tests/Tools.py +++ /dev/null @@ -1,27 +0,0 @@ -import json -from copy import deepcopy -from typing import Any, Dict, Union -from context.proto.context_pb2 import ConfigActionEnum - -def config_rule(action : ConfigActionEnum, resource_key : str, resource_value : Union[str, Dict[str, Any]]): - if not isinstance(resource_value, str): resource_value = json.dumps(resource_value, sort_keys=True) - return {'action': action, 'resource_key': resource_key, 'resource_value': resource_value} - -def config_rule_set(resource_key : str, resource_value : Union[str, Dict[str, Any]]): - return config_rule(ConfigActionEnum.CONFIGACTION_SET, resource_key, resource_value) - -def config_rule_delete(resource_key : str, resource_value : Union[str, Dict[str, Any]]): - return config_rule(ConfigActionEnum.CONFIGACTION_DELETE, resource_key, resource_value) - -def endpoint_id(device_id, endpoint_uuid, topology_id=None): - result = {'device_id': deepcopy(device_id), 'endpoint_uuid': {'uuid': endpoint_uuid}} - if topology_id is not None: result['topology_id'] = deepcopy(topology_id) - return result - -def endpoint(device_id, endpoint_uuid, endpoint_type, topology_id=None, kpi_sample_types=[]): - result = { - 'endpoint_id': endpoint_id(device_id, endpoint_uuid, topology_id=topology_id), - 'endpoint_type': endpoint_type, - } - if len(kpi_sample_types) > 0: result['kpi_sample_types'] = deepcopy(kpi_sample_types) - return result diff --git a/src/context/tests/__init__.py b/src/context/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/context/tests/__init__.py +++ b/src/context/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/context/tests/example_objects.py b/src/context/tests/example_objects.py deleted file mode 100644 index 61e0f4c7475539afa0502587cf50009260099258..0000000000000000000000000000000000000000 --- a/src/context/tests/example_objects.py +++ /dev/null @@ -1,199 +0,0 @@ -from copy import deepcopy -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID -from context.proto.context_pb2 import ( - DeviceDriverEnum, DeviceOperationalStatusEnum, ServiceStatusEnum, ServiceTypeEnum) -from context.proto.kpi_sample_types_pb2 import KpiSampleType -from .Tools import config_rule_set, endpoint, endpoint_id - -# Some example objects to be used by the tests - -## use "deepcopy" to prevent propagating forced changes during tests -CONTEXT_ID = {'context_uuid': {'uuid': DEFAULT_CONTEXT_UUID}} -CONTEXT = { - 'context_id': deepcopy(CONTEXT_ID), - 'topology_ids': [], - 'service_ids': [], -} - -TOPOLOGY_ID = { - 'context_id': deepcopy(CONTEXT_ID), - 'topology_uuid': {'uuid': DEFAULT_TOPOLOGY_UUID}, -} -TOPOLOGY = { - 'topology_id': deepcopy(TOPOLOGY_ID), - 'device_ids': [], - 'link_ids': [], -} - -PACKET_PORT_SAMPLE_TYPES = [ - KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, - KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, - KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, - KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, -] - -def _endpoint_id(device_id, endpoint_uuid): - return endpoint_id(device_id, endpoint_uuid, topology_id=TOPOLOGY_ID) - -def _endpoint(device_id, endpoint_uuid, endpoint_type): - return endpoint( - device_id, endpoint_uuid, endpoint_type, topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES) - -DEVICE1_UUID = 'DEV1' -DEVICE1_ID = {'device_uuid': {'uuid': DEVICE1_UUID}} -DEVICE1 = { - 'device_id': deepcopy(DEVICE1_ID), - 'device_type': 'packet-router', - 'device_config': {'config_rules': [ - config_rule_set('dev/rsrc1/value', 'value1'), - config_rule_set('dev/rsrc2/value', 'value2'), - config_rule_set('dev/rsrc3/value', 'value3'), - ]}, - 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED, - 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4], - 'device_endpoints': [ - _endpoint(DEVICE1_ID, 'EP2', 'port-packet-100G'), - _endpoint(DEVICE1_ID, 'EP3', 'port-packet-100G'), - _endpoint(DEVICE1_ID, 'EP100', 'port-packet-10G' ), - ], -} - -DEVICE2_UUID = 'DEV2' -DEVICE2_ID = {'device_uuid': {'uuid': DEVICE2_UUID}} -DEVICE2 = { - 'device_id': deepcopy(DEVICE2_ID), - 'device_type': 'packet-router', - 'device_config': {'config_rules': [ - config_rule_set('dev/rsrc1/value', 'value4'), - config_rule_set('dev/rsrc2/value', 'value5'), - config_rule_set('dev/rsrc3/value', 'value6'), - ]}, - 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED, - 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4], - 'device_endpoints': [ - _endpoint(DEVICE2_ID, 'EP1', 'port-packet-100G'), - _endpoint(DEVICE2_ID, 'EP3', 'port-packet-100G'), - _endpoint(DEVICE2_ID, 'EP100', 'port-packet-10G' ), - ], -} - -DEVICE3_UUID = 'DEV3' -DEVICE3_ID = {'device_uuid': {'uuid': DEVICE3_UUID}} -DEVICE3 = { - 'device_id': deepcopy(DEVICE3_ID), - 'device_type': 'packet-router', - 'device_config': {'config_rules': [ - config_rule_set('dev/rsrc1/value', 'value4'), - config_rule_set('dev/rsrc2/value', 'value5'), - config_rule_set('dev/rsrc3/value', 'value6'), - ]}, - 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED, - 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4], - 'device_endpoints': [ - _endpoint(DEVICE3_ID, 'EP1', 'port-packet-100G'), - _endpoint(DEVICE3_ID, 'EP2', 'port-packet-100G'), - _endpoint(DEVICE3_ID, 'EP100', 'port-packet-10G' ), - ], -} - -LINK_DEV1_DEV2_UUID = 'DEV1/EP2 ==> DEV2/EP1' -LINK_DEV1_DEV2_ID = {'link_uuid': {'uuid': LINK_DEV1_DEV2_UUID}} -LINK_DEV1_DEV2 = { - 'link_id': deepcopy(LINK_DEV1_DEV2_ID), - 'link_endpoint_ids' : [ - _endpoint_id(DEVICE1_ID, 'EP2'), - _endpoint_id(DEVICE2_ID, 'EP1'), - ] -} - -LINK_DEV2_DEV3_UUID = 'DEV2/EP3 ==> DEV3/EP2' -LINK_DEV2_DEV3_ID = {'link_uuid': {'uuid': LINK_DEV2_DEV3_UUID}} -LINK_DEV2_DEV3 = { - 'link_id': deepcopy(LINK_DEV2_DEV3_ID), - 'link_endpoint_ids' : [ - _endpoint_id(DEVICE2_ID, 'EP3'), - _endpoint_id(DEVICE3_ID, 'EP2'), - ] -} - -LINK_DEV1_DEV3_UUID = 'DEV1/EP3 ==> DEV3/EP1' -LINK_DEV1_DEV3_ID = {'link_uuid': {'uuid': LINK_DEV1_DEV3_UUID}} -LINK_DEV1_DEV3 = { - 'link_id': deepcopy(LINK_DEV1_DEV3_ID), - 'link_endpoint_ids' : [ - _endpoint_id(DEVICE1_ID, 'EP3'), - _endpoint_id(DEVICE3_ID, 'EP1'), - ] -} - -SERVICE_DEV1_DEV2_UUID = 'SVC:DEV1/EP100-DEV2/EP100' -SERVICE_DEV1_DEV2_ID = { - 'context_id': deepcopy(CONTEXT_ID), - 'service_uuid': {'uuid': SERVICE_DEV1_DEV2_UUID}, -} -SERVICE_DEV1_DEV2 = { - 'service_id': deepcopy(SERVICE_DEV1_DEV2_ID), - 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM, - 'service_endpoint_ids' : [ - _endpoint_id(DEVICE1_ID, 'EP100'), - _endpoint_id(DEVICE2_ID, 'EP100'), - ], - 'service_constraints': [ - {'constraint_type': 'latency_ms', 'constraint_value': '15.2'}, - {'constraint_type': 'jitter_us', 'constraint_value': '1.2'}, - ], - 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE}, - 'service_config': {'config_rules': [ - config_rule_set('svc/rsrc1/value', 'value7'), - config_rule_set('svc/rsrc2/value', 'value8'), - config_rule_set('svc/rsrc3/value', 'value9'), - ]}, -} - -SERVICE_DEV1_DEV3_UUID = 'SVC:DEV1/EP100-DEV3/EP100' -SERVICE_DEV1_DEV3_ID = { - 'context_id': deepcopy(CONTEXT_ID), - 'service_uuid': {'uuid': SERVICE_DEV1_DEV3_UUID}, -} -SERVICE_DEV1_DEV3 = { - 'service_id': deepcopy(SERVICE_DEV1_DEV3_ID), - 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM, - 'service_endpoint_ids' : [ - _endpoint_id(DEVICE1_ID, 'EP100'), - _endpoint_id(DEVICE3_ID, 'EP100'), - ], - 'service_constraints': [ - {'constraint_type': 'latency_ms', 'constraint_value': '5.8'}, - {'constraint_type': 'jitter_us', 'constraint_value': '0.1'}, - ], - 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE}, - 'service_config': {'config_rules': [ - config_rule_set('svc/rsrc1/value', 'value7'), - config_rule_set('svc/rsrc2/value', 'value8'), - config_rule_set('svc/rsrc3/value', 'value9'), - ]}, -} - -SERVICE_DEV2_DEV3_UUID = 'SVC:DEV2/EP100-DEV3/EP100' -SERVICE_DEV2_DEV3_ID = { - 'context_id': deepcopy(CONTEXT_ID), - 'service_uuid': {'uuid': SERVICE_DEV2_DEV3_UUID}, -} -SERVICE_DEV2_DEV3 = { - 'service_id': deepcopy(SERVICE_DEV2_DEV3_ID), - 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM, - 'service_endpoint_ids' : [ - _endpoint_id(DEVICE2_ID, 'EP100'), - _endpoint_id(DEVICE3_ID, 'EP100'), - ], - 'service_constraints': [ - {'constraint_type': 'latency_ms', 'constraint_value': '23.1'}, - {'constraint_type': 'jitter_us', 'constraint_value': '3.4'}, - ], - 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE}, - 'service_config': {'config_rules': [ - config_rule_set('svc/rsrc1/value', 'value7'), - config_rule_set('svc/rsrc2/value', 'value8'), - config_rule_set('svc/rsrc3/value', 'value9'), - ]}, -} diff --git a/src/context/tests/test_unitary.py b/src/context/tests/test_unitary.py index 750fa2a311bd35d0f47e04da3e424ca9d10345f7..b46c9468c56974be5c987dbbc284daae337d3c7b 100644 --- a/src/context/tests/test_unitary.py +++ b/src/context/tests/test_unitary.py @@ -1,40 +1,63 @@ -import copy, grpc, logging, os, pytest, requests, threading, time, urllib -from queue import Queue +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# pylint: disable=too-many-lines +import copy, grpc, logging, os, pytest, requests, time, urllib from typing import Tuple -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID, ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, ENVVAR_SUFIX_SERVICE_PORT_HTTP, get_env_var_name, + get_service_baseurl_http, get_service_port_grpc, get_service_port_http) from common.orm.Database import Database from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum from common.message_broker.MessageBroker import MessageBroker +from common.proto.context_pb2 import ( + Connection, ConnectionEvent, ConnectionId, Context, ContextEvent, ContextId, Device, DeviceEvent, DeviceId, + DeviceOperationalStatusEnum, Empty, EventTypeEnum, Link, LinkEvent, LinkId, Service, ServiceEvent, ServiceId, + ServiceStatusEnum, ServiceTypeEnum, Topology, TopologyEvent, TopologyId) from common.type_checkers.Assertions import ( - validate_context, validate_context_ids, validate_contexts, validate_device, validate_device_ids, validate_devices, - validate_link, validate_link_ids, validate_links, validate_service, validate_service_ids, validate_services, - validate_topologies, validate_topology, validate_topology_ids) -from context.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, RESTAPI_SERVICE_PORT, RESTAPI_BASE_URL) + validate_connection, validate_connection_ids, validate_connections, validate_context, validate_context_ids, + validate_contexts, validate_device, validate_device_ids, validate_devices, validate_link, validate_link_ids, + validate_links, validate_service, validate_service_ids, validate_services, validate_topologies, validate_topology, + validate_topology_ids) from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import ( - Context, ContextEvent, ContextId, Device, DeviceEvent, DeviceId, DeviceOperationalStatusEnum, Empty, - EventTypeEnum, Link, LinkEvent, LinkId, Service, ServiceEvent, ServiceId, ServiceStatusEnum, ServiceTypeEnum, - Topology, TopologyEvent, TopologyId) +from context.client.EventsCollector import EventsCollector from context.service.database.Tools import ( FASTHASHER_DATA_ACCEPTED_FORMAT, FASTHASHER_ITEM_ACCEPTED_FORMAT, fast_hasher) from context.service.grpc_server.ContextService import ContextService from context.service.Populate import populate -from context.service.rest_server.Server import Server as RestServer +from context.service.rest_server.RestServer import RestServer from context.service.rest_server.Resources import RESOURCES -from .example_objects import ( - CONTEXT, CONTEXT_ID, DEVICE1, DEVICE1_ID, DEVICE1_UUID, DEVICE2, DEVICE2_ID, DEVICE2_UUID, LINK_DEV1_DEV2, - LINK_DEV1_DEV2_ID, LINK_DEV1_DEV2_UUID, SERVICE_DEV1_DEV2, SERVICE_DEV1_DEV2_ID, SERVICE_DEV1_DEV2_UUID, TOPOLOGY, - TOPOLOGY_ID) +from .Objects import ( + CONNECTION_R1_R3, CONNECTION_R1_R3_ID, CONNECTION_R1_R3_UUID, CONTEXT, CONTEXT_ID, DEVICE_R1, DEVICE_R1_ID, + DEVICE_R1_UUID, DEVICE_R2, DEVICE_R2_ID, DEVICE_R2_UUID, DEVICE_R3, DEVICE_R3_ID, DEVICE_R3_UUID, LINK_R1_R2, + LINK_R1_R2_ID, LINK_R1_R2_UUID, SERVICE_R1_R2, SERVICE_R1_R2_ID, SERVICE_R1_R2_UUID, SERVICE_R1_R3, + SERVICE_R1_R3_ID, SERVICE_R1_R3_UUID, SERVICE_R2_R3, SERVICE_R2_R3_ID, SERVICE_R2_R3_UUID, TOPOLOGY, TOPOLOGY_ID) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -GRPC_PORT = 10000 + GRPC_SERVICE_PORT # avoid privileged ports -RESTAPI_PORT = 10000 + RESTAPI_SERVICE_PORT # avoid privileged ports +LOCAL_HOST = '127.0.0.1' +GRPC_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +HTTP_PORT = 10000 + get_service_port_http(ServiceNameEnum.CONTEXT) # avoid privileged ports -DEFAULT_REDIS_SERVICE_HOST = '127.0.0.1' +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(GRPC_PORT) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_HTTP)] = str(HTTP_PORT) + +DEFAULT_REDIS_SERVICE_HOST = LOCAL_HOST DEFAULT_REDIS_SERVICE_PORT = 6379 DEFAULT_REDIS_DATABASE_ID = 0 @@ -61,9 +84,7 @@ def context_db_mb(request) -> Tuple[Database, MessageBroker]: @pytest.fixture(scope='session') def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - _service = ContextService( - context_db_mb[0], context_db_mb[1], port=GRPC_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD) + _service = ContextService(context_db_mb[0], context_db_mb[1]) _service.start() yield _service _service.stop() @@ -71,7 +92,7 @@ def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pyli @pytest.fixture(scope='session') def context_service_rest(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name database = context_db_mb[0] - _rest_server = RestServer(port=RESTAPI_PORT, base_url=RESTAPI_BASE_URL) + _rest_server = RestServer() for endpoint_name, resource_class, resource_url in RESOURCES: _rest_server.add_resource(resource_class, resource_url, endpoint=endpoint_name, resource_class_args=(database,)) _rest_server.start() @@ -82,70 +103,24 @@ def context_service_rest(context_db_mb : Tuple[Database, MessageBroker]): # pyli @pytest.fixture(scope='session') def context_client_grpc(context_service_grpc : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='127.0.0.1', port=GRPC_PORT) + _client = ContextClient() yield _client _client.close() def do_rest_request(url : str): - request_url = 'http://127.0.0.1:{:s}{:s}{:s}'.format(str(RESTAPI_PORT), str(RESTAPI_BASE_URL), url) + base_url = get_service_baseurl_http(ServiceNameEnum.CONTEXT) + request_url = 'http://{:s}:{:s}{:s}{:s}'.format(str(LOCAL_HOST), str(HTTP_PORT), str(base_url), url) LOGGER.warning('Request: GET {:s}'.format(str(request_url))) reply = requests.get(request_url) LOGGER.warning('Reply: {:s}'.format(str(reply.text))) assert reply.status_code == 200, 'Reply failed with code {}'.format(reply.status_code) return reply.json() -class EventsCollector: - def __init__(self, context_client_grpc : ContextClient) -> None: # pylint: disable=redefined-outer-name - self._events_queue = Queue() - - self._context_stream = context_client_grpc.GetContextEvents(Empty()) - self._topology_stream = context_client_grpc.GetTopologyEvents(Empty()) - self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) - self._link_stream = context_client_grpc.GetLinkEvents(Empty()) - self._service_stream = context_client_grpc.GetServiceEvents(Empty()) - - self._context_thread = threading.Thread(target=self._collect, args=(self._context_stream ,), daemon=False) - self._topology_thread = threading.Thread(target=self._collect, args=(self._topology_stream,), daemon=False) - self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) - self._link_thread = threading.Thread(target=self._collect, args=(self._link_stream ,), daemon=False) - self._service_thread = threading.Thread(target=self._collect, args=(self._service_stream ,), daemon=False) - - def _collect(self, events_stream) -> None: - try: - for event in events_stream: - self._events_queue.put_nowait(event) - except grpc.RpcError as e: - if e.code() != grpc.StatusCode.CANCELLED: # pylint: disable=no-member - raise # pragma: no cover - - def start(self): - self._context_thread.start() - self._topology_thread.start() - self._device_thread.start() - self._link_thread.start() - self._service_thread.start() - - def get_event(self, block : bool = True, timeout : float = 0.1): - return self._events_queue.get(block=block, timeout=timeout) - - def stop(self): - self._context_stream.cancel() - self._topology_stream.cancel() - self._device_stream.cancel() - self._link_stream.cancel() - self._service_stream.cancel() - - self._context_thread.join() - self._topology_thread.join() - self._device_thread.join() - self._link_thread.join() - self._service_thread.join() - # ----- Test gRPC methods ---------------------------------------------------------------------------------------------- def test_grpc_context( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -193,7 +168,7 @@ def test_grpc_context( assert e.value.details() == msg with pytest.raises(grpc.RpcError) as e: - WRONG_SERVICE_ID = copy.deepcopy(SERVICE_DEV1_DEV2_ID) + WRONG_SERVICE_ID = copy.deepcopy(SERVICE_R1_R2_ID) WRONG_SERVICE_ID['context_id']['context_uuid']['uuid'] = 'wrong-context-uuid' WRONG_CONTEXT = copy.deepcopy(CONTEXT) WRONG_CONTEXT['service_ids'].append(WRONG_SERVICE_ID) @@ -266,7 +241,7 @@ def test_grpc_context( def test_grpc_topology( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -318,16 +293,16 @@ def test_grpc_topology( assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[0], TopologyEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Update the object ------------------------------------------------------------------------------------------ response = context_client_grpc.SetTopology(Topology(**TOPOLOGY)) @@ -374,16 +349,16 @@ def test_grpc_topology( context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[0], TopologyEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -398,7 +373,7 @@ def test_grpc_topology( def test_grpc_device( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -417,22 +392,22 @@ def test_grpc_device( assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: - context_client_grpc.GetDevice(DeviceId(**DEVICE1_ID)) + context_client_grpc.GetDevice(DeviceId(**DEVICE_R1_ID)) assert e.value.code() == grpc.StatusCode.NOT_FOUND - assert e.value.details() == 'Device({:s}) not found'.format(DEVICE1_UUID) + assert e.value.details() == 'Device({:s}) not found'.format(DEVICE_R1_UUID) # ----- List when the object does not exist ------------------------------------------------------------------------ response = context_client_grpc.ListDeviceIds(Empty()) @@ -451,32 +426,32 @@ def test_grpc_device( # ----- Create the object ------------------------------------------------------------------------------------------ with pytest.raises(grpc.RpcError) as e: - WRONG_DEVICE = copy.deepcopy(DEVICE1) + WRONG_DEVICE = copy.deepcopy(DEVICE_R1) WRONG_DEVICE['device_endpoints'][0]['endpoint_id']['device_id']['device_uuid']['uuid'] = 'wrong-device-uuid' context_client_grpc.SetDevice(Device(**WRONG_DEVICE)) assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT msg = 'request.device_endpoints[0].device_id.device_uuid.uuid(wrong-device-uuid) is invalid; '\ - 'should be == request.device_id.device_uuid.uuid(DEV1)' + 'should be == request.device_id.device_uuid.uuid({:s})'.format(DEVICE_R1_UUID) assert e.value.details() == msg - response = context_client_grpc.SetDevice(Device(**DEVICE1)) - assert response.device_uuid.uuid == DEVICE1_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) + assert response.device_uuid.uuid == DEVICE_R1_UUID # ----- Check create event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) assert isinstance(event, DeviceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert event.device_id.device_uuid.uuid == DEVICE_R1_UUID # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetDevice(Device(**DEVICE1)) - assert response.device_uuid.uuid == DEVICE1_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) + assert response.device_uuid.uuid == DEVICE_R1_UUID # ----- Check update event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) assert isinstance(event, DeviceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert event.device_id.device_uuid.uuid == DEVICE_R1_UUID # ----- Dump state of database after create/update the object ------------------------------------------------------ db_entries = context_database.dump() @@ -484,34 +459,34 @@ def test_grpc_device( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 41 + assert len(db_entries) == 40 # ----- Get when the object exists --------------------------------------------------------------------------------- - response = context_client_grpc.GetDevice(DeviceId(**DEVICE1_ID)) - assert response.device_id.device_uuid.uuid == DEVICE1_UUID + response = context_client_grpc.GetDevice(DeviceId(**DEVICE_R1_ID)) + assert response.device_id.device_uuid.uuid == DEVICE_R1_UUID assert response.device_type == 'packet-router' assert len(response.device_config.config_rules) == 3 - assert response.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - assert len(response.device_drivers) == 2 + assert response.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + assert len(response.device_drivers) == 1 assert len(response.device_endpoints) == 3 # ----- List when the object exists -------------------------------------------------------------------------------- response = context_client_grpc.ListDeviceIds(Empty()) assert len(response.device_ids) == 1 - assert response.device_ids[0].device_uuid.uuid == DEVICE1_UUID + assert response.device_ids[0].device_uuid.uuid == DEVICE_R1_UUID response = context_client_grpc.ListDevices(Empty()) assert len(response.devices) == 1 - assert response.devices[0].device_id.device_uuid.uuid == DEVICE1_UUID + assert response.devices[0].device_id.device_uuid.uuid == DEVICE_R1_UUID assert response.devices[0].device_type == 'packet-router' assert len(response.devices[0].device_config.config_rules) == 3 - assert response.devices[0].device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - assert len(response.devices[0].device_drivers) == 2 + assert response.devices[0].device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + assert len(response.devices[0].device_drivers) == 1 assert len(response.devices[0].device_endpoints) == 3 # ----- Create object relation ------------------------------------------------------------------------------------- TOPOLOGY_WITH_DEVICE = copy.deepcopy(TOPOLOGY) - TOPOLOGY_WITH_DEVICE['device_ids'].append(DEVICE1_ID) + TOPOLOGY_WITH_DEVICE['device_ids'].append(DEVICE_R1_ID) response = context_client_grpc.SetTopology(Topology(**TOPOLOGY_WITH_DEVICE)) assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID @@ -528,7 +503,7 @@ def test_grpc_device( assert response.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID assert len(response.device_ids) == 1 - assert response.device_ids[0].device_uuid.uuid == DEVICE1_UUID + assert response.device_ids[0].device_uuid.uuid == DEVICE_R1_UUID assert len(response.link_ids) == 0 # ----- Dump state of database after creating the object relation -------------------------------------------------- @@ -537,29 +512,28 @@ def test_grpc_device( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 41 + assert len(db_entries) == 40 # ----- Remove the object ------------------------------------------------------------------------------------------ - context_client_grpc.RemoveDevice(DeviceId(**DEVICE1_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R1_ID)) context_client_grpc.RemoveTopology(TopologyId(**TOPOLOGY_ID)) context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + events = events_collector.get_events(block=True, count=3) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], DeviceEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].device_id.device_uuid.uuid == DEVICE_R1_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[2], ContextEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -574,7 +548,7 @@ def test_grpc_device( def test_grpc_link( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -593,38 +567,36 @@ def test_grpc_link( assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - response = context_client_grpc.SetDevice(Device(**DEVICE1)) - assert response.device_uuid.uuid == DEVICE1_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) + assert response.device_uuid.uuid == DEVICE_R1_UUID - response = context_client_grpc.SetDevice(Device(**DEVICE2)) - assert response.device_uuid.uuid == DEVICE2_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R2)) + assert response.device_uuid.uuid == DEVICE_R2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=4) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[2].device_id.device_uuid.uuid == DEVICE_R1_UUID + + assert isinstance(events[3], DeviceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[3].device_id.device_uuid.uuid == DEVICE_R2_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: - context_client_grpc.GetLink(LinkId(**LINK_DEV1_DEV2_ID)) + context_client_grpc.GetLink(LinkId(**LINK_R1_R2_ID)) assert e.value.code() == grpc.StatusCode.NOT_FOUND - assert e.value.details() == 'Link({:s}) not found'.format(LINK_DEV1_DEV2_UUID) + assert e.value.details() == 'Link({:s}) not found'.format(LINK_R1_R2_UUID) # ----- List when the object does not exist ------------------------------------------------------------------------ response = context_client_grpc.ListLinkIds(Empty()) @@ -639,27 +611,27 @@ def test_grpc_link( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 69 + assert len(db_entries) == 67 # ----- Create the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetLink(Link(**LINK_DEV1_DEV2)) - assert response.link_uuid.uuid == LINK_DEV1_DEV2_UUID + response = context_client_grpc.SetLink(Link(**LINK_R1_R2)) + assert response.link_uuid.uuid == LINK_R1_R2_UUID # ----- Check create event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) assert isinstance(event, LinkEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + assert event.link_id.link_uuid.uuid == LINK_R1_R2_UUID # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetLink(Link(**LINK_DEV1_DEV2)) - assert response.link_uuid.uuid == LINK_DEV1_DEV2_UUID + response = context_client_grpc.SetLink(Link(**LINK_R1_R2)) + assert response.link_uuid.uuid == LINK_R1_R2_UUID # ----- Check update event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) assert isinstance(event, LinkEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert event.link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + assert event.link_id.link_uuid.uuid == LINK_R1_R2_UUID # ----- Dump state of database after create/update the object ------------------------------------------------------ db_entries = context_database.dump() @@ -667,26 +639,26 @@ def test_grpc_link( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 77 + assert len(db_entries) == 75 # ----- Get when the object exists --------------------------------------------------------------------------------- - response = context_client_grpc.GetLink(LinkId(**LINK_DEV1_DEV2_ID)) - assert response.link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + response = context_client_grpc.GetLink(LinkId(**LINK_R1_R2_ID)) + assert response.link_id.link_uuid.uuid == LINK_R1_R2_UUID assert len(response.link_endpoint_ids) == 2 # ----- List when the object exists -------------------------------------------------------------------------------- response = context_client_grpc.ListLinkIds(Empty()) assert len(response.link_ids) == 1 - assert response.link_ids[0].link_uuid.uuid == LINK_DEV1_DEV2_UUID + assert response.link_ids[0].link_uuid.uuid == LINK_R1_R2_UUID response = context_client_grpc.ListLinks(Empty()) assert len(response.links) == 1 - assert response.links[0].link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + assert response.links[0].link_id.link_uuid.uuid == LINK_R1_R2_UUID assert len(response.links[0].link_endpoint_ids) == 2 # ----- Create object relation ------------------------------------------------------------------------------------- TOPOLOGY_WITH_LINK = copy.deepcopy(TOPOLOGY) - TOPOLOGY_WITH_LINK['link_ids'].append(LINK_DEV1_DEV2_ID) + TOPOLOGY_WITH_LINK['link_ids'].append(LINK_R1_R2_ID) response = context_client_grpc.SetTopology(Topology(**TOPOLOGY_WITH_LINK)) assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID @@ -703,51 +675,48 @@ def test_grpc_link( assert response.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID assert len(response.device_ids) == 2 - assert response.device_ids[0].device_uuid.uuid == DEVICE1_UUID - assert response.device_ids[1].device_uuid.uuid == DEVICE2_UUID + assert response.device_ids[0].device_uuid.uuid == DEVICE_R1_UUID + assert response.device_ids[1].device_uuid.uuid == DEVICE_R2_UUID assert len(response.link_ids) == 1 - assert response.link_ids[0].link_uuid.uuid == LINK_DEV1_DEV2_UUID + assert response.link_ids[0].link_uuid.uuid == LINK_R1_R2_UUID db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 77 + assert len(db_entries) == 75 # ----- Remove the object ------------------------------------------------------------------------------------------ - context_client_grpc.RemoveLink(LinkId(**LINK_DEV1_DEV2_ID)) - context_client_grpc.RemoveDevice(DeviceId(**DEVICE1_ID)) - context_client_grpc.RemoveDevice(DeviceId(**DEVICE2_ID)) + context_client_grpc.RemoveLink(LinkId(**LINK_R1_R2_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R1_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R2_ID)) context_client_grpc.RemoveTopology(TopologyId(**TOPOLOGY_ID)) context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, LinkEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.link_id.link_uuid.uuid == LINK_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=5) - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[0], LinkEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].link_id.link_uuid.uuid == LINK_R1_R2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[1], DeviceEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].device_id.device_uuid.uuid == DEVICE_R1_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].device_id.device_uuid.uuid == DEVICE_R2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[3], TopologyEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[3].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[3].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[4], ContextEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[4].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -762,7 +731,7 @@ def test_grpc_link( def test_grpc_service( - context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name context_database = context_db_mb[0] @@ -781,38 +750,36 @@ def test_grpc_service( assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - response = context_client_grpc.SetDevice(Device(**DEVICE1)) - assert response.device_uuid.uuid == DEVICE1_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) + assert response.device_uuid.uuid == DEVICE_R1_UUID - response = context_client_grpc.SetDevice(Device(**DEVICE2)) - assert response.device_uuid.uuid == DEVICE2_UUID + response = context_client_grpc.SetDevice(Device(**DEVICE_R2)) + assert response.device_uuid.uuid == DEVICE_R2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + events = events_collector.get_events(block=True, count=4) - event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[2].device_id.device_uuid.uuid == DEVICE_R1_UUID + + assert isinstance(events[3], DeviceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[3].device_id.device_uuid.uuid == DEVICE_R2_UUID # ----- Get when the object does not exist ------------------------------------------------------------------------- with pytest.raises(grpc.RpcError) as e: - context_client_grpc.GetService(ServiceId(**SERVICE_DEV1_DEV2_ID)) + context_client_grpc.GetService(ServiceId(**SERVICE_R1_R2_ID)) assert e.value.code() == grpc.StatusCode.NOT_FOUND - assert e.value.details() == 'Service({:s}/{:s}) not found'.format(DEFAULT_CONTEXT_UUID, SERVICE_DEV1_DEV2_UUID) + assert e.value.details() == 'Service({:s}/{:s}) not found'.format(DEFAULT_CONTEXT_UUID, SERVICE_R1_R2_UUID) # ----- List when the object does not exist ------------------------------------------------------------------------ response = context_client_grpc.ListServiceIds(ContextId(**CONTEXT_ID)) @@ -827,51 +794,51 @@ def test_grpc_service( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 69 + assert len(db_entries) == 67 # ----- Create the object ------------------------------------------------------------------------------------------ with pytest.raises(grpc.RpcError) as e: - WRONG_SERVICE = copy.deepcopy(SERVICE_DEV1_DEV2) + WRONG_SERVICE = copy.deepcopy(SERVICE_R1_R2) WRONG_SERVICE['service_endpoint_ids'][0]\ ['topology_id']['context_id']['context_uuid']['uuid'] = 'wrong-context-uuid' context_client_grpc.SetService(Service(**WRONG_SERVICE)) assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT msg = 'request.service_endpoint_ids[0].topology_id.context_id.context_uuid.uuid(wrong-context-uuid) is invalid; '\ - 'should be == request.service_id.context_id.context_uuid.uuid(admin)' + 'should be == request.service_id.context_id.context_uuid.uuid({:s})'.format(DEFAULT_CONTEXT_UUID) assert e.value.details() == msg - response = context_client_grpc.SetService(Service(**SERVICE_DEV1_DEV2)) + response = context_client_grpc.SetService(Service(**SERVICE_R1_R2)) assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert response.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert response.service_uuid.uuid == SERVICE_R1_R2_UUID CONTEXT_WITH_SERVICE = copy.deepcopy(CONTEXT) - CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_DEV1_DEV2_ID) + CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_R1_R2_ID) response = context_client_grpc.SetContext(Context(**CONTEXT_WITH_SERVICE)) assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, ServiceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=2) - event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(events[0], ServiceEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID + + assert isinstance(events[1], ContextEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[1].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetService(Service(**SERVICE_DEV1_DEV2)) + response = context_client_grpc.SetService(Service(**SERVICE_R1_R2)) assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert response.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert response.service_uuid.uuid == SERVICE_R1_R2_UUID # ----- Check update event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) assert isinstance(event, ServiceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE assert event.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert event.service_id.service_uuid.uuid == SERVICE_R1_R2_UUID # ----- Dump state of database after create/update the object ------------------------------------------------------ db_entries = context_database.dump() @@ -879,67 +846,316 @@ def test_grpc_service( for db_entry in db_entries: LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 86 + assert len(db_entries) == 89 # ----- Get when the object exists --------------------------------------------------------------------------------- - response = context_client_grpc.GetService(ServiceId(**SERVICE_DEV1_DEV2_ID)) + response = context_client_grpc.GetService(ServiceId(**SERVICE_R1_R2_ID)) assert response.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert response.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert response.service_id.service_uuid.uuid == SERVICE_R1_R2_UUID assert response.service_type == ServiceTypeEnum.SERVICETYPE_L3NM assert len(response.service_endpoint_ids) == 2 assert len(response.service_constraints) == 2 - assert response.service_status.service_status == ServiceStatusEnum.SERVICESTATUS_ACTIVE + assert response.service_status.service_status == ServiceStatusEnum.SERVICESTATUS_PLANNED assert len(response.service_config.config_rules) == 3 # ----- List when the object exists -------------------------------------------------------------------------------- response = context_client_grpc.ListServiceIds(ContextId(**CONTEXT_ID)) assert len(response.service_ids) == 1 assert response.service_ids[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert response.service_ids[0].service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert response.service_ids[0].service_uuid.uuid == SERVICE_R1_R2_UUID response = context_client_grpc.ListServices(ContextId(**CONTEXT_ID)) assert len(response.services) == 1 assert response.services[0].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert response.services[0].service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + assert response.services[0].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID assert response.services[0].service_type == ServiceTypeEnum.SERVICETYPE_L3NM assert len(response.services[0].service_endpoint_ids) == 2 assert len(response.services[0].service_constraints) == 2 - assert response.services[0].service_status.service_status == ServiceStatusEnum.SERVICESTATUS_ACTIVE + assert response.services[0].service_status.service_status == ServiceStatusEnum.SERVICESTATUS_PLANNED assert len(response.services[0].service_config.config_rules) == 3 # ----- Remove the object ------------------------------------------------------------------------------------------ - context_client_grpc.RemoveService(ServiceId(**SERVICE_DEV1_DEV2_ID)) - context_client_grpc.RemoveDevice(DeviceId(**DEVICE1_ID)) - context_client_grpc.RemoveDevice(DeviceId(**DEVICE2_ID)) + context_client_grpc.RemoveService(ServiceId(**SERVICE_R1_R2_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R1_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R2_ID)) context_client_grpc.RemoveTopology(TopologyId(**TOPOLOGY_ID)) context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) # ----- Check remove event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) - assert isinstance(event, ServiceEvent) - assert event.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.service_id.service_uuid.uuid == SERVICE_DEV1_DEV2_UUID + events = events_collector.get_events(block=True, count=5) - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert isinstance(events[0], ServiceEvent) + assert events[0].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[0].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID - event = events_collector.get_event(block=True) - assert isinstance(event, DeviceEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.device_id.device_uuid.uuid == DEVICE2_UUID + assert isinstance(events[1], DeviceEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].device_id.device_uuid.uuid == DEVICE_R1_UUID + + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].device_id.device_uuid.uuid == DEVICE_R2_UUID + + assert isinstance(events[3], TopologyEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[3].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[3].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[4], ContextEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[4].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + # ----- Dump state of database after remove the object ------------------------------------------------------------- + db_entries = context_database.dump() + LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) + for db_entry in db_entries: + LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + LOGGER.info('-----------------------------------------------------------') + assert len(db_entries) == 0 + + +def test_grpc_connection( + context_client_grpc : ContextClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name + context_database = context_db_mb[0] + + # ----- Clean the database ----------------------------------------------------------------------------------------- + context_database.clear_all() + + # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- + events_collector = EventsCollector(context_client_grpc) + events_collector.start() + + # ----- Prepare dependencies for the test and capture related events ----------------------------------------------- + response = context_client_grpc.SetContext(Context(**CONTEXT)) + assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + response = context_client_grpc.SetTopology(Topology(**TOPOLOGY)) + assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert response.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) + assert response.device_uuid.uuid == DEVICE_R1_UUID + + response = context_client_grpc.SetDevice(Device(**DEVICE_R2)) + assert response.device_uuid.uuid == DEVICE_R2_UUID + + response = context_client_grpc.SetDevice(Device(**DEVICE_R3)) + assert response.device_uuid.uuid == DEVICE_R3_UUID + + response = context_client_grpc.SetService(Service(**SERVICE_R1_R2)) + assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert response.service_uuid.uuid == SERVICE_R1_R2_UUID + + CONTEXT_WITH_SERVICE = copy.deepcopy(CONTEXT) + CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_R1_R2_ID) + response = context_client_grpc.SetContext(Context(**CONTEXT_WITH_SERVICE)) + assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + response = context_client_grpc.SetService(Service(**SERVICE_R2_R3)) + assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert response.service_uuid.uuid == SERVICE_R2_R3_UUID + + CONTEXT_WITH_SERVICE = copy.deepcopy(CONTEXT) + CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_R2_R3_ID) + response = context_client_grpc.SetContext(Context(**CONTEXT_WITH_SERVICE)) + assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + response = context_client_grpc.SetService(Service(**SERVICE_R1_R3)) + assert response.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert response.service_uuid.uuid == SERVICE_R1_R3_UUID + + CONTEXT_WITH_SERVICE = copy.deepcopy(CONTEXT) + CONTEXT_WITH_SERVICE['service_ids'].append(SERVICE_R1_R3_ID) + response = context_client_grpc.SetContext(Context(**CONTEXT_WITH_SERVICE)) + assert response.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + events = events_collector.get_events(block=True, count=11) + + assert isinstance(events[0], ContextEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[0].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + assert isinstance(events[1], TopologyEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[1].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[2], DeviceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[2].device_id.device_uuid.uuid == DEVICE_R1_UUID + + assert isinstance(events[3], DeviceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[3].device_id.device_uuid.uuid == DEVICE_R2_UUID + + assert isinstance(events[4], DeviceEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[4].device_id.device_uuid.uuid == DEVICE_R3_UUID + + assert isinstance(events[5], ServiceEvent) + assert events[5].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[5].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[5].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID + + assert isinstance(events[6], ContextEvent) + assert events[6].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[6].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + assert isinstance(events[7], ServiceEvent) + assert events[7].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[7].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[7].service_id.service_uuid.uuid == SERVICE_R2_R3_UUID + + assert isinstance(events[8], ContextEvent) + assert events[8].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[8].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + assert isinstance(events[9], ServiceEvent) + assert events[9].event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert events[9].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[9].service_id.service_uuid.uuid == SERVICE_R1_R3_UUID + + assert isinstance(events[10], ContextEvent) + assert events[10].event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert events[10].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + + # ----- Get when the object does not exist ------------------------------------------------------------------------- + with pytest.raises(grpc.RpcError) as e: + context_client_grpc.GetConnection(ConnectionId(**CONNECTION_R1_R3_ID)) + assert e.value.code() == grpc.StatusCode.NOT_FOUND + assert e.value.details() == 'Connection({:s}) not found'.format(CONNECTION_R1_R3_UUID) + + # ----- List when the object does not exist ------------------------------------------------------------------------ + response = context_client_grpc.ListConnectionIds(ServiceId(**SERVICE_R1_R3_ID)) + assert len(response.connection_ids) == 0 + + response = context_client_grpc.ListConnections(ServiceId(**SERVICE_R1_R3_ID)) + assert len(response.connections) == 0 + + # ----- Dump state of database before create the object ------------------------------------------------------------ + db_entries = context_database.dump() + LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) + for db_entry in db_entries: + LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + LOGGER.info('-----------------------------------------------------------') + assert len(db_entries) == 150 + # ----- Create the object ------------------------------------------------------------------------------------------ + with pytest.raises(grpc.RpcError) as e: + WRONG_CONNECTION = copy.deepcopy(CONNECTION_R1_R3) + WRONG_CONNECTION['path_hops_endpoint_ids'][0]\ + ['topology_id']['context_id']['context_uuid']['uuid'] = 'wrong-context-uuid' + context_client_grpc.SetConnection(Connection(**WRONG_CONNECTION)) + assert e.value.code() == grpc.StatusCode.NOT_FOUND + # TODO: should we check that all endpoints belong to same topology? + # TODO: should we check that endpoints form links over the topology? + msg = 'EndPoint({:s}/{:s}:wrong-context-uuid/{:s}) not found'.format( + DEVICE_R1_UUID, WRONG_CONNECTION['path_hops_endpoint_ids'][0]['endpoint_uuid']['uuid'], DEFAULT_TOPOLOGY_UUID) + assert e.value.details() == msg + + response = context_client_grpc.SetConnection(Connection(**CONNECTION_R1_R3)) + assert response.connection_uuid.uuid == CONNECTION_R1_R3_UUID + + # ----- Check create event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) - assert isinstance(event, TopologyEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID - assert event.topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + assert isinstance(event, ConnectionEvent) + assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE + assert event.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID + # ----- Update the object ------------------------------------------------------------------------------------------ + response = context_client_grpc.SetConnection(Connection(**CONNECTION_R1_R3)) + assert response.connection_uuid.uuid == CONNECTION_R1_R3_UUID + + # ----- Check update event ----------------------------------------------------------------------------------------- event = events_collector.get_event(block=True) - assert isinstance(event, ContextEvent) - assert event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE - assert event.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert isinstance(event, ConnectionEvent) + assert event.event.event_type == EventTypeEnum.EVENTTYPE_UPDATE + assert event.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID + + # ----- Dump state of database after create/update the object ------------------------------------------------------ + db_entries = context_database.dump() + LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) + for db_entry in db_entries: + LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + LOGGER.info('-----------------------------------------------------------') + assert len(db_entries) == 166 + + # ----- Get when the object exists --------------------------------------------------------------------------------- + response = context_client_grpc.GetConnection(ConnectionId(**CONNECTION_R1_R3_ID)) + assert response.connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID + assert response.service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert response.service_id.service_uuid.uuid == SERVICE_R1_R3_UUID + assert len(response.path_hops_endpoint_ids) == 6 + assert len(response.sub_service_ids) == 2 + + # ----- List when the object exists -------------------------------------------------------------------------------- + response = context_client_grpc.ListConnectionIds(ServiceId(**SERVICE_R1_R3_ID)) + assert len(response.connection_ids) == 1 + assert response.connection_ids[0].connection_uuid.uuid == CONNECTION_R1_R3_UUID + + response = context_client_grpc.ListConnections(ServiceId(**SERVICE_R1_R3_ID)) + assert len(response.connections) == 1 + assert response.connections[0].connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID + assert len(response.connections[0].path_hops_endpoint_ids) == 6 + assert len(response.connections[0].sub_service_ids) == 2 + + # ----- Remove the object ------------------------------------------------------------------------------------------ + context_client_grpc.RemoveConnection(ConnectionId(**CONNECTION_R1_R3_ID)) + context_client_grpc.RemoveService(ServiceId(**SERVICE_R1_R3_ID)) + context_client_grpc.RemoveService(ServiceId(**SERVICE_R2_R3_ID)) + context_client_grpc.RemoveService(ServiceId(**SERVICE_R1_R2_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R1_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R2_ID)) + context_client_grpc.RemoveDevice(DeviceId(**DEVICE_R3_ID)) + context_client_grpc.RemoveTopology(TopologyId(**TOPOLOGY_ID)) + context_client_grpc.RemoveContext(ContextId(**CONTEXT_ID)) + + # ----- Check remove event ----------------------------------------------------------------------------------------- + events = events_collector.get_events(block=True, count=9) + + assert isinstance(events[0], ConnectionEvent) + assert events[0].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[0].connection_id.connection_uuid.uuid == CONNECTION_R1_R3_UUID + + assert isinstance(events[1], ServiceEvent) + assert events[1].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[1].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[1].service_id.service_uuid.uuid == SERVICE_R1_R3_UUID + + assert isinstance(events[2], ServiceEvent) + assert events[2].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[2].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[2].service_id.service_uuid.uuid == SERVICE_R2_R3_UUID + + assert isinstance(events[3], ServiceEvent) + assert events[3].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[3].service_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[3].service_id.service_uuid.uuid == SERVICE_R1_R2_UUID + + assert isinstance(events[4], DeviceEvent) + assert events[4].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[4].device_id.device_uuid.uuid == DEVICE_R1_UUID + + assert isinstance(events[5], DeviceEvent) + assert events[5].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[5].device_id.device_uuid.uuid == DEVICE_R2_UUID + + assert isinstance(events[6], DeviceEvent) + assert events[6].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[6].device_id.device_uuid.uuid == DEVICE_R3_UUID + + assert isinstance(events[7], TopologyEvent) + assert events[7].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[7].topology_id.context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID + assert events[7].topology_id.topology_uuid.uuid == DEFAULT_TOPOLOGY_UUID + + assert isinstance(events[8], ContextEvent) + assert events[8].event.event_type == EventTypeEnum.EVENTTYPE_REMOVE + assert events[8].context_id.context_uuid.uuid == DEFAULT_CONTEXT_UUID # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- events_collector.stop() @@ -961,8 +1177,7 @@ def test_rest_populate_database( ): database = context_db_mb[0] database.clear_all() - populate('127.0.0.1', GRPC_PORT) - + populate(LOCAL_HOST, GRPC_PORT) def test_rest_get_context_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name reply = do_rest_request('/context_ids') @@ -973,39 +1188,39 @@ def test_rest_get_contexts(context_service_rest : RestServer): # pylint: disable validate_contexts(reply) def test_rest_get_context(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) reply = do_rest_request('/context/{:s}'.format(context_uuid)) validate_context(reply) def test_rest_get_topology_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) reply = do_rest_request('/context/{:s}/topology_ids'.format(context_uuid)) validate_topology_ids(reply) def test_rest_get_topologies(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) reply = do_rest_request('/context/{:s}/topologies'.format(context_uuid)) validate_topologies(reply) def test_rest_get_topology(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') - topology_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) + topology_uuid = urllib.parse.quote(DEFAULT_TOPOLOGY_UUID) reply = do_rest_request('/context/{:s}/topology/{:s}'.format(context_uuid, topology_uuid)) validate_topology(reply, num_devices=3, num_links=3) def test_rest_get_service_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) reply = do_rest_request('/context/{:s}/service_ids'.format(context_uuid)) validate_service_ids(reply) def test_rest_get_services(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) reply = do_rest_request('/context/{:s}/services'.format(context_uuid)) validate_services(reply) def test_rest_get_service(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - context_uuid = urllib.parse.quote('admin') - service_uuid = urllib.parse.quote('SVC:DEV1/EP100-DEV2/EP100', safe='') + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) + service_uuid = urllib.parse.quote(SERVICE_R1_R2_UUID, safe='') reply = do_rest_request('/context/{:s}/service/{:s}'.format(context_uuid, service_uuid)) validate_service(reply) @@ -1018,7 +1233,7 @@ def test_rest_get_devices(context_service_rest : RestServer): # pylint: disable= validate_devices(reply) def test_rest_get_device(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - device_uuid = urllib.parse.quote('DEV1', safe='') + device_uuid = urllib.parse.quote(DEVICE_R1_UUID, safe='') reply = do_rest_request('/device/{:s}'.format(device_uuid)) validate_device(reply) @@ -1031,10 +1246,27 @@ def test_rest_get_links(context_service_rest : RestServer): # pylint: disable=re validate_links(reply) def test_rest_get_link(context_service_rest : RestServer): # pylint: disable=redefined-outer-name - link_uuid = urllib.parse.quote('DEV1/EP2 ==> DEV2/EP1', safe='') + link_uuid = urllib.parse.quote(LINK_R1_R2_UUID, safe='') reply = do_rest_request('/link/{:s}'.format(link_uuid)) validate_link(reply) +def test_rest_get_connection_ids(context_service_rest : RestServer): # pylint: disable=redefined-outer-name + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) + service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='') + reply = do_rest_request('/context/{:s}/service/{:s}/connection_ids'.format(context_uuid, service_uuid)) + validate_connection_ids(reply) + +def test_rest_get_connections(context_service_rest : RestServer): # pylint: disable=redefined-outer-name + context_uuid = urllib.parse.quote(DEFAULT_CONTEXT_UUID) + service_uuid = urllib.parse.quote(SERVICE_R1_R3_UUID, safe='') + reply = do_rest_request('/context/{:s}/service/{:s}/connections'.format(context_uuid, service_uuid)) + validate_connections(reply) + +def test_rest_get_connection(context_service_rest : RestServer): # pylint: disable=redefined-outer-name + connection_uuid = urllib.parse.quote(CONNECTION_R1_R3_UUID, safe='') + reply = do_rest_request('/connection/{:s}'.format(connection_uuid)) + validate_connection(reply) + # ----- Test misc. Context internal tools ------------------------------------------------------------------------------ diff --git a/src/dbscanserving/.gitlab-ci.yml b/src/dbscanserving/.gitlab-ci.yml index de704cf861f82e8e3a976461db6658d7ad2e888a..fd0d66bac25bbb5417a9f90415f3d0732312516b 100644 --- a/src/dbscanserving/.gitlab-ci.yml +++ b/src/dbscanserving/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # build, tag and push the Docker image to the gitlab registry build dbscanserving: variables: @@ -10,8 +24,8 @@ build dbscanserving: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - # after_script: - # - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' @@ -20,7 +34,7 @@ build dbscanserving: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAME.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # apply unit test to the dbscanserving component @@ -37,12 +51,15 @@ unit test dbscanserving: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 10006:10006 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 10006:10006 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - #- docker rm -f $IMAGE_NAME + - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' @@ -52,8 +69,12 @@ unit test dbscanserving: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the dbscanserving service in Kubernetes Cluster @@ -69,7 +90,7 @@ deploy dbscanserving: - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAME.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/dbscanserving/Config.py b/src/dbscanserving/Config.py index ec89bbb0f8b37539e06f9cc101c0f461a3bc2a82..6604abe6cda5bd203621de9f09f48ca5f6c8256e 100644 --- a/src/dbscanserving/Config.py +++ b/src/dbscanserving/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings diff --git a/src/dbscanserving/Dockerfile b/src/dbscanserving/Dockerfile index aa62cbe93cb008085762abbe0ddaae5a31f0fb73..31cf21b0ea8da830b72c726ee3e63dd1bc61d094 100644 --- a/src/dbscanserving/Dockerfile +++ b/src/dbscanserving/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + FROM python:3-slim # Install dependencies diff --git a/src/dbscanserving/__init__.py b/src/dbscanserving/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/dbscanserving/__init__.py +++ b/src/dbscanserving/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dbscanserving/client/DbscanServingClient.py b/src/dbscanserving/client/DbscanServingClient.py index 4d6614b5dc44c2b916fb298217fef4a8f1b8e72c..286b3318e7568f3edcfff9032c30b1244d826533 100644 --- a/src/dbscanserving/client/DbscanServingClient.py +++ b/src/dbscanserving/client/DbscanServingClient.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse @@ -6,6 +20,7 @@ from dbscanserving.proto.dbscanserving_pb2_grpc import DetectorStub LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class DbscanServingClient: def __init__(self, address, port): @@ -25,7 +40,7 @@ class DbscanServingClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def Detect(self, request : DetectionRequest) -> DetectionResponse: LOGGER.debug('Detect request: {:s}'.format(str(request))) response = self.stub.Detect(request) diff --git a/src/dbscanserving/client/__init__.py b/src/dbscanserving/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/dbscanserving/client/__init__.py +++ b/src/dbscanserving/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dbscanserving/genproto.sh b/src/dbscanserving/genproto.sh index d44156c2f327fe2344cb17d59fa51b3ead9bc43b..6c480c673d4081a4e7db1c2ff9741208794ddedd 100755 --- a/src/dbscanserving/genproto.sh +++ b/src/dbscanserving/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__init__.py << EOF > /dev/null +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +EOF # building current service protos python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto dbscanserving.proto diff --git a/src/dbscanserving/proto/__init__.py b/src/dbscanserving/proto/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/dbscanserving/proto/__init__.py +++ b/src/dbscanserving/proto/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dbscanserving/proto/dbscanserving_pb2.py b/src/dbscanserving/proto/dbscanserving_pb2.py index b5e464db4db39c2d3f6a5530c5d702e4bf25b8a0..f2d6c37c7c567394d3b12392a1fa4e0f748f6625 100644 --- a/src/dbscanserving/proto/dbscanserving_pb2.py +++ b/src/dbscanserving/proto/dbscanserving_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x13\x64\x62scanserving.proto\x12\rdbscanserving\"\x1a\n\x06Sample\x12\x10\n\x08\x66\x65\x61tures\x18\x01 \x03(\x02\"\xd6\x01\n\x10\x44\x65tectionRequest\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x02\x12\x13\n\x0bmin_samples\x18\x02 \x01(\x05\x12%\n\x06metric\x18\x03 \x01(\x0e\x32\x15.dbscanserving.Metric\x12\x13\n\x0bnum_samples\x18\x04 \x01(\x05\x12\x14\n\x0cnum_features\x18\x05 \x01(\x05\x12&\n\x07samples\x18\x06 \x03(\x0b\x32\x15.dbscanserving.Sample\x12\x17\n\nidentifier\x18\x07 \x01(\x05H\x00\x88\x01\x01\x42\r\n\x0b_identifier\",\n\x11\x44\x65tectionResponse\x12\x17\n\x0f\x63luster_indices\x18\x01 \x03(\x05*\x17\n\x06Metric\x12\r\n\tEUCLIDEAN\x10\x00\x32W\n\x08\x44\x65tector\x12K\n\x06\x44\x65tect\x12\x1f.dbscanserving.DetectionRequest\x1a .dbscanserving.DetectionResponseb\x06proto3' + serialized_pb=b'\n\x13\x64\x62scanserving.proto\x12\rdbscanserving\"\x1a\n\x06Sample\x12\x10\n\x08\x66\x65\x61tures\x18\x01 \x03(\x02\"\xc2\x01\n\x10\x44\x65tectionRequest\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x02\x12\x13\n\x0bmin_samples\x18\x02 \x01(\x05\x12%\n\x06metric\x18\x03 \x01(\x0e\x32\x15.dbscanserving.Metric\x12\x13\n\x0bnum_samples\x18\x04 \x01(\x05\x12\x14\n\x0cnum_features\x18\x05 \x01(\x05\x12&\n\x07samples\x18\x06 \x03(\x0b\x32\x15.dbscanserving.Sample\x12\x12\n\nidentifier\x18\x07 \x01(\x05\",\n\x11\x44\x65tectionResponse\x12\x17\n\x0f\x63luster_indices\x18\x01 \x03(\x05*\x17\n\x06Metric\x12\r\n\tEUCLIDEAN\x10\x00\x32W\n\x08\x44\x65tector\x12K\n\x06\x44\x65tect\x12\x1f.dbscanserving.DetectionRequest\x1a .dbscanserving.DetectionResponseb\x06proto3' ) _METRIC = _descriptor.EnumDescriptor( @@ -38,8 +38,8 @@ _METRIC = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=329, - serialized_end=352, + serialized_start=309, + serialized_end=332, ) _sym_db.RegisterEnumDescriptor(_METRIC) @@ -148,14 +148,9 @@ _DETECTIONREQUEST = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='_identifier', full_name='dbscanserving.DetectionRequest._identifier', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], serialized_start=67, - serialized_end=281, + serialized_end=261, ) @@ -186,15 +181,12 @@ _DETECTIONRESPONSE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=283, - serialized_end=327, + serialized_start=263, + serialized_end=307, ) _DETECTIONREQUEST.fields_by_name['metric'].enum_type = _METRIC _DETECTIONREQUEST.fields_by_name['samples'].message_type = _SAMPLE -_DETECTIONREQUEST.oneofs_by_name['_identifier'].fields.append( - _DETECTIONREQUEST.fields_by_name['identifier']) -_DETECTIONREQUEST.fields_by_name['identifier'].containing_oneof = _DETECTIONREQUEST.oneofs_by_name['_identifier'] DESCRIPTOR.message_types_by_name['Sample'] = _SAMPLE DESCRIPTOR.message_types_by_name['DetectionRequest'] = _DETECTIONREQUEST DESCRIPTOR.message_types_by_name['DetectionResponse'] = _DETECTIONRESPONSE @@ -231,8 +223,8 @@ _DETECTOR = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=354, - serialized_end=441, + serialized_start=334, + serialized_end=421, methods=[ _descriptor.MethodDescriptor( name='Detect', diff --git a/src/dbscanserving/requirements.in b/src/dbscanserving/requirements.in index b4272e5c4e709f5893c0e750d263fc24b7be4f7d..56f9e0673f4899ea9b4d6abcba5e13d005454b13 100644 --- a/src/dbscanserving/requirements.in +++ b/src/dbscanserving/requirements.in @@ -3,4 +3,5 @@ prometheus-client pytest pytest-benchmark grpcio -scikit-learn \ No newline at end of file +scikit-learn +coverage \ No newline at end of file diff --git a/src/dbscanserving/service/DbscanService.py b/src/dbscanserving/service/DbscanService.py index 43336ab089b6848971cda4e79e4da7aa26c1ca65..97654fa30532d2544cfdbbc9260b049f293ed395 100644 --- a/src/dbscanserving/service/DbscanService.py +++ b/src/dbscanserving/service/DbscanService.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc import logging from concurrent import futures diff --git a/src/dbscanserving/service/DbscanServiceServicerImpl.py b/src/dbscanserving/service/DbscanServiceServicerImpl.py index 251b3eb1ad4c5e51eb80207ce5036351ea65572f..5560eec1e333c16c0ea980a5af14e856c3909431 100644 --- a/src/dbscanserving/service/DbscanServiceServicerImpl.py +++ b/src/dbscanserving/service/DbscanServiceServicerImpl.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, grpc, logging from sklearn.cluster import DBSCAN from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method diff --git a/src/dbscanserving/service/__init__.py b/src/dbscanserving/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/dbscanserving/service/__init__.py +++ b/src/dbscanserving/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dbscanserving/service/__main__.py b/src/dbscanserving/service/__main__.py index bc3f1c681fe88d723d36a28bff64c0e6b04fd089..cad074a409af9e3106d84c81d3f20c6e6d9b1274 100644 --- a/src/dbscanserving/service/__main__.py +++ b/src/dbscanserving/service/__main__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, logging, signal, sys, time, threading, multiprocessing from prometheus_client import start_http_server from common.Settings import get_setting diff --git a/src/dbscanserving/tests/__init__.py b/src/dbscanserving/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/dbscanserving/tests/__init__.py +++ b/src/dbscanserving/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dbscanserving/tests/test_unitary.py b/src/dbscanserving/tests/test_unitary.py index 061d2f07d2e1a6876318214a909a26140c98197d..8198c9e215d13cfee62bc7ee13a0daa8224f37a5 100644 --- a/src/dbscanserving/tests/test_unitary.py +++ b/src/dbscanserving/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import random, logging, pytest, numpy from dbscanserving.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from dbscanserving.client.DbscanServingClient import DbscanServingClient diff --git a/src/device/.gitlab-ci.yml b/src/device/.gitlab-ci.yml index 8656e01fede917d6a6ef13d0c0cb5fac618c444c..3da19e7a38c9659fb8c86afd7beaefc7e08a6d7c 100644 --- a/src/device/.gitlab-ci.yml +++ b/src/device/.gitlab-ci.yml @@ -1,4 +1,18 @@ -# Build, tag and push the Docker image to the GitLab registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build device: variables: IMAGE_NAME: 'device' # name of the microservice @@ -7,19 +21,21 @@ build device: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -# after_script: -# - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -36,23 +52,32 @@ unit test device: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 2020:2020 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 2020:2020 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary_emulated.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy device: @@ -64,10 +89,10 @@ deploy device: - unit test device # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/device/Config.py b/src/device/Config.py index 753f4b57b2767552317882e72622c613f40e3ea2..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/Config.py +++ b/src/device/Config.py @@ -1,18 +1,14 @@ -import logging +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 2020 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 - -# Dependency micro-service connection settings -CONTEXT_SERVICE_HOST = '127.0.0.1' -CONTEXT_SERVICE_PORT = 1010 -MONITORING_SERVICE_HOST = '127.0.0.1' -MONITORING_SERVICE_PORT = 7070 diff --git a/src/device/Dockerfile b/src/device/Dockerfile index 70e3c8dcbbc6b78a53b468e51034ffb8e69f8e53..ad513d965d03102834230f709267bcf7ece321d8 100644 --- a/src/device/Dockerfile +++ b/src/device/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,24 +28,43 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/device +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY device/requirements.in device/requirements.in -RUN pip-compile --output-file=device/requirements.txt device/requirements.in -RUN python3 -m pip install -r device/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY context/. context -COPY device/. device -COPY monitoring/. monitoring +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/device +WORKDIR /var/teraflow/device +COPY src/device/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/monitoring/. monitoring/ -# Start device service +# Start the service ENTRYPOINT ["python", "-m", "device.service"] diff --git a/src/device/__init__.py b/src/device/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/__init__.py +++ b/src/device/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/client/DeviceClient.py b/src/device/client/DeviceClient.py index 7c5fa0ca2561a429d240b36f38357a874b882aa8..875496cbb6c5f85452bb8a2427288c6bdf13669d 100644 --- a/src/device/client/DeviceClient.py +++ b/src/device/client/DeviceClient.py @@ -1,16 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Device, DeviceConfig, DeviceId, Empty +from common.proto.device_pb2 import MonitoringSettings +from common.proto.device_pb2_grpc import DeviceServiceStub from common.tools.client.RetryDecorator import retry, delay_exponential -from device.proto.context_pb2 import Device, DeviceConfig, DeviceId, Empty -from device.proto.device_pb2 import MonitoringSettings -from device.proto.device_pb2_grpc import DeviceServiceStub +from common.tools.grpc.Tools import grpc_message_to_json_string LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class DeviceClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.DEVICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.DEVICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None @@ -26,37 +46,37 @@ class DeviceClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def AddDevice(self, request : Device) -> DeviceId: - LOGGER.debug('AddDevice request: {:s}'.format(str(request))) + LOGGER.debug('AddDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.AddDevice(request) - LOGGER.debug('AddDevice result: {:s}'.format(str(response))) + LOGGER.debug('AddDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ConfigureDevice(self, request : Device) -> DeviceId: - LOGGER.debug('ConfigureDevice request: {:s}'.format(str(request))) + LOGGER.debug('ConfigureDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.ConfigureDevice(request) - LOGGER.debug('ConfigureDevice result: {:s}'.format(str(response))) + LOGGER.debug('ConfigureDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def DeleteDevice(self, request : DeviceId) -> Empty: - LOGGER.debug('DeleteDevice request: {:s}'.format(str(request))) + LOGGER.debug('DeleteDevice request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteDevice(request) - LOGGER.debug('DeleteDevice result: {:s}'.format(str(response))) + LOGGER.debug('DeleteDevice result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetInitialConfig(self, request : DeviceId) -> DeviceConfig: - LOGGER.debug('GetInitialConfig request: {:s}'.format(str(request))) + LOGGER.debug('GetInitialConfig request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.GetInitialConfig(request) - LOGGER.debug('GetInitialConfig result: {:s}'.format(str(response))) + LOGGER.debug('GetInitialConfig result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def MonitorDeviceKpi(self, request : MonitoringSettings) -> Empty: - LOGGER.debug('MonitorDeviceKpi request: {:s}'.format(str(request))) + LOGGER.debug('MonitorDeviceKpi request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.MonitorDeviceKpi(request) - LOGGER.debug('MonitorDeviceKpi result: {:s}'.format(str(response))) + LOGGER.debug('MonitorDeviceKpi result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/device/client/__init__.py b/src/device/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/client/__init__.py +++ b/src/device/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/genproto.sh b/src/device/genproto.sh deleted file mode 100755 index 31632fb894f3ede9582063d81b1911fe2551d96d..0000000000000000000000000000000000000000 --- a/src/device/genproto.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto device.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto - -rm proto/context_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py -rm proto/monitoring_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/device_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/device_pb2_grpc.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py diff --git a/src/device/proto/__init__.py b/src/device/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/device/proto/context_pb2.py b/src/device/proto/context_pb2.py deleted file mode 100644 index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..0000000000000000000000000000000000000000 --- a/src/device/proto/context_pb2.py +++ /dev/null @@ -1,2545 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3552, - serialized_end=3658, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3661, - serialized_end=3858, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3861, - serialized_end=4004, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4007, - serialized_end=4136, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4139, - serialized_end=4275, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4277, - serialized_end=4370, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2605, - serialized_end=2735, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2738, - serialized_end=2872, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2874, - serialized_end=2975, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2977, - serialized_end=3040, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3042, - serialized_end=3096, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3099, - serialized_end=3240, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3242, - serialized_end=3307, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3309, - serialized_end=3367, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3369, - serialized_end=3463, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3550, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/device/proto/device_pb2.py b/src/device/proto/device_pb2.py deleted file mode 100644 index 4d4dbb82567256dd79595884f0ed9c2f13498d31..0000000000000000000000000000000000000000 --- a/src/device/proto/device_pb2.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: device.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='device.proto', - package='device', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\rcontext.proto\x1a\x10monitoring.proto\"\xa4\x01\n\x12MonitoringSettings\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x31\n\x0ekpi_descriptor\x18\x02 \x01(\x0b\x32\x19.monitoring.KpiDescriptor\x12\x1b\n\x13sampling_duration_s\x18\x03 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x04 \x01(\x02\x32\xb2\x02\n\rDeviceService\x12\x31\n\tAddDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x37\n\x0f\x43onfigureDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12>\n\x10GetInitialConfig\x12\x11.context.DeviceId\x1a\x15.context.DeviceConfig\"\x00\x12@\n\x10MonitorDeviceKpi\x12\x1a.device.MonitoringSettings\x1a\x0e.context.Empty\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) - - - - -_MONITORINGSETTINGS = _descriptor.Descriptor( - name='MonitoringSettings', - full_name='device.MonitoringSettings', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='device.MonitoringSettings.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_descriptor', full_name='device.MonitoringSettings.kpi_descriptor', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='device.MonitoringSettings.sampling_duration_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='device.MonitoringSettings.sampling_interval_s', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=58, - serialized_end=222, -) - -_MONITORINGSETTINGS.fields_by_name['kpi_id'].message_type = monitoring__pb2._KPIID -_MONITORINGSETTINGS.fields_by_name['kpi_descriptor'].message_type = monitoring__pb2._KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitoringSettings'] = _MONITORINGSETTINGS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -MonitoringSettings = _reflection.GeneratedProtocolMessageType('MonitoringSettings', (_message.Message,), { - 'DESCRIPTOR' : _MONITORINGSETTINGS, - '__module__' : 'device_pb2' - # @@protoc_insertion_point(class_scope:device.MonitoringSettings) - }) -_sym_db.RegisterMessage(MonitoringSettings) - - - -_DEVICESERVICE = _descriptor.ServiceDescriptor( - name='DeviceService', - full_name='device.DeviceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=225, - serialized_end=531, - methods=[ - _descriptor.MethodDescriptor( - name='AddDevice', - full_name='device.DeviceService.AddDevice', - index=0, - containing_service=None, - input_type=context__pb2._DEVICE, - output_type=context__pb2._DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ConfigureDevice', - full_name='device.DeviceService.ConfigureDevice', - index=1, - containing_service=None, - input_type=context__pb2._DEVICE, - output_type=context__pb2._DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteDevice', - full_name='device.DeviceService.DeleteDevice', - index=2, - containing_service=None, - input_type=context__pb2._DEVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInitialConfig', - full_name='device.DeviceService.GetInitialConfig', - index=3, - containing_service=None, - input_type=context__pb2._DEVICEID, - output_type=context__pb2._DEVICECONFIG, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorDeviceKpi', - full_name='device.DeviceService.MonitorDeviceKpi', - index=4, - containing_service=None, - input_type=_MONITORINGSETTINGS, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_DEVICESERVICE) - -DESCRIPTOR.services_by_name['DeviceService'] = _DEVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/device/proto/device_pb2_grpc.py b/src/device/proto/device_pb2_grpc.py deleted file mode 100644 index 2b9bfc47da3b33b632ff46a8454496a499305a6c..0000000000000000000000000000000000000000 --- a/src/device/proto/device_pb2_grpc.py +++ /dev/null @@ -1,199 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 -from . import device_pb2 as device__pb2 - - -class DeviceServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AddDevice = channel.unary_unary( - '/device.DeviceService/AddDevice', - request_serializer=context__pb2.Device.SerializeToString, - response_deserializer=context__pb2.DeviceId.FromString, - ) - self.ConfigureDevice = channel.unary_unary( - '/device.DeviceService/ConfigureDevice', - request_serializer=context__pb2.Device.SerializeToString, - response_deserializer=context__pb2.DeviceId.FromString, - ) - self.DeleteDevice = channel.unary_unary( - '/device.DeviceService/DeleteDevice', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetInitialConfig = channel.unary_unary( - '/device.DeviceService/GetInitialConfig', - request_serializer=context__pb2.DeviceId.SerializeToString, - response_deserializer=context__pb2.DeviceConfig.FromString, - ) - self.MonitorDeviceKpi = channel.unary_unary( - '/device.DeviceService/MonitorDeviceKpi', - request_serializer=device__pb2.MonitoringSettings.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - - -class DeviceServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def AddDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ConfigureDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteDevice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetInitialConfig(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def MonitorDeviceKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_DeviceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'AddDevice': grpc.unary_unary_rpc_method_handler( - servicer.AddDevice, - request_deserializer=context__pb2.Device.FromString, - response_serializer=context__pb2.DeviceId.SerializeToString, - ), - 'ConfigureDevice': grpc.unary_unary_rpc_method_handler( - servicer.ConfigureDevice, - request_deserializer=context__pb2.Device.FromString, - response_serializer=context__pb2.DeviceId.SerializeToString, - ), - 'DeleteDevice': grpc.unary_unary_rpc_method_handler( - servicer.DeleteDevice, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetInitialConfig': grpc.unary_unary_rpc_method_handler( - servicer.GetInitialConfig, - request_deserializer=context__pb2.DeviceId.FromString, - response_serializer=context__pb2.DeviceConfig.SerializeToString, - ), - 'MonitorDeviceKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorDeviceKpi, - request_deserializer=device__pb2.MonitoringSettings.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'device.DeviceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class DeviceService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def AddDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/device.DeviceService/AddDevice', - context__pb2.Device.SerializeToString, - context__pb2.DeviceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ConfigureDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/device.DeviceService/ConfigureDevice', - context__pb2.Device.SerializeToString, - context__pb2.DeviceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteDevice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/device.DeviceService/DeleteDevice', - context__pb2.DeviceId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetInitialConfig(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/device.DeviceService/GetInitialConfig', - context__pb2.DeviceId.SerializeToString, - context__pb2.DeviceConfig.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def MonitorDeviceKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/device.DeviceService/MonitorDeviceKpi', - device__pb2.MonitoringSettings.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/device/proto/kpi_sample_types_pb2.py b/src/device/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/device/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/device/proto/monitoring_pb2.py b/src/device/proto/monitoring_pb2.py deleted file mode 100644 index b313ebb68f0da37a540898e8c362fd204a799076..0000000000000000000000000000000000000000 --- a/src/device/proto/monitoring_pb2.py +++ /dev/null @@ -1,452 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\x1a\x16kpi_sample_types.proto\"\xda\x01\n\rKpiDescriptor\x12\x17\n\x0fkpi_description\x18\x01 \x01(\t\x12\x38\n\x0fkpi_sample_type\x18\x02 \x01(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\x12$\n\tdevice_id\x18\x03 \x01(\x0b\x32\x11.context.DeviceId\x12(\n\x0b\x65ndpoint_id\x18\x04 \x01(\x0b\x32\x13.context.EndPointId\x12&\n\nservice_id\x18\x05 \x01(\x0b\x32\x12.context.ServiceId\"p\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x1b\n\x13sampling_duration_s\x18\x02 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x03 \x01(\x02\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"d\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"a\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x12\n\x08\x66loatVal\x18\x02 \x01(\x02H\x00\x12\x13\n\tstringVal\x18\x03 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x04 \x01(\x08H\x00\x42\x07\n\x05value\",\n\x07KpiList\x12!\n\x08kpi_list\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi2\xf3\x02\n\x11MonitoringService\x12;\n\tCreateKpi\x12\x19.monitoring.KpiDescriptor\x1a\x11.monitoring.KpiId\"\x00\x12\x42\n\x10GetKpiDescriptor\x12\x11.monitoring.KpiId\x1a\x19.monitoring.KpiDescriptor\"\x00\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,kpi__sample__types__pb2.DESCRIPTOR,]) - - - - -_KPIDESCRIPTOR = _descriptor.Descriptor( - name='KpiDescriptor', - full_name='monitoring.KpiDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_description', full_name='monitoring.KpiDescriptor.kpi_description', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.KpiDescriptor.kpi_sample_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.KpiDescriptor.device_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='monitoring.KpiDescriptor.endpoint_id', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='monitoring.KpiDescriptor.service_id', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=72, - serialized_end=290, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='monitoring.MonitorKpiRequest.sampling_duration_s', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='monitoring.MonitorKpiRequest.sampling_interval_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=292, - serialized_end=404, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=406, - serialized_end=444, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=546, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='floatVal', full_name='monitoring.KpiValue.floatVal', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='boolVal', full_name='monitoring.KpiValue.boolVal', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=548, - serialized_end=645, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_list', full_name='monitoring.KpiList.kpi_list', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=647, - serialized_end=691, -) - -_KPIDESCRIPTOR.fields_by_name['kpi_sample_type'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_KPIDESCRIPTOR.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIDESCRIPTOR.fields_by_name['endpoint_id'].message_type = context__pb2._ENDPOINTID -_KPIDESCRIPTOR.fields_by_name['service_id'].message_type = context__pb2._SERVICEID -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['floatVal']) -_KPIVALUE.fields_by_name['floatVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPILIST.fields_by_name['kpi_list'].message_type = _KPI -DESCRIPTOR.message_types_by_name['KpiDescriptor'] = _KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -KpiDescriptor = _reflection.GeneratedProtocolMessageType('KpiDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _KPIDESCRIPTOR, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) - }) -_sym_db.RegisterMessage(KpiDescriptor) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=694, - serialized_end=1065, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_KPIDESCRIPTOR, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetKpiDescriptor', - full_name='monitoring.MonitoringService.GetKpiDescriptor', - index=1, - containing_service=None, - input_type=_KPIID, - output_type=_KPIDESCRIPTOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=2, - containing_service=None, - input_type=_KPI, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=3, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/device/requirements.in b/src/device/requirements.in index 5c38e92914207bf101ebc00b2cef453a3a85f82a..10506fbd42c5b7a64afb3cc7c6ea32e0f1fa49f6 100644 --- a/src/device/requirements.in +++ b/src/device/requirements.in @@ -1,14 +1,18 @@ -anytree -apscheduler -fastcache -grpcio-health-checking -grpcio -Jinja2 -netconf-client #1.7.3 -prometheus-client -pytest -pytest-benchmark -python-json-logger -pytz -redis -xmltodict +anytree==2.8.0 +APScheduler==3.8.1 +fastcache==1.1.0 +Jinja2==3.0.3 +ncclient==0.6.13 +p4runtime==1.3.0 +paramiko==2.9.2 +python-json-logger==2.0.2 +pytz==2021.3 +redis==4.1.2 +requests==2.27.1 +xmltodict==0.12.0 + +# pip's dependency resolver does not take into account installed packages. +# p4runtime does not specify the version of grpcio/protobuf it needs, so it tries to install latest one +# adding here again grpcio==1.47.* and protobuf==3.20.* with explicit versions to prevent collisions +grpcio==1.47.* +protobuf==3.20.* diff --git a/src/device/service/DeviceService.py b/src/device/service/DeviceService.py index 11cb8d3e39236002ee7ca6471c69112bbcfa059a..4dc2b01000d8ca6dd2b3ecee0b0f867338636c73 100644 --- a/src/device/service/DeviceService.py +++ b/src/device/service/DeviceService.py @@ -1,73 +1,40 @@ -import grpc, logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc from common.orm.backend.BackendEnum import BackendEnum from common.orm.Database import Database from common.orm.Factory import get_database_backend -from context.client.ContextClient import ContextClient -from device.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from device.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server -from monitoring.client.monitoring_client import MonitoringClient +from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService from .driver_api.DriverInstanceCache import DriverInstanceCache from .DeviceServiceServicerImpl import DeviceServiceServicerImpl from .MonitoringLoops import MonitoringLoops -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class DeviceService: - def __init__( - self, context_client : ContextClient, monitoring_client : MonitoringClient, - driver_instance_cache : DriverInstanceCache, - address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD): - - self.context_client = context_client - self.monitoring_client = monitoring_client - self.driver_instance_cache = driver_instance_cache - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.device_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - self.database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) - self.monitoring_loops = MonitoringLoops(monitoring_client, self.database) - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) +class DeviceService(GenericGrpcService): + def __init__(self, driver_instance_cache : DriverInstanceCache, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.DEVICE) + super().__init__(port, cls_name=cls_name) + database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) + self.monitoring_loops = MonitoringLoops(database) + self.device_servicer = DeviceServiceServicerImpl(database, driver_instance_cache, self.monitoring_loops) + def install_servicers(self): self.monitoring_loops.start() - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.device_servicer = DeviceServiceServicerImpl( - self.context_client, self.database, self.driver_instance_cache, self.monitoring_loops) add_DeviceServiceServicer_to_server(self.device_servicer, self.server) - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) + super().stop() self.monitoring_loops.stop() - LOGGER.debug('Service stopped') diff --git a/src/device/service/DeviceServiceServicerImpl.py b/src/device/service/DeviceServiceServicerImpl.py index e72b4b610b8a718fcc726e38db09a7b0d8ced089..6189816bcd35dd973e4a7da389f256bdb685a79f 100644 --- a/src/device/service/DeviceServiceServicerImpl.py +++ b/src/device/service/DeviceServiceServicerImpl.py @@ -1,18 +1,30 @@ -import grpc, json, logging -from typing import Any, List, Tuple -from google.protobuf.json_format import MessageToDict +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, json, logging, re +from typing import Any, Dict, List, Tuple from common.orm.Database import Database from common.orm.HighLevel import get_object, update_or_create_object from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceConfig, DeviceId, Empty +from common.proto.device_pb2 import MonitoringSettings +from common.proto.device_pb2_grpc import DeviceServiceServicer +from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException, OperationFailedException +from common.tools.grpc.Tools import grpc_message_to_json from context.client.ContextClient import ContextClient -from context.proto.kpi_sample_types_pb2 import KpiSampleType -from device.proto.context_pb2 import ConfigActionEnum, Device, DeviceConfig, DeviceId, Empty -from device.proto.device_pb2 import MonitoringSettings -from device.proto.device_pb2_grpc import DeviceServiceServicer -from device.service.database.RelationModels import EndPointMonitorKpiModel -from .MonitoringLoops import MonitoringLoops from .database.ConfigModel import ( ConfigModel, ConfigRuleModel, ORM_ConfigActionEnum, get_config_rules, grpc_config_rules_to_raw, update_config) from .database.DatabaseTools import ( @@ -22,10 +34,12 @@ from .database.DeviceModel import DeviceModel, DriverModel from .database.EndPointModel import EndPointModel, EndPointMonitorModel from .database.KpiModel import KpiModel from .database.KpiSampleType import ORM_KpiSampleTypeEnum, grpc_to_enum__kpi_sample_type +from .database.RelationModels import EndPointMonitorKpiModel from .driver_api._Driver import _Driver, RESOURCE_ENDPOINTS #, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES from .driver_api.DriverInstanceCache import DriverInstanceCache from .driver_api.Tools import ( check_delete_errors, check_set_errors, check_subscribe_errors, check_unsubscribe_errors) +from .MonitoringLoops import MonitoringLoops LOGGER = logging.getLogger(__name__) @@ -35,11 +49,10 @@ METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) class DeviceServiceServicerImpl(DeviceServiceServicer): def __init__( - self, context_client : ContextClient, database : Database, driver_instance_cache : DriverInstanceCache, - monitoring_loops : MonitoringLoops): - + self, database : Database, driver_instance_cache : DriverInstanceCache, monitoring_loops : MonitoringLoops + ) -> None: LOGGER.debug('Creating Servicer...') - self.context_client = context_client + self.context_client = ContextClient() self.database = database self.driver_instance_cache = driver_instance_cache self.monitoring_loops = monitoring_loops @@ -54,17 +67,18 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): unexpected_config_rules = [] for config_rule in request.device_config.config_rules: if (config_rule.action == ConfigActionEnum.CONFIGACTION_SET) and \ - (config_rule.resource_key.startswith('_connect/')): - connection_config_rules[config_rule.resource_key.replace('_connect/', '')] = config_rule.resource_value + (config_rule.WhichOneof('config_rule') == 'custom') and \ + (config_rule.custom.resource_key.startswith('_connect/')): + connection_config_rules[ + config_rule.custom.resource_key.replace('_connect/', '') + ] = config_rule.custom.resource_value else: unexpected_config_rules.append(config_rule) if len(unexpected_config_rules) > 0: - unexpected_config_rules = MessageToDict( - request.device_config, including_default_value_fields=True, - preserving_proto_field_name=True, use_integers_for_enums=True) + unexpected_config_rules = grpc_message_to_json(request.device_config) unexpected_config_rules = unexpected_config_rules['config_rules'] unexpected_config_rules = list(filter( - lambda cr: cr['resource_key'].replace('_connect/', '') not in connection_config_rules, + lambda cr: cr.get('custom', {})['resource_key'].replace('_connect/', '') not in connection_config_rules, unexpected_config_rules)) str_unexpected_config_rules = json.dumps(unexpected_config_rules, sort_keys=True) raise InvalidArgumentException( @@ -73,19 +87,17 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): 'with "_connect/" tag. Others should be configured after adding the device.') if len(request.device_endpoints) > 0: - unexpected_endpoints = MessageToDict( - request.device_endpoints, including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=True) + unexpected_endpoints = [] + for device_endpoint in request.device_endpoints: + unexpected_endpoints.append(grpc_message_to_json(device_endpoint)) str_unexpected_endpoints = json.dumps(unexpected_endpoints, sort_keys=True) raise InvalidArgumentException( 'device.device_endpoints', str_unexpected_endpoints, - extra_details='RPC method AddDevice does not accept endpoints. Endpoints are discovered through '\ + extra_details='RPC method AddDevice does not accept Endpoints. Endpoints are discovered through '\ 'interrogation of the physical device.') # Remove device configuration - json_request = MessageToDict( - request, including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=True) + json_request = grpc_message_to_json(request, use_integers_for_enums=True) json_request['device_config'] = {} request = Device(**json_request) @@ -109,32 +121,42 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): driver.Connect() endpoints = driver.GetConfig([RESOURCE_ENDPOINTS]) - #LOGGER.info('[AddDevice] endpoints = {:s}'.format(str(endpoints))) - for resource_key, resource_value in endpoints: - endpoint_uuid = resource_value.get('uuid') - endpoint_type = resource_value.get('type') - str_endpoint_key = key_to_str([device_uuid, endpoint_uuid]) - db_endpoint, _ = update_or_create_object( - self.database, EndPointModel, str_endpoint_key, { - 'device_fk' : db_device, - 'endpoint_uuid': endpoint_uuid, - 'endpoint_type': endpoint_type, - 'resource_key' : resource_key, - }) - sample_types = resource_value.get('sample_types', {}) - for sample_type, monitor_resource_key in sample_types.items(): - str_endpoint_monitor_key = key_to_str([str_endpoint_key, str(sample_type)]) - update_or_create_object(self.database, EndPointMonitorModel, str_endpoint_monitor_key, { - 'endpoint_fk' : db_endpoint, - 'resource_key' : monitor_resource_key, - 'kpi_sample_type': grpc_to_enum__kpi_sample_type(sample_type), + try: + for resource_key, resource_value in endpoints: + if isinstance(resource_value, Exception): + LOGGER.error('Error retrieving "{:s}": {:s}'.format(str(RESOURCE_ENDPOINTS), str(resource_value))) + continue + endpoint_uuid = resource_value.get('uuid') + endpoint_type = resource_value.get('type') + str_endpoint_key = key_to_str([device_uuid, endpoint_uuid]) + db_endpoint, _ = update_or_create_object( + self.database, EndPointModel, str_endpoint_key, { + 'device_fk' : db_device, + 'endpoint_uuid': endpoint_uuid, + 'endpoint_type': endpoint_type, + 'resource_key' : resource_key, }) + sample_types : Dict[int, str] = resource_value.get('sample_types', {}) + for sample_type, monitor_resource_key in sample_types.items(): + str_endpoint_monitor_key = key_to_str([str_endpoint_key, str(sample_type)]) + update_or_create_object(self.database, EndPointMonitorModel, str_endpoint_monitor_key, { + 'endpoint_fk' : db_endpoint, + 'resource_key' : monitor_resource_key, + 'kpi_sample_type': grpc_to_enum__kpi_sample_type(sample_type), + }) + except: # pylint: disable=bare-except + LOGGER.exception('[AddDevice] endpoints = {:s}'.format(str(endpoints))) + + raw_running_config_rules = driver.GetConfig() + running_config_rules = [] + for resource_key, resource_value in raw_running_config_rules: + if isinstance(resource_value, Exception): + msg = 'Error retrieving config rules: {:s} => {:s}' + LOGGER.error(msg.format(str(resource_key), str(resource_value))) + continue + config_rule = (ORM_ConfigActionEnum.SET, resource_key, json.dumps(resource_value, sort_keys=True)) + running_config_rules.append(config_rule) - running_config_rules = driver.GetConfig() - running_config_rules = [ - (ORM_ConfigActionEnum.SET, config_rule[0], json.dumps(config_rule[1], sort_keys=True)) - for config_rule in running_config_rules - ] #for running_config_rule in running_config_rules: # LOGGER.info('[AddDevice] running_config_rule: {:s}'.format(str(running_config_rule))) update_config(self.database, device_uuid, 'running', running_config_rules) @@ -204,7 +226,7 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): for config_rule in running_config_rules ] #for running_config_rule in running_config_rules: - # LOGGER.info('[AddDevice] running_config_rule: {:s}'.format(str(running_config_rule))) + # LOGGER.info('[ConfigureDevice] running_config_rule: {:s}'.format(str(running_config_rule))) update_config(self.database, device_uuid, 'running', running_config_rules) sync_device_to_context(db_device, self.context_client) @@ -214,6 +236,8 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): def DeleteDevice(self, request : DeviceId, context : grpc.ServicerContext) -> Empty: device_uuid = request.device_uuid.uuid + self.monitoring_loops.remove(device_uuid) + sync_device_from_context(device_uuid, self.context_client, self.database) db_device : DeviceModel = get_object(self.database, DeviceModel, device_uuid, raise_if_not_found=False) if db_device is None: return Empty() @@ -222,24 +246,27 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): delete_device_from_context(db_device, self.context_client) for db_kpi_pk,_ in db_device.references(KpiModel): - KpiModel(self.database, db_kpi_pk).delete() + db_kpi = get_object(self.database, KpiModel, db_kpi_pk) + for db_endpoint_monitor_kpi_pk,_ in db_kpi.references(EndPointMonitorKpiModel): + get_object(self.database, EndPointMonitorKpiModel, db_endpoint_monitor_kpi_pk).delete() + db_kpi.delete() for db_endpoint_pk,_ in db_device.references(EndPointModel): db_endpoint = EndPointModel(self.database, db_endpoint_pk) for db_endpoint_monitor_pk,_ in db_endpoint.references(EndPointMonitorModel): - EndPointMonitorModel(self.database, db_endpoint_monitor_pk).delete() + get_object(self.database, EndPointMonitorModel, db_endpoint_monitor_pk).delete() db_endpoint.delete() for db_driver_pk,_ in db_device.references(DriverModel): - DriverModel(self.database, db_driver_pk).delete() + get_object(self.database, DriverModel, db_driver_pk).delete() db_initial_config = ConfigModel(self.database, db_device.device_initial_config_fk) for db_config_rule_pk,_ in db_initial_config.references(ConfigRuleModel): - ConfigRuleModel(self.database, db_config_rule_pk).delete() + get_object(self.database, ConfigRuleModel, db_config_rule_pk).delete() db_running_config = ConfigModel(self.database, db_device.device_running_config_fk) for db_config_rule_pk,_ in db_running_config.references(ConfigRuleModel): - ConfigRuleModel(self.database, db_config_rule_pk).delete() + get_object(self.database, ConfigRuleModel, db_config_rule_pk).delete() db_device.delete() db_initial_config.delete() @@ -307,12 +334,13 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): db_endpoint_monitor : EndPointMonitorModel = get_object( self.database, EndPointMonitorModel, str_endpoint_monitor_key, raise_if_not_found=False) if db_endpoint_monitor is None: - msg = 'SampleType({:s}/{:s}) not supported for EndPoint({:s}).'.format( + msg = 'SampleType({:s}/{:s}) not supported for Device({:s})/EndPoint({:s}).'.format( str(sample_type), str(KpiSampleType.Name(sample_type).upper().replace('KPISAMPLETYPE_', '')), - str(endpoint_uuid)) + str(device_uuid), str(endpoint_uuid)) raise OperationFailedException('MonitorDeviceKpi', extra_details=msg) - str_endpoint_monitor_kpi_key = key_to_str([device_uuid, db_endpoint_monitor.resource_key], separator=':') + endpoint_monitor_resource_key = re.sub('[^A-Za-z0-9]', '.', db_endpoint_monitor.resource_key) + str_endpoint_monitor_kpi_key = key_to_str([device_uuid, endpoint_monitor_resource_key], separator=':') attributes = { 'endpoint_monitor_fk': db_endpoint_monitor, 'kpi_fk' : db_kpi, @@ -361,7 +389,8 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): msg = 'EndPointMonitor({:s}) not found.'.format(str(str_endpoint_monitor_key)) raise OperationFailedException('MonitorDeviceKpi', extra_details=msg) - str_endpoint_monitor_kpi_key = key_to_str([device_uuid, db_endpoint_monitor.resource_key], separator=':') + endpoint_monitor_resource_key = re.sub('[^A-Za-z0-9]', '.', db_endpoint_monitor.resource_key) + str_endpoint_monitor_kpi_key = key_to_str([device_uuid, endpoint_monitor_resource_key], separator=':') db_endpoint_monitor_kpi : EndPointMonitorKpiModel = get_object( self.database, EndPointMonitorKpiModel, str_endpoint_monitor_kpi_key, raise_if_not_found=False) if db_endpoint_monitor_kpi is None: @@ -388,4 +417,32 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): # requests. #self.monitoring_loops.remove(device_uuid) + # Subscriptions are not stored as classical driver config. + # TODO: consider adding it somehow in the configuration. + # Warning: GetConfig might be very slow in OpenConfig devices + #running_config_rules = [ + # (config_rule[0], json.dumps(config_rule[1], sort_keys=True)) + # for config_rule in driver.GetConfig() + #] + #context_config_rules = { + # config_rule[1]: config_rule[2] + # for config_rule in get_config_rules(self.database, device_uuid, 'running') + #} + + ## each in context, not in running => delete in context + ## each in running, not in context => add to context + ## each in context and in running, context.value != running.value => update in context + #running_config_rules_actions : List[Tuple[ORM_ConfigActionEnum, str, str]] = [] + #for config_rule_key,config_rule_value in running_config_rules: + # running_config_rules_actions.append((ORM_ConfigActionEnum.SET, config_rule_key, config_rule_value)) + # context_config_rules.pop(config_rule_key, None) + #for context_rule_key,context_rule_value in context_config_rules.items(): + # running_config_rules_actions.append((ORM_ConfigActionEnum.DELETE, context_rule_key, context_rule_value)) + + ##msg = '[MonitorDeviceKpi] running_config_rules_action[{:d}]: {:s}' + ##for i,running_config_rules_action in enumerate(running_config_rules_actions): + ## LOGGER.info(msg.format(i, str(running_config_rules_action))) + #update_config(self.database, device_uuid, 'running', running_config_rules_actions) + + sync_device_to_context(db_device, self.context_client) return Empty() diff --git a/src/device/service/MonitoringLoops.py b/src/device/service/MonitoringLoops.py index 2e96e8df1dfd7a050aae004b5d5a41bae469e438..4d6d3f59147026c3104062cca0684ea9e3a304cf 100644 --- a/src/device/service/MonitoringLoops.py +++ b/src/device/service/MonitoringLoops.py @@ -1,12 +1,27 @@ -import logging, queue, threading +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, queue, re, threading +from datetime import datetime from typing import Dict from common.orm.Database import Database from common.orm.HighLevel import get_object from common.orm.backend.Tools import key_to_str -from device.service.database.RelationModels import EndPointMonitorKpiModel -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto.monitoring_pb2 import Kpi +from common.proto.monitoring_pb2 import Kpi +from monitoring.client.MonitoringClient import MonitoringClient from .database.KpiModel import KpiModel +from .database.RelationModels import EndPointMonitorKpiModel from .driver_api._Driver import _Driver LOGGER = logging.getLogger(__name__) @@ -19,7 +34,7 @@ class MonitoringLoop: self._samples_queue = samples_queue self._running = threading.Event() self._terminate = threading.Event() - self._samples_stream = self._driver.GetState(blocking=True) + self._samples_stream = self._driver.GetState(blocking=True, terminate=self._terminate) self._collector_thread = threading.Thread(target=self._collect, daemon=True) def _collect(self) -> None: @@ -37,12 +52,11 @@ class MonitoringLoop: def stop(self): self._terminate.set() - self._samples_stream.cancel() self._collector_thread.join() class MonitoringLoops: - def __init__(self, monitoring_client : MonitoringClient, database : Database) -> None: - self._monitoring_client = monitoring_client + def __init__(self, database : Database) -> None: + self._monitoring_client = MonitoringClient() self._database = database self._samples_queue = queue.Queue() self._running = threading.Event() @@ -68,7 +82,6 @@ class MonitoringLoops: def start(self): self._exporter_thread.start() - self._running.set() @property def is_running(self): return self._running.is_set() @@ -82,6 +95,7 @@ class MonitoringLoops: LOGGER.error('[MonitoringLoops:_export] Database not set. Terminating Exporter.') return + self._running.set() while not self._terminate.is_set(): try: sample = self._samples_queue.get(block=True, timeout=QUEUE_GET_WAIT_TIMEOUT) @@ -90,6 +104,7 @@ class MonitoringLoops: continue device_uuid, timestamp, endpoint_monitor_resource_key, value = sample + endpoint_monitor_resource_key = re.sub('[^A-Za-z0-9]', '.', endpoint_monitor_resource_key) str_endpoint_monitor_kpi_key = key_to_str([device_uuid, endpoint_monitor_resource_key], separator=':') #db_entries = self._database.dump() @@ -111,9 +126,11 @@ class MonitoringLoops: LOGGER.warning('Kpi({:s}) not found'.format(str_kpi_key)) continue + # FIXME: uint32 used for intVal results in out of range issues. Temporarily changed to float + # extend the 'kpi_value' to support long integers (uint64 / int64 / ...) if isinstance(value, int): - kpi_value_field_name = 'intVal' - kpi_value_field_cast = int + kpi_value_field_name = 'floatVal' # 'intVal' + kpi_value_field_cast = float # int elif isinstance(value, float): kpi_value_field_name = 'floatVal' kpi_value_field_cast = float @@ -127,8 +144,10 @@ class MonitoringLoops: try: self._monitoring_client.IncludeKpi(Kpi(**{ 'kpi_id' : {'kpi_id': {'uuid': db_kpi.kpi_uuid}}, - 'timestamp': str(timestamp), + 'timestamp': datetime.utcfromtimestamp(timestamp).isoformat() + 'Z', 'kpi_value': {kpi_value_field_name: kpi_value_field_cast(value)} })) except: # pylint: disable=bare-except LOGGER.exception('Unable to format/send Kpi') + + self._running.clear() diff --git a/src/device/service/__init__.py b/src/device/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/service/__init__.py +++ b/src/device/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/service/__main__.py b/src/device/service/__main__.py index 6832faf70b1d10f4796e50269ab018f0c6be147e..1f0adfa8f1dd8b3e307ed202967b1d5195171f11 100644 --- a/src/device/service/__main__.py +++ b/src/device/service/__main__.py @@ -1,19 +1,30 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting -from context.client.ContextClient import ContextClient -from device.Config import ( - CONTEXT_SERVICE_HOST, CONTEXT_SERVICE_PORT, GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, - METRICS_PORT, MONITORING_SERVICE_HOST, MONITORING_SERVICE_PORT) -from monitoring.client.monitoring_client import MonitoringClient +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) from .DeviceService import DeviceService -from .MonitoringLoops import MonitoringLoops from .driver_api.DriverFactory import DriverFactory from .driver_api.DriverInstanceCache import DriverInstanceCache from .drivers import DRIVERS terminate = threading.Event() -LOGGER = None +LOGGER : logging.Logger = None def signal_handler(signal, frame): # pylint: disable=redefined-outer-name LOGGER.warning('Terminate signal received') @@ -22,47 +33,33 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - grpc_service_port = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD ) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - context_service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST', default=CONTEXT_SERVICE_HOST ) - context_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=CONTEXT_SERVICE_PORT ) - monitoring_service_host = get_setting('MONITORINGSERVICE_SERVICE_HOST', default=MONITORING_SERVICE_HOST) - monitoring_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=MONITORING_SERVICE_PORT) - + log_level = get_log_level() logging.basicConfig(level=log_level) + logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) + logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) + logging.getLogger('monitoring-client').setLevel(logging.WARNING) LOGGER = logging.getLogger(__name__) + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) - # Initialize Context Client - if context_service_host is None or context_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Context component'.format( - str(context_service_host), str(context_service_port))) - context_client = ContextClient(context_service_host, context_service_port) - - # Initialize Monitoring Client - if monitoring_service_host is None or monitoring_service_port is None: - raise Exception('Wrong address({:s}):port({:s}) of Monitoring component'.format( - str(monitoring_service_host), str(monitoring_service_port))) - monitoring_client = MonitoringClient(monitoring_service_host, monitoring_service_port) - # Initialize Driver framework driver_factory = DriverFactory(DRIVERS) driver_instance_cache = DriverInstanceCache(driver_factory) # Starting device service - grpc_service = DeviceService( - context_client, monitoring_client, driver_instance_cache, port=grpc_service_port, max_workers=max_workers, - grace_period=grace_period) + grpc_service = DeviceService(driver_instance_cache) grpc_service.start() # Wait for Ctrl+C or termination signal diff --git a/src/device/service/database/ConfigModel.py b/src/device/service/database/ConfigModel.py index 82697bfbae7d1f58fdc851aa66f86f0fc78a767e..8472a44eaefefceaee36dcbe40d9a427eb2cbb36 100644 --- a/src/device/service/database/ConfigModel.py +++ b/src/device/service/database/ConfigModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools, logging, operator from enum import Enum from typing import Dict, List, Tuple, Union @@ -10,7 +24,8 @@ from common.orm.fields.IntegerField import IntegerField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model -from device.proto.context_pb2 import ConfigActionEnum +from common.proto.context_pb2 import ConfigActionEnum +from common.tools.grpc.Tools import grpc_message_to_json_string from .Tools import fast_hasher, grpc_to_enum, remove_dict_key LOGGER = logging.getLogger(__name__) @@ -43,8 +58,10 @@ class ConfigRuleModel(Model): # pylint: disable=abstract-method def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ result = { 'action': self.action.value, - 'resource_key': self.key, - 'resource_value': self.value, + 'custom': { + 'resource_key': self.key, + 'resource_value': self.value, + }, } if include_position: result['position'] = self.position return result @@ -59,7 +76,11 @@ def delete_all_config_rules(database : Database, db_parent_pk : str, config_name def grpc_config_rules_to_raw(grpc_config_rules) -> List[Tuple[ORM_ConfigActionEnum, str, str]]: def translate(grpc_config_rule): action = grpc_to_enum__config_action(grpc_config_rule.action) - return action, grpc_config_rule.resource_key, grpc_config_rule.resource_value + config_rule_type = str(grpc_config_rule.WhichOneof('config_rule')) + if config_rule_type != 'custom': + raise NotImplementedError('ConfigRule of type {:s} is not implemented: {:s}'.format( + config_rule_type, grpc_message_to_json_string(grpc_config_rule))) + return action, grpc_config_rule.custom.resource_key, grpc_config_rule.custom.resource_value return [translate(grpc_config_rule) for grpc_config_rule in grpc_config_rules] def get_config_rules( @@ -69,15 +90,17 @@ def get_config_rules( str_config_key = key_to_str([db_parent_pk, config_name], separator=':') db_config = get_object(database, ConfigModel, str_config_key, raise_if_not_found=False) return [] if db_config is None else [ + # pylint: disable=no-member, protected-access (ORM_ConfigActionEnum._value2member_map_.get(config_rule['action']), - config_rule['resource_key'], config_rule['resource_value']) + config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) for config_rule in db_config.dump() + if 'custom' in config_rule ] def update_config( database : Database, db_parent_pk : str, config_name : str, raw_config_rules : List[Tuple[ORM_ConfigActionEnum, str, str]] - ) -> List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]]: +) -> List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]]: str_config_key = key_to_str([db_parent_pk, config_name], separator=':') result : Tuple[ConfigModel, bool] = get_or_create_object(database, ConfigModel, str_config_key) @@ -91,7 +114,8 @@ def update_config( result : Tuple[ConfigRuleModel, bool] = update_or_create_object( database, ConfigRuleModel, str_config_rule_key, { 'config_fk': db_config, 'position': position, 'action': action, 'key': resource_key, - 'value': resource_value}) + 'value': resource_value, + }) db_config_rule, updated = result db_objects.append((db_config_rule, updated)) diff --git a/src/device/service/database/ContextModel.py b/src/device/service/database/ContextModel.py index f4da5097e3f1ab0298ec66ff6007fb6a21be65ed..0ca13269c52d02ea663e10be986ab28d12d8f144 100644 --- a/src/device/service/database/ContextModel.py +++ b/src/device/service/database/ContextModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Dict, List from common.orm.fields.PrimaryKeyField import PrimaryKeyField diff --git a/src/device/service/database/DatabaseTools.py b/src/device/service/database/DatabaseTools.py index 27a5f89a579451e9e512bc7288ca8690a25de27d..4409f078b78b7369702e262ec7e371adcd35a7cd 100644 --- a/src/device/service/database/DatabaseTools.py +++ b/src/device/service/database/DatabaseTools.py @@ -1,11 +1,25 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc from typing import Any, Dict, Tuple from common.orm.Database import Database from common.orm.HighLevel import get_or_create_object, update_or_create_object from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Device, DeviceId from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException from context.client.ContextClient import ContextClient -from device.proto.context_pb2 import Device, DeviceId from device.service.driver_api.FilterFields import FilterFieldEnum from .ConfigModel import delete_all_config_rules, grpc_config_rules_to_raw, update_config from .ContextModel import ContextModel diff --git a/src/device/service/database/DeviceModel.py b/src/device/service/database/DeviceModel.py index bba19d787622019b7b8f25de9c07b7c0984ec42c..7a0a2325928ed7312063eb66d629a08cc7591b7b 100644 --- a/src/device/service/database/DeviceModel.py +++ b/src/device/service/database/DeviceModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools, logging from enum import Enum from typing import Dict, List @@ -8,7 +22,7 @@ from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.PrimaryKeyField import PrimaryKeyField from common.orm.fields.StringField import StringField from common.orm.model.Model import Model -from device.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from common.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum from .ConfigModel import ConfigModel from .Tools import grpc_to_enum diff --git a/src/device/service/database/EndPointModel.py b/src/device/service/database/EndPointModel.py index 7e0832c51f70cabe49cd4b19d7c23bf923bcf98e..84d0c97073481af162b1e66f7e35c93bc6e1eed5 100644 --- a/src/device/service/database/EndPointModel.py +++ b/src/device/service/database/EndPointModel.py @@ -1,6 +1,21 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Dict, List from common.orm.Database import Database +from common.orm.HighLevel import update_or_create_object from common.orm.backend.Tools import key_to_str from common.orm.fields.EnumeratedField import EnumeratedField from common.orm.fields.ForeignKeyField import ForeignKeyField @@ -58,9 +73,14 @@ def set_endpoint_monitors(database : Database, db_endpoint : EndPointModel, grpc db_endpoint_pk = db_endpoint.pk for kpi_sample_type in grpc_endpoint_kpi_sample_types: orm_kpi_sample_type = grpc_to_enum__kpi_sample_type(kpi_sample_type) - str_endpoint_kpi_sample_type_key = key_to_str([db_endpoint_pk, orm_kpi_sample_type.name]) - db_endpoint_kpi_sample_type = EndPointMonitorModel(database, str_endpoint_kpi_sample_type_key) - db_endpoint_kpi_sample_type.endpoint_fk = db_endpoint - db_endpoint_kpi_sample_type.resource_key = '' # during initialization, allow empty value - db_endpoint_kpi_sample_type.kpi_sample_type = orm_kpi_sample_type - db_endpoint_kpi_sample_type.save() + str_endpoint_kpi_sample_type_key = key_to_str([db_endpoint_pk, str(orm_kpi_sample_type.value)]) + #db_endpoint_kpi_sample_type = EndPointMonitorModel(database, str_endpoint_kpi_sample_type_key) + #db_endpoint_kpi_sample_type.endpoint_fk = db_endpoint + #db_endpoint_kpi_sample_type.resource_key = '' # during initialization, allow empty value + #db_endpoint_kpi_sample_type.kpi_sample_type = orm_kpi_sample_type + #db_endpoint_kpi_sample_type.save() + update_or_create_object(database, EndPointMonitorModel, str_endpoint_kpi_sample_type_key, { + 'endpoint_fk' : db_endpoint, + #'resource_key' : '', # during initialization, allow empty value + 'kpi_sample_type': orm_kpi_sample_type, + }) diff --git a/src/device/service/database/KpiModel.py b/src/device/service/database/KpiModel.py index 3ec78f60f233f5492d4780009e7cbf815f5e5248..e3631d38099c02cd459af7f8393b6991c476bd92 100644 --- a/src/device/service/database/KpiModel.py +++ b/src/device/service/database/KpiModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Dict from common.orm.fields.EnumeratedField import EnumeratedField diff --git a/src/device/service/database/KpiSampleType.py b/src/device/service/database/KpiSampleType.py index 24ac67200e85bb7fe29cf0971de020351b2b45da..0a2015b3fdeaceeed8b01619805f55f2a9267468 100644 --- a/src/device/service/database/KpiSampleType.py +++ b/src/device/service/database/KpiSampleType.py @@ -1,6 +1,20 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import functools from enum import Enum -from device.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.kpi_sample_types_pb2 import KpiSampleType from .Tools import grpc_to_enum class ORM_KpiSampleTypeEnum(Enum): diff --git a/src/device/service/database/RelationModels.py b/src/device/service/database/RelationModels.py index 6d1a9780f3bcd12d4aa3718c94e910b80a40ba18..0f6caa646f7548fe0d4aa23829183a132069c589 100644 --- a/src/device/service/database/RelationModels.py +++ b/src/device/service/database/RelationModels.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from common.orm.fields.ForeignKeyField import ForeignKeyField from common.orm.fields.PrimaryKeyField import PrimaryKeyField diff --git a/src/device/service/database/Tools.py b/src/device/service/database/Tools.py index 36ffbcd46fcf686371b0799445ce4f9ce5b75838..43bb71bd90582644c67d3ca528611eae937b6460 100644 --- a/src/device/service/database/Tools.py +++ b/src/device/service/database/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import hashlib, re from enum import Enum from typing import Dict, List, Tuple, Union diff --git a/src/device/service/database/TopologyModel.py b/src/device/service/database/TopologyModel.py index 71c1067f03803c6d89c69910c82a3c1e24970eee..a099c8adfd8bb64d94c8326c90094f39d7fe9b6b 100644 --- a/src/device/service/database/TopologyModel.py +++ b/src/device/service/database/TopologyModel.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging from typing import Dict from common.orm.fields.ForeignKeyField import ForeignKeyField diff --git a/src/device/service/database/__init__.py b/src/device/service/database/__init__.py index ff9b7da0cd0f83f8e01bbb904d8e2471503f00ca..c59423e79961c8503f4469d69c53946988cae24e 100644 --- a/src/device/service/database/__init__.py +++ b/src/device/service/database/__init__.py @@ -1,2 +1,16 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # In-Memory database with a simplified representation of Context Database focused on the Device model. # Used as an internal configuration cache, for message validation, and message formatting purposes. diff --git a/src/device/service/driver_api/AnyTreeTools.py b/src/device/service/driver_api/AnyTreeTools.py index 47e80e6c71cadd1fb24a6aecb0309f8194a06756..f4999b64bab9ddd19d97037f99767ee17827aa24 100644 --- a/src/device/service/driver_api/AnyTreeTools.py +++ b/src/device/service/driver_api/AnyTreeTools.py @@ -1,5 +1,19 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import anytree -from typing import Any, List, Optional +from typing import Any, List, Optional, Union from apscheduler.job import Job class TreeNode(anytree.node.Node): @@ -28,20 +42,24 @@ class RawStyle(anytree.render.AbstractStyle): Node('/root/sub0/sub0A') Node('/root/sub1') """ - super(RawStyle, self).__init__(u'', u'', u'') + super(RawStyle, self).__init__('', '', '') + +def get_subnode( + resolver : anytree.Resolver, root : TreeNode, key_or_path : Union[str, List[str]], default : Optional[Any] = None): -def get_subnode(resolver : anytree.Resolver, root : TreeNode, path : List[str], default : Optional[Any] = None): + if isinstance(key_or_path, str): key_or_path = key_or_path.split('/') node = root - for path_item in path: + for path_item in key_or_path: try: node = resolver.get(node, path_item) except anytree.ChildResolverError: return default return node -def set_subnode_value(resolver : anytree.Resolver, root : TreeNode, path : List[str], value : Any): +def set_subnode_value(resolver : anytree.Resolver, root : TreeNode, key_or_path : Union[str, List[str]], value : Any): + if isinstance(key_or_path, str): key_or_path = key_or_path.split('/') node = root - for path_item in path: + for path_item in key_or_path: try: node = resolver.get(node, path_item) except anytree.ChildResolverError: diff --git a/src/device/service/driver_api/DriverFactory.py b/src/device/service/driver_api/DriverFactory.py index 10b4961fcf98871cc4cbf3e078391006591b606c..b2b6c467a9d7c941a430e7bc7aaa1ab123053750 100644 --- a/src/device/service/driver_api/DriverFactory.py +++ b/src/device/service/driver_api/DriverFactory.py @@ -1,11 +1,25 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, operator from enum import Enum from typing import Any, Dict, Iterable, List, Set, Tuple -from device.service.driver_api._Driver import _Driver -from device.service.driver_api.Exceptions import ( +from ._Driver import _Driver +from .Exceptions import ( UnsatisfiedFilterException, UnsupportedDriverClassException, UnsupportedFilterFieldException, UnsupportedFilterFieldValueException) -from device.service.driver_api.FilterFields import FILTER_FIELD_ALLOWED_VALUES, FilterFieldEnum +from .FilterFields import FILTER_FIELD_ALLOWED_VALUES, FilterFieldEnum LOGGER = logging.getLogger(__name__) @@ -62,6 +76,7 @@ class DriverFactory: field_candidate_driver_classes = field_candidate_driver_classes.union(field_indice_drivers) if candidate_driver_classes is None: + if len(field_candidate_driver_classes) == 0: continue candidate_driver_classes = {k:1 for k in field_candidate_driver_classes} else: for candidate_driver_class in candidate_driver_classes: diff --git a/src/device/service/driver_api/DriverInstanceCache.py b/src/device/service/driver_api/DriverInstanceCache.py index f960e37cbd22a7d4c06c9119ffaf64540dfc791a..41cc66363885e28082aa353ec46950fbf6ce10e0 100644 --- a/src/device/service/driver_api/DriverInstanceCache.py +++ b/src/device/service/driver_api/DriverInstanceCache.py @@ -1,10 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, threading from typing import Any, Dict, Optional - -from device.service.driver_api.FilterFields import FilterFieldEnum from ._Driver import _Driver from .DriverFactory import DriverFactory from .Exceptions import DriverInstanceCacheTerminatedException +from .FilterFields import FilterFieldEnum LOGGER = logging.getLogger(__name__) diff --git a/src/device/service/driver_api/Exceptions.py b/src/device/service/driver_api/Exceptions.py index c35d6372d60b4ea465b40d98e9e43e979835451d..1a03da97f3fcd42c5417318864277f36e62f6233 100644 --- a/src/device/service/driver_api/Exceptions.py +++ b/src/device/service/driver_api/Exceptions.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + class UnsatisfiedFilterException(Exception): def __init__(self, filter_fields): msg = 'No Driver satisfies FilterFields({:s})' diff --git a/src/device/service/driver_api/FilterFields.py b/src/device/service/driver_api/FilterFields.py index c7de05f92a743c826d54897930b10013bd09c2b7..9ea5445903958286d68ff3246e0801e0a7955d2a 100644 --- a/src/device/service/driver_api/FilterFields.py +++ b/src/device/service/driver_api/FilterFields.py @@ -1,14 +1,21 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from enum import Enum +from common.DeviceTypes import DeviceTypeEnum from device.service.database.DeviceModel import ORM_DeviceDriverEnum -class DeviceTypeFilterFieldEnum(Enum): - EMULATED = 'emulated' - OPTICAL_ROADM = 'optical-roadm' - OPTICAL_TRANDPONDER = 'optical-trandponder' - OPTICAL_LINE_SYSTEM = 'optical-line-system' - PACKET_ROUTER = 'packet-router' - PACKET_SWITCH = 'packet-switch' - class FilterFieldEnum(Enum): DEVICE_TYPE = 'device_type' DRIVER = 'driver' @@ -18,7 +25,7 @@ class FilterFieldEnum(Enum): # Map allowed filter fields to allowed values per Filter field. If no restriction (free text) None is specified FILTER_FIELD_ALLOWED_VALUES = { - FilterFieldEnum.DEVICE_TYPE.value : {i.value for i in DeviceTypeFilterFieldEnum}, + FilterFieldEnum.DEVICE_TYPE.value : {i.value for i in DeviceTypeEnum}, FilterFieldEnum.DRIVER.value : {i.value for i in ORM_DeviceDriverEnum}, FilterFieldEnum.VENDOR.value : None, FilterFieldEnum.MODEL.value : None, diff --git a/src/device/service/driver_api/QueryFields.py b/src/device/service/driver_api/QueryFields.py deleted file mode 100644 index 15b3f5b7582283083c9ea1080dc4f3d6f5390501..0000000000000000000000000000000000000000 --- a/src/device/service/driver_api/QueryFields.py +++ /dev/null @@ -1,33 +0,0 @@ -from enum import Enum - -class DeviceTypeQueryFieldEnum(Enum): - OPTICAL_ROADM = 'optical-roadm' - OPTICAL_TRANDPONDER = 'optical-trandponder' - PACKET_ROUTER = 'packet-router' - PACKET_SWITCH = 'packet-switch' - -class ProtocolQueryFieldEnum(Enum): - SOFTWARE = 'software' - GRPC = 'grpc' - RESTAPI = 'restapi' - NETCONF = 'netconf' - GNMI = 'gnmi' - RESTCONF = 'restconf' - -class DataModelQueryFieldEnum(Enum): - EMULATED = 'emu' - OPENCONFIG = 'oc' - P4 = 'p4' - TRANSPORT_API = 'tapi' - IETF_NETWORK_TOPOLOGY = 'ietf-netw-topo' - ONF_TR_352 = 'onf-tr-352' - -# Map allowed query fields to allowed values per query field. If no restriction (free text) None is specified -QUERY_FIELDS = { - 'device_type' : {i.value for i in DeviceTypeQueryFieldEnum}, - 'protocol' : {i.value for i in ProtocolQueryFieldEnum}, - 'data_model' : {i.value for i in DataModelQueryFieldEnum}, - 'vendor' : None, - 'model' : None, - 'serial_number': None, -} diff --git a/src/device/service/driver_api/Tools.py b/src/device/service/driver_api/Tools.py index ab22cbc040daee7e47e80b0235b79b19cdb7acbc..19c81d89bfe7e7e1bd46edb205eaf1f2b4bee778 100644 --- a/src/device/service/driver_api/Tools.py +++ b/src/device/service/driver_api/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import operator from typing import Any, Callable, List, Tuple, Union diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index 73174ba53ac6e0b357d3bd790c53f429bea36d87..7dbb9eddb238dcaae9d00b579a1851aacf53225d 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -1,10 +1,27 @@ -from typing import Any, Iterator, List, Tuple, Union +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import threading +from typing import Any, Iterator, List, Optional, Tuple, Union # Special resource names to request to the driver to retrieve the specified configuration/structural resources. # These resource names should be used with GetConfig() method. RESOURCE_ENDPOINTS = '__endpoints__' RESOURCE_INTERFACES = '__interfaces__' RESOURCE_NETWORK_INSTANCES = '__network_instances__' +RESOURCE_ROUTING_POLICIES = '__routing_policies__' +RESOURCE_ACL = '__acl__' class _Driver: def __init__(self, address : str, port : int, **settings) -> None: @@ -56,17 +73,6 @@ class _Driver: """ raise NotImplementedError() - #def GetResource(self, endpoint_uuid : str) -> Optional[str]: - # """ Retrieve the endpoint path for subscriptions. - # Parameters: - # endpoint_uuid : str - # Target endpoint UUID - # Returns: - # resource_path : Optional[str] - # The path of the endpoint, or None if it is not found. - # """ - # raise NotImplementedError() - def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: """ Create/Update configuration for a list of resources. Parameters: @@ -129,21 +135,30 @@ class _Driver: """ raise NotImplementedError() - def GetState(self, blocking=False) -> Iterator[Tuple[float, str, Any]]: + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: """ Retrieve last collected values for subscribed resources. Operates as a generator, so this method should be called once and will block until values are available. When values are available, it should yield each of them and block again until new values are available. When the driver is destroyed, GetState() can return - instead of yield to terminate the loop. + instead of yield to terminate the loop. Terminate enables to request interruption of the generation. Examples: # keep looping waiting for extra samples (generator loop) - for timestamp,resource_key,resource_value in my_driver.GetState(blocking=True): + terminate = threading.Event() + i = 0 + for timestamp,resource_key,resource_value in my_driver.GetState(blocking=True, terminate=terminate): process(timestamp, resource_key, resource_value) + i += 1 + if i == 10: terminate.set() # just retrieve accumulated samples - samples = my_driver.GetState(blocking=False) + samples = my_driver.GetState(blocking=False, terminate=terminate) # or (as classical loop) - for timestamp,resource_key,resource_value in my_driver.GetState(blocking=False): + i = 0 + for timestamp,resource_key,resource_value in my_driver.GetState(blocking=False, terminate=terminate): process(timestamp, resource_key, resource_value) + i += 1 + if i == 10: terminate.set() Parameters: blocking : bool Select the driver behaviour. In both cases, the driver will first retrieve the samples accumulated @@ -152,6 +167,8 @@ class _Driver: terminates the loop and returns. Non-blocking behaviour can be used for periodically polling the driver, while blocking can be used when a separate thread is in charge of collecting the samples produced by the driver. + terminate : threading.Event + Signals the interruption of the GetState method as soon as possible. Returns: results : Iterator[Tuple[float, str, Any]] Sequences of state sample. Each State sample contains a float Unix-like timestamps of the samples in diff --git a/src/device/service/driver_api/__init__.py b/src/device/service/driver_api/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/service/driver_api/__init__.py +++ b/src/device/service/driver_api/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/service/drivers/__init__.py b/src/device/service/drivers/__init__.py index e59bae207e4cd14f238aabcb7e373bb973374005..40912f50b98f1d5fc9555d87a4855a12ab8e0c07 100644 --- a/src/device/service/drivers/__init__.py +++ b/src/device/service/drivers/__init__.py @@ -1,25 +1,69 @@ -from ..driver_api.FilterFields import FilterFieldEnum, DeviceTypeFilterFieldEnum, ORM_DeviceDriverEnum +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.DeviceTypes import DeviceTypeEnum +from ..driver_api.FilterFields import FilterFieldEnum, ORM_DeviceDriverEnum from .emulated.EmulatedDriver import EmulatedDriver from .openconfig.OpenConfigDriver import OpenConfigDriver from .transport_api.TransportApiDriver import TransportApiDriver +from .p4.p4_driver import P4Driver +from .microwave.IETFApiDriver import IETFApiDriver DRIVERS = [ (EmulatedDriver, [ { - FilterFieldEnum.DEVICE_TYPE: DeviceTypeFilterFieldEnum.EMULATED, - FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.UNDEFINED, + # Driver==unspecified & no device type specified => use Emulated + FilterFieldEnum.DRIVER: ORM_DeviceDriverEnum.UNDEFINED, + }, + { + # Emulated OLS/Packet Router, specifying Undefined/OpenConfig/TAPI Driver => use EmulatedDriver + FilterFieldEnum.DEVICE_TYPE: [ + DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM, + DeviceTypeEnum.EMULATED_PACKET_ROUTER, + ], + FilterFieldEnum.DRIVER : [ + ORM_DeviceDriverEnum.UNDEFINED, + ORM_DeviceDriverEnum.OPENCONFIG, + ORM_DeviceDriverEnum.TRANSPORT_API + ], } ]), (OpenConfigDriver, [ { - FilterFieldEnum.DEVICE_TYPE: DeviceTypeFilterFieldEnum.PACKET_ROUTER, + # Real Packet Router, specifying OpenConfig Driver => use OpenConfigDriver + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.PACKET_ROUTER, FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.OPENCONFIG, } ]), (TransportApiDriver, [ { - FilterFieldEnum.DEVICE_TYPE: DeviceTypeFilterFieldEnum.OPTICAL_LINE_SYSTEM, + # Real OLS, specifying TAPI Driver => use TransportApiDriver + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.OPTICAL_LINE_SYSTEM, FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.TRANSPORT_API, } ]), + (P4Driver, [ + { + # Real P4 Switch, specifying P4 Driver => use P4Driver + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.P4_SWITCH, + FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.P4, + } + ]), + (IETFApiDriver, [ + { + FilterFieldEnum.DEVICE_TYPE: DeviceTypeEnum.MICROVAWE_RADIO_SYSTEM, + FilterFieldEnum.DRIVER : ORM_DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, + } + ]), ] diff --git a/src/device/service/drivers/emulated/AnyTreeTools.py b/src/device/service/drivers/emulated/AnyTreeTools.py deleted file mode 100644 index e7817b78921e3b91fb84ca660f022c869ac88220..0000000000000000000000000000000000000000 --- a/src/device/service/drivers/emulated/AnyTreeTools.py +++ /dev/null @@ -1,62 +0,0 @@ -import anytree -from typing import Any, List, Optional - -from anytree.render import Row - -class TreeNode(anytree.node.Node): - def __init__(self, name, parent=None, children=None, **kwargs) -> None: - super().__init__(name, parent=parent, children=children, **kwargs) - self.value : Optional[Any] = None - - def get_full_path(self): - return self.separator.join([''] + [str(node.name) for node in self.path]) - -class RawStyle(anytree.render.AbstractStyle): - def __init__(self): - """ - Raw style. - - >>> from anytree import Node, RenderTree - >>> root = Node("root") - >>> s0 = Node("sub0", parent=root) - >>> s0b = Node("sub0B", parent=s0) - >>> s0a = Node("sub0A", parent=s0) - >>> s1 = Node("sub1", parent=root) - >>> print(RenderTree(root, style=RawStyle())) - Node('/root') - Node('/root/sub0') - Node('/root/sub0/sub0B') - Node('/root/sub0/sub0A') - Node('/root/sub1') - """ - super(RawStyle, self).__init__(u'', u'', u'') - -def get_subnode(resolver : anytree.Resolver, root : TreeNode, path : List[str], default : Optional[Any] = None): - node = root - for path_item in path: - try: - node = resolver.get(node, path_item) - except anytree.ChildResolverError: - return default - return node - -def set_subnode_value(resolver : anytree.Resolver, root : TreeNode, path : List[str], value : Any): - node = root - for path_item in path: - try: - node = resolver.get(node, path_item) - except anytree.ChildResolverError: - node = TreeNode(path_item, parent=node) - node.value = value - -def dump_subtree(root : TreeNode): - if not isinstance(root, TreeNode): raise Exception('root must be a TreeNode') - results = [] - for row in anytree.RenderTree(root, style=RawStyle()): - node : TreeNode = row.node - path = node.get_full_path()[2:] # get full path except the heading root placeholder "/." - if len(path) == 0: continue - value = node.value - if value is None: continue - results.append((path, value)) - return results diff --git a/src/device/service/drivers/emulated/EmulatedDriver.py b/src/device/service/drivers/emulated/EmulatedDriver.py index c92554fe30bd86066e3b9e31f09412b1dd82020a..2ee9a10ca93ceead96115528873c8876fadcf8ed 100644 --- a/src/device/service/drivers/emulated/EmulatedDriver.py +++ b/src/device/service/drivers/emulated/EmulatedDriver.py @@ -1,5 +1,18 @@ -import json -import anytree, logging, pytz, queue, random, threading +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree, json, logging, math, pytz, queue, random, re, threading from datetime import datetime, timedelta from typing import Any, Dict, Iterator, List, Optional, Tuple, Union from apscheduler.executors.pool import ThreadPoolExecutor @@ -47,14 +60,74 @@ def compose_resource_endpoint(endpoint_data : Dict[str, Any]) -> Tuple[str, Any] endpoint_resource_value = {'uuid': endpoint_uuid, 'type': endpoint_type, 'sample_types': sample_types} return endpoint_resource_key, endpoint_resource_value -def do_sampling(resource_key : str, out_samples : queue.Queue): - out_samples.put_nowait((datetime.timestamp(datetime.utcnow()), resource_key, random.random())) +RE_GET_ENDPOINT_METRIC = re.compile(r'.*\/endpoint\[([^\]]+)\]\/state\/(.*)') +RE_GET_ENDPOINT_FROM_INTERFACE = re.compile(r'.*\/interface\[([^\]]+)\].*') + +class SyntheticSamplingParameters: + def __init__(self) -> None: + self.__lock = threading.Lock() + self.__data = {} + self.__configured_endpoints = set() + + def set_endpoint_configured(self, endpoint_uuid : str): + with self.__lock: + self.__configured_endpoints.add(endpoint_uuid) + + def unset_endpoint_configured(self, endpoint_uuid : str): + with self.__lock: + self.__configured_endpoints.discard(endpoint_uuid) + + def get(self, resource_key : str) -> Tuple[float, float, float, float]: + with self.__lock: + match = RE_GET_ENDPOINT_METRIC.match(resource_key) + if match is None: + msg = '[SyntheticSamplingParameters:get] unable to extract endpoint-metric from resource_key "{:s}"' + LOGGER.error(msg.format(resource_key)) + return (0, 0, 1, 0, 0) + endpoint_uuid = match.group(1) + + # If endpoint is not configured, generate a flat synthetic traffic aligned at 0 + if endpoint_uuid not in self.__configured_endpoints: return (0, 0, 1, 0, 0) + + metric = match.group(2) + metric_sense = metric.lower().replace('packets_', '').replace('bytes_', '') + + msg = '[SyntheticSamplingParameters:get] resource_key={:s}, endpoint_uuid={:s}, metric={:s}, metric_sense={:s}' + LOGGER.info(msg.format(resource_key, endpoint_uuid, metric, metric_sense)) + + parameters_key = '{:s}-{:s}'.format(endpoint_uuid, metric_sense) + parameters = self.__data.get(parameters_key) + if parameters is not None: return parameters + + # assume packets + amplitude = 1.e7 * random.random() + phase = 60 * random.random() + period = 3600 * random.random() + offset = 1.e8 * random.random() + amplitude + avg_bytes_per_packet = random.randint(500, 1500) + parameters = (amplitude, phase, period, offset, avg_bytes_per_packet) + return self.__data.setdefault(parameters_key, parameters) + +def do_sampling( + synthetic_sampling_parameters : SyntheticSamplingParameters, resource_key : str, out_samples : queue.Queue + ): + amplitude, phase, period, offset, avg_bytes_per_packet = synthetic_sampling_parameters.get(resource_key) + if 'bytes' in resource_key.lower(): + # convert to bytes + amplitude = avg_bytes_per_packet * amplitude + offset = avg_bytes_per_packet * offset + timestamp = datetime.timestamp(datetime.utcnow()) + waveform = amplitude * math.sin(2 * math.pi * timestamp / period + phase) + offset + noise = amplitude * random.random() + value = abs(0.95 * waveform + 0.05 * noise) + out_samples.put_nowait((timestamp, resource_key, value)) class EmulatedDriver(_Driver): def __init__(self, address : str, port : int, **settings) -> None: # pylint: disable=super-init-not-called self.__lock = threading.Lock() self.__initial = TreeNode('.') self.__running = TreeNode('.') + self.__subscriptions = TreeNode('.') endpoints = settings.get('endpoints', []) endpoint_resources = [] @@ -73,6 +146,7 @@ class EmulatedDriver(_Driver): job_defaults = {'coalesce': False, 'max_instances': 3}, timezone=pytz.utc) self.__out_samples = queue.Queue() + self.__synthetic_sampling_parameters = SyntheticSamplingParameters() def Connect(self) -> bool: # If started, assume it is already connected @@ -148,6 +222,12 @@ class EmulatedDriver(_Driver): pass set_subnode_value(resolver, self.__running, resource_path, resource_value) + + match = RE_GET_ENDPOINT_FROM_INTERFACE.match(resource_key) + if match is not None: + endpoint_uuid = match.group(1) + self.__synthetic_sampling_parameters.set_endpoint_configured(endpoint_uuid) + results.append(True) return results @@ -176,6 +256,11 @@ class EmulatedDriver(_Driver): results.append(False) continue + match = RE_GET_ENDPOINT_FROM_INTERFACE.match(resource_key) + if match is not None: + endpoint_uuid = match.group(1) + self.__synthetic_sampling_parameters.unset_endpoint_configured(endpoint_uuid) + parent = resource_node.parent children = list(parent.children) children.remove(resource_node) @@ -211,12 +296,12 @@ class EmulatedDriver(_Driver): job_id = 'k={:s}/d={:f}/i={:f}'.format(resource_key, sampling_duration, sampling_interval) job = self.__scheduler.add_job( - do_sampling, args=(resource_key, self.__out_samples), kwargs={}, - id=job_id, trigger='interval', seconds=sampling_interval, - start_date=start_date, end_date=end_date, timezone=pytz.utc) + do_sampling, args=(self.__synthetic_sampling_parameters, resource_key, self.__out_samples), + kwargs={}, id=job_id, trigger='interval', seconds=sampling_interval, start_date=start_date, + end_date=end_date, timezone=pytz.utc) subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] - set_subnode_value(resolver, self.__running, subscription_path, job) + set_subnode_value(resolver, self.__subscriptions, subscription_path, job) results.append(True) return results @@ -242,7 +327,7 @@ class EmulatedDriver(_Driver): continue subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] - subscription_node = get_subnode(resolver, self.__running, subscription_path) + subscription_node = get_subnode(resolver, self.__subscriptions, subscription_path) # if not found, resource_node is None if subscription_node is None: @@ -262,8 +347,10 @@ class EmulatedDriver(_Driver): results.append(True) return results - def GetState(self, blocking=False) -> Iterator[Tuple[str, Any]]: - while not self.__terminate.is_set(): + def GetState(self, blocking=False, terminate : Optional[threading.Event] = None) -> Iterator[Tuple[str, Any]]: + while True: + if self.__terminate.is_set(): break + if terminate is not None and terminate.is_set(): break try: sample = self.__out_samples.get(block=blocking, timeout=0.1) except queue.Empty: diff --git a/src/device/service/drivers/emulated/QueryFields.py b/src/device/service/drivers/emulated/QueryFields.py deleted file mode 100644 index 6db43e5b5d4ffe1bbcc652d305981757bd960c3e..0000000000000000000000000000000000000000 --- a/src/device/service/drivers/emulated/QueryFields.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - -VENDOR_CTTC = 'cttc' - -DEVICE_MODEL_EMULATED_OPTICAL_ROADM = 'cttc_emu_opt_rdm' -DEVICE_MODEL_EMULATED_OPTICAL_TRANDPONDER = 'cttc_emu_opt_tp' -DEVICE_MODEL_EMULATED_PACKET_ROUTER = 'cttc_emu_pkt_rtr' -DEVICE_MODEL_EMULATED_PACKET_SWITCH = 'cttc_emu_pkt_swt' diff --git a/src/device/service/drivers/emulated/__init__.py b/src/device/service/drivers/emulated/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/service/drivers/emulated/__init__.py +++ b/src/device/service/drivers/emulated/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/service/drivers/microwave/IETFApiDriver.py b/src/device/service/drivers/microwave/IETFApiDriver.py new file mode 100644 index 0000000000000000000000000000000000000000..4d5ec439f4085575fc0f7fddb228d30dab3010b5 --- /dev/null +++ b/src/device/service/drivers/microwave/IETFApiDriver.py @@ -0,0 +1,110 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, requests, threading +from typing import Any, Iterator, List, Optional, Tuple, Union +from common.type_checkers.Checkers import chk_string, chk_type +from device.service.driver_api._Driver import _Driver +from . import ALL_RESOURCE_KEYS +from .Tools import create_connectivity_service, find_key, config_getter, delete_connectivity_service + +LOGGER = logging.getLogger(__name__) + +class IETFApiDriver(_Driver): + def __init__(self, address: str, port: int, **settings) -> None: # pylint: disable=super-init-not-called + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + self.__ietf_root = 'https://' + address + ':' + str(port) + self.__timeout = int(settings.get('timeout', 120)) + + def Connect(self) -> bool: + url = self.__ietf_root + '/nmswebs/restconf/data/ietf-network:networks' + with self.__lock: + if self.__started.is_set(): return True + try: + requests.get(url, timeout=self.__timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(str(self.__ietf_root))) + return False + except Exception: # pylint: disable=broad-except + LOGGER.exception('Exception connecting {:s}'.format(str(self.__ietf_root))) + return False + else: + self.__started.set() + return True + + def Disconnect(self) -> bool: + with self.__lock: + self.__terminate.set() + return True + + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + with self.__lock: + return [] + + def GetConfig(self, resource_keys : List[str] = []) -> List[Tuple[str, Union[Any, None, Exception]]]: + chk_type('resources', resource_keys, list) + results = [] + with self.__lock: + if len(resource_keys) == 0: resource_keys = ALL_RESOURCE_KEYS + for i, resource_key in enumerate(resource_keys): + str_resource_name = 'resource_key[#{:d}]'.format(i) + chk_string(str_resource_name, resource_key, allow_empty=False) + results.extend(config_getter(self.__ietf_root, resource_key, self.__timeout)) + return results + + def SetConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: + return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + + node_id_src = find_key(resource, 'node_id_src') + tp_id_src = find_key(resource, 'tp_id_src') + node_id_dst = find_key(resource, 'node_id_dst') + tp_id_dst = find_key(resource, 'tp_id_dst') + vlan_id = find_key(resource, 'vlan_id') + uuid = find_key(resource, 'uuid') + + data = create_connectivity_service( + self.__ietf_root, self.__timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id) + results.extend(data) + return results + + def DeleteConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + uuid = find_key(resource, 'uuid') + results.extend(delete_connectivity_service(self.__ietf_root, self.__timeout, uuid)) + return results + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: IETF API Driver does not support monitoring by now + return [False for _ in subscriptions] + + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: IETF API Driver does not support monitoring by now + return [False for _ in subscriptions] + + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: + # TODO: IETF API Driver does not support monitoring by now + return [] diff --git a/src/device/service/drivers/microwave/Tools.py b/src/device/service/drivers/microwave/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..93498f72d4646e1837e934903b6b3e2da6e52259 --- /dev/null +++ b/src/device/service/drivers/microwave/Tools.py @@ -0,0 +1,151 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json, logging, requests +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS + +LOGGER = logging.getLogger(__name__) + + +def find_key(resource, key): + return json.loads(resource[1])[key] + +# this function exports only the endpoints which are not already involved in a microwave physical link +def is_exportable_endpoint(node, termination_point_id, links): + # for each link we check if the endpoint (termination_point_id) is already used by an existing link + for link in links: + src = link['source'] + dest = link['destination'] + if dest['dest-node'] == node and dest['dest-tp'] == termination_point_id: + return False + if src['source-node'] == node and src['source-tp'] == termination_point_id: + return False + return True + +def config_getter(root_url, resource_key, timeout): + # getting endpoints + network_name = 'SIAE-ETH-TOPOLOGY' + FIELDS = ''.join([ + 'ietf-network-topology:', + 'link(link-id;destination(dest-node;dest-tp);source(source-node;source-tp));', + 'node(node-id;ietf-network-topology:termination-point(tp-id;ietf-te-topology:te/name)))', + ]) + URL_TEMPLATE = '{:s}/nmswebs/restconf/data/ietf-network:networks/network={:s}?fields={:s}' + url = URL_TEMPLATE.format(root_url, network_name, FIELDS) + + result = [] + try: + response = requests.get(url, timeout=timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + else: + context = json.loads(response.content) + if resource_key == RESOURCE_ENDPOINTS: + network_instance = context.get('ietf-network:network', {}) + links = network_instance.get('ietf-network-topology:link', []) + for sip in network_instance['node']: + tp = sip['ietf-network-topology:termination-point'] + node_id = sip['node-id'] + for te in tp: + tp_id = te['tp-id'] + if not is_exportable_endpoint(node_id, tp_id, links): continue + resource_key = '/endpoints/endpoint[{:s}:{:s}]'.format(node_id,tp_id) + resource_value = {'uuid': tp_id, 'type': te['ietf-te-topology:te']['name']} + result.append((resource_key, resource_value)) + + # getting created services + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc'.format(root_url) + try: + response = requests.get(url, timeout=timeout, verify=False) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + else: + context = json.loads(response.content) + if resource_key == RESOURCE_ENDPOINTS: + etht_service = context.get('ietf-eth-tran-service:etht-svc', {}) + service_instances = etht_service.get('etht-svc-instances', []) + for service in service_instances: + service_name = service['etht-svc-name'] + resource_key = '/services/service[{:s}]'.format(service_name) + resource_value = {'uuid': service_name, 'type': service['etht-svc-type']} + result.append((resource_key, resource_value)) + return result + +def create_connectivity_service( + root_url, timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id): + + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc'.format(root_url) + headers = {'content-type': 'application/json'} + data = { + 'etht-svc-instances': [ + { + 'etht-svc-name': uuid, + 'etht-svc-type': 'ietf-eth-tran-types:p2p-svc', + 'etht-svc-end-points': [ + { + 'etht-svc-access-points': [ + {'access-node-id': node_id_src, 'access-ltp-id': tp_id_src, 'access-point-id': '1'} + ], + 'outer-tag': {'vlan-value': vlan_id, 'tag-type': 'ietf-eth-tran-types:classify-c-vlan'}, + 'etht-svc-end-point-name': '{:s}:{:s}'.format(str(node_id_src), str(tp_id_src)), + 'service-classification-type': 'ietf-eth-tran-types:vlan-classification' + }, + { + 'etht-svc-access-points': [ + {'access-node-id': node_id_dst, 'access-ltp-id': tp_id_dst, 'access-point-id': '2'} + ], + 'outer-tag': {'vlan-value': vlan_id, 'tag-type': 'ietf-eth-tran-types:classify-c-vlan'}, + 'etht-svc-end-point-name': '{:s}:{:s}'.format(str(node_id_dst), str(tp_id_dst)), + 'service-classification-type': 'ietf-eth-tran-types:vlan-classification' + } + ] + } + ] + } + results = [] + try: + LOGGER.info('Connectivity service {:s}: {:s}'.format(str(uuid), str(data))) + response = requests.post(url=url, data=json.dumps(data), timeout=timeout, headers=headers, verify=False) + LOGGER.info('Microwave Driver response: {:s}'.format(str(response))) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception creating ConnectivityService(uuid={:s}, data={:s})'.format(str(uuid), str(data))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not create ConnectivityService(uuid={:s}, data={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(data), str(response.status_code), str(response))) + results.append(response.status_code == 201) + return results + +def delete_connectivity_service(root_url, timeout, uuid): + url = '{:s}/nmswebs/restconf/data/ietf-eth-tran-service:etht-svc/etht-svc-instances={:s}' + url = url.format(root_url, uuid) + results = [] + try: + response = requests.delete(url=url, timeout=timeout, verify=False) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception deleting ConnectivityService(uuid={:s})'.format(str(uuid))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not delete ConnectivityService(uuid={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(response.status_code), str(response))) + results.append(response.status_code == 202) + return results diff --git a/src/device/service/drivers/microwave/__init__.py b/src/device/service/drivers/microwave/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..925746998061f4e05c468133dfacaaa0414551c8 --- /dev/null +++ b/src/device/service/drivers/microwave/__init__.py @@ -0,0 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES + +ALL_RESOURCE_KEYS = [ + RESOURCE_ENDPOINTS, + RESOURCE_INTERFACES, + RESOURCE_NETWORK_INSTANCES, +] + +RESOURCE_KEY_MAPPINGS = { + RESOURCE_ENDPOINTS : 'component', + RESOURCE_INTERFACES : 'interface', + RESOURCE_NETWORK_INSTANCES: 'network_instance', +} diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index e2381d81e5e1aa81907f90b6e473efb154e92e79..dd41096ec25fb74f1b1b855c98f90e09fee33194 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -1,57 +1,239 @@ -import logging, pytz, queue, threading -#from datetime import datetime, timedelta -from typing import Any, List, Tuple, Union -#from apscheduler.executors.pool import ThreadPoolExecutor -#from apscheduler.job import Job -#from apscheduler.jobstores.memory import MemoryJobStore -#from apscheduler.schedulers.background import BackgroundScheduler -from netconf_client.connect import connect_ssh -from netconf_client.ncclient import Manager -from common.type_checkers.Checkers import chk_length, chk_string, chk_type +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree, copy, logging, pytz, queue, re, threading +#import lxml.etree as ET +from datetime import datetime, timedelta +from typing import Any, Dict, Iterator, List, Optional, Tuple, Union +from apscheduler.executors.pool import ThreadPoolExecutor +from apscheduler.job import Job +from apscheduler.jobstores.memory import MemoryJobStore +from apscheduler.schedulers.background import BackgroundScheduler +from ncclient.manager import Manager, connect_ssh +from common.tools.client.RetryDecorator import delay_exponential +from common.type_checkers.Checkers import chk_length, chk_string, chk_type, chk_float from device.service.driver_api.Exceptions import UnsupportedResourceKeyException from device.service.driver_api._Driver import _Driver -from device.service.driver_api.AnyTreeTools import set_subnode_value -from device.service.drivers.openconfig.Tools import xml_pretty_print, xml_to_dict, xml_to_file -from device.service.drivers.openconfig.templates import ALL_RESOURCE_KEYS, compose_config, get_filter, parse +from device.service.driver_api.AnyTreeTools import TreeNode, get_subnode, set_subnode_value #dump_subtree +#from .Tools import xml_pretty_print, xml_to_dict, xml_to_file +from .templates import ALL_RESOURCE_KEYS, EMPTY_CONFIG, compose_config, get_filter, parse +from .RetryDecorator import retry -#logging.getLogger('ncclient.transport.ssh').setLevel(logging.WARNING) +DEBUG_MODE = False +logging.getLogger('ncclient.manager').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) +logging.getLogger('ncclient.transport.ssh').setLevel(logging.DEBUG if DEBUG_MODE else logging.WARNING) +logging.getLogger('apscheduler.executors.default').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) +logging.getLogger('apscheduler.scheduler').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) +logging.getLogger('monitoring-client').setLevel(logging.INFO if DEBUG_MODE else logging.ERROR) LOGGER = logging.getLogger(__name__) -#def do_sampling(resource_key : str, out_samples : queue.Queue): -# out_samples.put_nowait((datetime.timestamp(datetime.utcnow()), resource_key, random.random())) +RE_GET_ENDPOINT_FROM_INTERFACE_KEY = re.compile(r'.*interface\[([^\]]+)\].*') +RE_GET_ENDPOINT_FROM_INTERFACE_XPATH = re.compile(r".*interface\[oci\:name\='([^\]]+)'\].*") -class OpenConfigDriver(_Driver): - def __init__(self, address : str, port : int, **settings) -> None: # pylint: disable=super-init-not-called +# Collection of samples through NetConf is very slow and each request collects all the data. +# Populate a cache periodically (when first interface is interrogated). +# Evict data after some seconds, when data is considered as outdated + +SAMPLE_EVICTION_SECONDS = 30.0 # seconds +SAMPLE_RESOURCE_KEY = 'interfaces/interface/state/counters' + +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class NetconfSessionHandler: + def __init__(self, address : str, port : int, **settings) -> None: + self.__lock = threading.RLock() + self.__connected = threading.Event() self.__address = address self.__port = int(port) - self.__settings = settings + self.__username = settings.get('username') + self.__password = settings.get('password') + self.__key_filename = settings.get('key_filename') + self.__hostkey_verify = settings.get('hostkey_verify', True) + self.__look_for_keys = settings.get('look_for_keys', True) + self.__allow_agent = settings.get('allow_agent', True) + self.__force_running = settings.get('force_running', False) + self.__device_params = settings.get('device_params', {}) + self.__manager_params = settings.get('manager_params', {}) + self.__nc_params = settings.get('nc_params', {}) + self.__manager : Manager = None + self.__candidate_supported = False + + def connect(self): + with self.__lock: + self.__manager = connect_ssh( + host=self.__address, port=self.__port, username=self.__username, password=self.__password, + device_params=self.__device_params, manager_params=self.__manager_params, nc_params=self.__nc_params, + key_filename=self.__key_filename, hostkey_verify=self.__hostkey_verify, allow_agent=self.__allow_agent, + look_for_keys=self.__look_for_keys) + self.__candidate_supported = ':candidate' in self.__manager.server_capabilities + self.__connected.set() + + def disconnect(self): + if not self.__connected.is_set(): return + with self.__lock: + self.__manager.close_session() + + @property + def use_candidate(self): return self.__candidate_supported and not self.__force_running + + @RETRY_DECORATOR + def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin + with self.__lock: + return self.__manager.get(filter=filter, with_defaults=with_defaults) + + @RETRY_DECORATOR + def edit_config( + self, config, target='running', default_operation=None, test_option=None, + error_option=None, format='xml' # pylint: disable=redefined-builtin + ): + if config == EMPTY_CONFIG: return + with self.__lock: + self.__manager.edit_config( + config, target=target, default_operation=default_operation, test_option=test_option, + error_option=error_option, format=format) + + def locked(self, target): + return self.__manager.locked(target=target) + + def commit(self, confirmed=False, timeout=None, persist=None, persist_id=None): + return self.__manager.commit(confirmed=confirmed, timeout=timeout, persist=persist, persist_id=persist_id) + +def compute_delta_sample(previous_sample, previous_timestamp, current_sample, current_timestamp): + if previous_sample is None: return None + if previous_timestamp is None: return None + if current_sample is None: return None + if current_timestamp is None: return None + delay = current_timestamp - previous_timestamp + field_keys = set(previous_sample.keys()).union(current_sample.keys()) + field_keys.discard('name') + delta_sample = {'name': previous_sample['name']} + for field_key in field_keys: + previous_sample_value = previous_sample[field_key] + if not isinstance(previous_sample_value, (int, float)): continue + current_sample_value = current_sample[field_key] + if not isinstance(current_sample_value, (int, float)): continue + delta_value = current_sample_value - previous_sample_value + if delta_value < 0: continue + delta_sample[field_key] = delta_value / delay + return delta_sample + +class SamplesCache: + def __init__(self, netconf_handler : NetconfSessionHandler) -> None: + self.__netconf_handler = netconf_handler + self.__lock = threading.Lock() + self.__timestamp = None + self.__absolute_samples = {} + self.__delta_samples = {} + + def _refresh_samples(self) -> None: + with self.__lock: + try: + now = datetime.timestamp(datetime.utcnow()) + if self.__timestamp is not None and (now - self.__timestamp) < SAMPLE_EVICTION_SECONDS: return + str_filter = get_filter(SAMPLE_RESOURCE_KEY) + xml_data = self.__netconf_handler.get(filter=str_filter).data_ele + interface_samples = parse(SAMPLE_RESOURCE_KEY, xml_data) + for interface,samples in interface_samples: + match = RE_GET_ENDPOINT_FROM_INTERFACE_KEY.match(interface) + if match is None: continue + interface = match.group(1) + delta_sample = compute_delta_sample( + self.__absolute_samples.get(interface), self.__timestamp, samples, now) + if delta_sample is not None: self.__delta_samples[interface] = delta_sample + self.__absolute_samples[interface] = samples + self.__timestamp = now + except: # pylint: disable=bare-except + LOGGER.exception('Error collecting samples') + + def get(self, resource_key : str) -> Tuple[float, Dict]: + self._refresh_samples() + match = RE_GET_ENDPOINT_FROM_INTERFACE_XPATH.match(resource_key) + with self.__lock: + if match is None: return self.__timestamp, {} + interface = match.group(1) + return self.__timestamp, copy.deepcopy(self.__delta_samples.get(interface, {})) + +def do_sampling(samples_cache : SamplesCache, resource_key : str, out_samples : queue.Queue) -> None: + try: + timestamp, samples = samples_cache.get(resource_key) + counter_name = resource_key.split('/')[-1].split(':')[-1] + value = samples.get(counter_name) + if value is None: + LOGGER.warning('[do_sampling] value not found for {:s}'.format(resource_key)) + return + sample = (timestamp, resource_key, value) + out_samples.put_nowait(sample) + except: # pylint: disable=bare-except + LOGGER.exception('Error retrieving samples') + +def edit_config( + netconf_handler : NetconfSessionHandler, resources : List[Tuple[str, Any]], delete=False, target='running', + default_operation='merge', test_option=None, error_option=None, format='xml' # pylint: disable=redefined-builtin +): + str_method = 'DeleteConfig' if delete else 'SetConfig' + LOGGER.info('[{:s}] resources = {:s}'.format(str_method, str(resources))) + results = [None for _ in resources] + for i,resource in enumerate(resources): + str_resource_name = 'resources[#{:d}]'.format(i) + try: + LOGGER.info('[{:s}] resource = {:s}'.format(str_method, str(resource))) + chk_type(str_resource_name, resource, (list, tuple)) + chk_length(str_resource_name, resource, min_length=2, max_length=2) + resource_key,resource_value = resource + chk_string(str_resource_name + '.key', resource_key, allow_empty=False) + str_config_message = compose_config(resource_key, resource_value, delete=delete) + if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) + LOGGER.info('[{:s}] str_config_message[{:d}] = {:s}'.format( + str_method, len(str_config_message), str(str_config_message))) + netconf_handler.edit_config( + config=str_config_message, target=target, default_operation=default_operation, + test_option=test_option, error_option=error_option, format=format) + results[i] = True + except Exception as e: # pylint: disable=broad-except + str_operation = 'preparing' if target == 'candidate' else ('deleting' if delete else 'setting') + msg = '[{:s}] Exception {:s} {:s}: {:s}' + LOGGER.exception(msg.format(str_method, str_operation, str_resource_name, str(resource))) + results[i] = e # if validation fails, store the exception + return results + +class OpenConfigDriver(_Driver): + def __init__(self, address : str, port : int, **settings) -> None: # pylint: disable=super-init-not-called self.__lock = threading.Lock() #self.__initial = TreeNode('.') #self.__running = TreeNode('.') + self.__subscriptions = TreeNode('.') self.__started = threading.Event() self.__terminate = threading.Event() - self.__netconf_manager : Manager = None - #self.__scheduler = BackgroundScheduler(daemon=True) # scheduler used to emulate sampling events - #self.__scheduler.configure( - # jobstores = {'default': MemoryJobStore()}, - # executors = {'default': ThreadPoolExecutor(max_workers=1)}, - # job_defaults = {'coalesce': False, 'max_instances': 3}, - # timezone=pytz.utc) - #self.__out_samples = queue.Queue() + self.__scheduler = BackgroundScheduler(daemon=True) # scheduler used to emulate sampling events + self.__scheduler.configure( + jobstores = {'default': MemoryJobStore()}, + executors = {'default': ThreadPoolExecutor(max_workers=1)}, + job_defaults = {'coalesce': False, 'max_instances': 3}, + timezone=pytz.utc) + self.__out_samples = queue.Queue() + self.__netconf_handler : NetconfSessionHandler = NetconfSessionHandler(address, port, **settings) + self.__samples_cache = SamplesCache(self.__netconf_handler) def Connect(self) -> bool: with self.__lock: if self.__started.is_set(): return True - username = self.__settings.get('username') - password = self.__settings.get('password') - timeout = int(self.__settings.get('timeout', 120)) - session = connect_ssh( - host=self.__address, port=self.__port, username=username, password=password) - self.__netconf_manager = Manager(session, timeout=timeout) - self.__netconf_manager.set_logger_level(logging.DEBUG) + self.__netconf_handler.connect() # Connect triggers activation of sampling events that will be scheduled based on subscriptions - #self.__scheduler.start() + self.__scheduler.start() self.__started.set() return True @@ -62,8 +244,8 @@ class OpenConfigDriver(_Driver): # If not started, assume it is already disconnected if not self.__started.is_set(): return True # Disconnect triggers deactivation of sampling events - #self.__scheduler.shutdown() - self.__netconf_manager.close_session() + self.__scheduler.shutdown() + self.__netconf_handler.disconnect() return True def GetInitialConfig(self) -> List[Tuple[str, Any]]: @@ -80,8 +262,9 @@ class OpenConfigDriver(_Driver): try: chk_string(str_resource_name, resource_key, allow_empty=False) str_filter = get_filter(resource_key) + LOGGER.info('[GetConfig] str_filter = {:s}'.format(str(str_filter))) if str_filter is None: str_filter = resource_key - xml_data = self.__netconf_manager.get(filter=str_filter).data_ele + xml_data = self.__netconf_handler.get(filter=str_filter).data_ele if isinstance(xml_data, Exception): raise xml_data results.extend(parse(resource_key, xml_data)) except Exception as e: # pylint: disable=broad-except @@ -89,143 +272,125 @@ class OpenConfigDriver(_Driver): results.append((resource_key, e)) # if validation fails, store the exception return results - #def GetResource(self, endpoint_uuid : str) -> Optional[str]: - # chk_string('endpoint_uuid', endpoint_uuid) - # return { - # #'key': 'value', - # }.get(endpoint_uuid) - def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: chk_type('resources', resources, list) if len(resources) == 0: return [] + with self.__lock: + if self.__netconf_handler.use_candidate: + with self.__netconf_handler.locked(target='candidate'): + results = edit_config(self.__netconf_handler, resources, target='candidate') + try: + self.__netconf_handler.commit() + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('[SetConfig] Exception commiting resources: {:s}'.format(str(resources))) + results = [e for _ in resources] # if commit fails, set exception in each resource + else: + results = edit_config(self.__netconf_handler, resources) + return results + + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + with self.__lock: + if self.__netconf_handler.use_candidate: + with self.__netconf_handler.locked(target='candidate'): + results = edit_config(self.__netconf_handler, resources, target='candidate', delete=True) + try: + self.__netconf_handler.commit() + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('[DeleteConfig] Exception commiting resources: {:s}'.format(str(resources))) + results = [e for _ in resources] # if commit fails, set exception in each resource + else: + results = edit_config(self.__netconf_handler, resources, delete=True) + return results + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + chk_type('subscriptions', subscriptions, list) + if len(subscriptions) == 0: return [] results = [] + resolver = anytree.Resolver(pathattr='name') with self.__lock: - for i,resource in enumerate(resources): - str_resource_name = 'resources[#{:d}]'.format(i) + for i,subscription in enumerate(subscriptions): + str_subscription_name = 'subscriptions[#{:d}]'.format(i) try: - #LOGGER.info('resource = {:s}'.format(str(resource))) - chk_type(str_resource_name, resource, (list, tuple)) - chk_length(str_resource_name, resource, min_length=2, max_length=2) - resource_key,resource_value = resource - chk_string(str_resource_name + '.key', resource_key, allow_empty=False) - str_config_message = compose_config(resource_key, resource_value) - if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) - #LOGGER.info('str_config_message = {:s}'.format(str(str_config_message))) - self.__netconf_manager.edit_config(str_config_message, target='running') - results.append(True) + chk_type(str_subscription_name, subscription, (list, tuple)) + chk_length(str_subscription_name, subscription, min_length=3, max_length=3) + resource_key,sampling_duration,sampling_interval = subscription + chk_string(str_subscription_name + '.resource_key', resource_key, allow_empty=False) + resource_path = resource_key.split('/') + chk_float(str_subscription_name + '.sampling_duration', sampling_duration, min_value=0) + chk_float(str_subscription_name + '.sampling_interval', sampling_interval, min_value=0) except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Exception setting {:s}: {:s}'.format(str_resource_name, str(resource))) + LOGGER.exception('Exception validating {:s}: {:s}'.format(str_subscription_name, str(resource_key))) results.append(e) # if validation fails, store the exception + continue + + start_date,end_date = None,None + if sampling_duration >= 1.e-12: + start_date = datetime.utcnow() + end_date = start_date + timedelta(seconds=sampling_duration) + + job_id = 'k={:s}/d={:f}/i={:f}'.format(resource_key, sampling_duration, sampling_interval) + job = self.__scheduler.add_job( + do_sampling, args=(self.__samples_cache, resource_key, self.__out_samples), + kwargs={}, id=job_id, trigger='interval', seconds=sampling_interval, + start_date=start_date, end_date=end_date, timezone=pytz.utc) + + subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] + set_subnode_value(resolver, self.__subscriptions, subscription_path, job) + results.append(True) return results - def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: - chk_type('resources', resources, list) - if len(resources) == 0: return [] + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + chk_type('subscriptions', subscriptions, list) + if len(subscriptions) == 0: return [] results = [] + resolver = anytree.Resolver(pathattr='name') with self.__lock: - for i,resource in enumerate(resources): - str_resource_name = 'resources[#{:d}]'.format(i) + for i,resource in enumerate(subscriptions): + str_subscription_name = 'resources[#{:d}]'.format(i) try: - #LOGGER.info('resource = {:s}'.format(str(resource))) - chk_type(str_resource_name, resource, (list, tuple)) - chk_length(str_resource_name, resource, min_length=2, max_length=2) - resource_key,resource_value = resource - chk_string(str_resource_name + '.key', resource_key, allow_empty=False) - str_config_message = compose_config(resource_key, resource_value, delete=True) - if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) - #LOGGER.info('str_config_message = {:s}'.format(str(str_config_message))) - self.__netconf_manager.edit_config(str_config_message, target='running') - results.append(True) + chk_type(str_subscription_name, resource, (list, tuple)) + chk_length(str_subscription_name, resource, min_length=3, max_length=3) + resource_key,sampling_duration,sampling_interval = resource + chk_string(str_subscription_name + '.resource_key', resource_key, allow_empty=False) + resource_path = resource_key.split('/') + chk_float(str_subscription_name + '.sampling_duration', sampling_duration, min_value=0) + chk_float(str_subscription_name + '.sampling_interval', sampling_interval, min_value=0) except Exception as e: # pylint: disable=broad-except - LOGGER.exception('Exception deleting {:s}: {:s}'.format(str_resource_name, str(resource_key))) + LOGGER.exception('Exception validating {:s}: {:s}'.format(str_subscription_name, str(resource_key))) results.append(e) # if validation fails, store the exception + continue + + subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] + subscription_node = get_subnode(resolver, self.__subscriptions, subscription_path) + + # if not found, resource_node is None + if subscription_node is None: + results.append(False) + continue + + job : Job = getattr(subscription_node, 'value', None) + if job is None or not isinstance(job, Job): + raise Exception('Malformed subscription node or wrong resource key: {:s}'.format(str(resource))) + job.remove() + + parent = subscription_node.parent + children = list(parent.children) + children.remove(subscription_node) + parent.children = tuple(children) + + results.append(True) return results -# def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: -# chk_type('subscriptions', subscriptions, list) -# if len(subscriptions) == 0: return [] -# results = [] -# resolver = anytree.Resolver(pathattr='name') -# with self.__lock: -# for i,subscription in enumerate(subscriptions): -# str_subscription_name = 'subscriptions[#{:d}]'.format(i) -# try: -# chk_type(str_subscription_name, subscription, (list, tuple)) -# chk_length(str_subscription_name, subscription, min_length=3, max_length=3) -# resource_key,sampling_duration,sampling_interval = subscription -# chk_string(str_subscription_name + '.resource_key', resource_key, allow_empty=False) -# resource_path = resource_key.split('/') -# chk_float(str_subscription_name + '.sampling_duration', sampling_duration, min_value=0) -# chk_float(str_subscription_name + '.sampling_interval', sampling_interval, min_value=0) -# except Exception as e: # pylint: disable=broad-except -# LOGGER.exception('Exception validating {:s}: {:s}'.format(str_subscription_name, str(resource_key))) -# results.append(e) # if validation fails, store the exception -# continue -# -# start_date,end_date = None,None -# if sampling_duration <= 1.e-12: -# start_date = datetime.utcnow() -# end_date = start_date + timedelta(seconds=sampling_duration) -# -# job_id = 'k={:s}/d={:f}/i={:f}'.format(resource_key, sampling_duration, sampling_interval) -# job = self.__scheduler.add_job( -# do_sampling, args=(resource_key, self.__out_samples), kwargs={}, -# id=job_id, trigger='interval', seconds=sampling_interval, -# start_date=start_date, end_date=end_date, timezone=pytz.utc) -# -# subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] -# set_subnode_value(resolver, self.__running, subscription_path, job) -# results.append(True) -# return results -# -# def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: -# chk_type('subscriptions', subscriptions, list) -# if len(subscriptions) == 0: return [] -# results = [] -# resolver = anytree.Resolver(pathattr='name') -# with self.__lock: -# for i,resource in enumerate(subscriptions): -# str_subscription_name = 'resources[#{:d}]'.format(i) -# try: -# chk_type(str_subscription_name, resource, (list, tuple)) -# chk_length(str_subscription_name, resource, min_length=3, max_length=3) -# resource_key,sampling_duration,sampling_interval = resource -# chk_string(str_subscription_name + '.resource_key', resource_key, allow_empty=False) -# resource_path = resource_key.split('/') -# chk_float(str_subscription_name + '.sampling_duration', sampling_duration, min_value=0) -# chk_float(str_subscription_name + '.sampling_interval', sampling_interval, min_value=0) -# except Exception as e: # pylint: disable=broad-except -# LOGGER.exception('Exception validating {:s}: {:s}'.format(str_subscription_name, str(resource_key))) -# results.append(e) # if validation fails, store the exception -# continue -# -# subscription_path = resource_path + ['{:.3f}:{:.3f}'.format(sampling_duration, sampling_interval)] -# subscription_node = get_subnode(resolver, self.__running, subscription_path) -# -# # if not found, resource_node is None -# if subscription_node is None: -# results.append(False) -# continue -# -# job : Job = getattr(subscription_node, 'value', None) -# if job is None or not isinstance(job, Job): -# raise Exception('Malformed subscription node or wrong resource key: {:s}'.format(str(resource))) -# job.remove() -# -# parent = subscription_node.parent -# children = list(parent.children) -# children.remove(subscription_node) -# parent.children = tuple(children) -# -# results.append(True) -# return results -# -# def GetState(self, blocking=False) -> Iterator[Tuple[str, Any]]: -# while not self.__terminate.is_set(): -# try: -# sample = self.__out_samples.get(block=blocking, timeout=0.1) -# except queue.Empty: -# if blocking: continue -# return -# if sample is None: continue -# yield sample + def GetState(self, blocking=False, terminate : Optional[threading.Event] = None) -> Iterator[Tuple[str, Any]]: + while True: + if self.__terminate.is_set(): break + if terminate is not None and terminate.is_set(): break + try: + sample = self.__out_samples.get(block=blocking, timeout=0.1) + except queue.Empty: + if blocking: continue + return + if sample is None: continue + yield sample diff --git a/src/device/service/drivers/openconfig/RetryDecorator.py b/src/device/service/drivers/openconfig/RetryDecorator.py new file mode 100644 index 0000000000000000000000000000000000000000..d8ccddb4d09dd8863cedc2893fb3c6ec4e0491cd --- /dev/null +++ b/src/device/service/drivers/openconfig/RetryDecorator.py @@ -0,0 +1,46 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, time +from common.tools.client.RetryDecorator import delay_linear + +LOGGER = logging.getLogger(__name__) + +def retry(max_retries=0, delay_function=delay_linear(initial=0, increment=0), + prepare_method_name=None, prepare_method_args=[], prepare_method_kwargs={}): + def _reconnect(func): + def wrapper(self, *args, **kwargs): + if prepare_method_name is not None: + prepare_method = getattr(self, prepare_method_name, None) + if prepare_method is None: raise Exception('Prepare Method ({}) not found'.format(prepare_method_name)) + num_try, given_up = 0, False + while not given_up: + try: + return func(self, *args, **kwargs) + except OSError as e: + if str(e) != 'Socket is closed': raise + + num_try += 1 + given_up = num_try > max_retries + if given_up: raise Exception('Giving up... {:d} tries failed'.format(max_retries)) from e + if delay_function is not None: + delay = delay_function(num_try) + time.sleep(delay) + LOGGER.info('Retry {:d}/{:d} after {:f} seconds...'.format(num_try, max_retries, delay)) + else: + LOGGER.info('Retry {:d}/{:d} immediate...'.format(num_try, max_retries)) + + if prepare_method_name is not None: prepare_method(*prepare_method_args, **prepare_method_kwargs) + return wrapper + return _reconnect diff --git a/src/device/service/drivers/openconfig/Tools.py b/src/device/service/drivers/openconfig/Tools.py index 230a6e3c33586c5d1771a6da2fd9dabc533e9538..73d46145cd159257af086ad9498261c9accf97b3 100644 --- a/src/device/service/drivers/openconfig/Tools.py +++ b/src/device/service/drivers/openconfig/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import xml.dom.minidom, xmltodict def xml_pretty_print(data : str): diff --git a/src/device/service/drivers/openconfig/__init__.py b/src/device/service/drivers/openconfig/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/service/drivers/openconfig/__init__.py +++ b/src/device/service/drivers/openconfig/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/service/drivers/openconfig/templates/Acl.py b/src/device/service/drivers/openconfig/templates/Acl.py new file mode 100644 index 0000000000000000000000000000000000000000..6cd90f373427e2ab55550985929c4cfcd8798702 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/Acl.py @@ -0,0 +1,123 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, lxml.etree as ET +from typing import Any, Dict, List, Tuple +from .Namespace import NAMESPACES +from .Tools import add_value_from_tag + +LOGGER = logging.getLogger(__name__) + +XPATH_ACL_SET = "//ocacl:acl/ocacl:acl-sets/ocacl:acl-set" +XPATH_A_ACL_ENTRY = ".//ocacl:acl-entries/ocacl:ecl-entry" +XPATH_A_IPv4 = ".//ocacl:ipv4/ocacl:config" +XPATH_A_TRANSPORT = ".//ocacl:transport/ocacl:config" +XPATH_A_ACTIONS = ".//ocacl:actions/ocacl:config" + +XPATH_INTERFACE = "//ocacl:acl/ocacl:interfaces/ocacl:interface" +XPATH_I_INGRESS = ".//ocacl:ingress-acl-sets/ocacl:ingress-acl-set" +XPATH_I_EGRESS = ".//ocacl:egress-acl-sets/ocacl:egress-acl-set" + +def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + #LOGGER.info('[ACL] xml_data = {:s}'.format(str(ET.tostring(xml_data)))) + + response = [] + acl = {} + + for xml_acl in xml_data.xpath(XPATH_ACL_SET, namespaces=NAMESPACES): + #LOGGER.info('xml_acl = {:s}'.format(str(ET.tostring(xml_acl)))) + + acl_name = xml_acl.find('ocacl:name', namespaces=NAMESPACES) + if acl_name is None or acl_name.text is None: continue + add_value_from_tag(acl, 'name', acl_name) + + acl_type = xml_acl.find('ocacl:type', namespaces=NAMESPACES) + add_value_from_tag(acl, 'type', acl_type) + + for xml_acl_entries in xml_acl.xpath(XPATH_A_ACL_ENTRY, namespaces=NAMESPACES): + + acl_id = xml_acl_entries.find('ocacl:sequence_id', namespaces=NAMESPACES) + add_value_from_tag(acl, 'sequence_id', acl_id) + + for xml_ipv4 in xml_acl_entries.xpath(XPATH_A_IPv4, namespaces=NAMESPACES): + + ipv4_source = xml_ipv4.find('ocacl:source_address', namespaces=NAMESPACES) + add_value_from_tag(acl, 'source_address' , ipv4_source) + + ipv4_destination = xml_ipv4.find('ocacl:destination_address', namespaces=NAMESPACES) + add_value_from_tag(acl, 'destination_address' , ipv4_destination) + + ipv4_protocol = xml_ipv4.find('ocacl:protocol', namespaces=NAMESPACES) + add_value_from_tag(acl, 'protocol' , ipv4_protocol) + + ipv4_dscp = xml_ipv4.find('ocacl:dscp', namespaces=NAMESPACES) + add_value_from_tag(acl, 'dscp' , ipv4_dscp) + + ipv4_hop_limit = xml_ipv4.find('ocacl:hop_limit', namespaces=NAMESPACES) + add_value_from_tag(acl, 'hop_limit' , ipv4_hop_limit) + + for xml_transport in xml_acl_entries.xpath(XPATH_A_TRANSPORT, namespaces=NAMESPACES): + + transport_source = xml_transport.find('ocacl:source_port', namespaces=NAMESPACES) + add_value_from_tag(acl, 'source_port' ,transport_source) + + transport_destination = xml_transport.find('ocacl:destination_port', namespaces=NAMESPACES) + add_value_from_tag(acl, 'destination_port' ,transport_destination) + + transport_tcp_flags = xml_transport.find('ocacl:tcp_flags', namespaces=NAMESPACES) + add_value_from_tag(acl, 'tcp_flags' ,transport_tcp_flags) + + for xml_action in xml_acl_entries.xpath(XPATH_A_ACTIONS, namespaces=NAMESPACES): + + action = xml_action.find('ocacl:forwarding_action', namespaces=NAMESPACES) + add_value_from_tag(acl, 'forwarding_action' ,action) + + log_action = xml_action.find('ocacl:log_action', namespaces=NAMESPACES) + add_value_from_tag(acl, 'log_action' ,log_action) + + resource_key = '/acl/acl-set[{:s}][{:s}]/acl-entry[{:s}]'.format( + acl['name'], acl['type'], acl['sequence-id']) + response.append((resource_key,acl)) + + for xml_interface in xml_data.xpath(XPATH_INTERFACE, namespaces=NAMESPACES): + + interface = {} + + interface_id = xml_interface.find('ocacl:id', namespaces=NAMESPACES) + add_value_from_tag(interface, 'id' , interface_id) + + for xml_ingress in xml_interface.xpath(XPATH_I_INGRESS, namespaces=NAMESPACES): + + i_name = xml_ingress.find('ocacl:set_name_ingress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'ingress_set_name' , i_name) + + i_type = xml_ingress.find('ocacl:type_ingress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'ingress_type' , i_type) + + resource_key = '/acl/interfaces/ingress[{:s}][{:s}]'.format( + acl['name'], acl['type']) + response.append((resource_key,interface)) + + for xml_egress in xml_interface.xpath(XPATH_I_EGRESS, namespaces=NAMESPACES): + + e_name = xml_egress.find('ocacl:set_name_egress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'egress_set_name' , e_name) + + e_type = xml_egress.find('ocacl:type_egress', namespaces=NAMESPACES) + add_value_from_tag(interface, 'egress_type' , e_type) + + resource_key = '/acl/interfaces/egress[{:s}][{:s}]'.format( + acl['name'], acl['type']) + response.append((resource_key,interface)) + return response diff --git a/src/device/service/drivers/openconfig/templates/EndPoints.py b/src/device/service/drivers/openconfig/templates/EndPoints.py index a7d5c9be6ce9dd53d3b31998b4d4a269c972eb22..c11b1669d5b4cf3ca47986817ded28f75ae8358f 100644 --- a/src/device/service/drivers/openconfig/templates/EndPoints.py +++ b/src/device/service/drivers/openconfig/templates/EndPoints.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, lxml.etree as ET from typing import Any, Dict, List, Tuple from device.service.database.KpiSampleType import ORM_KpiSampleTypeEnum @@ -33,5 +47,5 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: add_value_from_collection(endpoint, 'sample_types', sample_types) if len(endpoint) == 0: continue - response.append(('endpoint[{:s}]'.format(endpoint['uuid']), endpoint)) + response.append(('/endpoint[{:s}]'.format(endpoint['uuid']), endpoint)) return response diff --git a/src/device/service/drivers/openconfig/templates/Interfaces.py b/src/device/service/drivers/openconfig/templates/Interfaces.py index 0bbd70d04a3c093dcdbad4966be3030dbc8ba0fb..33f977524c6f65655fbe17f6d2d95a7cfc223967 100644 --- a/src/device/service/drivers/openconfig/templates/Interfaces.py +++ b/src/device/service/drivers/openconfig/templates/Interfaces.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, lxml.etree as ET from typing import Any, Dict, List, Tuple from .Namespace import NAMESPACES @@ -12,7 +26,7 @@ XPATH_IPV4ADDRESSES = ".//ociip:ipv4/ociip:addresses/ociip:address" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] for xml_interface in xml_data.xpath(XPATH_INTERFACES, namespaces=NAMESPACES): - LOGGER.info('xml_interface = {:s}'.format(str(ET.tostring(xml_interface)))) + #LOGGER.info('xml_interface = {:s}'.format(str(ET.tostring(xml_interface)))) interface = {} @@ -20,46 +34,96 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: if interface_name is None or interface_name.text is None: continue add_value_from_tag(interface, 'name', interface_name) - interface_type = xml_interface.find('oci:config/oci:type', namespaces=NAMESPACES) - add_value_from_tag(interface, 'type', interface_type) + #interface_type = xml_interface.find('oci:config/oci:type', namespaces=NAMESPACES) + #add_value_from_tag(interface, 'type', interface_type) + + interface_mtu = xml_interface.find('oci:config/oci:mtu', namespaces=NAMESPACES) + add_value_from_tag(interface, 'mtu', interface_mtu, cast=int) + + interface_description = xml_interface.find('oci:config/oci:description', namespaces=NAMESPACES) + add_value_from_tag(interface, 'description', interface_description) for xml_subinterface in xml_interface.xpath(XPATH_SUBINTERFACES, namespaces=NAMESPACES): - LOGGER.info('xml_subinterface = {:s}'.format(str(ET.tostring(xml_subinterface)))) + #LOGGER.info('xml_subinterface = {:s}'.format(str(ET.tostring(xml_subinterface)))) subinterface = {} + add_value_from_tag(subinterface, 'name', interface_name) + subinterface_index = xml_subinterface.find('oci:index', namespaces=NAMESPACES) if subinterface_index is None or subinterface_index.text is None: continue - add_value_from_tag(subinterface, 'index', subinterface_index) + add_value_from_tag(subinterface, 'index', subinterface_index, cast=int) vlan_id = xml_subinterface.find('ocv:vlan/ocv:config/ocv:vlan-id', namespaces=NAMESPACES) add_value_from_tag(subinterface, 'vlan_id', vlan_id, cast=int) - ipv4_addresses = [] + # TODO: implement support for multiple IP addresses per subinterface + #ipv4_addresses = [] for xml_ipv4_address in xml_subinterface.xpath(XPATH_IPV4ADDRESSES, namespaces=NAMESPACES): - LOGGER.info('xml_ipv4_address = {:s}'.format(str(ET.tostring(xml_ipv4_address)))) + #LOGGER.info('xml_ipv4_address = {:s}'.format(str(ET.tostring(xml_ipv4_address)))) - ipv4_address = {} + #ipv4_address = {} - origin = xml_ipv4_address.find('ociip:state/ociip:origin', namespaces=NAMESPACES) - add_value_from_tag(ipv4_address, 'origin', origin) + #origin = xml_ipv4_address.find('ociip:state/ociip:origin', namespaces=NAMESPACES) + #add_value_from_tag(ipv4_address, 'origin', origin) address = xml_ipv4_address.find('ociip:state/ociip:ip', namespaces=NAMESPACES) - add_value_from_tag(ipv4_address, 'ip', address) + #add_value_from_tag(ipv4_address, 'ip', address) + add_value_from_tag(subinterface, 'address_ip', address) prefix = xml_ipv4_address.find('ociip:state/ociip:prefix-length', namespaces=NAMESPACES) - add_value_from_tag(ipv4_address, 'prefix_length', prefix) + #add_value_from_tag(ipv4_address, 'prefix_length', prefix) + add_value_from_tag(subinterface, 'address_prefix', prefix, cast=int) - if len(ipv4_address) == 0: continue - ipv4_addresses.append(ipv4_address) + #if len(ipv4_address) == 0: continue + #ipv4_addresses.append(ipv4_address) - add_value_from_collection(subinterface, 'ipv4_addresses', ipv4_addresses) + #add_value_from_collection(subinterface, 'ipv4_addresses', ipv4_addresses) if len(subinterface) == 0: continue - resource_key = 'interface[{:s}]/subinterface[{:s}]'.format(interface['name'], subinterface['index']) + resource_key = '/interface[{:s}]/subinterface[{:s}]'.format(interface['name'], str(subinterface['index'])) response.append((resource_key, subinterface)) if len(interface) == 0: continue - response.append(('interface[{:s}]'.format(interface['name']), interface)) + response.append(('/interface[{:s}]'.format(interface['name']), interface)) + + return response + +def parse_counters(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + response = [] + for xml_interface in xml_data.xpath(XPATH_INTERFACES, namespaces=NAMESPACES): + #LOGGER.info('[parse_counters] xml_interface = {:s}'.format(str(ET.tostring(xml_interface)))) + + interface = {} + + interface_name = xml_interface.find('oci:name', namespaces=NAMESPACES) + if interface_name is None or interface_name.text is None: continue + add_value_from_tag(interface, 'name', interface_name) + + interface_in_pkts = xml_interface.find('oci:state/oci:counters/oci:in-pkts', namespaces=NAMESPACES) + add_value_from_tag(interface, 'in-pkts', interface_in_pkts, cast=int) + + interface_in_octets = xml_interface.find('oci:state/oci:counters/oci:in-octets', namespaces=NAMESPACES) + add_value_from_tag(interface, 'in-octets', interface_in_octets, cast=int) + + interface_in_errors = xml_interface.find('oci:state/oci:counters/oci:in-errors', namespaces=NAMESPACES) + add_value_from_tag(interface, 'in-errors', interface_in_errors, cast=int) + + interface_out_octets = xml_interface.find('oci:state/oci:counters/oci:out-octets', namespaces=NAMESPACES) + add_value_from_tag(interface, 'out-octets', interface_out_octets, cast=int) + + interface_out_pkts = xml_interface.find('oci:state/oci:counters/oci:out-pkts', namespaces=NAMESPACES) + add_value_from_tag(interface, 'out-pkts', interface_out_pkts, cast=int) + + interface_out_errors = xml_interface.find('oci:state/oci:counters/oci:out-errors', namespaces=NAMESPACES) + add_value_from_tag(interface, 'out-errors', interface_out_errors, cast=int) + + interface_out_discards = xml_interface.find('oci:state/oci:counters/oci:out-discards', namespaces=NAMESPACES) + add_value_from_tag(interface, 'out-discards', interface_out_discards, cast=int) + + #LOGGER.info('[parse_counters] interface = {:s}'.format(str(interface))) + + if len(interface) == 0: continue + response.append(('/interface[{:s}]'.format(interface['name']), interface)) return response diff --git a/src/device/service/drivers/openconfig/templates/Namespace.py b/src/device/service/drivers/openconfig/templates/Namespace.py index ff4b7c9c747b4efa872ba177e6e6a4fd7f6203b4..94af95566f33751a25fb1cb1c817cbffa910eec4 100644 --- a/src/device/service/drivers/openconfig/templates/Namespace.py +++ b/src/device/service/drivers/openconfig/templates/Namespace.py @@ -1,6 +1,22 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -NAMESPACE_NETCONF = 'urn:ietf:params:xml:ns:netconf:base:1.0' +NAMESPACE_NETCONF = 'urn:ietf:params:xml:ns:netconf:base:1.0' + +NAMESPACE_ACL = 'http://openconfig.net/yang/acl' +NAMESPACE_BGP_POLICY = 'http://openconfig.net/yang/bgp-policy' NAMESPACE_INTERFACES = 'http://openconfig.net/yang/interfaces' NAMESPACE_INTERFACES_IP = 'http://openconfig.net/yang/interfaces/ip' NAMESPACE_NETWORK_INSTANCE = 'http://openconfig.net/yang/network-instance' @@ -8,10 +24,15 @@ NAMESPACE_NETWORK_INSTANCE_TYPES = 'http://openconfig.net/yang/network-instance- NAMESPACE_OPENCONFIG_TYPES = 'http://openconfig.net/yang/openconfig-types' NAMESPACE_PLATFORM = 'http://openconfig.net/yang/platform' NAMESPACE_PLATFORM_PORT = 'http://openconfig.net/yang/platform/port' +NAMESPACE_POLICY_TYPES = 'http://openconfig.net/yang/policy-types' +NAMESPACE_POLICY_TYPES_2 = 'http://openconfig.net/yang/policy_types' +NAMESPACE_ROUTING_POLICY = 'http://openconfig.net/yang/routing-policy' NAMESPACE_VLAN = 'http://openconfig.net/yang/vlan' NAMESPACES = { 'nc' : NAMESPACE_NETCONF, + 'ocacl': NAMESPACE_ACL, + 'ocbp' : NAMESPACE_BGP_POLICY, 'oci' : NAMESPACE_INTERFACES, 'ociip': NAMESPACE_INTERFACES_IP, 'ocni' : NAMESPACE_NETWORK_INSTANCE, @@ -19,5 +40,8 @@ NAMESPACES = { 'ococt': NAMESPACE_OPENCONFIG_TYPES, 'ocp' : NAMESPACE_PLATFORM, 'ocpp' : NAMESPACE_PLATFORM_PORT, + 'ocpt' : NAMESPACE_POLICY_TYPES, + 'ocpt2': NAMESPACE_POLICY_TYPES_2, + 'ocrp' : NAMESPACE_ROUTING_POLICY, 'ocv' : NAMESPACE_VLAN, } diff --git a/src/device/service/drivers/openconfig/templates/NetworkInstances.py b/src/device/service/drivers/openconfig/templates/NetworkInstances.py index 06bf5cd0f38aaf8c61f2919c25891e15f9ac4343..b091a0d206195a6c2ce94008628071cd9e30944f 100644 --- a/src/device/service/drivers/openconfig/templates/NetworkInstances.py +++ b/src/device/service/drivers/openconfig/templates/NetworkInstances.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, lxml.etree as ET from typing import Any, Dict, List, Tuple from .Namespace import NAMESPACES @@ -6,6 +20,12 @@ from .Tools import add_value_from_collection, add_value_from_tag LOGGER = logging.getLogger(__name__) XPATH_NETWORK_INSTANCES = "//ocni:network-instances/ocni:network-instance" +XPATH_NI_PROTOCOLS = ".//ocni:protocols/ocni:protocol" +XPATH_NI_TABLE_CONNECTS = ".//ocni:table-connections/ocni:table-connection" + +XPATH_NI_IIP_AP = ".//ocni:inter-instance-policies/ocni:apply-policy" +XPATH_NI_IIP_AP_IMPORT = ".//ocni:config/ocni:import-policy" +XPATH_NI_IIP_AP_EXPORT = ".//ocni:config/ocni:export-policy" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] @@ -21,15 +41,88 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: ni_type = xml_network_instance.find('ocni:config/ocni:type', namespaces=NAMESPACES) add_value_from_tag(network_instance, 'type', ni_type) - ni_router_id = xml_network_instance.find('ocni:config/ocni:router-id', namespaces=NAMESPACES) - add_value_from_tag(network_instance, 'router_id', ni_router_id) + #ni_router_id = xml_network_instance.find('ocni:config/ocni:router-id', namespaces=NAMESPACES) + #add_value_from_tag(network_instance, 'router_id', ni_router_id) ni_route_dist = xml_network_instance.find('ocni:config/ocni:route-distinguisher', namespaces=NAMESPACES) add_value_from_tag(network_instance, 'route_distinguisher', ni_route_dist) - ni_address_families = [] - add_value_from_collection(network_instance, 'address_families', ni_address_families) + #ni_address_families = [] + #add_value_from_collection(network_instance, 'address_families', ni_address_families) if len(network_instance) == 0: continue - response.append(('network_instance[{:s}]'.format(network_instance['name']), network_instance)) + response.append(('/network_instance[{:s}]'.format(network_instance['name']), network_instance)) + + for xml_protocol in xml_network_instance.xpath(XPATH_NI_PROTOCOLS, namespaces=NAMESPACES): + #LOGGER.info('xml_protocol = {:s}'.format(str(ET.tostring(xml_protocol)))) + + protocol = {} + add_value_from_tag(protocol, 'name', ni_name) + + identifier = xml_protocol.find('ocni:identifier', namespaces=NAMESPACES) + if identifier is None: identifier = xml_protocol.find('ocpt:identifier', namespaces=NAMESPACES) + if identifier is None: identifier = xml_protocol.find('ocpt2:identifier', namespaces=NAMESPACES) + if identifier is None or identifier.text is None: continue + add_value_from_tag(protocol, 'identifier', identifier, cast=lambda s: s.replace('oc-pol-types:', '')) + + name = xml_protocol.find('ocni:name', namespaces=NAMESPACES) + add_value_from_tag(protocol, 'protocol_name', name) + + if protocol['identifier'] == 'BGP': + bgp_as = xml_protocol.find('ocni:bgp/ocni:global/ocni:config/ocni:as', namespaces=NAMESPACES) + add_value_from_tag(protocol, 'as', bgp_as, cast=int) + + resource_key = '/network_instance[{:s}]/protocols[{:s}]'.format( + network_instance['name'], protocol['identifier']) + response.append((resource_key, protocol)) + + for xml_table_connection in xml_network_instance.xpath(XPATH_NI_TABLE_CONNECTS, namespaces=NAMESPACES): + #LOGGER.info('xml_table_connection = {:s}'.format(str(ET.tostring(xml_table_connection)))) + + table_connection = {} + add_value_from_tag(table_connection, 'name', ni_name) + + src_protocol = xml_table_connection.find('ocni:src-protocol', namespaces=NAMESPACES) + add_value_from_tag(table_connection, 'src_protocol', src_protocol, + cast=lambda s: s.replace('oc-pol-types:', '')) + + dst_protocol = xml_table_connection.find('ocni:dst-protocol', namespaces=NAMESPACES) + add_value_from_tag(table_connection, 'dst_protocol', dst_protocol, + cast=lambda s: s.replace('oc-pol-types:', '')) + + address_family = xml_table_connection.find('ocni:address-family', namespaces=NAMESPACES) + add_value_from_tag(table_connection, 'address_family', address_family, + cast=lambda s: s.replace('oc-types:', '')) + + default_import_policy = xml_table_connection.find('ocni:default-import-policy', namespaces=NAMESPACES) + add_value_from_tag(table_connection, 'default_import_policy', default_import_policy) + + resource_key = '/network_instance[{:s}]/table_connections[{:s}][{:s}][{:s}]'.format( + network_instance['name'], table_connection['src_protocol'], table_connection['dst_protocol'], + table_connection['address_family']) + response.append((resource_key, table_connection)) + + for xml_iip_ap in xml_network_instance.xpath(XPATH_NI_IIP_AP, namespaces=NAMESPACES): + #LOGGER.info('xml_iip_ap = {:s}'.format(str(ET.tostring(xml_iip_ap)))) + + for xml_import_policy in xml_iip_ap.xpath(XPATH_NI_IIP_AP_IMPORT, namespaces=NAMESPACES): + #LOGGER.info('xml_import_policy = {:s}'.format(str(ET.tostring(xml_import_policy)))) + if xml_import_policy.text is None: continue + iip_ap = {} + add_value_from_tag(iip_ap, 'name', ni_name) + add_value_from_tag(iip_ap, 'import_policy', xml_import_policy) + resource_key = '/network_instance[{:s}]/inter_instance_policies[{:s}]'.format( + iip_ap['name'], iip_ap['import_policy']) + response.append((resource_key, iip_ap)) + + for xml_export_policy in xml_iip_ap.xpath(XPATH_NI_IIP_AP_EXPORT, namespaces=NAMESPACES): + #LOGGER.info('xml_export_policy = {:s}'.format(str(ET.tostring(xml_export_policy)))) + if xml_export_policy.text is None: continue + iip_ap = {} + add_value_from_tag(iip_ap, 'name', ni_name) + add_value_from_tag(iip_ap, 'export_policy', xml_export_policy) + resource_key = '/network_instance[{:s}]/inter_instance_policies[{:s}]'.format( + iip_ap['name'], iip_ap['export_policy']) + response.append((resource_key, iip_ap)) + return response diff --git a/src/device/service/drivers/openconfig/templates/RoutingPolicy.py b/src/device/service/drivers/openconfig/templates/RoutingPolicy.py new file mode 100644 index 0000000000000000000000000000000000000000..369732de3fe58c52a2e9ab2227899160d091ff68 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/RoutingPolicy.py @@ -0,0 +1,85 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, logging, lxml.etree as ET +from typing import Any, Dict, List, Tuple +from .Namespace import NAMESPACES +from .Tools import add_value_from_tag + +LOGGER = logging.getLogger(__name__) + +XPATH_POLICY_DEFINITIONS = "//ocrp:routing-policy/ocrp:policy-definitions/ocrp:policy-definition" +XPATH_PD_STATEMENTS = ".//ocrp:statements/ocrp:statement" +XPATH_PD_ST_CONDITIONS = ".//ocrp:conditions/ocbp:bgp-conditions/ocbp:match-ext-community-set" +XPATH_PD_ST_ACTIONS = ".//ocrp:actions" + +XPATH_BGP_EXT_COMMUN_SET = "//ocrp:routing-policy/ocrp:defined-sets/ocbp:bgp-defined-sets/" + \ + "ocbp:ext-community-sets/ocbp:ext-community-set" + +def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + #LOGGER.info('[RoutePolicy] xml_data = {:s}'.format(str(ET.tostring(xml_data)))) + + response = [] + for xml_policy_definition in xml_data.xpath(XPATH_POLICY_DEFINITIONS, namespaces=NAMESPACES): + #LOGGER.info('xml_policy_definition = {:s}'.format(str(ET.tostring(xml_policy_definition)))) + + policy_definition = {} + + policy_name = xml_policy_definition.find('ocrp:name', namespaces=NAMESPACES) + if policy_name is None or policy_name.text is None: continue + add_value_from_tag(policy_definition, 'policy_name', policy_name) + + resource_key = '/routing_policy/policy_definition[{:s}]'.format(policy_definition['policy_name']) + response.append((resource_key, copy.deepcopy(policy_definition))) + + for xml_statement in xml_policy_definition.xpath(XPATH_PD_STATEMENTS, namespaces=NAMESPACES): + statement_name = xml_statement.find('ocrp:name', namespaces=NAMESPACES) + add_value_from_tag(policy_definition, 'statement_name', statement_name) + + for xml_condition in xml_statement.xpath(XPATH_PD_ST_CONDITIONS, namespaces=NAMESPACES): + ext_community_set_name = xml_condition.find('ocbp:config/ocbp:ext-community-set', namespaces=NAMESPACES) + add_value_from_tag(policy_definition, 'ext_community_set_name', ext_community_set_name) + + match_set_options = xml_condition.find('ocbp:config/ocbp:match-set-options', namespaces=NAMESPACES) + add_value_from_tag(policy_definition, 'match_set_options', match_set_options) + + for xml_action in xml_statement.xpath(XPATH_PD_ST_ACTIONS, namespaces=NAMESPACES): + policy_result = xml_action.find('ocbp:config/ocbp:policy-result', namespaces=NAMESPACES) + add_value_from_tag(policy_definition, 'policy_result', policy_result) + + resource_key = '/routing_policy/policy_definition[{:s}]/statement[{:s}]'.format( + policy_definition['policy_name'], policy_definition['statement_name']) + response.append((resource_key, copy.deepcopy(policy_definition))) + + for xml_bgp_ext_community_set in xml_data.xpath(XPATH_BGP_EXT_COMMUN_SET, namespaces=NAMESPACES): + #LOGGER.info('xml_bgp_ext_community_set = {:s}'.format(str(ET.tostring(xml_bgp_ext_community_set)))) + + bgp_ext_community_set = {} + + ext_community_set_name = xml_bgp_ext_community_set.find('ocbp:ext-community-set-name', namespaces=NAMESPACES) + if ext_community_set_name is None or ext_community_set_name.text is None: continue + add_value_from_tag(bgp_ext_community_set, 'ext_community_set_name', ext_community_set_name) + + resource_key = '/routing_policy/bgp_defined_set[{:s}]'.format(bgp_ext_community_set['ext_community_set_name']) + response.append((resource_key, copy.deepcopy(bgp_ext_community_set))) + + ext_community_member = xml_bgp_ext_community_set.find('ocbp:ext-community-member', namespaces=NAMESPACES) + if ext_community_member is not None and ext_community_member.text is not None: + add_value_from_tag(bgp_ext_community_set, 'ext_community_member', ext_community_member) + + resource_key = '/routing_policy/bgp_defined_set[{:s}][{:s}]'.format( + bgp_ext_community_set['ext_community_set_name'], bgp_ext_community_set['ext_community_member']) + response.append((resource_key, copy.deepcopy(bgp_ext_community_set))) + + return response diff --git a/src/device/service/drivers/openconfig/templates/Tools.py b/src/device/service/drivers/openconfig/templates/Tools.py index e95167dc56dfd323b6fe88a716573a4246305df0..67b6ee89fb051b35afee34d7b35057cce5239d96 100644 --- a/src/device/service/drivers/openconfig/templates/Tools.py +++ b/src/device/service/drivers/openconfig/templates/Tools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import lxml.etree as ET from typing import Collection, Dict diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index c1d1450568ac6e7efc7265b434de8f6ebabd61bc..901f5cf0291dca1bda155e20abd16db5989df7dc 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -1,41 +1,79 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import json, logging, lxml.etree as ET, re from typing import Any, Dict from jinja2 import Environment, PackageLoader, select_autoescape -from device.service.driver_api._Driver import RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES +from device.service.driver_api._Driver import ( + RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL) from .EndPoints import parse as parse_endpoints -from .Interfaces import parse as parse_interfaces +from .Interfaces import parse as parse_interfaces, parse_counters from .NetworkInstances import parse as parse_network_instances +from .RoutingPolicy import parse as parse_routing_policy +from .Acl import parse as parse_acl ALL_RESOURCE_KEYS = [ RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, + RESOURCE_ROUTING_POLICIES, # routing policies should come before network instances RESOURCE_NETWORK_INSTANCES, + RESOURCE_ACL, ] RESOURCE_KEY_MAPPINGS = { RESOURCE_ENDPOINTS : 'component', RESOURCE_INTERFACES : 'interface', RESOURCE_NETWORK_INSTANCES: 'network_instance', + RESOURCE_ROUTING_POLICIES : 'routing_policy', + RESOURCE_ACL : 'acl', } RESOURCE_PARSERS = { 'component' : parse_endpoints, 'interface' : parse_interfaces, 'network_instance': parse_network_instances, + 'routing_policy' : parse_routing_policy, + 'interfaces/interface/state/counters': parse_counters, + 'acl' : parse_acl, } LOGGER = logging.getLogger(__name__) RE_REMOVE_FILTERS = re.compile(r'\[[^\]]+\]') +RE_REMOVE_FILTERS_2 = re.compile(r'\/[a-z]+:') +EMPTY_CONFIG = '' +EMPTY_FILTER = '' JINJA_ENV = Environment(loader=PackageLoader('device.service.drivers.openconfig'), autoescape=select_autoescape()) def get_filter(resource_key : str): resource_key = RESOURCE_KEY_MAPPINGS.get(resource_key, resource_key) - template_name = '{:s}/get.xml'.format(RE_REMOVE_FILTERS.sub('', resource_key)) + resource_key = RE_REMOVE_FILTERS.sub('', resource_key) + resource_key = RE_REMOVE_FILTERS_2.sub('/', resource_key) + resource_key = resource_key.replace('//', '') + template_name = '{:s}/get.xml'.format(resource_key) template = JINJA_ENV.get_template(template_name) - return '{:s}'.format(template.render()) + return '{:s}'.format(template.render().strip()) def parse(resource_key : str, xml_data : ET.Element): - parser = RESOURCE_PARSERS.get(RESOURCE_KEY_MAPPINGS.get(resource_key, resource_key)) + resource_key = RESOURCE_KEY_MAPPINGS.get(resource_key, resource_key) + resource_key = RE_REMOVE_FILTERS.sub('', resource_key) + resource_key = RE_REMOVE_FILTERS_2.sub('/', resource_key) + resource_key = resource_key.replace('//', '') + #resource_key_parts = resource_key.split('/') + #if len(resource_key_parts) > 1: resource_key_parts = resource_key_parts[:-1] + #resource_key = '/'.join(resource_key_parts) + #resource_key = RESOURCE_KEY_MAPPINGS.get(resource_key, resource_key) + parser = RESOURCE_PARSERS.get(resource_key) if parser is None: return [(resource_key, xml_data)] return parser(xml_data) @@ -44,4 +82,4 @@ def compose_config(resource_key : str, resource_value : str, delete : bool = Fal template = JINJA_ENV.get_template(template_name) data : Dict[str, Any] = json.loads(resource_value) operation = 'delete' if delete else 'merge' - return '{:s}'.format(template.render(**data, operation=operation)) + return '{:s}'.format(template.render(**data, operation=operation).strip()) diff --git a/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..fac259b6fdcd3cbded93088ddc6335ea2bfe5f69 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/acl-set/acl-entry/edit_config.xml @@ -0,0 +1,42 @@ + + + + {{name}} + {{type}} + + {{name}} + {{type}} + + + + {{sequence_id}} + + {{sequence_id}} + + + + {% if source_address is defined %}{{source_address}}{% endif%} + {% if destination_address is defined %}{{destination_address}}{% endif%} + {% if protocol is defined %}{{protocol}}{% endif%} + {% if dscp is defined %}{{dscp}}{% endif%} + {% if hop_limit is defined %}{{hop_limit}}{% endif%} + + + + + {% if source_port is defined %}{{source_port}}{% endif%} + {% if destination_port is defined %}{{destination_port}}{% endif%} + {% if tcp_flags is defined %}{{tcp_flags}}{% endif%} + + + + + {% if forwarding_action is defined %}{{forwarding_action}}{% endif%} + {% if log_action is defined %}{{log_action}}{% endif%} + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/acl/get.xml b/src/device/service/drivers/openconfig/templates/acl/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..dfed162427d03953890ecf1f90352cc26a76cbc9 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/get.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..d987b0cc4b40298533f140f71af83c6fad884020 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/interfaces/egress/edit_config.xml @@ -0,0 +1,26 @@ + + + + {{id}} + + {{id}} + + + + {{interface}} + {% if subinterface is defined %}{{subinterface}}{% endif%} + + + + + {{set_name_egress}} + {{type_egress}} + + {{set_name_egress}} + {{type_egress}} + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..144a03c55477e532379541be5443063fe3aa2f10 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/edit_config.xml @@ -0,0 +1,26 @@ + + + + {{id}} + + {{id}} + + + + {{interface}} + {% if subinterface is defined %}{{subinterface}}{% endif%} + + + + + {{set_name_ingress}} + {{type_ingress}} + + {{set_name_ingress}} + {{type_ingress}} + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/interface/edit_config.xml b/src/device/service/drivers/openconfig/templates/interface/edit_config.xml index ae29586a607b8ffd25e61c0aa9056109aacd3cb9..ff15d1d682ea910208237c32adcc93029fb036d8 100644 --- a/src/device/service/drivers/openconfig/templates/interface/edit_config.xml +++ b/src/device/service/drivers/openconfig/templates/interface/edit_config.xml @@ -1,12 +1,14 @@ - + {{name}} - {% if operation is not defined or operation != 'delete' %} {{name}} + {% if operation is defined and operation == 'delete' %} + + {% else %} {{description}} {{mtu}} + {% endif %} - {% endif %} diff --git a/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml b/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml index bdc698eeffd626076f6f62e576fe6ef916361412..d266f819c41355ba8a30086415f2bba3b68f1f3d 100644 --- a/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml +++ b/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml @@ -4,8 +4,6 @@ {% if operation is not defined or operation != 'delete' %} {{name}} - {{description}} - {{mtu}} {% endif %} @@ -14,7 +12,24 @@ {% if operation is not defined or operation != 'delete' %} {{index}} + true + + + {{vlan_id}} + + + + +
+ {{address_ip}} + + {{address_ip}} + {{address_prefix}} + +
+
+
{% endif %}
diff --git a/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/get.xml b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..90145e25c268db9af2944ba8d2a7ed757f10123a --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/get.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-octets/get.xml b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-octets/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..83da4b223c6abdc8d1bc20a0367b550e78522e39 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-octets/get.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-pkts/get.xml b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-pkts/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..645204d20335cc60a3db4839a69955cacce85092 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/in-pkts/get.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-octets/get.xml b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-octets/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..28958ec6a724131c073847dc98f6a8a60e51190a --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-octets/get.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-pkts/get.xml b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-pkts/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..52c27410c4b4a69a2ce5c440fe101301c4136510 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/interfaces/interface/state/counters/out-pkts/get.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml b/src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml index fab1fdc61f0b6add9c915e914f830270d9875a0a..9362c09c6cfebcd1f83b05002f58eda51724b911 100644 --- a/src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml +++ b/src/device/service/drivers/openconfig/templates/network_instance/edit_config.xml @@ -5,12 +5,16 @@ {{name}} oc-ni-types:{{type}} - {% for address_family in address_families %} - oc-types:{{address_family}} - {% endfor %} - {{router_id}} + {{description}} + {% if router_id is defined %}{{router_id}}{% endif %} {{route_distinguisher}} + true + + + oc-ni-types:MPLS + + {% endif %} diff --git a/src/device/service/drivers/openconfig/templates/network_instance/inter_instance_policies/edit_config.xml b/src/device/service/drivers/openconfig/templates/network_instance/inter_instance_policies/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7c87c7ab13317b5bb2a15c43d241673196bf6d2 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/network_instance/inter_instance_policies/edit_config.xml @@ -0,0 +1,15 @@ +{% if operation is not defined or operation != 'delete' %} + + + {{name}} + + + + {% if import_policy is defined %}{{import_policy}}{% endif%} + {% if export_policy is defined %}{{export_policy}}{% endif%} + + + + + +{% endif %} diff --git a/src/device/service/drivers/openconfig/templates/network_instance/interface/edit_config.xml b/src/device/service/drivers/openconfig/templates/network_instance/interface/edit_config.xml index 51f2d4318fbdd2d6da120851a72a6edafe173c73..d5c33d31a6d671216db55c0eded94dc15a56bec8 100644 --- a/src/device/service/drivers/openconfig/templates/network_instance/interface/edit_config.xml +++ b/src/device/service/drivers/openconfig/templates/network_instance/interface/edit_config.xml @@ -7,7 +7,8 @@ {% if operation is not defined or operation != 'delete' %} {{id}} - {{id}} + {{interface}} + {{subinterface}} {% endif %} diff --git a/src/device/service/drivers/openconfig/templates/network_instance/protocols/edit_config.xml b/src/device/service/drivers/openconfig/templates/network_instance/protocols/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..da05d0467605e6cec0c3448cc325ff60dfc7cfc9 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/network_instance/protocols/edit_config.xml @@ -0,0 +1,27 @@ + + + {{name}} + + + {{identifier}} + {{protocol_name}} + {% if operation is not defined or operation != 'delete' %} + + {{identifier}} + {{protocol_name}} + true + + {% if identifier=='BGP' %} + + + + {{as}} + + + + {% endif %} + {% endif %} + + + + diff --git a/src/device/service/drivers/openconfig/templates/network_instance/table_connections/edit_config.xml b/src/device/service/drivers/openconfig/templates/network_instance/table_connections/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..46bf5e387789c7efc800ad96ed759748273bed34 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/network_instance/table_connections/edit_config.xml @@ -0,0 +1,20 @@ + + + {{name}} + + + oc-pol-types:{{src_protocol}} + oc-pol-types:{{dst_protocol}} + oc-types:{{address_family}} + {% if operation is not defined or operation != 'delete' %} + + oc-pol-types:{{src_protocol}} + oc-pol-types:{{dst_protocol}} + oc-types:{{address_family}} + {% if default_import_policy is defined %}{{default_import_policy}}{% endif %} + + {% endif %} + + + + diff --git a/src/device/service/drivers/openconfig/templates/routing_policy/bgp_defined_set/edit_config.xml b/src/device/service/drivers/openconfig/templates/routing_policy/bgp_defined_set/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..df64606ae5ab434e5e3453f7294db02bb749bdce --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/routing_policy/bgp_defined_set/edit_config.xml @@ -0,0 +1,14 @@ + + + + + + {{ext_community_set_name}} + {% if operation is not defined or operation != 'delete' %} + {% if ext_community_member is defined %} {{ext_community_member}}{% endif %} + {% endif %} + + + + + diff --git a/src/device/service/drivers/openconfig/templates/routing_policy/get.xml b/src/device/service/drivers/openconfig/templates/routing_policy/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..797e970264fa25c2d45f54cb9c0a6cd0b769f29a --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/routing_policy/get.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/edit_config.xml b/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3a31866be5fc072bced339dd7b54f9f92bab290 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/edit_config.xml @@ -0,0 +1,12 @@ + + + + {{policy_name}} + {% if operation is not defined or operation != 'delete' %} + + {{policy_name}} + + {% endif %} + + + diff --git a/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/statement/edit_config.xml b/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/statement/edit_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..711067f424b68da0e69913ce01f5133c5cbbfe02 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/routing_policy/policy_definition/statement/edit_config.xml @@ -0,0 +1,30 @@ +{% if operation is not defined or operation != 'delete' %} + + + + {{policy_name}} + + + {{statement_name}} + + {{statement_name}} + + + + + {{ext_community_set_name}} + {{match_set_options}} + + + + + + {{policy_result}} + + + + + + + +{% endif %} diff --git a/src/device/service/drivers/p4/__init__.py b/src/device/service/drivers/p4/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/device/service/drivers/p4/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/service/drivers/p4/p4_driver.py b/src/device/service/drivers/p4/p4_driver.py new file mode 100644 index 0000000000000000000000000000000000000000..af05952b313d1632eacd5962cc34c4aa1b6b5a10 --- /dev/null +++ b/src/device/service/drivers/p4/p4_driver.py @@ -0,0 +1,260 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +""" +P4 driver plugin for the TeraFlow SDN controller. +""" + +import logging +import threading +from typing import Any, Iterator, List, Optional, Tuple, Union +from .p4_util import P4RuntimeClient,\ + P4_ATTR_DEV_ID, P4_ATTR_DEV_NAME, P4_ATTR_DEV_VENDOR,\ + P4_ATTR_DEV_HW_VER, P4_ATTR_DEV_SW_VER, P4_ATTR_DEV_PIPECONF,\ + P4_VAL_DEF_VENDOR, P4_VAL_DEF_HW_VER, P4_VAL_DEF_SW_VER, P4_VAL_DEF_PIPECONF + +try: + from _Driver import _Driver +except ImportError: + from device.service.driver_api._Driver import _Driver + +LOGGER = logging.getLogger(__name__) + + +class P4Driver(_Driver): + """ + P4Driver class inherits the abstract _Driver class to support P4 devices. + + Attributes + ---------- + address : str + IP address of the P4Runtime server running on the P4 device + port : int + transport port number of the P4Runtime server running on the P4 device + **settings : map + id : int + P4 device datapath ID (Mandatory) + name : str + P4 device name (Optional) + vendor : str + P4 device vendor (Optional) + hw_ver : str + Hardware version of the P4 device (Optional) + sw_ver : str + Software version of the P4 device (Optional) + pipeconf : str + P4 device table configuration (Optional) + """ + + def __init__(self, address: str, port: int, **settings) -> None: + # pylint: disable=super-init-not-called + self.__client = None + self.__address = address + self.__port = int(port) + self.__settings = settings + + try: + self.__dev_id = self.__settings.get(P4_ATTR_DEV_ID) + except Exception as ex: + LOGGER.error('P4 device ID is a mandatory setting') + raise Exception from ex + + if P4_ATTR_DEV_NAME in self.__settings: + self.__dev_name = self.__settings.get(P4_ATTR_DEV_NAME) + else: + self.__dev_name = str(self.__dev_id) + LOGGER.warning( + 'No device name is provided. Setting default name: %s', + self.__dev_name) + + if P4_ATTR_DEV_VENDOR in self.__settings: + self.__dev_vendor = self.__settings.get(P4_ATTR_DEV_VENDOR) + else: + self.__dev_vendor = P4_VAL_DEF_VENDOR + LOGGER.warning( + 'No vendor is provided. Setting default vendor: %s', + self.__dev_vendor) + + if P4_ATTR_DEV_HW_VER in self.__settings: + self.__dev_hw_version = self.__settings.get(P4_ATTR_DEV_HW_VER) + else: + self.__dev_hw_version = P4_VAL_DEF_HW_VER + LOGGER.warning( + 'No HW version is provided. Setting default HW version: %s', + self.__dev_hw_version) + + if P4_ATTR_DEV_SW_VER in self.__settings: + self.__dev_sw_version = self.__settings.get(P4_ATTR_DEV_SW_VER) + else: + self.__dev_sw_version = P4_VAL_DEF_SW_VER + LOGGER.warning( + 'No SW version is provided. Setting default SW version: %s', + self.__dev_sw_version) + + if P4_ATTR_DEV_PIPECONF in self.__settings: + self.__dev_pipeconf = self.__settings.get(P4_ATTR_DEV_PIPECONF) + else: + self.__dev_pipeconf = P4_VAL_DEF_PIPECONF + LOGGER.warning( + 'No P4 pipeconf is provided. Setting default P4 pipeconf: %s', + self.__dev_pipeconf) + + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + + LOGGER.info('Initializing P4 device at %s:%d with settings:', + self.__address, self.__port) + + for key, value in settings.items(): + LOGGER.info('\t%8s = %s', key, value) + + def Connect(self) -> bool: + """ + Establishes a connection between the P4 device driver and a P4 device. + + :return: boolean connection status. + """ + LOGGER.info( + 'Connecting to P4 device %s:%d ...', + self.__address, self.__port) + + with self.__lock: + # Skip if already connected + if self.__started.is_set(): + return True + + # Instantiate a gRPC channel with the P4 device + grpc_address = f'{self.__address}:{self.__port}' + election_id = (1, 0) + self.__client = P4RuntimeClient( + self.__dev_id, grpc_address, election_id) + LOGGER.info('\tConnected!') + self.__started.set() + + return True + + def Disconnect(self) -> bool: + """ + Terminates the connection between the P4 device driver and a P4 device. + + :return: boolean disconnection status. + """ + LOGGER.info( + 'Disconnecting from P4 device %s:%d ...', + self.__address, self.__port) + + # If not started, assume it is already disconnected + if not self.__started.is_set(): + return True + + # gRPC client must already be instantiated + assert self.__client + + # Trigger termination of loops and processes + self.__terminate.set() + + # Trigger connection tear down with the P4Runtime server + self.__client.tear_down() + self.__client = None + + LOGGER.info('\tDisconnected!') + + return True + + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + """ + Retrieves the initial configuration of a P4 device. + + :return: list of initial configuration items. + """ + LOGGER.info('P4 GetInitialConfig()') + return [] + + def GetConfig(self, resource_keys : List[str] = [])\ + -> List[Tuple[str, Union[Any, None, Exception]]]: + """ + Retrieves the current configuration of a P4 device. + + :param resource_keys: configuration parameters to retrieve. + :return: list of values associated with the requested resource keys. + """ + + LOGGER.info('P4 GetConfig()') + return [] + + def SetConfig(self, resources : List[Tuple[str, Any]])\ + -> List[Union[bool, Exception]]: + """ + Submits a new configuration to a P4 device. + + :param resources: configuration parameters to set. + :return: list of results for resource key changes requested. + """ + LOGGER.info('P4 SetConfig()') + return [] + + def DeleteConfig(self, resources : List[Tuple[str, Any]])\ + -> List[Union[bool, Exception]]: + """ + Revokes P4 device configuration. + + :param resources: list of tuples with resource keys to be deleted. + :return: list of results for resource key deletions requested. + """ + LOGGER.info('P4 DeleteConfig()') + return [] + + def GetResource(self, endpoint_uuid : str) -> Optional[str]: + """ + Retrieves a certain resource from a P4 device. + + :param endpoint_uuid: target endpoint UUID. + :return: The path of the endpoint or None if not found. + """ + LOGGER.info('P4 GetResource()') + return "" + + def GetState(self, blocking=False, terminate : Optional[threading.Event] = None) -> Iterator[Tuple[str, Any]]: + """ + Retrieves the state of a P4 device. + + :param blocking: if non-blocking, the driver terminates the loop and + returns. + :return: sequences of state sample. + """ + LOGGER.info('P4 GetState()') + return [] + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]])\ + -> List[Union[bool, Exception]]: + """ + Subscribes to certain state information. + + :param subscriptions: list of tuples with resources to be subscribed. + :return: list of results for resource subscriptions requested. + """ + LOGGER.info('P4 SubscribeState()') + return [] + + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]])\ + -> List[Union[bool, Exception]]: + """ + Unsubscribes from certain state information. + + :param subscriptions: list of tuples with resources to be unsubscribed. + :return: list of results for resource un-subscriptions requested. + """ + LOGGER.info('P4 UnsubscribeState()') + return [] diff --git a/src/device/service/drivers/p4/p4_util.py b/src/device/service/drivers/p4/p4_util.py new file mode 100644 index 0000000000000000000000000000000000000000..b3d54499f56772768dc19bc1cae3bbf9a25e7dc2 --- /dev/null +++ b/src/device/service/drivers/p4/p4_util.py @@ -0,0 +1,271 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +""" +P4 driver utilities. +""" + +import logging +import queue +import sys +import threading +from functools import wraps +import grpc +import google.protobuf.text_format +from google.rpc import code_pb2 + +from p4.v1 import p4runtime_pb2 +from p4.v1 import p4runtime_pb2_grpc + +P4_ATTR_DEV_ID = 'id' +P4_ATTR_DEV_NAME = 'name' +P4_ATTR_DEV_VENDOR = 'vendor' +P4_ATTR_DEV_HW_VER = 'hw_ver' +P4_ATTR_DEV_SW_VER = 'sw_ver' +P4_ATTR_DEV_PIPECONF = 'pipeconf' + +P4_VAL_DEF_VENDOR = 'Unknown' +P4_VAL_DEF_HW_VER = 'BMv2 simple_switch' +P4_VAL_DEF_SW_VER = 'Stratum' +P4_VAL_DEF_PIPECONF = 'org.onosproject.pipelines.fabric' + +STREAM_ATTR_ARBITRATION = 'arbitration' +STREAM_ATTR_PACKET = 'packet' +STREAM_ATTR_DIGEST = 'digest' +STREAM_ATTR_UNKNOWN = 'unknown' + +LOGGER = logging.getLogger(__name__) + + +class P4RuntimeException(Exception): + """ + P4Runtime exception handler. + + Attributes + ---------- + grpc_error : object + gRPC error + """ + + def __init__(self, grpc_error): + super().__init__() + self.grpc_error = grpc_error + + def __str__(self): + return str('P4Runtime RPC error (%s): %s', + self.grpc_error.code().name(), self.grpc_error.details()) + + +def parse_p4runtime_error(fun): + """ + Parse P4Runtime error. + + :param fun: function + :return: parsed error + """ + @wraps(fun) + def handle(*args, **kwargs): + try: + return fun(*args, **kwargs) + except grpc.RpcError as rpc_ex: + raise P4RuntimeException(rpc_ex) from None + except Exception as ex: + raise Exception(ex) from None + return handle + + +class P4RuntimeClient: + """ + P4Runtime client. + + Attributes + ---------- + device_id : int + P4 device ID + grpc_address : str + IP address and port + election_id : tuple + Mastership election ID + role_name : str + Role name (optional) + """ + def __init__(self, device_id, grpc_address, election_id, role_name=None): + self.device_id = device_id + self.election_id = election_id + self.role_name = role_name + self.stream_in_q = None + self.stream_out_q = None + self.stream = None + self.stream_recv_thread = None + LOGGER.debug( + 'Connecting to device %d at %s', device_id, grpc_address) + self.channel = grpc.insecure_channel(grpc_address) + self.stub = p4runtime_pb2_grpc.P4RuntimeStub(self.channel) + try: + self.set_up_stream() + except P4RuntimeException: + LOGGER.critical('Failed to connect to P4Runtime server') + sys.exit(1) + + def set_up_stream(self): + """ + Set up a gRPC stream. + """ + self.stream_out_q = queue.Queue() + # queues for different messages + self.stream_in_q = { + STREAM_ATTR_ARBITRATION: queue.Queue(), + STREAM_ATTR_PACKET: queue.Queue(), + STREAM_ATTR_DIGEST: queue.Queue(), + STREAM_ATTR_UNKNOWN: queue.Queue(), + } + + def stream_req_iterator(): + while True: + st_p = self.stream_out_q.get() + if st_p is None: + break + yield st_p + + def stream_recv_wrapper(stream): + @parse_p4runtime_error + def stream_recv(): + for st_p in stream: + if st_p.HasField(STREAM_ATTR_ARBITRATION): + self.stream_in_q[STREAM_ATTR_ARBITRATION].put(st_p) + elif st_p.HasField(STREAM_ATTR_PACKET): + self.stream_in_q[STREAM_ATTR_PACKET].put(st_p) + elif st_p.HasField(STREAM_ATTR_DIGEST): + self.stream_in_q[STREAM_ATTR_DIGEST].put(st_p) + else: + self.stream_in_q[STREAM_ATTR_UNKNOWN].put(st_p) + try: + stream_recv() + except P4RuntimeException as ex: + LOGGER.critical('StreamChannel error, closing stream') + LOGGER.critical(ex) + for k in self.stream_in_q: + self.stream_in_q[k].put(None) + self.stream = self.stub.StreamChannel(stream_req_iterator()) + self.stream_recv_thread = threading.Thread( + target=stream_recv_wrapper, args=(self.stream,)) + self.stream_recv_thread.start() + self.handshake() + + def handshake(self): + """ + Handshake with gRPC server. + """ + + req = p4runtime_pb2.StreamMessageRequest() + arbitration = req.arbitration + arbitration.device_id = self.device_id + election_id = arbitration.election_id + election_id.high = self.election_id[0] + election_id.low = self.election_id[1] + if self.role_name is not None: + arbitration.role.name = self.role_name + self.stream_out_q.put(req) + + rep = self.get_stream_packet(STREAM_ATTR_ARBITRATION, timeout=2) + if rep is None: + LOGGER.critical('Failed to establish session with server') + sys.exit(1) + is_primary = (rep.arbitration.status.code == code_pb2.OK) + LOGGER.debug('Session established, client is %s', + 'primary' if is_primary else 'backup') + if not is_primary: + LOGGER.warning( + 'You are not the primary client, ' + 'you only have read access to the server') + + def get_stream_packet(self, type_, timeout=1): + """ + Get a new message from the stream. + + :param type_: stream type. + :param timeout: time to wait. + :return: message or None + """ + if type_ not in self.stream_in_q: + LOGGER.critical('Unknown stream type %s', type_) + return None + try: + msg = self.stream_in_q[type_].get(timeout=timeout) + return msg + except queue.Empty: # timeout expired + return None + + @parse_p4runtime_error + def get_p4info(self): + """ + Retrieve P4Info content. + + :return: P4Info object. + """ + + LOGGER.debug('Retrieving P4Info file') + req = p4runtime_pb2.GetForwardingPipelineConfigRequest() + req.device_id = self.device_id + req.response_type =\ + p4runtime_pb2.GetForwardingPipelineConfigRequest.P4INFO_AND_COOKIE + rep = self.stub.GetForwardingPipelineConfig(req) + return rep.config.p4info + + @parse_p4runtime_error + def set_fwd_pipe_config(self, p4info_path, bin_path): + """ + Configure the pipeline. + + :param p4info_path: path to the P4Info file + :param bin_path: path to the binary file + :return: + """ + + LOGGER.debug('Setting forwarding pipeline config') + req = p4runtime_pb2.SetForwardingPipelineConfigRequest() + req.device_id = self.device_id + if self.role_name is not None: + req.role = self.role_name + election_id = req.election_id + election_id.high = self.election_id[0] + election_id.low = self.election_id[1] + req.action =\ + p4runtime_pb2.SetForwardingPipelineConfigRequest.VERIFY_AND_COMMIT + with open(p4info_path, 'r', encoding='utf8') as f_1: + with open(bin_path, 'rb', encoding='utf8') as f_2: + try: + google.protobuf.text_format.Merge( + f_1.read(), req.config.p4info) + except google.protobuf.text_format.ParseError: + LOGGER.error('Error when parsing P4Info') + raise + req.config.p4_device_config = f_2.read() + return self.stub.SetForwardingPipelineConfig(req) + + def tear_down(self): + """ + Tear connection with the gRPC server down. + """ + + if self.stream_out_q: + LOGGER.debug('Cleaning up stream') + self.stream_out_q.put(None) + if self.stream_in_q: + for k in self.stream_in_q: + self.stream_in_q[k].put(None) + if self.stream_recv_thread: + self.stream_recv_thread.join() + self.channel.close() + del self.channel diff --git a/src/device/service/drivers/transport_api/Tools.py b/src/device/service/drivers/transport_api/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..8f18c56b3ac6ae79ead86199c56486cf9c00eae4 --- /dev/null +++ b/src/device/service/drivers/transport_api/Tools.py @@ -0,0 +1,114 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json, logging, requests +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS + +LOGGER = logging.getLogger(__name__) + + +def find_key(resource, key): + return json.loads(resource[1])[key] + + +def config_getter(root_url, resource_key, timeout): + url = '{:s}/restconf/data/tapi-common:context'.format(root_url) + result = [] + try: + response = requests.get(url, timeout=timeout) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(url)) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception retrieving {:s}'.format(resource_key)) + result.append((resource_key, e)) + else: + context = json.loads(response.content) + + if resource_key == RESOURCE_ENDPOINTS: + for sip in context['tapi-common:context']['service-interface-point']: + result.append( + ('/endpoints/endpoint[{:s}]'.format(sip['uuid']), {'uuid': sip['uuid'], 'type': '10Gbps'})) + + return result + +def create_connectivity_service( + root_url, timeout, uuid, input_sip, output_sip, direction, capacity_value, capacity_unit, layer_protocol_name, + layer_protocol_qualifier): + + url = '{:s}/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context'.format(root_url) + headers = {'content-type': 'application/json'} + data = { + 'tapi-connectivity:connectivity-service': [ + { + 'uuid': uuid, + 'connectivity-constraint': { + 'requested-capacity': { + 'total-size': { + 'value': capacity_value, + 'unit': capacity_unit + } + }, + 'connectivity-direction': direction + }, + 'end-point': [ + { + 'service-interface-point': { + 'service-interface-point-uuid': input_sip + }, + 'layer-protocol-name': layer_protocol_name, + 'layer-protocol-qualifier': layer_protocol_qualifier, + 'local-id': input_sip + }, + { + 'service-interface-point': { + 'service-interface-point-uuid': output_sip + }, + 'layer-protocol-name': layer_protocol_name, + 'layer-protocol-qualifier': layer_protocol_qualifier, + 'local-id': output_sip + } + ] + } + ] + } + results = [] + try: + LOGGER.info('Connectivity service {:s}: {:s}'.format(str(uuid), str(data))) + response = requests.post(url=url, data=json.dumps(data), timeout=timeout, headers=headers) + LOGGER.info('TAPI response: {:s}'.format(str(response))) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception creating ConnectivityService(uuid={:s}, data={:s})'.format(str(uuid), str(data))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not create ConnectivityService(uuid={:s}, data={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(data), str(response.status_code), str(response))) + results.append(response.status_code == 201) + return results + +def delete_connectivity_service(root_url, timeout, uuid): + url = '{:s}/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={:s}' + url = url.format(root_url, uuid) + results = [] + try: + response = requests.delete(url=url, timeout=timeout) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Exception deleting ConnectivityService(uuid={:s})'.format(str(uuid))) + results.append(e) + else: + if response.status_code != 201: + msg = 'Could not delete ConnectivityService(uuid={:s}). status_code={:s} reply={:s}' + LOGGER.error(msg.format(str(uuid), str(response.status_code), str(response))) + results.append(response.status_code == 202) + return results diff --git a/src/device/service/drivers/transport_api/TransportApiDriver.py b/src/device/service/drivers/transport_api/TransportApiDriver.py index f20173dd022a517d1e5630dc23c3455b0ed3c710..b0ecfe32f63b2568d7b5fb7498e532935aee018c 100644 --- a/src/device/service/drivers/transport_api/TransportApiDriver.py +++ b/src/device/service/drivers/transport_api/TransportApiDriver.py @@ -1,9 +1,113 @@ -import logging +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, requests, threading +from typing import Any, Iterator, List, Optional, Tuple, Union +from common.type_checkers.Checkers import chk_string, chk_type from device.service.driver_api._Driver import _Driver +from . import ALL_RESOURCE_KEYS +from .Tools import create_connectivity_service, find_key, config_getter, delete_connectivity_service LOGGER = logging.getLogger(__name__) -# TODO: Implement TransportAPI Driver - class TransportApiDriver(_Driver): - pass + def __init__(self, address: str, port: int, **settings) -> None: # pylint: disable=super-init-not-called + self.__lock = threading.Lock() + self.__started = threading.Event() + self.__terminate = threading.Event() + self.__tapi_root = 'http://' + address + ':' + str(port) + self.__timeout = int(settings.get('timeout', 120)) + + def Connect(self) -> bool: + url = self.__tapi_root + '/restconf/data/tapi-common:context' + with self.__lock: + if self.__started.is_set(): return True + try: + requests.get(url, timeout=self.__timeout) + except requests.exceptions.Timeout: + LOGGER.exception('Timeout connecting {:s}'.format(str(self.__tapi_root))) + return False + except Exception: # pylint: disable=broad-except + LOGGER.exception('Exception connecting {:s}'.format(str(self.__tapi_root))) + return False + else: + self.__started.set() + return True + + def Disconnect(self) -> bool: + with self.__lock: + self.__terminate.set() + return True + + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + with self.__lock: + return [] + + def GetConfig(self, resource_keys : List[str] = []) -> List[Tuple[str, Union[Any, None, Exception]]]: + chk_type('resources', resource_keys, list) + results = [] + with self.__lock: + if len(resource_keys) == 0: resource_keys = ALL_RESOURCE_KEYS + for i, resource_key in enumerate(resource_keys): + str_resource_name = 'resource_key[#{:d}]'.format(i) + chk_string(str_resource_name, resource_key, allow_empty=False) + results.extend(config_getter(self.__tapi_root, resource_key, self.__timeout)) + return results + + def SetConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: + return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + + input_sip = find_key(resource, 'input_sip') + output_sip = find_key(resource, 'output_sip') + uuid = find_key(resource, 'uuid') + capacity_value = find_key(resource, 'capacity_value') + capacity_unit = find_key(resource, 'capacity_unit') + layer_protocol_name = find_key(resource, 'layer_protocol_name') + layer_protocol_qualifier = find_key(resource, 'layer_protocol_qualifier') + direction = find_key(resource, 'direction') + + data = create_connectivity_service( + self.__tapi_root, self.__timeout, uuid, input_sip, output_sip, direction, capacity_value, + capacity_unit, layer_protocol_name, layer_protocol_qualifier) + results.extend(data) + return results + + def DeleteConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + results = [] + if len(resources) == 0: return results + with self.__lock: + for resource in resources: + LOGGER.info('resource = {:s}'.format(str(resource))) + uuid = find_key(resource, 'uuid') + results.extend(delete_connectivity_service(self.__tapi_root, self.__timeout, uuid)) + return results + + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: TAPI does not support monitoring by now + return [False for _ in subscriptions] + + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # TODO: TAPI does not support monitoring by now + return [False for _ in subscriptions] + + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: + # TODO: TAPI does not support monitoring by now + return [] diff --git a/src/device/service/drivers/transport_api/__init__.py b/src/device/service/drivers/transport_api/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..925746998061f4e05c468133dfacaaa0414551c8 100644 --- a/src/device/service/drivers/transport_api/__init__.py +++ b/src/device/service/drivers/transport_api/__init__.py @@ -0,0 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from device.service.driver_api._Driver import RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES + +ALL_RESOURCE_KEYS = [ + RESOURCE_ENDPOINTS, + RESOURCE_INTERFACES, + RESOURCE_NETWORK_INSTANCES, +] + +RESOURCE_KEY_MAPPINGS = { + RESOURCE_ENDPOINTS : 'component', + RESOURCE_INTERFACES : 'interface', + RESOURCE_NETWORK_INSTANCES: 'network_instance', +} diff --git a/src/device/tests/.gitignore b/src/device/tests/.gitignore index 5cb8b444d357c5e39eb31759d67b92fca7beabb2..4cbf5059c2f905c16aac6234e2b9ca0ac7584c09 100644 --- a/src/device/tests/.gitignore +++ b/src/device/tests/.gitignore @@ -1,3 +1,5 @@ # Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. -Device_OpenConfig_Infinera.py -Device_Transport_Api_CTTC.py +Device_OpenConfig_Adva* +Device_OpenConfig_Cisco* +Device_OpenConfig_Infinera* +Device_Transport_Api* diff --git a/src/device/tests/CommonObjects.py b/src/device/tests/CommonObjects.py index 2b51dcd2322e70dff9a5229e65e6a220708a834f..61f0b44cd5715ac5e631c9e552fc61e7caa524d0 100644 --- a/src/device/tests/CommonObjects.py +++ b/src/device/tests/CommonObjects.py @@ -1,21 +1,36 @@ -from copy import deepcopy +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + -# use "deepcopy" to prevent propagating forced changes during tests +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) -CONTEXT_ID = {'context_uuid': {'uuid': DEFAULT_CONTEXT_UUID}} -CONTEXT = { - 'context_id': deepcopy(CONTEXT_ID), - 'topology_ids': [], - 'service_ids': [], -} -TOPOLOGY_ID = { - 'context_id': deepcopy(CONTEXT_ID), - 'topology_uuid': {'uuid': DEFAULT_TOPOLOGY_UUID}, -} -TOPOLOGY = { - 'topology_id': deepcopy(TOPOLOGY_ID), - 'device_ids': [], - 'link_ids': [], -} +# ----- KPI Sample Types ----------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] diff --git a/src/device/tests/Device_Emulated.py b/src/device/tests/Device_Emulated.py index 27595dd8afed8b2985c76338ffc88d81fc9cc2d0..7b8f15918146fcde9e920825e42e2985deeaee24 100644 --- a/src/device/tests/Device_Emulated.py +++ b/src/device/tests/Device_Emulated.py @@ -1,101 +1,90 @@ -import operator -from copy import deepcopy -from device.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum -from device.service.database.KpiSampleType import ORM_KpiSampleTypeEnum -from .Tools import config_rule_set, config_rule_delete - -# use "deepcopy" to prevent propagating forced changes during tests - -DEVICE_EMU_UUID = 'EMULATED' -DEVICE_EMU_TYPE = 'emulated' -DEVICE_EMU_ADDRESS = '127.0.0.1' -DEVICE_EMU_PORT = '0' -DEVICE_EMU_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_UNDEFINED] - -DEVICE_EMU_ID = {'device_uuid': {'uuid': DEVICE_EMU_UUID}} -DEVICE_EMU = { - 'device_id': deepcopy(DEVICE_EMU_ID), - 'device_type': DEVICE_EMU_TYPE, - 'device_config': {'config_rules': []}, - 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED, - 'device_drivers': DEVICE_EMU_DRIVERS, - 'device_endpoints': [], -} - -PACKET_PORT_SAMPLE_TYPES = [ - ORM_KpiSampleTypeEnum.PACKETS_TRANSMITTED, - ORM_KpiSampleTypeEnum.PACKETS_RECEIVED, - ORM_KpiSampleTypeEnum.BYTES_TRANSMITTED, - ORM_KpiSampleTypeEnum.BYTES_RECEIVED, -] +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -ENDPOINT_UUIDS = ['EP1', 'EP2', 'EP3', 'EP4'] +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from device.tests.CommonObjects import PACKET_PORT_SAMPLE_TYPES -DEVICE_EMU_ENDPOINTS = [] -for endpoint_uuid in ENDPOINT_UUIDS: - DEVICE_EMU_ENDPOINTS.append((endpoint_uuid, '10Gbps', PACKET_PORT_SAMPLE_TYPES)) +DEVICE_EMU_UUID = 'EMULATED' +DEVICE_EMU_ID = json_device_id(DEVICE_EMU_UUID) +DEVICE_EMU = json_device_emulated_packet_router_disabled(DEVICE_EMU_UUID) +DEVICE_EMU_EP_UUIDS = ['EP1', 'EP2', 'EP3', 'EP4'] +DEVICE_EMU_EP_DESCS = [(ep_uuid, '10Gbps', PACKET_PORT_SAMPLE_TYPES) for ep_uuid in DEVICE_EMU_EP_UUIDS] +DEVICE_EMU_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_EMU_EP_DESCS) RSRC_EP = '/endpoints/endpoint[{:s}]' RSRC_SUBIF = RSRC_EP + '/subinterfaces/subinterface[{:d}]' RSRC_ADDRIPV4 = RSRC_SUBIF + '/ipv4/address[{:s}]' DEVICE_EMU_ENDPOINTS_COOKED = [] -for endpoint_uuid,endpoint_type,endpoint_sample_types in DEVICE_EMU_ENDPOINTS: +for endpoint_uuid,endpoint_type,endpoint_sample_types in DEVICE_EMU_EP_DESCS: endpoint_resource_key = RSRC_EP.format(str(endpoint_uuid)) sample_types = {} for endpoint_sample_type in endpoint_sample_types: - sample_type_name = endpoint_sample_type.name.lower() - sample_types[endpoint_sample_type.value] = '{:s}/state/{:s}'.format(endpoint_resource_key, sample_type_name) + sample_type_name = KpiSampleType.Name(endpoint_sample_type).lower().replace('kpisampletype_', '') + sample_types[endpoint_sample_type] = '{:s}/state/{:s}'.format(endpoint_resource_key, sample_type_name) endpoint_resource_value = {'uuid': endpoint_uuid, 'type': endpoint_type, 'sample_types': sample_types} DEVICE_EMU_ENDPOINTS_COOKED.append((endpoint_resource_key, endpoint_resource_value)) -DEVICE_EMU_CONNECT_RULES = [ - config_rule_set('_connect/address', DEVICE_EMU_ADDRESS ), - config_rule_set('_connect/port', DEVICE_EMU_PORT ), - config_rule_set('_connect/settings', {'endpoints': [ - { - 'uuid': endpoint_uuid, 'type': endpoint_type, - 'sample_types': list(map(operator.attrgetter('value'), endpoint_sample_types)), - } - for endpoint_uuid,endpoint_type,endpoint_sample_types in DEVICE_EMU_ENDPOINTS - ]}), +DEVICE_EMU_CONFIG_ENDPOINTS = [ + json_config_rule_set(RSRC_EP.format('EP1'), {'enabled' : True}), + json_config_rule_set(RSRC_EP.format('EP2'), {'enabled' : True}), + json_config_rule_set(RSRC_EP.format('EP3'), {'enabled' : True}), + json_config_rule_set(RSRC_EP.format('EP4'), {'enabled' : True}), ] -DEVICE_EMU_CONFIG_ENDPOINTS = [] -for endpoint_uuid in ENDPOINT_UUIDS: - DEVICE_EMU_CONFIG_ENDPOINTS.append(config_rule_set(RSRC_EP.format(endpoint_uuid), {'enabled' : True})) - -DEVICE_EMU_CONFIG_ADDRESSES = [] -for endpoint_uuid in ENDPOINT_UUIDS: - endpoint_number = int(endpoint_uuid.replace('EP', '')) - subinterface_index = 0 - subinterface_address = '10.{:d}.{:d}.1'.format(endpoint_number, subinterface_index) - subinterface_prefix_length = 24 - DEVICE_EMU_CONFIG_ADDRESSES.extend([ - config_rule_set(RSRC_SUBIF .format(endpoint_uuid, subinterface_index), { - 'index': subinterface_index}), - config_rule_set(RSRC_ADDRIPV4.format(endpoint_uuid, subinterface_index, subinterface_address), { - 'ip': subinterface_address, 'prefix_length': subinterface_prefix_length}), - ]) +DEVICE_EMU_CONFIG_ADDRESSES = [ + json_config_rule_set(RSRC_SUBIF .format('EP1', 0), {'index': 0}), + json_config_rule_set(RSRC_ADDRIPV4.format('EP1', 0, '10.1.0.1'), {'ip': '10.1.0.1', 'prefix_length': 24}), + + json_config_rule_set(RSRC_SUBIF .format('EP2', 0), {'index': 0}), + json_config_rule_set(RSRC_ADDRIPV4.format('EP2', 0, '10.2.0.1'), {'ip': '10.2.0.1', 'prefix_length': 24}), + + json_config_rule_set(RSRC_SUBIF .format('EP3', 0), {'index': 0}), + json_config_rule_set(RSRC_ADDRIPV4.format('EP3', 0, '10.3.0.1'), {'ip': '10.3.0.1', 'prefix_length': 24}), + + json_config_rule_set(RSRC_SUBIF .format('EP4', 0), {'index': 0}), + json_config_rule_set(RSRC_ADDRIPV4.format('EP4', 0, '10.4.0.1'), {'ip': '10.4.0.1', 'prefix_length': 24}), +] DEVICE_EMU_RECONFIG_ADDRESSES = [ - config_rule_delete(RSRC_SUBIF .format('EP2', 0 ), {}), - config_rule_delete(RSRC_ADDRIPV4.format('EP2', 0, '10.2.0.1'), {'ip': '10.2.0.1', 'prefix_length': 24}), + json_config_rule_delete(RSRC_SUBIF .format('EP2', 0), {}), + json_config_rule_delete(RSRC_ADDRIPV4.format('EP2', 0, '10.2.0.1'), {'ip': '10.2.0.1', 'prefix_length': 24}), - config_rule_set (RSRC_SUBIF .format('EP2', 1 ), {'index': 1}), - config_rule_set (RSRC_ADDRIPV4.format('EP2', 1, '10.2.1.1'), {'ip': '10.2.1.1', 'prefix_length': 24}), + json_config_rule_set (RSRC_SUBIF .format('EP2', 1), {'index': 1}), + json_config_rule_set (RSRC_ADDRIPV4.format('EP2', 1, '10.2.1.1'), {'ip': '10.2.1.1', 'prefix_length': 24}), ] -DEVICE_EMU_DECONFIG_ADDRESSES = [] -for endpoint_uuid in ENDPOINT_UUIDS: - endpoint_number = int(endpoint_uuid.replace('EP', '')) - subinterface_index = 1 if endpoint_uuid == 'EP2' else 0 - subinterface_address = '10.{:d}.{:d}.1'.format(endpoint_number, subinterface_index) - DEVICE_EMU_DECONFIG_ADDRESSES.extend([ - config_rule_delete(RSRC_SUBIF .format(endpoint_uuid, subinterface_index), {}), - config_rule_delete(RSRC_ADDRIPV4.format(endpoint_uuid, subinterface_index, subinterface_address), {}), - ]) - -DEVICE_EMU_DECONFIG_ENDPOINTS = [] -for endpoint_uuid in ENDPOINT_UUIDS: - DEVICE_EMU_DECONFIG_ENDPOINTS.append(config_rule_delete(RSRC_EP.format(endpoint_uuid), {})) +DEVICE_EMU_DECONFIG_ADDRESSES = [ + json_config_rule_delete(RSRC_SUBIF .format('EP1', 0), {}), + json_config_rule_delete(RSRC_ADDRIPV4.format('EP1', 0, '10.1.0.1'), {}), + + json_config_rule_delete(RSRC_SUBIF .format('EP2', 1), {}), + json_config_rule_delete(RSRC_ADDRIPV4.format('EP2', 1, '10.2.1.1'), {}), + + json_config_rule_delete(RSRC_SUBIF .format('EP3', 0), {}), + json_config_rule_delete(RSRC_ADDRIPV4.format('EP3', 0, '10.3.0.1'), {}), + + json_config_rule_delete(RSRC_SUBIF .format('EP4', 0), {}), + json_config_rule_delete(RSRC_ADDRIPV4.format('EP4', 0, '10.4.0.1'), {}), +] + +DEVICE_EMU_DECONFIG_ENDPOINTS = [ + json_config_rule_delete(RSRC_EP.format('EP1'), {}), + json_config_rule_delete(RSRC_EP.format('EP2'), {}), + json_config_rule_delete(RSRC_EP.format('EP3'), {}), + json_config_rule_delete(RSRC_EP.format('EP4'), {}), +] diff --git a/src/device/tests/Device_Microwave_Template.py b/src/device/tests/Device_Microwave_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..710d28becad9c0bb50b639f3c5d0ef8fa1abe145 --- /dev/null +++ b/src/device/tests/Device_Microwave_Template.py @@ -0,0 +1,46 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_microwave_disabled) + +DEVICE_MICROWAVE_UUID = 'DEVICE-MICROWAVE' # populate 'device-uuid' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_ADDRESS = '127.0.0.1' # populate 'address' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_PORT = 8443 # populate 'port' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_TIMEOUT = 120 # populate 'timeout' of the MICROWAVE SMDC server + +DEVICE_MICROWAVE_ID = json_device_id(DEVICE_MICROWAVE_UUID) +DEVICE_MICROWAVE = json_device_microwave_disabled(DEVICE_MICROWAVE_UUID) + +DEVICE_MICROWAVE_CONNECT_RULES = json_device_connect_rules(DEVICE_MICROWAVE_ADDRESS, DEVICE_MICROWAVE_PORT, { + 'timeout' : DEVICE_MICROWAVE_TIMEOUT, +}) + +DEVICE_MICROWAVE_CONFIG_RULES = [ + json_config_rule_set('/services/service[service_uuid]', { + 'uuid' : 'service-uuid', # populate 'service_name of the service to test + 'node_id_src': '172.26.60.243', # populate 'node_id_src' of the service to test + 'tp_id_src' : 9, # populate 'tp_id_src' of the service to test + 'node_id_dst': '172.26.60.244', # populate 'node_id_dst' of the service to test + 'tp_id_dst' : 9, # populate 'tp_id_dst' of the service to test + 'vlan_id' : 121, # populate 'vlan_id' of the service to test + }) +] + +DEVICE_MICROWAVE_DECONFIG_RULES = [ + json_config_rule_delete('/services/service[service-uuid]', { + 'uuid': 'service-uuid' # populate 'service_name' of the service to test + }) +] diff --git a/src/device/tests/Device_OpenConfig_Template.py b/src/device/tests/Device_OpenConfig_Template.py index 5f917c5c4057727a64697251696fdeb0283ab7cd..6afa2721ff920c39de243b308b9b9a4749cb013b 100644 --- a/src/device/tests/Device_OpenConfig_Template.py +++ b/src/device/tests/Device_OpenConfig_Template.py @@ -1,38 +1,40 @@ -from copy import deepcopy -from device.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum -from .Tools import config_rule_set, config_rule_delete +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -# use "deepcopy" to prevent propagating forced changes during tests +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_packetrouter_disabled) -DEVICE_OC_UUID = 'DEV2' -DEVICE_OC_TYPE = 'packet-router' +DEVICE_OC_UUID = 'DEV-UUID' # populate the name of the device to test DEVICE_OC_ADDRESS = '127.0.0.1' # populate the Netconf Server IP address of the device to test -DEVICE_OC_PORT = '830' # populate the Netconf Server port of the device to test +DEVICE_OC_PORT = 830 # populate the Netconf Server port of the device to test DEVICE_OC_USERNAME = 'username' # populate the Netconf Server username of the device to test DEVICE_OC_PASSWORD = 'password' # populate the Netconf Server password of the device to test -DEVICE_OC_TIMEOUT = 120 -DEVICE_OC_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG] +DEVICE_OC_TIMEOUT = 15 -DEVICE_OC_ID = {'device_uuid': {'uuid': DEVICE_OC_UUID}} -DEVICE_OC = { - 'device_id': deepcopy(DEVICE_OC_ID), - 'device_type': DEVICE_OC_TYPE, - 'device_config': {'config_rules': []}, - 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED, - 'device_drivers': DEVICE_OC_DRIVERS, - 'device_endpoints': [], # populated through the driver, leave this list empty -} +DEVICE_OC_ID = json_device_id(DEVICE_OC_UUID) +DEVICE_OC = json_device_packetrouter_disabled(DEVICE_OC_UUID) -DEVICE_OC_CONNECT_RULES = [ - config_rule_set('_connect/address', DEVICE_OC_ADDRESS), - config_rule_set('_connect/port', DEVICE_OC_PORT ), - config_rule_set('_connect/settings', { - 'username': DEVICE_OC_USERNAME, - 'password': DEVICE_OC_PASSWORD, - 'timeout' : DEVICE_OC_TIMEOUT, - }), -] +DEVICE_OC_CONNECT_RULES = json_device_connect_rules(DEVICE_OC_ADDRESS, DEVICE_OC_PORT, { + 'username' : DEVICE_OC_USERNAME, + 'password' : DEVICE_OC_PASSWORD, + 'force_running' : False, + 'hostkey_verify' : True, + 'look_for_keys' : True, + 'allow_agent' : True, + 'device_params' : {'name': 'default'}, + 'manager_params' : {'timeout' : DEVICE_OC_TIMEOUT}, +}) DEVICE_OC_CONFIG_RULES = [] # populate your configuration rules to test - DEVICE_OC_DECONFIG_RULES = [] # populate your deconfiguration rules to test diff --git a/src/device/tests/Device_Transport_Api_Template.py b/src/device/tests/Device_Transport_Api_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..ef4fa4d57700637121f7d64113c57120ffbc49a4 --- /dev/null +++ b/src/device/tests/Device_Transport_Api_Template.py @@ -0,0 +1,48 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_tapi_disabled) + +DEVICE_TAPI_UUID = 'DEVICE-TAPI' # populate 'device-uuid' of the TAPI server +DEVICE_TAPI_ADDRESS = '0.0.0.0' # populate 'address' of the TAPI server +DEVICE_TAPI_PORT = 4900 # populate 'port' of the TAPI server +DEVICE_TAPI_TIMEOUT = 120 # populate 'timeout' of the TAPI server + +DEVICE_TAPI_ID = json_device_id(DEVICE_TAPI_UUID) +DEVICE_TAPI = json_device_tapi_disabled(DEVICE_TAPI_UUID) + +DEVICE_TAPI_CONNECT_RULES = json_device_connect_rules(DEVICE_TAPI_ADDRESS, DEVICE_TAPI_PORT, { + 'timeout' : DEVICE_TAPI_TIMEOUT, +}) + +DEVICE_TAPI_CONFIG_RULES = [ + json_config_rule_set('node_4_port_16-input_to_node_2_port_17-output', { + 'uuid' : 'service-uuid', # populate 'service-uuid' of the service to test + 'input_sip' : 'input-sip-uuid', # populate 'input-sip-uuid' of the service to test + 'output_sip' : 'output-sip-uuid', # populate 'output-sip-uuid' of the service to test + 'capacity_unit' : 'GHz', # populate 'capacity-unit' of the service to test + 'capacity_value' : 1, # populate 'capacity-value' of the service to test + 'direction' : 'UNIDIRECTIONAL', # populate 'direction' of the service to test + 'layer_protocol_name' : 'PHOTONIC_MEDIA', + 'layer_protocol_qualifier': 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC', + }) +] + +DEVICE_TAPI_DECONFIG_RULES = [ + json_config_rule_delete('node_4_port_16-input_to_node_2_port_17-output', { + 'uuid': 'service-uuid' # populate 'service-uuid' of the service to test + }) +] diff --git a/src/device/tests/MockMonitoringService.py b/src/device/tests/MockMonitoringService.py deleted file mode 100644 index 6f51f0d8360f96ed183c11b336eb300fe3695a36..0000000000000000000000000000000000000000 --- a/src/device/tests/MockMonitoringService.py +++ /dev/null @@ -1,47 +0,0 @@ -import grpc, logging -from concurrent import futures -from queue import Queue -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server -from .MockMonitoringServiceServicerImpl import MockMonitoringServiceServicerImpl - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class MockMonitoringService: - def __init__( - self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.queue_samples = Queue() - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.monitoring_servicer = MockMonitoringServiceServicerImpl(self.queue_samples) - add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/device/tests/MockMonitoringServiceServicerImpl.py b/src/device/tests/MockMonitoringServiceServicerImpl.py deleted file mode 100644 index 1787acdaa68fd80037ab1f4d14d7f86599f9ac14..0000000000000000000000000000000000000000 --- a/src/device/tests/MockMonitoringServiceServicerImpl.py +++ /dev/null @@ -1,15 +0,0 @@ -import logging -from queue import Queue -from monitoring.proto.context_pb2 import Empty -from monitoring.proto.monitoring_pb2 import Kpi -from monitoring.proto.monitoring_pb2_grpc import MonitoringServiceServicer - -LOGGER = logging.getLogger(__name__) - -class MockMonitoringServiceServicerImpl(MonitoringServiceServicer): - def __init__(self, queue_samples : Queue): - self.queue_samples = queue_samples - - def IncludeKpi(self, request : Kpi, context) -> Empty: - self.queue_samples.put(request) - return Empty() diff --git a/src/device/tests/MockService_Dependencies.py b/src/device/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..ba8d0ac56d74d2efa3e7964a3ae519bb355bff91 --- /dev/null +++ b/src/device/tests/MockService_Dependencies.py @@ -0,0 +1,50 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os, queue +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Monitoring import MockServicerImpl_Monitoring +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_MONITORING = ServiceNameEnum.MONITORING + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Monitoring to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.queue_samples = queue.Queue() + self.monitoring_servicer = MockServicerImpl_Monitoring(queue_samples=self.queue_samples) + add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/device/tests/PrepareTestScenario.py b/src/device/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..440bdac41ba792e5dbfd47e114516bb17be69859 --- /dev/null +++ b/src/device/tests/PrepareTestScenario.py @@ -0,0 +1,80 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from common.proto.context_pb2 import Context, Topology +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from device.service.drivers import DRIVERS +from device.tests.CommonObjects import CONTEXT, TOPOLOGY +from device.tests.MockService_Dependencies import MockService_Dependencies +from monitoring.client.MonitoringClient import MonitoringClient + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +DEVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def monitoring_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = MonitoringClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name + + _driver_factory = DriverFactory(DRIVERS) + _driver_instance_cache = DriverInstanceCache(_driver_factory) + _service = DeviceService(_driver_instance_cache) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + context_client.SetContext(Context(**CONTEXT)) + context_client.SetTopology(Topology(**TOPOLOGY)) diff --git a/src/device/tests/Tools.py b/src/device/tests/Tools.py deleted file mode 100644 index 2d8e99de30ebfcc4ed257a7bee512f4d416bd64c..0000000000000000000000000000000000000000 --- a/src/device/tests/Tools.py +++ /dev/null @@ -1,25 +0,0 @@ -import json -from copy import deepcopy -from typing import Any, Dict, Union -from device.proto.context_pb2 import ConfigActionEnum - -def config_rule(action : ConfigActionEnum, resource_key : str, resource_value : Union[str, Dict[str, Any]]): - if not isinstance(resource_value, str): resource_value = json.dumps(resource_value, sort_keys=True) - return {'action': action, 'resource_key': resource_key, 'resource_value': resource_value} - -def config_rule_set(resource_key : str, resource_value : Union[str, Dict[str, Any]]): - return config_rule(ConfigActionEnum.CONFIGACTION_SET, resource_key, resource_value) - -def config_rule_delete(resource_key : str, resource_value : Union[str, Dict[str, Any]]): - return config_rule(ConfigActionEnum.CONFIGACTION_DELETE, resource_key, resource_value) - -def endpoint_id(device_id, endpoint_uuid, topology_id=None): - result = {'device_id': deepcopy(device_id), 'endpoint_uuid': {'uuid': endpoint_uuid}} - if topology_id is not None: result['topology_id'] = deepcopy(topology_id) - return result - -def endpoint(device_id, endpoint_uuid, endpoint_type, topology_id=None): - return { - 'endpoint_id': endpoint_id(device_id, endpoint_uuid, topology_id=topology_id), - 'endpoint_type': endpoint_type, - } diff --git a/src/device/tests/__init__.py b/src/device/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/device/tests/__init__.py +++ b/src/device/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/device/tests/device_p4.py b/src/device/tests/device_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..4cd0a4c745d3a07b71f320ce79d73c95ffb0af37 --- /dev/null +++ b/src/device/tests/device_p4.py @@ -0,0 +1,52 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +""" +P4 device example configuration. +""" + +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_p4_disabled) + +DEVICE_P4_DPID = 0 +DEVICE_P4_NAME = 'device:leaf1' +DEVICE_P4_ADDRESS = '127.0.0.1' +DEVICE_P4_PORT = '50101' +DEVICE_P4_VENDOR = 'Open Networking Foundation' +DEVICE_P4_HW_VER = 'BMv2 simple_switch' +DEVICE_P4_SW_VER = 'Stratum' +DEVICE_P4_PIPECONF = 'org.onosproject.pipelines.fabric' +DEVICE_P4_WORKERS = 2 +DEVICE_P4_GRACE_PERIOD = 60 +DEVICE_P4_TIMEOUT = 60 + +DEVICE_P4_UUID = DEVICE_P4_NAME +DEVICE_P4_ID = json_device_id(DEVICE_P4_UUID) +DEVICE_P4 = json_device_p4_disabled(DEVICE_P4_UUID) + +DEVICE_P4_CONNECT_RULES = json_device_connect_rules( + DEVICE_P4_ADDRESS, DEVICE_P4_PORT, { + 'id': DEVICE_P4_DPID, + 'name': DEVICE_P4_NAME, + 'hw-ver': DEVICE_P4_HW_VER, + 'sw-ver': DEVICE_P4_SW_VER, + 'pipeconf': DEVICE_P4_PIPECONF, + 'timeout': DEVICE_P4_TIMEOUT + } +) + +DEVICE_P4_CONFIG_RULES = [ + json_config_rule_set('key1', 'value1'), +] diff --git a/src/device/tests/mock_p4runtime_service.py b/src/device/tests/mock_p4runtime_service.py new file mode 100644 index 0000000000000000000000000000000000000000..77da0113676dc6f820d995b34915df6d0ba30f01 --- /dev/null +++ b/src/device/tests/mock_p4runtime_service.py @@ -0,0 +1,80 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +""" +A mock P4Runtime server. +""" + +import logging +from concurrent import futures +import grpc +from p4.v1 import p4runtime_pb2_grpc + +from .device_p4 import( + DEVICE_P4_ADDRESS, DEVICE_P4_PORT, + DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD) +from .mock_p4runtime_servicer_impl import MockP4RuntimeServicerImpl + +LOGGER = logging.getLogger(__name__) + + +class MockP4RuntimeService: + """ + P4Runtime server for testing purposes. + """ + + def __init__( + self, address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD): + self.address = address + self.port = port + self.endpoint = f'{self.address}:{self.port}' + self.max_workers = max_workers + self.grace_period = grace_period + self.server = None + self.servicer = None + + def start(self): + """ + Start the P4Runtime server. + """ + + LOGGER.info( + 'Starting P4Runtime service on %s with max_workers: %s', + str(self.endpoint), str(self.max_workers)) + + self.server = grpc.server( + futures.ThreadPoolExecutor(max_workers=self.max_workers)) + + self.servicer = MockP4RuntimeServicerImpl() + p4runtime_pb2_grpc.add_P4RuntimeServicer_to_server( + self.servicer, self.server) + + _ = self.server.add_insecure_port(self.endpoint) + LOGGER.info('Listening on %s...', str(self.endpoint)) + + self.server.start() + LOGGER.debug('P4Runtime service started') + + def stop(self): + """ + Stop the P4Runtime server. + """ + + LOGGER.debug( + 'Stopping P4Runtime service (grace period %d seconds...', + self.grace_period) + self.server.stop(self.grace_period) + LOGGER.debug('P4Runtime service stopped') diff --git a/src/device/tests/mock_p4runtime_servicer_impl.py b/src/device/tests/mock_p4runtime_servicer_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..d29445da43afb58ef062f62c496b0780f92a4648 --- /dev/null +++ b/src/device/tests/mock_p4runtime_servicer_impl.py @@ -0,0 +1,69 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +""" +A mock P4Runtime service implementation. +""" + +import queue +from google.rpc import code_pb2 +from p4.v1 import p4runtime_pb2, p4runtime_pb2_grpc +from p4.config.v1 import p4info_pb2 + +try: + from p4_util import STREAM_ATTR_ARBITRATION, STREAM_ATTR_PACKET +except ImportError: + from device.service.drivers.p4.p4_util import STREAM_ATTR_ARBITRATION,\ + STREAM_ATTR_PACKET + +class MockP4RuntimeServicerImpl(p4runtime_pb2_grpc.P4RuntimeServicer): + """ + A P4Runtime service implementation for testing purposes. + """ + + def __init__(self): + self.p4info = p4info_pb2.P4Info() + self.p4runtime_api_version = "1.3.0" + self.stored_packet_out = queue.Queue() + + def GetForwardingPipelineConfig(self, request, context): + rep = p4runtime_pb2.GetForwardingPipelineConfigResponse() + if self.p4info is not None: + rep.config.p4info.CopyFrom(self.p4info) + return rep + + def SetForwardingPipelineConfig(self, request, context): + self.p4info.CopyFrom(request.config.p4info) + return p4runtime_pb2.SetForwardingPipelineConfigResponse() + + def Write(self, request, context): + return p4runtime_pb2.WriteResponse() + + def Read(self, request, context): + yield p4runtime_pb2.ReadResponse() + + def StreamChannel(self, request_iterator, context): + for req in request_iterator: + if req.HasField(STREAM_ATTR_ARBITRATION): + rep = p4runtime_pb2.StreamMessageResponse() + rep.arbitration.CopyFrom(req.arbitration) + rep.arbitration.status.code = code_pb2.OK + yield rep + elif req.HasField(STREAM_ATTR_PACKET): + self.stored_packet_out.put(req) + + def Capabilities(self, request, context): + rep = p4runtime_pb2.CapabilitiesResponse() + rep.p4runtime_api_version = self.p4runtime_api_version + return rep diff --git a/src/device/tests/test_unit_p4.py b/src/device/tests/test_unit_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..777ab280aa2b500c3c2b445fcecdf81024b817f3 --- /dev/null +++ b/src/device/tests/test_unit_p4.py @@ -0,0 +1,97 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import pytest +from device.service.drivers.p4.p4_driver import P4Driver +from .device_p4 import( + DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_DPID, DEVICE_P4_NAME, + DEVICE_P4_VENDOR, DEVICE_P4_HW_VER, DEVICE_P4_SW_VER, + DEVICE_P4_PIPECONF, DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD) +from .mock_p4runtime_service import MockP4RuntimeService + + +@pytest.fixture(scope='session') +def p4runtime_service(): + _service = MockP4RuntimeService( + address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD) + _service.start() + yield _service + _service.stop() + + +@pytest.fixture(scope='session') +def device_driverapi_p4(): + _driver = P4Driver( + address=DEVICE_P4_ADDRESS, + port=DEVICE_P4_PORT, + id=DEVICE_P4_DPID, + name=DEVICE_P4_NAME, + vendor=DEVICE_P4_VENDOR, + hw_ver=DEVICE_P4_HW_VER, + sw_ver=DEVICE_P4_SW_VER, + pipeconf=DEVICE_P4_PIPECONF) + _driver.Connect() + yield _driver + _driver.Disconnect() + + +def test_device_driverapi_p4_setconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.SetConfig([]) + return + + +def test_device_driverapi_p4_getconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.GetConfig() + return + + +def test_device_driverapi_p4_getresource( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.GetResource("") + return + + +def test_device_driverapi_p4_getstate( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.GetState() + return + + +def test_device_driverapi_p4_deleteconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.DeleteConfig([]) + return + + +def test_device_driverapi_p4_subscribe_state( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.SubscribeState([]) + return + + +def test_device_driverapi_p4_unsubscribe_state( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name + device_driverapi_p4.UnsubscribeState([]) + return diff --git a/src/device/tests/test_unitary.py b/src/device/tests/test_unitary.py deleted file mode 100644 index 7c2ad83d52b80e0a9d41cd8d0cecf9a4539618ea..0000000000000000000000000000000000000000 --- a/src/device/tests/test_unitary.py +++ /dev/null @@ -1,577 +0,0 @@ -import copy, grpc, json, logging, operator, os, pytest, time -from datetime import datetime -from typing import Tuple -from queue import Queue, Empty -from google.protobuf.json_format import MessageToDict -from common.orm.Database import Database -from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum -from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum -from common.message_broker.MessageBroker import MessageBroker -from context.Config import ( - GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as CONTEXT_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as CONTEXT_GRPC_GRACE_PERIOD) -from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import DeviceId, DeviceOperationalStatusEnum -from context.service.grpc_server.ContextService import ContextService -from device.Config import ( - GRPC_SERVICE_PORT as DEVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as DEVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as DEVICE_GRPC_GRACE_PERIOD) -from device.client.DeviceClient import DeviceClient -from device.proto.context_pb2 import ConfigActionEnum, Context, Device, Topology -from device.proto.device_pb2 import MonitoringSettings -from device.proto.kpi_sample_types_pb2 import KpiSampleType -from device.service.DeviceService import DeviceService -from device.service.driver_api._Driver import _Driver -from device.service.driver_api.DriverFactory import DriverFactory -from device.service.driver_api.DriverInstanceCache import DriverInstanceCache -from device.service.drivers import DRIVERS -from device.tests.MockMonitoringService import MockMonitoringService -from device.tests.Tools import endpoint_id -from monitoring.Config import ( - GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as MONITORING_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as MONITORING_GRPC_GRACE_PERIOD) -from monitoring.client.monitoring_client import MonitoringClient -from .CommonObjects import CONTEXT, TOPOLOGY -from .Device_Emulated import ( - DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, - DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_ENDPOINTS, DEVICE_EMU_ENDPOINTS_COOKED, - DEVICE_EMU_ID, DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) -try: - from .Device_OpenConfig_Infinera import( - DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, - DEVICE_OC_UUID) - ENABLE_OPENCONFIG = True -except ImportError: - ENABLE_OPENCONFIG = False - # Create a Device_OpenConfig_??.py file with the details for your device to test it and import it as follows in the - # try block of this import statement. - # from .Device_OpenConfig_?? import( - # DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, - # DEVICE_OC_UUID) - - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -CONTEXT_GRPC_SERVICE_PORT = 10000 + CONTEXT_GRPC_SERVICE_PORT # avoid privileged ports -DEVICE_GRPC_SERVICE_PORT = 10000 + DEVICE_GRPC_SERVICE_PORT # avoid privileged ports -MONITORING_GRPC_SERVICE_PORT = 10000 + MONITORING_GRPC_SERVICE_PORT # avoid privileged ports - -DEFAULT_REDIS_SERVICE_HOST = '127.0.0.1' -DEFAULT_REDIS_SERVICE_PORT = 6379 -DEFAULT_REDIS_DATABASE_ID = 0 - -REDIS_CONFIG = { - 'REDIS_SERVICE_HOST': os.environ.get('REDIS_SERVICE_HOST', DEFAULT_REDIS_SERVICE_HOST), - 'REDIS_SERVICE_PORT': os.environ.get('REDIS_SERVICE_PORT', DEFAULT_REDIS_SERVICE_PORT), - 'REDIS_DATABASE_ID' : os.environ.get('REDIS_DATABASE_ID', DEFAULT_REDIS_DATABASE_ID ), -} - -SCENARIOS = [ - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), - #('all_redis', DatabaseBackendEnum.REDIS, REDIS_CONFIG, MessageBrokerBackendEnum.REDIS, REDIS_CONFIG), -] - -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) - yield _database, _message_broker - _message_broker.terminate() - -@pytest.fixture(scope='session') -def context_service(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - _service = ContextService( - context_db_mb[0], context_db_mb[1], port=CONTEXT_GRPC_SERVICE_PORT, max_workers=CONTEXT_GRPC_MAX_WORKERS, - grace_period=CONTEXT_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(context_service : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='127.0.0.1', port=CONTEXT_GRPC_SERVICE_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def monitoring_service(): - _service = MockMonitoringService(port=MONITORING_GRPC_SERVICE_PORT, max_workers=MONITORING_GRPC_MAX_WORKERS, - grace_period=MONITORING_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def monitoring_client(monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - _client = MonitoringClient(server='127.0.0.1', port=MONITORING_GRPC_SERVICE_PORT) - #yield _client - #_client.close() - return _client - -@pytest.fixture(scope='session') -def device_service( - context_client : ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name - - _driver_factory = DriverFactory(DRIVERS) - _driver_instance_cache = DriverInstanceCache(_driver_factory) - _service = DeviceService( - context_client, monitoring_client, _driver_instance_cache, port=DEVICE_GRPC_SERVICE_PORT, - max_workers=DEVICE_GRPC_MAX_WORKERS, grace_period=DEVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name - _client = DeviceClient(address='127.0.0.1', port=DEVICE_GRPC_SERVICE_PORT) - yield _client - _client.close() - -def grpc_message_to_json_string(message): - return str(MessageToDict( - message, including_default_value_fields=True, preserving_proto_field_name=True, use_integers_for_enums=False)) - - -def test_prepare_environment( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - context_client.SetContext(Context(**CONTEXT)) - context_client.SetTopology(Topology(**TOPOLOGY)) - - -# ----- Test Device Driver Emulated ------------------------------------------------------------------------------------ -# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other -# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must -# implement the Driver API. - -def test_device_emulated_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - with pytest.raises(grpc.RpcError) as e: - DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_emulated_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - -def test_device_emulated_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) - #LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - #LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_emulated_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - assert endpoint_cooked in driver_config - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) - - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - endpoint_cooked = copy.deepcopy(endpoint_cooked) - endpoint_cooked[1]['enabled'] = True - assert endpoint_cooked in driver_config - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - assert (config_rule['resource_key'], json.loads(config_rule['resource_value'])) in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - RESULTING_CONFIG_ENDPOINTS = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - - # Try to reconfigure... - - DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES.update({cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES)}) - for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: - if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: - RESULTING_CONFIG_RULES.pop(reconfig_rule['resource_key'], None) - else: - RESULTING_CONFIG_RULES[reconfig_rule['resource_key']] = reconfig_rule - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - for config_rule in RESULTING_CONFIG_RULES: - resource = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - assert resource in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_emulated_monitor( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService, # pylint: disable=redefined-outer-name - monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - - #device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - - SAMPLING_DURATION_SEC = 3.0 - SAMPLING_INTERVAL_SEC = 0.5 - - MONITORING_SETTINGS_LIST = [] - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} - for endpoint_uuid,_,sample_types in DEVICE_EMU_ENDPOINTS: - for sample_type in sample_types: - sample_type_id = sample_type.value - sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') - kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(DEVICE_EMU_UUID, endpoint_uuid, str(sample_type_id)) - monitoring_settings = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'kpi_descriptor': { - 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( - sample_type_name, endpoint_uuid, DEVICE_EMU_UUID), - 'kpi_sample_type': sample_type_id, - 'device_id': DEVICE_EMU_ID, - 'endpoint_id': endpoint_id(DEVICE_EMU_ID, endpoint_uuid), - }, - 'sampling_duration_s': SAMPLING_DURATION_SEC, - 'sampling_interval_s': SAMPLING_INTERVAL_SEC, - } - MONITORING_SETTINGS_LIST.append(monitoring_settings) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 - - NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC - NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI - - # Start monitoring the device - t_start_monitoring = datetime.timestamp(datetime.utcnow()) - for monitoring_settings in MONITORING_SETTINGS_LIST: - device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) - - # wait to receive the expected number of samples - # if takes more than 1.5 times the sampling duration, assume there is an error - time_ini = time.time() - queue_samples : Queue = monitoring_service.queue_samples - received_samples = [] - while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): - try: - received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) - #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) - received_samples.append(received_sample) - except Empty: - continue - - t_end_monitoring = datetime.timestamp(datetime.utcnow()) - - LOGGER.info('received_samples = {:s}'.format(str(received_samples))) - assert len(received_samples) == NUM_SAMPLES_EXPECTED - for received_sample in received_samples: - kpi_uuid = received_sample.kpi_id.kpi_id.uuid - assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED - assert isinstance(received_sample.timestamp, str) - timestamp = float(received_sample.timestamp) - assert timestamp > t_start_monitoring - assert timestamp < t_end_monitoring - assert received_sample.kpi_value.HasField('floatVal') - assert isinstance(received_sample.kpi_value.floatVal, float) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 - - LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) - for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): - assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI - - # Unsubscribe monitoring - for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): - MONITORING_SETTINGS_UNSUBSCRIBE = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'sampling_duration_s': -1, # negative value in sampling_duration_s or in sampling_interval_s means unsibscribe - 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe - } - device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) - - -def test_device_emulated_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = driver.GetConfig() - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) - assert config_rule in driver_config - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == 0 - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - assert len(device_data.device_config.config_rules) == 0 - - -def test_device_emulated_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID, {}) - assert driver is None - - -# ----- Test Device Driver OpenConfig ---------------------------------------------------------------------------------- - -def test_device_openconfig_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - with pytest.raises(grpc.RpcError) as e: - DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_openconfig_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - -def test_device_openconfig_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_openconfig_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_openconfig_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_DECONFIG_RULES: - action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) - config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) - assert config_rule not in config_rules - - -def test_device_openconfig_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: return # if there is no device to test against, asusme test is silently passed. - - device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID, {}) - assert driver is None diff --git a/src/device/tests/test_unitary_emulated.py b/src/device/tests/test_unitary_emulated.py new file mode 100644 index 0000000000000000000000000000000000000000..87c067a08e37475bcf44b0546abcfcaf25fc965d --- /dev/null +++ b/src/device/tests/test_unitary_emulated.py @@ -0,0 +1,399 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import calendar, copy, dateutil.parser, grpc, json, logging, operator, pytest, queue, time +from datetime import datetime, timezone +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId, DeviceOperationalStatusEnum +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +from .Device_Emulated import ( + DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, + DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_ENDPOINTS_COOKED, DEVICE_EMU_ID, + DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +# ----- Test Device Driver Emulated -------------------------------------------- +# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other +# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must +# implement the Driver API. + +def test_device_emulated_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_ENDPOINTS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_ENDPOINTS['device_endpoints'].append(json_endpoint(DEVICE_EMU_ID, 'ep-id', 'ep-type')) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_ENDPOINTS)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_endpoints([' + msg_tail = ']) is invalid; RPC method AddDevice does not accept Endpoints. '\ + 'Endpoints are discovered through interrogation of the physical device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_emulated_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + + +def test_device_emulated_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_emulated_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + assert endpoint_cooked in driver_config + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + endpoint_cooked = copy.deepcopy(endpoint_cooked) + endpoint_cooked[1]['enabled'] = True + assert endpoint_cooked in driver_config + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + assert 'custom' in config_rule + rule = (config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])) + assert rule in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + RESULTING_CONFIG_ENDPOINTS = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + json.loads(json.dumps(config_rule['custom']['resource_value']))) + assert config_rule in config_rules + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + json.loads(json.dumps(config_rule['custom']['resource_value']))) + assert config_rule in config_rules + + # Try to reconfigure... + + DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES.update({ + cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES) + }) + for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: + assert 'custom' in reconfig_rule + if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: + RESULTING_CONFIG_RULES.pop(reconfig_rule['custom']['resource_key'], None) + else: + RESULTING_CONFIG_RULES[reconfig_rule['custom']['resource_key']] = reconfig_rule + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + resource = [config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])] + assert resource in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + ] + #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_emulated_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + device_uuid = DEVICE_EMU_UUID + json_device_id = DEVICE_EMU_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + #assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + + SAMPLING_DURATION_SEC = 10.0 + SAMPLING_INTERVAL_SEC = 2.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + assert isinstance(received_sample.timestamp, str) + try: + timestamp = float(received_sample.timestamp) + except ValueError: + dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) + timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_emulated_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = driver.GetConfig() + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + driver_config = list(filter( + lambda config_rule: ( + not isinstance(config_rule[1], str) or not config_rule[1].startswith('do_sampling (trigger:')), + driver_config)) + LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = [config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])] + #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) + assert config_rule in driver_config + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == 0 + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = device_data.device_config.config_rules + LOGGER.info('config_rules = {:s}'.format(str(config_rules))) + clean_config_rules = [] + for config_rule in config_rules: + assert config_rule.WhichOneof('config_rule') == 'custom' + if config_rule.custom.resource_key.startswith('/endpoints/endpoint'): continue + config_rule_value = json.loads(config_rule.custom.resource_value) + if isinstance(config_rule_value, str) and config_rule_value.startswith('do_sampling (trigger:'): continue + clean_config_rules.append(config_rule) + LOGGER.info('clean_config_rules = {:s}'.format(str(clean_config_rules))) + assert len(clean_config_rules) == 0 + + +def test_device_emulated_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_microwave.py b/src/device/tests/test_unitary_microwave.py new file mode 100644 index 0000000000000000000000000000000000000000..189984703ec7d6d9e68613624e3b759e133438ac --- /dev/null +++ b/src/device/tests/test_unitary_microwave.py @@ -0,0 +1,171 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, grpc, logging, pytest +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Microwave_Template import ( + DEVICE_MICROWAVE, DEVICE_MICROWAVE_CONNECT_RULES, DEVICE_MICROWAVE_UUID, DEVICE_MICROWAVE_ID, + DEVICE_MICROWAVE_CONFIG_RULES, DEVICE_MICROWAVE_DECONFIG_RULES) + ENABLE_MICROWAVE = True +except ImportError: + ENABLE_MICROWAVE = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver Microwave ------------------------------------------------ + +def test_device_microwave_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_MICROWAVE_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_microwave_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + DEVICE_MICROWAVE_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + +def test_device_microwave_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_microwave_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_microwave_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_microwave_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_openconfig.py b/src/device/tests/test_unitary_openconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..32fb5709a98d095982d46d16450117a84f89f165 --- /dev/null +++ b/src/device/tests/test_unitary_openconfig.py @@ -0,0 +1,304 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import calendar, copy, dateutil.parser, grpc, logging, pytest, queue, time +from datetime import datetime, timezone +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_OpenConfig_Infinera1 import( + #from .Device_OpenConfig_Infinera2 import( + DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, + DEVICE_OC_UUID) + ENABLE_OPENCONFIG = True +except ImportError: + ENABLE_OPENCONFIG = False + +ENABLE_OPENCONFIG_CONFIGURE = True +ENABLE_OPENCONFIG_MONITOR = True +ENABLE_OPENCONFIG_DECONFIGURE = True + + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver OpenConfig ------------------------------------------ + +def test_device_openconfig_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_openconfig_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + + +def test_device_openconfig_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_openconfig_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_CONFIGURE: pytest.skip('Skipping test OpenConfig configure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_openconfig_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_MONITOR: pytest.skip('Skipping test OpenConfig monitor') + + device_uuid = DEVICE_OC_UUID + json_device_id = DEVICE_OC_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + + SAMPLING_DURATION_SEC = 60.0 + SAMPLING_INTERVAL_SEC = 15.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + #assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + assert isinstance(received_sample.timestamp, str) + try: + timestamp = float(received_sample.timestamp) + except ValueError: + dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) + timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + # TODO: review why num_samples_received per KPI != NUM_SAMPLES_EXPECTED_PER_KPI + #for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + # assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED: + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_openconfig_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_DECONFIGURE: pytest.skip('Skipping test OpenConfig deconfigure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_openconfig_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_p4.py b/src/device/tests/test_unitary_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..86a669bd40deb8f7839d3e682b8a1f52f3c38e1b --- /dev/null +++ b/src/device/tests/test_unitary_p4.py @@ -0,0 +1,145 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, grpc, logging, pytest +from common.proto.context_pb2 import Device, DeviceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +from .mock_p4runtime_service import MockP4RuntimeService +try: + from .device_p4 import( + DEVICE_P4, DEVICE_P4_ID, DEVICE_P4_UUID, DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_WORKERS, + DEVICE_P4_GRACE_PERIOD, DEVICE_P4_CONNECT_RULES, DEVICE_P4_CONFIG_RULES) + ENABLE_P4 = True +except ImportError: + ENABLE_P4 = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def p4runtime_service(): + _service = MockP4RuntimeService( + address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD) + _service.start() + yield _service + _service.stop() + + +# ----- Test Device Driver P4 -------------------------------------------------- + +def test_device_p4_add_error_cases( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + with pytest.raises(grpc.RpcError) as e: + device_p4_with_extra_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONFIG_RULES) + device_client.AddDevice(Device(**device_p4_with_extra_rules)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_p4_add_correct( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + device_p4_with_connect_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_connect_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_client.AddDevice(Device(**device_p4_with_connect_rules)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is not None + + +def test_device_p4_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_P4_ID)) + LOGGER.info('initial_config = {:s}'.format( + grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + LOGGER.info('device_data = {:s}'.format( + grpc_message_to_json_string(device_data))) + + +def test_device_p4_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + pytest.skip('Skipping test for unimplemented method') + + +def test_device_p4_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip( + 'Skipping test: No P4 device has been configured') + + pytest.skip('Skipping test for unimplemented method') + + +def test_device_p4_delete( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + + if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_P4_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is None diff --git a/src/device/tests/test_unitary_tapi.py b/src/device/tests/test_unitary_tapi.py new file mode 100644 index 0000000000000000000000000000000000000000..993c0c413d868471316aee6b3b1e313d3f449ceb --- /dev/null +++ b/src/device/tests/test_unitary_tapi.py @@ -0,0 +1,171 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, grpc, logging, pytest +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Transport_Api_CTTC import ( + DEVICE_TAPI, DEVICE_TAPI_CONNECT_RULES, DEVICE_TAPI_UUID, DEVICE_TAPI_ID, DEVICE_TAPI_CONFIG_RULES, + DEVICE_TAPI_DECONFIG_RULES) + ENABLE_TAPI = True +except ImportError: + ENABLE_TAPI = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver TAPI ------------------------------------------------ + +def test_device_tapi_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_TAPI_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_tapi_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + DEVICE_TAPI_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + +def test_device_tapi_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_tapi_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_tapi_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_tapi_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID, {}) + assert driver is None diff --git a/src/dlt/__init__.py b/src/dlt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dlt/config/ca.org1.example.com-cert.pem b/src/dlt/config/ca.org1.example.com-cert.pem deleted file mode 100644 index 9c10b97908d70ae16b542f922563dbcba21056c6..0000000000000000000000000000000000000000 --- a/src/dlt/config/ca.org1.example.com-cert.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw -cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH -EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh -Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw -WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV -BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT -Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi -ggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P -l2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG -AQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD -AgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc -n9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE= ------END CERTIFICATE----- diff --git a/src/dlt/connector/__init__.py b/src/dlt/connector/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dlt/connector/client/__init__.py b/src/dlt/connector/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dlt/connector/service/__init__.py b/src/dlt/connector/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dlt/connector/tests/__init__.py b/src/dlt/connector/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/dlt/connector/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/dlt/.gitignore b/src/dlt/gateway/.gitignore similarity index 100% rename from src/dlt/.gitignore rename to src/dlt/gateway/.gitignore diff --git a/src/dlt/README.md b/src/dlt/gateway/README.md similarity index 100% rename from src/dlt/README.md rename to src/dlt/gateway/README.md diff --git a/src/dlt/build.gradle.kts b/src/dlt/gateway/build.gradle.kts similarity index 100% rename from src/dlt/build.gradle.kts rename to src/dlt/gateway/build.gradle.kts diff --git a/src/dlt/gateway/config/ca.org1.example.com-cert.pem b/src/dlt/gateway/config/ca.org1.example.com-cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..5287a0f2bada9649c0d2ddd8eb8a71b2dac10df7 --- /dev/null +++ b/src/dlt/gateway/config/ca.org1.example.com-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw +cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH +EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh +Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw +WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV +BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT +Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg +yfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L +4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG +AQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD +AgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P +mbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk= +-----END CERTIFICATE----- diff --git a/src/dlt/config/connection-org1.json b/src/dlt/gateway/config/connection-org1.json similarity index 59% rename from src/dlt/config/connection-org1.json rename to src/dlt/gateway/config/connection-org1.json index c28ac57118e8695375187eaf103f1f499f2cf301..320a20806650edaea9de45d0e208bc2b8dea12f0 100644 --- a/src/dlt/config/connection-org1.json +++ b/src/dlt/gateway/config/connection-org1.json @@ -26,7 +26,7 @@ "peer0.org1.example.com": { "url": "grpcs://s2:7051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg\nyfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L\n4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD\nAgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P\nmbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk=\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org1.example.com", @@ -36,7 +36,7 @@ "peer0.org2.example.com": { "url": "grpcs://s2:9051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICHzCCAcWgAwIBAgIUJiJ5815YVes2sG95oFzj0QWWBKswCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMTExMjMxMjM3MDBaFw0zNjExMTkxMjM3MDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATdQw+PQyT3Ql5M\nv/xvafYFhU5Jtl0CwYyrXTtRajpPnlPnNvXUqVMxmdSR+4m2WBYyBdZ8IhGaayb/\nrOro8Mpko0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUrsPP1HIS6O+JeWL2ct/ujkfP7dEwCgYIKoZIzj0EAwIDSAAwRQIh\nAMynA2Q/cbMXEHihnQdpdEz/83jGAokp7dKMHst02b3gAiA0XReJWdc0AUXZtbSq\nZG8mXOJeZu0Zro9DuQUEDPBfDQ==\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICHzCCAcWgAwIBAgIUejv57h6dJkVIM2R1YnlqykkvG7gwCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMjA3MDUwOTQ0MDBaFw0zNzA3MDEwOTQ0MDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASFZqoisCIgZyMM\n8e0YBA+jxH/+Fc4Y4OkEl5uGRXGl9s0OemCdvhlX9K+esX2DVk1st1PMfTEj/six\n9XPpVqzNo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUPEyzGBlZEjguoJB16wAmoH2bAh8wCgYIKoZIzj0EAwIDSAAwRQIh\nAL6DAWgrqRtbYoQ0oYAr/2vze0JtQcXoqiQKlyvYkUBbAiB/uSHBk3NwjzI8t8iW\nzQzr5eNy5JwOO0SWwPEv4Ev9iQ==\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org2.example.com", @@ -50,7 +50,7 @@ "caName": "ca-org1", "tlsCACerts": { "pem": [ - "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIUWZ4l32loO9+FM0FYw61y3dUF5a0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwNzA1MDk0NDAwWhcNMzcwNzAxMDk0NDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNPg\nyfDxHr4ZmFp3HB19f27vfc1YTKBnznLqIFwVad2Y+eXfni8DnTRNGgwdkG9uIK2L\n4Y9mwlKG/mTNx629G4GjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBSZlT6qe+DAGpEBXyMxzidqCkQ4PjAKBggqhkjOPQQD\nAgNHADBEAiAIG5jwBGddB9CwocmjAzFv8+e7+0bvNSwjrG229QogTgIgbTNoC33P\nmbR5ChlkUAW2t41hTOCSMIwLAlvEwpeCnAk=\n-----END CERTIFICATE-----\n" ] }, "httpOptions": { @@ -62,7 +62,7 @@ "orderer0.example.com": { "url": "grpcs://s2:7050", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICCzCCAbGgAwIBAgIUDr4RiMRC/q95iWAfWiZTLTdDoDUwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIxMTEyMzEyMzcwMFoXDTM2MTExOTEyMzcwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAE4ErISW/k5iZv0n7n1qpbOZcRMNmn8VqAOX4UIELm\nQ51neULt9T3pxdGEsq7B5O1ncB/RdZwf+3dihBHjngXerKNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFP2/1CHK9OdPjs/9\np1mh3t+pyujsMAoGCCqGSM49BAMCA0gAMEUCIQDETOC8hB9EaEvdc2sdEtcNeyXu\nYryyf6I5tJC13E2hOQIgef+ymHy6eXf0jNkY6DXz041THa/67dSrXaZGgaTh4LI=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICCjCCAbGgAwIBAgIURV0KgZTOagIAIU7wRcSg/mKl5RUwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIyMDcwNTA5NDQwMFoXDTM3MDcwMTA5NDQwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAEWrOugtJgVLAKZRw9jaC15RUbVuTm0ZmsqNyiQrKQ\nYawLE6fs+QIU7WQ25fxlYtmGB2S8nofGCDuwaoTevW0GoaNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFLKBzGXaQg2Irr57\npjoFYZ9F1NoNMAoGCCqGSM49BAMCA0cAMEQCIB1YdgOEsATw2GeaFmq6nqWg0JDT\np456JB/reFmnPWdJAiBPo5H9sMh+MpP4R5ue7nuwYK7SEJ1DOJqWMlPuNhVgtA==\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "orderer0.example.com", diff --git a/src/dlt/gradle.properties b/src/dlt/gateway/gradle.properties similarity index 100% rename from src/dlt/gradle.properties rename to src/dlt/gateway/gradle.properties diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.jar b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.jar rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.properties b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.properties rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties diff --git a/src/dlt/gradlew b/src/dlt/gateway/gradlew similarity index 100% rename from src/dlt/gradlew rename to src/dlt/gateway/gradlew diff --git a/src/dlt/gradlew.bat b/src/dlt/gateway/gradlew.bat similarity index 100% rename from src/dlt/gradlew.bat rename to src/dlt/gateway/gradlew.bat diff --git a/src/dlt/settings.gradle.kts b/src/dlt/gateway/settings.gradle.kts similarity index 100% rename from src/dlt/settings.gradle.kts rename to src/dlt/gateway/settings.gradle.kts diff --git a/src/dlt/src/main/kotlin/Main.kt b/src/dlt/gateway/src/main/kotlin/Main.kt similarity index 97% rename from src/dlt/src/main/kotlin/Main.kt rename to src/dlt/gateway/src/main/kotlin/Main.kt index d6298cc2890a8cec8ea9af4a05bbabb5ab8f3b4d..68a820ee9feb622a5f3d8429dd56b905b0e1a1b4 100644 --- a/src/dlt/src/main/kotlin/Main.kt +++ b/src/dlt/gateway/src/main/kotlin/Main.kt @@ -125,8 +125,7 @@ suspend fun main(args: Array) { } try { - val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.DISABLE) - .setType(Config.DltRecordType.SLICE).setJson("{}").build() + val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.DISABLE).build() val result = client.post("http://localhost:8080/dlt/record") { body = newRecord.toByteArray() } diff --git a/src/dlt/src/main/kotlin/fabric/ConnectGateway.kt b/src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/ConnectGateway.kt rename to src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt diff --git a/src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt b/src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt rename to src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt diff --git a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt similarity index 90% rename from src/dlt/src/main/kotlin/fabric/FabricConnector.kt rename to src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt index 0918f59e1f616af4deae3835cc2f48ae6c932902..d7c163954ec4f1b63b5e646e714d493050e114c0 100644 --- a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt +++ b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt @@ -38,6 +38,7 @@ package fabric import org.hyperledger.fabric.gateway.Contract +import org.hyperledger.fabric.gateway.ContractEvent import org.hyperledger.fabric.gateway.Wallet import org.hyperledger.fabric.gateway.Wallets import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory @@ -45,6 +46,7 @@ import org.hyperledger.fabric_ca.sdk.HFCAClient import proto.Config import java.nio.file.Paths import java.util.* +import java.util.function.Consumer class FabricConnector(val config: Config.DltConfig) { private val caClient: HFCAClient @@ -63,6 +65,7 @@ class FabricConnector(val config: Config.DltConfig) { // Create a wallet for managing identities wallet = Wallets.newFileSystemWallet(Paths.get(config.wallet)) contract = connect() + subscribeForEvents() } fun connect(): Contract { @@ -102,4 +105,13 @@ class FabricConnector(val config: Config.DltConfig) { fun deleteData(uuid: String): String { return String(contract.submitTransaction("DeactivateRecord", uuid)) } + + private fun subscribeForEvents() { + val consumer = Consumer { + event: ContractEvent? -> run { + println(event?.payload?.get()?.let { String(it) }) + } + } + contract.addContractListener(consumer) + } } \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/fabric/RegisterUser.kt b/src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/RegisterUser.kt rename to src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt diff --git a/src/dlt/src/main/kotlin/http/Server.kt b/src/dlt/gateway/src/main/kotlin/http/Server.kt similarity index 100% rename from src/dlt/src/main/kotlin/http/Server.kt rename to src/dlt/gateway/src/main/kotlin/http/Server.kt diff --git a/src/dlt/src/main/kotlin/proto/Config.proto b/src/dlt/gateway/src/main/kotlin/proto/Config.proto similarity index 100% rename from src/dlt/src/main/kotlin/proto/Config.proto rename to src/dlt/gateway/src/main/kotlin/proto/Config.proto diff --git a/src/gitlab-ci.yml_generator.py b/src/gitlab-ci.yml_generator.py index 00739e305159ef7b6b0733203434d190d61ad840..8e367eb02b85b74a38932a2bb57004712d7fb883 100755 --- a/src/gitlab-ci.yml_generator.py +++ b/src/gitlab-ci.yml_generator.py @@ -1,4 +1,18 @@ #!/usr/bin/python +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import argparse import os.path diff --git a/src/interdomain/.gitlab-ci.yml b/src/interdomain/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..23bad6cf3b604b6134325b72316d036a9e53b6fc --- /dev/null +++ b/src/interdomain/.gitlab-ci.yml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build interdomain + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 3030:3030 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test interdomain + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/interdomain/Config.py b/src/interdomain/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/src/interdomain/Config.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/interdomain/Dockerfile b/src/interdomain/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..388fcb76d08b49fdbc20baa3fb0d1ae957fdd46f --- /dev/null +++ b/src/interdomain/Dockerfile @@ -0,0 +1,73 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/interdomain +WORKDIR /var/teraflow/interdomain +COPY src/interdomain/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/interdomain/. interdomain/ +COPY src/monitoring/. monitoring/ +COPY src/service/. service/ +COPY src/slice/. slice/ + +# Start the service +ENTRYPOINT ["python", "-m", "interdomain.service"] diff --git a/src/interdomain/__init__.py b/src/interdomain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/interdomain/client/InterdomainClient.py b/src/interdomain/client/InterdomainClient.py new file mode 100644 index 0000000000000000000000000000000000000000..1f1ca924a972b85d9d1c848e1897b520d63adf93 --- /dev/null +++ b/src/interdomain/client/InterdomainClient.py @@ -0,0 +1,81 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController +from common.proto.interdomain_pb2_grpc import InterdomainServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class InterdomainClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.INTERDOMAIN) + if not port: port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = InterdomainServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def RequestSlice(self, request : Slice) -> SliceId: + LOGGER.debug('RequestSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RequestSlice(request) + LOGGER.debug('RequestSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def Authenticate(self, request : TeraFlowController) -> AuthenticationResult: + LOGGER.debug('Authenticate request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Authenticate(request) + LOGGER.debug('Authenticate result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def LookUpSlice(self, request : Slice) -> SliceId: + LOGGER.debug('LookUpSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.LookUpSlice(request) + LOGGER.debug('LookUpSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def OrderSliceFromCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('OrderSliceFromCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.OrderSliceFromCatalog(request) + LOGGER.debug('OrderSliceFromCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def CreateSliceAndAddToCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('CreateSliceAndAddToCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSliceAndAddToCatalog(request) + LOGGER.debug('CreateSliceAndAddToCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/interdomain/client/__init__.py b/src/interdomain/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/centralizedattackdetector/service/__init__.py b/src/interdomain/requirements.in similarity index 100% rename from src/centralizedattackdetector/service/__init__.py rename to src/interdomain/requirements.in diff --git a/src/interdomain/service/InterdomainService.py b/src/interdomain/service/InterdomainService.py new file mode 100644 index 0000000000000000000000000000000000000000..28b57d64baefb601d2990f73e8da41e7cd9db724 --- /dev/null +++ b/src/interdomain/service/InterdomainService.py @@ -0,0 +1,29 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.interdomain_pb2_grpc import add_InterdomainServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .InterdomainServiceServicerImpl import InterdomainServiceServicerImpl +from .RemoteDomainClients import RemoteDomainClients + +class InterdomainService(GenericGrpcService): + def __init__(self, remote_domain_clients : RemoteDomainClients, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + super().__init__(port, cls_name=cls_name) + self.interdomain_servicer = InterdomainServiceServicerImpl(remote_domain_clients) + + def install_servicers(self): + add_InterdomainServiceServicer_to_server(self.interdomain_servicer, self.server) diff --git a/src/interdomain/service/InterdomainServiceServicerImpl.py b/src/interdomain/service/InterdomainServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..01ba90ef5a6cb098e6d419fa0d6abb450893f8c6 --- /dev/null +++ b/src/interdomain/service/InterdomainServiceServicerImpl.py @@ -0,0 +1,153 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from common.proto.context_pb2 import ( + AuthenticationResult, Slice, SliceId, SliceStatus, SliceStatusEnum, TeraFlowController) +from common.proto.interdomain_pb2_grpc import InterdomainServiceServicer +#from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from interdomain.service.RemoteDomainClients import RemoteDomainClients +from slice.client.SliceClient import SliceClient + +LOGGER = logging.getLogger(__name__) + +SERVICE_NAME = 'Interdomain' +METHOD_NAMES = ['RequestSlice', 'Authenticate', 'LookUpSlice', 'OrderSliceFromCatalog', 'CreateSliceAndAddToCatalog'] +METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) + +class InterdomainServiceServicerImpl(InterdomainServiceServicer): + def __init__(self, remote_domain_clients : RemoteDomainClients): + LOGGER.debug('Creating Servicer...') + self.remote_domain_clients = remote_domain_clients + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def RequestSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + context_client = ContextClient() + slice_client = SliceClient() + + domains_to_endpoints = {} + local_domain_uuid = None + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + domain_uuid = device_uuid.split('@')[1] + endpoints = domains_to_endpoints.setdefault(domain_uuid, []) + endpoints.append(slice_endpoint_id) + if local_domain_uuid is None: local_domain_uuid = domain_uuid + + reply = Slice() + reply.CopyFrom(request) + + # decompose remote slices + for domain_uuid, slice_endpoint_ids in domains_to_endpoints.items(): + if domain_uuid == local_domain_uuid: continue + + remote_slice_request = Slice() + remote_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + remote_slice_request.slice_id.slice_uuid.uuid = \ + request.slice_id.slice_uuid.uuid + ':subslice@' + local_domain_uuid + remote_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in slice_endpoint_ids: + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = endpoint_id.device_id.device_uuid.uuid + slice_endpoint_id.endpoint_uuid.uuid = endpoint_id.endpoint_uuid.uuid + + # add endpoint connecting to remote domain + if domain_uuid == 'D1': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif domain_uuid == 'D2': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + interdomain_client = self.remote_domain_clients.get_peer('remote-teraflow') + remote_slice_reply = interdomain_client.LookUpSlice(remote_slice_request) + if remote_slice_reply == remote_slice_request.slice_id: # pylint: disable=no-member + # successful case + remote_slice = interdomain_client.OrderSliceFromCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + else: + # not in catalog + remote_slice = interdomain_client.CreateSliceAndAddToCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + + #context_client.SetSlice(remote_slice) + #subslice_id = reply.slice_subslice_ids.add() + #subslice_id.CopyFrom(remote_slice.slice_id) + + local_slice_request = Slice() + local_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + local_slice_request.slice_id.slice_uuid.uuid = request.slice_id.slice_uuid.uuid + ':subslice' + local_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in domains_to_endpoints[local_domain_uuid]: + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.CopyFrom(endpoint_id) + + # add endpoint connecting to remote domain + if local_domain_uuid == 'D1': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif local_domain_uuid == 'D2': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + local_slice_reply = slice_client.CreateSlice(local_slice_request) + if local_slice_reply != local_slice_request.slice_id: # pylint: disable=no-member + raise Exception('Local Slice creation failed. Wrong Slice Id was returned') + + subslice_id = reply.slice_subslice_ids.add() + subslice_id.context_id.context_uuid.uuid = local_slice_request.slice_id.context_id.context_uuid.uuid + subslice_id.slice_uuid.uuid = local_slice_request.slice_id.slice_uuid.uuid + + context_client.SetSlice(reply) + return reply.slice_id + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def Authenticate(self, request : TeraFlowController, context : grpc.ServicerContext) -> AuthenticationResult: + auth_result = AuthenticationResult() + auth_result.context_id.CopyFrom(request.context_id) # pylint: disable=no-member + auth_result.authenticated = True + return auth_result + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def LookUpSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + try: + context_client = ContextClient() + slice_ = context_client.GetSlice(request.slice_id) + return slice_.slice_id + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s})'.format(grpc_message_to_json_string(request.slice_id))) + return SliceId() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def OrderSliceFromCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + raise NotImplementedError('OrderSliceFromCatalog') + #return Slice() + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def CreateSliceAndAddToCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + context_client = ContextClient() + slice_client = SliceClient() + reply = slice_client.CreateSlice(request) + if reply != request.slice_id: # pylint: disable=no-member + raise Exception('Slice creation failed. Wrong Slice Id was returned') + return context_client.GetSlice(request.slice_id) diff --git a/src/interdomain/service/RemoteDomainClients.py b/src/interdomain/service/RemoteDomainClients.py new file mode 100644 index 0000000000000000000000000000000000000000..0aaadfeff0aa05ab0d356b00069a6ec86e89926d --- /dev/null +++ b/src/interdomain/service/RemoteDomainClients.py @@ -0,0 +1,55 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, socket +from common.Constants import DEFAULT_CONTEXT_UUID, ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import TeraFlowController +from interdomain.client.InterdomainClient import InterdomainClient + +LOGGER = logging.getLogger(__name__) + +class RemoteDomainClients: + def __init__(self) -> None: + self.peer_domain = {} + + def add_peer( + self, domain_name : str, host : str, port : int, context_uuid : str = DEFAULT_CONTEXT_UUID + ) -> None: + while True: + try: + remote_teraflow_ip = socket.gethostbyname(host) + if len(remote_teraflow_ip) > 0: break + except socket.gaierror as e: + if str(e) == '[Errno -2] Name or service not known': continue + + interdomain_client = InterdomainClient(host=host, port=port) + request = TeraFlowController() + request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_UUID # pylint: disable=no-member + request.ip_address = get_service_host(ServiceNameEnum.INTERDOMAIN) + request.port = int(get_service_port_grpc(ServiceNameEnum.INTERDOMAIN)) + + reply = interdomain_client.Authenticate(request) + if not reply.authenticated: + msg = 'Authentication against {:s}:{:d} rejected' + raise Exception(msg.format(str(remote_teraflow_ip), port)) + + self.peer_domain[domain_name] = interdomain_client + + def get_peer(self, domain_name : str) -> InterdomainClient: + LOGGER.warning('peers: {:s}'.format(str(self.peer_domain))) + return self.peer_domain.get(domain_name) + + def remove_peer(self, domain_name : str) -> None: + return self.peer_domain.pop(domain_name, None) diff --git a/src/interdomain/service/__init__.py b/src/interdomain/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/interdomain/service/__main__.py b/src/interdomain/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..c0a078f4ded85ab957011d21d56c97c8d303dc2a --- /dev/null +++ b/src/interdomain/service/__main__.py @@ -0,0 +1,75 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + get_service_port_grpc, wait_for_environment_variables) +from .InterdomainService import InterdomainService +from .RemoteDomainClients import RemoteDomainClients + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Define remote domain clients + remote_domain_clients = RemoteDomainClients() + + # Starting Interdomain service + grpc_service = InterdomainService(remote_domain_clients) + grpc_service.start() + + # TODO: improve with configuration the definition of the remote peers + interdomain_service_port_grpc = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + remote_domain_clients.add_peer('remote-teraflow', 'remote-teraflow', interdomain_service_port_grpc) + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/interdomain/tests/__init__.py b/src/interdomain/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/interdomain/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/interdomain/tests/test_unitary.py b/src/interdomain/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..7fe1acc7cec5cbf3663dc7db68c45a22b56d3a6d --- /dev/null +++ b/src/interdomain/tests/test_unitary.py @@ -0,0 +1,143 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +#import logging, grpc +#import os +#import sqlite3 +# +#import pytest +#from typing import Tuple +# +#from interdomain.proto import context_pb2, kpi_sample_types_pb2, monitoring_pb2 +#from interdomain.client.interdomain_client import InterdomainClient +#from interdomain.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +#from interdomain.service.InterdomainService import InterdomainService +# +#from common.orm.Database import Database +#from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum +#from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum +#from common.message_broker.MessageBroker import MessageBroker +# +#LOGGER = logging.getLogger(__name__) +#LOGGER.setLevel(logging.DEBUG) +# +############################ +## Tests Setup +############################ +# +#SERVER_ADDRESS = '127.0.0.1' +#LISTEN_ADDRESS = '[::]' +#GRPC_PORT_MONITORING = 9090 +# +#GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports +# +#SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit +# ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), +#] +# +# +## This fixture will be requested by test cases and last during testing session +#@pytest.fixture(scope='session') +#def interdomain_service(): +# LOGGER.warning('interdomain_service begin') +# +# interdomain_port = GRPC_INTERDOMAIN_PORT +# max_workers = GRPC_MAX_WORKERS +# grace_period = GRPC_GRACE_PERIOD +# +# LOGGER.info('Initializing InterdomainService...') +# grpc_service = InterdomainService(port=interdomain_port, max_workers=max_workers, grace_period=grace_period) +# server = grpc_service.start() +# +# # yield the server, when test finishes, execution will resume to stop it +# LOGGER.warning('interdomain_service yielding') +# yield server +# +# LOGGER.info('Terminating InterdomainService...') +# grpc_service.stop() +# +## This fixture will be requested by test cases and last during testing session. +## The client requires the server, so client fixture has the server as dependency. +#@pytest.fixture(scope='session') +#def interdomain_client(interdomain_service): +# LOGGER.warning('interdomain_client begin') +# client = InterdomainClient(server=SERVER_ADDRESS, port=GRPC_PORT_INTERDOMAIN) # instantiate the client +# LOGGER.warning('interdomain_client returning') +# return client +# +## This fixture will be requested by test cases and last during testing session. +#@pytest.fixture(scope='session') +#def create_TeraFlowController(): +# LOGGER.warning('create_TeraFlowController begin') +# # form request +# tf_ctl = context_pb2.TeraFlowController() +# tf_ctl.context_id = context_pb2.ContextId() +# tf_ctl.context_id.context_uuid = context_pb2.Uuid() +# tf_ctl.context_id.context_uuid.uuid = str(1) +# tf_ctl.ip_address = "127.0.0.1" +# tf_ctl.port = 9090 +# return tf_ctl +# +#@pytest.fixture(scope='session') +#def create_TransportSlice(): +# LOGGER.warning('create_TransportSlice begin') +# +# # form request +# slice_req = slice_pb2.TransportSlice() +# slice_req.contextId = context_pb2.ContextId() +# slice_req.contextId.context_uuid = context_pb2.Uuid() +# slice_req.contextId.context_uuid.uuid = str(1) +# slice_req.slice_id = context_pb2.Uuid() +# slice_req.slice_id.context_uuid.uuid = str(1) +# +# return slice_req +# +# +############################ +## Tests Implementation +############################ +# +# +## Test case that makes use of client fixture to test server's CreateKpi method +#def test_Authenticate(interdomain_client,create_TeraFlowController): +# # make call to server +# LOGGER.warning('test_Authenticate requesting') +# response = interdomain_client.Authenticate(create_TeraFlowController) +# LOGGER.debug(str(response)) +# assert isinstance(response, context.AuthenticationResult) +# +## Test case that makes use of client fixture to test server's MonitorKpi method +#def test_LookUpSlice(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_LookUpSlice begin') +# +# response = interdomain_client.LookUpSlice(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's GetStreamKpi method +#def test_CreateSliceAndAddToCatalog(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_CreateSliceAndAddToCatalog begin') +# response = interdomain_client.CreateSliceAndAddToCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's IncludeKpi method +#def test_OrderSliceFromCatalog(interdomain_client,create_TransportSlice): +# # make call to server +# LOGGER.warning('test_OrderSliceFromCatalog requesting') +# response = interdomain_client.OrderSliceFromCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# diff --git a/src/l3_attackmitigator/.gitlab-ci.yml b/src/l3_attackmitigator/.gitlab-ci.yml index e20771744b43a9209c8b9a193a1fb126008bb006..bcad35c74b3ca2f427b54831f313db855657c821 100644 --- a/src/l3_attackmitigator/.gitlab-ci.yml +++ b/src/l3_attackmitigator/.gitlab-ci.yml @@ -1,61 +1,106 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice - IMAGE_NAME_TEST: 'l3_attackmitigator-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_attackmitigator: +# Apply unit test to the component +unit test l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice - IMAGE_NAME_TEST: 'l3_attackmitigator-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build l3_attackmitigator before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run -d -p 10002:10002 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10002:10002 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker port $IMAGE_NAME - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - - docker stop $IMAGE_NAME - - docker rm $IMAGE_NAME + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy l3_attackmitigator: + variables: + IMAGE_NAME: 'l3_attackmitigator' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_attackmitigator - - unit_test l3_attackmitigator - - dependencies all - - integ_test execute + - unit test l3_attackmitigator + # - integ_test execute script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/l3_attackmitigatorservice.yaml" - - kubectl delete pods --selector app=l3_attackmitigatorservice + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/l3_attackmitigator/Config.py b/src/l3_attackmitigator/Config.py index 1c2d658637fa3285d736a41328dfb64fefab6a80..429977bc585a01fb288aab121cdb3cedb8fa9ac0 100644 --- a/src/l3_attackmitigator/Config.py +++ b/src/l3_attackmitigator/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings diff --git a/src/l3_attackmitigator/Dockerfile b/src/l3_attackmitigator/Dockerfile index 0065f273c6831a314c5a5f88802ec40a00c416d1..2b814f0eed8fbfba96a759212ae5ff0e2172c14f 100644 --- a/src/l3_attackmitigator/Dockerfile +++ b/src/l3_attackmitigator/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,22 +28,41 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_attackmitigator +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY l3_attackmitigator/requirements.in l3_attackmitigator/requirements.in -RUN pip-compile --output-file=l3_attackmitigator/requirements.txt l3_attackmitigator/requirements.in -RUN python3 -m pip install -r l3_attackmitigator/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY l3_attackmitigator/. l3_attackmitigator +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_attackmitigator +WORKDIR /var/teraflow/l3_attackmitigator +COPY src/l3_attackmitigator/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_attackmitigator/. l3_attackmitigator -# Start service service +# Start the service ENTRYPOINT ["python", "-m", "l3_attackmitigator.service"] diff --git a/src/l3_attackmitigator/__init__.py b/src/l3_attackmitigator/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_attackmitigator/__init__.py +++ b/src/l3_attackmitigator/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_attackmitigator/client/__init__.py b/src/l3_attackmitigator/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_attackmitigator/client/__init__.py +++ b/src/l3_attackmitigator/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_attackmitigator/client/l3_attackmitigatorClient.py b/src/l3_attackmitigator/client/l3_attackmitigatorClient.py index 190d6388459151e42fdebd0642fb9ccde3621ce0..77e09a2f718fb7d0748666842117f60652bebdea 100644 --- a/src/l3_attackmitigator/client/l3_attackmitigatorClient.py +++ b/src/l3_attackmitigator/client/l3_attackmitigatorClient.py @@ -1,9 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorStub, ) -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( Output, EmptyMitigator ) @@ -11,7 +25,7 @@ from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) - +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class l3_attackmitigatorClient: def __init__(self, address, port): @@ -32,14 +46,14 @@ class l3_attackmitigatorClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SendOutput(self, request: Output) -> EmptyMitigator: LOGGER.debug('SendOutput request: {}'.format(request)) response = self.stub.SendOutput(request) LOGGER.debug('SendOutput result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetMitigation(self, request: EmptyMitigator) -> EmptyMitigator: LOGGER.debug('GetMitigation request: {}'.format(request)) response = self.stub.GetMitigation(request) diff --git a/src/l3_attackmitigator/proto/__init__.py b/src/l3_attackmitigator/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py deleted file mode 100644 index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..0000000000000000000000000000000000000000 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py +++ /dev/null @@ -1,248 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_attackmitigator.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_attackmitigator.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) - - - - -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=81, - serialized_end=330, -) - -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) - }) -_sym_db.RegisterMessage(Output) - - - -_L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( - name='L3Attackmitigator', - full_name='L3Attackmitigator', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, - methods=[ - _descriptor.MethodDescriptor( - name='SendOutput', - full_name='L3Attackmitigator.SendOutput', - index=0, - containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetMitigation', - full_name='L3Attackmitigator.GetMitigation', - index=1, - containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3ATTACKMITIGATOR) - -DESCRIPTOR.services_by_name['L3Attackmitigator'] = _L3ATTACKMITIGATOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py deleted file mode 100644 index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..0000000000000000000000000000000000000000 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - - -from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 - - -class L3AttackmitigatorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendOutput = channel.unary_unary( - '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - self.GetMitigation = channel.unary_unary( - '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - - -class L3AttackmitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendOutput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMitigation(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3AttackmitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendOutput': grpc.unary_unary_rpc_method_handler( - servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - 'GetMitigation': grpc.unary_unary_rpc_method_handler( - servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Attackmitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Attackmitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMitigation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_attackmitigator/requirements.in b/src/l3_attackmitigator/requirements.in index e11480b450adad83b398c2a6a21cf8fe1a7b186d..772ae923931c8b09917e75a600ce2b5a0d2d4ecf 100644 --- a/src/l3_attackmitigator/requirements.in +++ b/src/l3_attackmitigator/requirements.in @@ -1,8 +1 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn +# no extra dependency diff --git a/src/l3_attackmitigator/service/__init__.py b/src/l3_attackmitigator/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_attackmitigator/service/__init__.py +++ b/src/l3_attackmitigator/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_attackmitigator/service/__main__.py b/src/l3_attackmitigator/service/__main__.py index baa85988bd169e9ce54afcb97689d3f1c9ac4b3a..ac2ff528ae2df5d0604978534a256e111080d181 100644 --- a/src/l3_attackmitigator/service/__main__.py +++ b/src/l3_attackmitigator/service/__main__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading, os from prometheus_client import start_http_server from common.Settings import get_setting diff --git a/src/l3_attackmitigator/service/l3_attackmitigatorService.py b/src/l3_attackmitigator/service/l3_attackmitigatorService.py index 9bfd2e06c774ee19f989004015e6ffbf3e035b87..2ce7f93169430d586ba33a03f03918966c8dcc7b 100644 --- a/src/l3_attackmitigator/service/l3_attackmitigatorService.py +++ b/src/l3_attackmitigator/service/l3_attackmitigatorService.py @@ -1,10 +1,24 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc import logging from concurrent import futures from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH from grpc_health.v1.health_pb2 import HealthCheckResponse from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( add_L3AttackmitigatorServicer_to_server, ) from l3_attackmitigator.service.l3_attackmitigatorServiceServicerImpl import ( diff --git a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py index 725dc36b4907579c494845a3e8e594acca31059e..8664704524ecef779235af3ca3dc765af7af4898 100644 --- a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py +++ b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py @@ -1,9 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import print_function import logging -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( EmptyMitigator ) -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorServicer, ) diff --git a/src/l3_attackmitigator/tests/__init__.py b/src/l3_attackmitigator/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_attackmitigator/tests/__init__.py +++ b/src/l3_attackmitigator/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_attackmitigator/tests/test_unitary.py b/src/l3_attackmitigator/tests/test_unitary.py index 1aa6fc4a843ae04e4d520507c789c669eefcd31a..14d43edaff85da0e2597c55557dde74dbaae32aa 100644 --- a/src/l3_attackmitigator/tests/test_unitary.py +++ b/src/l3_attackmitigator/tests/test_unitary.py @@ -1,9 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging import pytest from l3_attackmitigator.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from l3_attackmitigator.client.l3_attackmitigatorClient import l3_attackmitigatorClient from l3_attackmitigator.service.l3_attackmitigatorService import l3_attackmitigatorService -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( Output, ) diff --git a/src/l3_centralizedattackdetector/.gitlab-ci.yml b/src/l3_centralizedattackdetector/.gitlab-ci.yml index aaebe01e4dce047b8c84a515283231d06cd26dab..073b7925c7f7c39e1a44766fc21167236875877d 100644 --- a/src/l3_centralizedattackdetector/.gitlab-ci.yml +++ b/src/l3_centralizedattackdetector/.gitlab-ci.yml @@ -1,61 +1,106 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_centralizedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_centralizedattackdetector: +# Apply unit test to the component +unit test l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_centralizedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build l3_centralizedattackdetector before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run -d -p 10001:10001 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10001:10001 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker port $IMAGE_NAME - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - - docker stop $IMAGE_NAME - - docker rm $IMAGE_NAME + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy l3_centralizedattackdetector: + variables: + IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_centralizedattackdetector - - unit_test l3_centralizedattackdetector - - dependencies all - - integ_test execute + - unit test l3_centralizedattackdetector + # - integ_test execute script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/l3_centralizedattackdetectorservice.yaml" - - kubectl delete pods --selector app=l3_centralizedattackdetectorservice + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/l3_centralizedattackdetector/Config.py b/src/l3_centralizedattackdetector/Config.py index 9c8a5cef5598e811ebf391718ce6e3afd79bd9f3..2b7ec70f13e273c5913607f8b9cd4b6cb59555f7 100644 --- a/src/l3_centralizedattackdetector/Config.py +++ b/src/l3_centralizedattackdetector/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings diff --git a/src/l3_centralizedattackdetector/Dockerfile b/src/l3_centralizedattackdetector/Dockerfile index cb29b6987ed1882380782c9c60e327b3bf64fc6f..3db5c2b4d7e4020b727d0d3f9b106f9c4af2e6b6 100644 --- a/src/l3_centralizedattackdetector/Dockerfile +++ b/src/l3_centralizedattackdetector/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,22 +28,41 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_centralizedattackdetector +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY l3_centralizedattackdetector/requirements.in l3_centralizedattackdetector/requirements.in -RUN pip-compile --output-file=l3_centralizedattackdetector/requirements.txt l3_centralizedattackdetector/requirements.in -RUN python3 -m pip install -r l3_centralizedattackdetector/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY l3_centralizedattackdetector/. l3_centralizedattackdetector +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_centralizedattackdetector +WORKDIR /var/teraflow/l3_centralizedattackdetector +COPY src/l3_centralizedattackdetector/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_centralizedattackdetector/. l3_centralizedattackdetector -# Start service service +# Start the service ENTRYPOINT ["python", "-m", "l3_centralizedattackdetector.service"] diff --git a/src/l3_centralizedattackdetector/__init__.py b/src/l3_centralizedattackdetector/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_centralizedattackdetector/__init__.py +++ b/src/l3_centralizedattackdetector/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_centralizedattackdetector/client/__init__.py b/src/l3_centralizedattackdetector/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_centralizedattackdetector/client/__init__.py +++ b/src/l3_centralizedattackdetector/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py b/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py index 64b66f3cede33e4511f8eb00a94239d680e55f78..3a159503c1c2d6b7387122430f1d36b77cd3ff78 100644 --- a/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py +++ b/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py @@ -1,9 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorStub, ) -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( Empty, ModelInput, ModelOutput @@ -12,6 +26,7 @@ from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class l3_centralizedattackdetectorClient: def __init__(self, address, port): @@ -32,14 +47,14 @@ class l3_centralizedattackdetectorClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def SendInput(self, request: ModelInput) -> Empty: LOGGER.debug('SendInput request: {}'.format(request)) response = self.stub.SendInput(request) LOGGER.debug('SendInput result: {}'.format(response)) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def GetOutput(self, request: Empty) -> ModelOutput: LOGGER.debug('GetOutput request: {}'.format(request)) response = self.stub.GetOutput(request) diff --git a/src/l3_centralizedattackdetector/genproto.sh b/src/l3_centralizedattackdetector/genproto.sh deleted file mode 100644 index a68c8638db15b776a7d1f70484daf2651c72253a..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/genproto.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_attackmitigator.proto - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2_grpc.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2_grpc.py diff --git a/src/l3_centralizedattackdetector/proto/__init__.py b/src/l3_centralizedattackdetector/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py deleted file mode 100644 index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py +++ /dev/null @@ -1,248 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_attackmitigator.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_attackmitigator.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) - - - - -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=81, - serialized_end=330, -) - -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) - }) -_sym_db.RegisterMessage(Output) - - - -_L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( - name='L3Attackmitigator', - full_name='L3Attackmitigator', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, - methods=[ - _descriptor.MethodDescriptor( - name='SendOutput', - full_name='L3Attackmitigator.SendOutput', - index=0, - containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetMitigation', - full_name='L3Attackmitigator.GetMitigation', - index=1, - containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3ATTACKMITIGATOR) - -DESCRIPTOR.services_by_name['L3Attackmitigator'] = _L3ATTACKMITIGATOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py deleted file mode 100644 index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - - -from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 - - -class L3AttackmitigatorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendOutput = channel.unary_unary( - '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - self.GetMitigation = channel.unary_unary( - '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - - -class L3AttackmitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendOutput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMitigation(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3AttackmitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendOutput': grpc.unary_unary_rpc_method_handler( - servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - 'GetMitigation': grpc.unary_unary_rpc_method_handler( - servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Attackmitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Attackmitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMitigation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py deleted file mode 100644 index cafbc6bf86a42e438dfccb1636f49b066be1530a..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ /dev/null @@ -1,409 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_centralizedattackdetector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_centralizedattackdetector.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' -) - - - - -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, - number=5, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, - number=6, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, - number=7, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, - number=8, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, - number=14, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, - number=15, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, - number=16, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=39, - serialized_end=512, -) - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='Empty.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=514, - serialized_end=555, -) - - -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=558, - serialized_end=812, -) - -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) - }) -_sym_db.RegisterMessage(ModelInput) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:Empty) - }) -_sym_db.RegisterMessage(Empty) - -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) - }) -_sym_db.RegisterMessage(ModelOutput) - - - -_L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( - name='L3Centralizedattackdetector', - full_name='L3Centralizedattackdetector', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, - methods=[ - _descriptor.MethodDescriptor( - name='SendInput', - full_name='L3Centralizedattackdetector.SendInput', - index=0, - containing_service=None, - input_type=_MODELINPUT, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetOutput', - full_name='L3Centralizedattackdetector.GetOutput', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_MODELOUTPUT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3CENTRALIZEDATTACKDETECTOR) - -DESCRIPTOR.services_by_name['L3Centralizedattackdetector'] = _L3CENTRALIZEDATTACKDETECTOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py deleted file mode 100644 index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ /dev/null @@ -1,101 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import l3_centralizedattackdetector_pb2 as l3__centralizedattackdetector__pb2 - - -class L3CentralizedattackdetectorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendInput = channel.unary_unary( - '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - ) - self.GetOutput = channel.unary_unary( - '/L3Centralizedattackdetector/GetOutput', - request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, - ) - - -class L3CentralizedattackdetectorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendInput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetOutput(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendInput': grpc.unary_unary_rpc_method_handler( - servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, - response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - ), - 'GetOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetOutput, - request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Centralizedattackdetector', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Centralizedattackdetector(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendInput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - l3__centralizedattackdetector__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', - l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/requirements.in b/src/l3_centralizedattackdetector/requirements.in index 31aba06dccdcd151699628fc5162e733a9c768b3..9e25a1c28fb6c472e92bbb175eaa1c030fffe760 100644 --- a/src/l3_centralizedattackdetector/requirements.in +++ b/src/l3_centralizedattackdetector/requirements.in @@ -1,9 +1,3 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn -onnxruntime +numpy==1.23.* +onnxruntime==1.12.* +scikit-learn==1.1.* diff --git a/src/l3_centralizedattackdetector/service/__init__.py b/src/l3_centralizedattackdetector/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_centralizedattackdetector/service/__init__.py +++ b/src/l3_centralizedattackdetector/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_centralizedattackdetector/service/__main__.py b/src/l3_centralizedattackdetector/service/__main__.py index b05d5b14782a7dae8b34a49e03c0d00e1b39d3ca..42c7412cb85a7c168d09347eda32d73ea61dbf0e 100644 --- a/src/l3_centralizedattackdetector/service/__main__.py +++ b/src/l3_centralizedattackdetector/service/__main__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading, os from prometheus_client import start_http_server from common.Settings import get_setting diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py index dd4a2fce9d078645c08a26090f209cc2425698e2..bad8cee7eadc26ceaf4dddd8a8452b3b8636e1d9 100644 --- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py +++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py @@ -1,10 +1,24 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc import logging from concurrent import futures from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH from grpc_health.v1.health_pb2 import HealthCheckResponse from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( add_L3CentralizedattackdetectorServicer_to_server, ) from l3_centralizedattackdetector.service.l3_centralizedattackdetectorServiceServicerImpl import ( diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py index 2f11e1cfb5d57a50703cb3d44e2b05a7fb1a1b4f..ad05b0ee62e87ce9028dc043b693c1b4cae008b3 100644 --- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py +++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from __future__ import print_function from datetime import datetime import os @@ -5,17 +19,17 @@ import grpc import numpy as np import onnxruntime as rt import logging -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( Empty, ) -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorServicer, ) -from l3_centralizedattackdetector.proto.l3_attackmitigator_pb2 import ( - Output, +from common.proto.l3_attackmitigator_pb2 import ( + L3AttackmitigatorOutput, ) -from l3_centralizedattackdetector.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorStub, ) @@ -74,7 +88,7 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto output_message["tag_name"] = "Normal" output_message["tag"] = 0 - return Output(**output_message) + return L3AttackmitigatorOutput(**output_message) def SendInput(self, request, context): # PERFORM INFERENCE WITH SENT INPUTS diff --git a/src/l3_centralizedattackdetector/tests/__init__.py b/src/l3_centralizedattackdetector/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_centralizedattackdetector/tests/__init__.py +++ b/src/l3_centralizedattackdetector/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_centralizedattackdetector/tests/test_unitary.py b/src/l3_centralizedattackdetector/tests/test_unitary.py index 2f991feda3c9b421b5cffc591fa404f38e038e35..a939b9efa11c9ceeb96ccb6d04c9ec929ab55cda 100644 --- a/src/l3_centralizedattackdetector/tests/test_unitary.py +++ b/src/l3_centralizedattackdetector/tests/test_unitary.py @@ -1,9 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging import pytest from l3_centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from l3_centralizedattackdetector.client.l3_centralizedattackdetectorClient import l3_centralizedattackdetectorClient from l3_centralizedattackdetector.service.l3_centralizedattackdetectorService import l3_centralizedattackdetectorService -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( ModelInput, ) diff --git a/src/l3_distributedattackdetector/.gitlab-ci.yml b/src/l3_distributedattackdetector/.gitlab-ci.yml index c2579c70ac78c7ec8ca21fc48110b4656b644f08..c373d223715f77a833fdb3ea1c090e61f2e2c303 100644 --- a/src/l3_distributedattackdetector/.gitlab-ci.yml +++ b/src/l3_distributedattackdetector/.gitlab-ci.yml @@ -1,60 +1,106 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_distributedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: build before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test l3_distributedattackdetector: +# Apply unit test to the component +unit test l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice - IMAGE_NAME_TEST: 'l3_distributedattackdetector-test' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: unit_test needs: - build l3_distributedattackdetector before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run -d -p 10000:10000 --name $IMAGE_NAME --network=teraflowbridge "$IMAGE_NAME:$IMAGE_TAG" - - docker ps -a + - docker run --name $IMAGE_NAME -d -p 10000:10000 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose -o log_cli=true $IMAGE_NAME/tests/test_unitary.py" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - - docker stop $IMAGE_NAME - - docker rm $IMAGE_NAME + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy l3_distributedattackdetector: + variables: + IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) stage: deploy needs: - - build l3_distributedattackdetector - - unit_test l3_distributedattackdetector - - dependencies all - - integ_test execute + - unit test l3_distributedattackdetector + # - integ_test execute script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/l3_distributedattackdetectorservice.yaml" - - kubectl delete pods --selector app=l3_distributedattackdetectorservice + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/l3_distributedattackdetector/Config.py b/src/l3_distributedattackdetector/Config.py index 8cb99bb0d21b238037ace527e581232b7394f4e8..73d3e471a2fc1b4ccc2a053064abd70e0b145a0f 100644 --- a/src/l3_distributedattackdetector/Config.py +++ b/src/l3_distributedattackdetector/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings diff --git a/src/l3_distributedattackdetector/Dockerfile b/src/l3_distributedattackdetector/Dockerfile index 3b50a89735e1d96bc334fb1d78663fcd37cfb1ed..4bdbcf03cebc6f89603cde6d8ea41e28d6bd157c 100644 --- a/src/l3_distributedattackdetector/Dockerfile +++ b/src/l3_distributedattackdetector/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,23 +28,42 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_distributedattackdetector +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY l3_distributedattackdetector/requirements.in l3_distributedattackdetector/requirements.in -RUN pip-compile --output-file=l3_distributedattackdetector/requirements.txt l3_distributedattackdetector/requirements.in -RUN python3 -m pip install -r l3_distributedattackdetector/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY l3_distributedattackdetector/. l3_distributedattackdetector +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_distributedattackdetector +WORKDIR /var/teraflow/l3_distributedattackdetector +COPY src/l3_distributedattackdetector/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_distributedattackdetector/. l3_distributedattackdetector -# Start service service +# Start the service RUN nohup bash -c "service/tstat -l -i lo -s service/piped &" && sleep 5 ENTRYPOINT ["python", "-m", "l3_distributedattackdetector.service"] diff --git a/src/l3_distributedattackdetector/__init__.py b/src/l3_distributedattackdetector/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_distributedattackdetector/__init__.py +++ b/src/l3_distributedattackdetector/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_distributedattackdetector/proto/__init__.py b/src/l3_distributedattackdetector/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py deleted file mode 100644 index cafbc6bf86a42e438dfccb1636f49b066be1530a..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ /dev/null @@ -1,409 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_centralizedattackdetector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_centralizedattackdetector.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' -) - - - - -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, - number=5, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, - number=6, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, - number=7, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, - number=8, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, - number=14, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, - number=15, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, - number=16, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=39, - serialized_end=512, -) - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='Empty.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=514, - serialized_end=555, -) - - -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=558, - serialized_end=812, -) - -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) - }) -_sym_db.RegisterMessage(ModelInput) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:Empty) - }) -_sym_db.RegisterMessage(Empty) - -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) - }) -_sym_db.RegisterMessage(ModelOutput) - - - -_L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( - name='L3Centralizedattackdetector', - full_name='L3Centralizedattackdetector', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, - methods=[ - _descriptor.MethodDescriptor( - name='SendInput', - full_name='L3Centralizedattackdetector.SendInput', - index=0, - containing_service=None, - input_type=_MODELINPUT, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetOutput', - full_name='L3Centralizedattackdetector.GetOutput', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_MODELOUTPUT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3CENTRALIZEDATTACKDETECTOR) - -DESCRIPTOR.services_by_name['L3Centralizedattackdetector'] = _L3CENTRALIZEDATTACKDETECTOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py deleted file mode 100644 index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ /dev/null @@ -1,101 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import l3_centralizedattackdetector_pb2 as l3__centralizedattackdetector__pb2 - - -class L3CentralizedattackdetectorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendInput = channel.unary_unary( - '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - ) - self.GetOutput = channel.unary_unary( - '/L3Centralizedattackdetector/GetOutput', - request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, - ) - - -class L3CentralizedattackdetectorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendInput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetOutput(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendInput': grpc.unary_unary_rpc_method_handler( - servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, - response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - ), - 'GetOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetOutput, - request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Centralizedattackdetector', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Centralizedattackdetector(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendInput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - l3__centralizedattackdetector__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', - l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_distributedattackdetector/requirements.in b/src/l3_distributedattackdetector/requirements.in index e11480b450adad83b398c2a6a21cf8fe1a7b186d..772ae923931c8b09917e75a600ce2b5a0d2d4ecf 100644 --- a/src/l3_distributedattackdetector/requirements.in +++ b/src/l3_distributedattackdetector/requirements.in @@ -1,8 +1 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn +# no extra dependency diff --git a/src/l3_distributedattackdetector/service/__init__.py b/src/l3_distributedattackdetector/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_distributedattackdetector/service/__init__.py +++ b/src/l3_distributedattackdetector/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_distributedattackdetector/service/__main__.py b/src/l3_distributedattackdetector/service/__main__.py index 1194e2634a337e06e4698cced41ce5fcf9846895..1ce6831f22e63b482031f919f040ad1182c4e2d4 100644 --- a/src/l3_distributedattackdetector/service/__main__.py +++ b/src/l3_distributedattackdetector/service/__main__.py @@ -1,12 +1,26 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging import sys import os import time import grpc -from l3_distributedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorStub, ) -from l3_distributedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( ModelInput, ) diff --git a/src/l3_distributedattackdetector/service/piped/0demo/log_tcp_temp_complete b/src/l3_distributedattackdetector/service/piped/0demo/log_tcp_temp_complete index 52bac35ef3f46d8162ba5d21b5c63fa74cb7f6e6..97d1e3d33602eea453b0dc423ba98f8fe651d91b 100644 --- a/src/l3_distributedattackdetector/service/piped/0demo/log_tcp_temp_complete +++ b/src/l3_distributedattackdetector/service/piped/0demo/log_tcp_temp_complete @@ -350,3 +350,31 @@ 221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - 221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - 221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - +221.181.185.159 26406 11 0 10 4 1111 6 1111 0 0 0 1 0 10.25.0.6 22 10 0 10 5 1497 4 1497 0 0 0 1 0 1631699183883.141113 1631699185936.677002 2053.536000 327.059000 334.471000 2053.536000 1726.893000 326.976000 327.081000 1 1 0 0 0 0 0 13.977100 0.022000 42.534000 21.563233 6 40 40 334.779504 326.582000 367.107000 18.068151 5 64 64 0 0 0 0 0 0 1 1 7 1 0 1460 856 15 33536 29200 0 856 15 15 0 0 0 0 0 0 0 0 0 1 1 7 1 0 1410 1080 41 64384 64128 0 1080 41 41 0 0 0 0 0 0 0 0 0 0 0 --- 6 4 - - 0 0 0 0.000000 0.000000 0.000000 0.000000 0 0 - - 0.0 0.0 - diff --git a/src/l3_distributedattackdetector/tests/__init__.py b/src/l3_distributedattackdetector/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/l3_distributedattackdetector/tests/__init__.py +++ b/src/l3_distributedattackdetector/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/l3_distributedattackdetector/tests/data_generator.py b/src/l3_distributedattackdetector/tests/data_generator.py index 18b861ebbbf2547829dc3b11b12965acf4eef20a..43c3d707c8ccd52ccc63afdc7278bf67ec3f628a 100644 --- a/src/l3_distributedattackdetector/tests/data_generator.py +++ b/src/l3_distributedattackdetector/tests/data_generator.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os from time import sleep diff --git a/src/l3_distributedattackdetector/tests/test_unitary.py b/src/l3_distributedattackdetector/tests/test_unitary.py index 96eae5f67adf70fe523f0e1e2e5167d84294c6b9..0e868d7815ec0c3837bb2e9a1e439b98f3674f39 100644 --- a/src/l3_distributedattackdetector/tests/test_unitary.py +++ b/src/l3_distributedattackdetector/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging import os from subprocess import Popen, DEVNULL diff --git a/src/monitoring/.gitignore b/src/monitoring/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ac497892a71b6dda0ef118a1d174a5409849a201 --- /dev/null +++ b/src/monitoring/.gitignore @@ -0,0 +1,3 @@ +# Ignoring specific folders/files used internally while coding Monitoring component +proto/ +genproto_win.sh diff --git a/src/monitoring/.gitlab-ci.yml b/src/monitoring/.gitlab-ci.yml index 4b475bb26f7fa462743f7586060487174f02c2da..246b29bd42a889b0662a8ab0cb8b198e8f4b92ab 100644 --- a/src/monitoring/.gitlab-ci.yml +++ b/src/monitoring/.gitlab-ci.yml @@ -1,4 +1,18 @@ -# Build, tag and push the Docker image to the GitLab registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build monitoring: variables: IMAGE_NAME: 'monitoring' # name of the microservice @@ -7,19 +21,21 @@ build monitoring: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -# after_script: -# - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -33,34 +49,40 @@ unit test monitoring: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - - if docker container ls | grep influxdb; then docker rm -f influxdb; else echo "influxdb image is not in the system"; fi + - if docker container ls | grep questdb; then docker rm -f questdb; else echo "questdb image is not in the system"; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name influxdb -d -p 8086:8086 -e INFLUXDB_DB=$INFLUXDB_DATABASE -e INFLUXDB_ADMIN_USER=$INFLUXDB_USER -e INFLUXDB_ADMIN_PASSWORD=$INFLUXDB_PASSWORD -e INFLUXDB_HTTP_AUTH_ENABLED=True --network=teraflowbridge --rm influxdb:1.8 + - docker pull questdb/questdb + - docker run --name questdb -d -p 9000:9000 -p 9009:9009 -p 8812:8812 -p 9003:9003 -e QDB_CAIRO_COMMIT_LAG=1000 -e QDB_CAIRO_MAX_UNCOMMITTED_ROWS=100000 --network=teraflowbridge --rm questdb/questdb - sleep 10 - - docker run --name $IMAGE_NAME -d -p 7070:7070 --env INFLUXDB_USER=$INFLUXDB_USER --env INFLUXDB_PASSWORD=$INFLUXDB_PASSWORD --env INFLUXDB_DATABASE=$INFLUXDB_DATABASE --env INFLUXDB_HOSTNAME=influxdb -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 7070:7070 --env METRICSDB_HOSTNAME=localhost --env METRICSDB_ILP_PORT=9009 --env METRICSDB_REST_PORT=9000 --env METRICSDB_TABLE=monitoring -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 30 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --junitxml=/opt/results/report.xml" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - - docker rm -f influxdb + - docker rm -f questdb - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml artifacts: when: always reports: - junit: src/$IMAGE_NAME/tests/report.xml + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy monitoring: @@ -72,10 +94,10 @@ deploy monitoring: - unit test monitoring # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/monitoring/Config.py b/src/monitoring/Config.py deleted file mode 100644 index 11036b0d17dc640418fd4d0be1c7e81acb56c559..0000000000000000000000000000000000000000 --- a/src/monitoring/Config.py +++ /dev/null @@ -1,12 +0,0 @@ -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 7070 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 diff --git a/src/monitoring/Dockerfile b/src/monitoring/Dockerfile index af2fd608521c297f7aa97b45f0e3fc5d88e5615c..f26741df048572339ee757c7dce8b89604558caf 100644 --- a/src/monitoring/Dockerfile +++ b/src/monitoring/Dockerfile @@ -1,51 +1,70 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install wget g++ && \ rm -rf /var/lib/apt/lists/* -# show python logs as they occur +# Set Python to show logs as they occur ENV PYTHONUNBUFFERED=0 -# download the grpc health probe +# Download the gRPC health probe RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Create module sub-folders +# Create component sub-folders, get specific Python packages RUN mkdir -p /var/teraflow/monitoring -RUN mkdir -p /var/teraflow/common -RUN mkdir -p /var/teraflow/common/tools -RUN mkdir -p /var/teraflow/common/rpc_method_wrapper -RUN mkdir -p /var/teraflow/device -RUN mkdir -p /var/teraflow/device/proto -RUN mkdir -p /var/teraflow/device/client -RUN mkdir -p /var/teraflow/context - - -# Get Python packages per module -COPY monitoring/requirements.in requirements.in -RUN pip-compile --output-file=requirements.txt requirements.in +WORKDIR /var/teraflow/monitoring +COPY src/monitoring/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in RUN python3 -m pip install -r requirements.txt -# add files into working directory -COPY monitoring/. monitoring -COPY device/proto/. device/proto -COPY device/client/. device/client -COPY device/Config.py device -COPY common/. common -COPY context/. context - -RUN rm -r common/message_broker/tests -RUN rm -r common/orm/tests -RUN rm -r common/rpc_method_wrapper/tests -RUN rm -r context/tests/test_unitary.py +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/monitoring/. monitoring/ +# Start the service ENTRYPOINT ["python", "-m", "monitoring.service"] diff --git a/src/monitoring/__init__.py b/src/monitoring/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/monitoring/__init__.py +++ b/src/monitoring/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/monitoring/client/MonitoringClient.py b/src/monitoring/client/MonitoringClient.py new file mode 100644 index 0000000000000000000000000000000000000000..f65072f19013b820312aa56b7f0062f9c95f712c --- /dev/null +++ b/src/monitoring/client/MonitoringClient.py @@ -0,0 +1,183 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from typing import Iterator +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc + +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.proto.context_pb2 import Empty +from common.proto.monitoring_pb2 import Kpi, KpiDescriptor, KpiId, MonitorKpiRequest, \ + KpiDescriptorList, KpiQuery, KpiList, SubsDescriptor, SubscriptionID, SubsIDList, \ + AlarmDescriptor, AlarmID, AlarmIDList, AlarmResponse, AlarmSubscription +from common.proto.monitoring_pb2_grpc import MonitoringServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class MonitoringClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.MONITORING) + if not port: port = get_service_port_grpc(ServiceNameEnum.MONITORING) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = MonitoringServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def SetKpi(self, request : KpiDescriptor) -> KpiId: + LOGGER.debug('SetKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetKpi(request) + LOGGER.debug('SetKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteKpi(self,request : KpiId) -> Empty: + LOGGER.debug('DeleteKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteKpi(request) + LOGGER.info('DeleteKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetKpiDescriptor(self, request : KpiId) -> KpiDescriptor: + LOGGER.debug('GetKpiDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetKpiDescriptor(request) + LOGGER.debug('GetKpiDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetKpiDescriptorList(self, request : Empty) -> KpiDescriptorList: + LOGGER.debug('GetKpiDescriptorList: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetKpiDescriptorList(request) + LOGGER.debug('GetKpiDescriptorList result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def IncludeKpi(self, request : Kpi) -> Empty: + LOGGER.debug('IncludeKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.IncludeKpi(request) + LOGGER.debug('IncludeKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def MonitorKpi(self, request : MonitorKpiRequest) -> Empty: + LOGGER.debug('MonitorKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.MonitorKpi(request) + LOGGER.debug('MonitorKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def QueryKpiData(self, request : KpiQuery) -> KpiList: + LOGGER.debug('QueryKpiData: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.QueryKpiData(request) + LOGGER.debug('QueryKpiData result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SubscribeKpi(self, request : SubsDescriptor) -> Iterator[KpiList]: + LOGGER.debug('SubscribeKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SubscribeKpi(request) + LOGGER.debug('SubscribeKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSubsDescriptor(self, request : SubscriptionID) -> SubsDescriptor: + LOGGER.debug('GetSubsDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSubsDescriptor(request) + LOGGER.debug('GetSubsDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSubscriptions(self, request : Empty) -> SubsIDList: + LOGGER.debug('GetSubscriptions: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSubscriptions(request) + LOGGER.debug('GetSubscriptions result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteSubscription(self, request : SubscriptionID) -> Empty: + LOGGER.debug('DeleteSubscription: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteSubscription(request) + LOGGER.debug('DeleteSubscription result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetKpiAlarm(self, request : AlarmDescriptor) -> AlarmID: + LOGGER.debug('SetKpiAlarm: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetKpiAlarm(request) + LOGGER.debug('SetKpiAlarm result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetAlarms(self, request : Empty) -> AlarmIDList: + LOGGER.debug('GetAlarms: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarms(request) + LOGGER.debug('GetAlarms result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def GetAlarmDescriptor(self, request : AlarmID) -> AlarmDescriptor: + LOGGER.debug('GetAlarmDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarmDescriptor(request) + LOGGER.debug('GetAlarmDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def GetAlarmResponseStream(self, request : AlarmSubscription) -> AlarmResponse: + LOGGER.debug('GetAlarmResponseStream: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarmResponseStream(request) + LOGGER.debug('GetAlarmResponseStream result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def DeleteAlarm(self, request : AlarmID) -> Empty: + LOGGER.debug('DeleteAlarm: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteAlarm(request) + LOGGER.debug('DeleteAlarm result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetStreamKpi(self, request : KpiId) -> Iterator[Kpi]: + LOGGER.debug('GetStreamKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetStreamKpi(request) + LOGGER.debug('GetStreamKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetInstantKpi(self, request : KpiId) -> Kpi: + LOGGER.debug('GetInstantKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetInstantKpi(request) + LOGGER.debug('GetInstantKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + +if __name__ == '__main__': + import sys + # get port + _port = sys.argv[1] if len(sys.argv) > 1 else '7070' + + # make call to server + client = MonitoringClient(port=_port) diff --git a/src/monitoring/client/__init__.py b/src/monitoring/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/monitoring/client/__init__.py +++ b/src/monitoring/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/monitoring/client/monitoring_client.py b/src/monitoring/client/monitoring_client.py deleted file mode 100644 index c3ab508c947ae07835801ad724f4589af92379c8..0000000000000000000000000000000000000000 --- a/src/monitoring/client/monitoring_client.py +++ /dev/null @@ -1,61 +0,0 @@ -import sys -import grpc - -from monitoring.proto import monitoring_pb2 -from monitoring.proto import monitoring_pb2_grpc -from monitoring.proto import context_pb2 - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoring-client') -LOGGER.setLevel('DEBUG') - -class MonitoringClient: - - def __init__(self, server='monitoring', port='7070'): - endpoint = '{}:{}'.format(server, port) - LOGGER.info('init monitoringClient {}'.format(endpoint)) - self.channel = grpc.insecure_channel(endpoint) - self.server = monitoring_pb2_grpc.MonitoringServiceStub(self.channel) - - def CreateKpi(self, request): - LOGGER.info('CreateKpi: {}'.format(request)) - response = self.server.CreateKpi(request) - LOGGER.info('CreateKpi result: {}'.format(response)) - return response - - def MonitorKpi(self, request): - LOGGER.info('MonitorKpi: {}'.format(request)) - response = self.server.MonitorKpi(request) - LOGGER.info('MonitorKpi result: {}'.format(response)) - return response - - def IncludeKpi(self, request): - LOGGER.info('IncludeKpi: {}'.format(request)) - response = self.server.IncludeKpi(request) - LOGGER.info('IncludeKpi result: {}'.format(response)) - return response - - def GetStreamKpi(self, request): - LOGGER.info('GetStreamKpi: {}'.format(request)) - response = self.server.GetStreamKpi(request) - LOGGER.info('GetStreamKpi result: {}'.format(response)) - yield monitoring_pb2.Kpi() - - def GetInstantKpi(self, request): - LOGGER.info('GetInstantKpi: {}'.format(request)) - response = self.server.GetInstantKpi(request) - LOGGER.info('GetInstantKpi result: {}'.format(response)) - return monitoring_pb2.Kpi() - - def GetKpiDescriptor(self, request): - LOGGER.info('GetKpiDescriptor: {}'.format(request)) - response = self.server.GetKpiDescriptor(request) - LOGGER.info('GetKpiDescriptor result: {}'.format(response)) - return response - -if __name__ == '__main__': - # get port - port = sys.argv[1] if len(sys.argv) > 1 else '7070' - - # make call to server - client = MonitoringClient(port=port) diff --git a/src/monitoring/genproto.sh b/src/monitoring/genproto.sh deleted file mode 100755 index b37b49ba2078301d837610d10c10b9a095bec783..0000000000000000000000000000000000000000 --- a/src/monitoring/genproto.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -rm proto/context_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2_grpc.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py diff --git a/src/monitoring/proto/__init__.py b/src/monitoring/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/monitoring/proto/context_pb2.py b/src/monitoring/proto/context_pb2.py deleted file mode 100644 index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/context_pb2.py +++ /dev/null @@ -1,2545 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3552, - serialized_end=3658, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3661, - serialized_end=3858, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3861, - serialized_end=4004, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4007, - serialized_end=4136, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4139, - serialized_end=4275, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4277, - serialized_end=4370, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2605, - serialized_end=2735, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2738, - serialized_end=2872, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2874, - serialized_end=2975, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2977, - serialized_end=3040, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3042, - serialized_end=3096, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3099, - serialized_end=3240, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3242, - serialized_end=3307, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3309, - serialized_end=3367, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3369, - serialized_end=3463, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3550, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/kpi_sample_types_pb2.py b/src/monitoring/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/monitoring_pb2.py b/src/monitoring/proto/monitoring_pb2.py deleted file mode 100644 index b313ebb68f0da37a540898e8c362fd204a799076..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/monitoring_pb2.py +++ /dev/null @@ -1,452 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\x1a\x16kpi_sample_types.proto\"\xda\x01\n\rKpiDescriptor\x12\x17\n\x0fkpi_description\x18\x01 \x01(\t\x12\x38\n\x0fkpi_sample_type\x18\x02 \x01(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\x12$\n\tdevice_id\x18\x03 \x01(\x0b\x32\x11.context.DeviceId\x12(\n\x0b\x65ndpoint_id\x18\x04 \x01(\x0b\x32\x13.context.EndPointId\x12&\n\nservice_id\x18\x05 \x01(\x0b\x32\x12.context.ServiceId\"p\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x1b\n\x13sampling_duration_s\x18\x02 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x03 \x01(\x02\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"d\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"a\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x12\n\x08\x66loatVal\x18\x02 \x01(\x02H\x00\x12\x13\n\tstringVal\x18\x03 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x04 \x01(\x08H\x00\x42\x07\n\x05value\",\n\x07KpiList\x12!\n\x08kpi_list\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi2\xf3\x02\n\x11MonitoringService\x12;\n\tCreateKpi\x12\x19.monitoring.KpiDescriptor\x1a\x11.monitoring.KpiId\"\x00\x12\x42\n\x10GetKpiDescriptor\x12\x11.monitoring.KpiId\x1a\x19.monitoring.KpiDescriptor\"\x00\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,kpi__sample__types__pb2.DESCRIPTOR,]) - - - - -_KPIDESCRIPTOR = _descriptor.Descriptor( - name='KpiDescriptor', - full_name='monitoring.KpiDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_description', full_name='monitoring.KpiDescriptor.kpi_description', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.KpiDescriptor.kpi_sample_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.KpiDescriptor.device_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='monitoring.KpiDescriptor.endpoint_id', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='monitoring.KpiDescriptor.service_id', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=72, - serialized_end=290, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='monitoring.MonitorKpiRequest.sampling_duration_s', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='monitoring.MonitorKpiRequest.sampling_interval_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=292, - serialized_end=404, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=406, - serialized_end=444, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=546, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='floatVal', full_name='monitoring.KpiValue.floatVal', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='boolVal', full_name='monitoring.KpiValue.boolVal', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=548, - serialized_end=645, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_list', full_name='monitoring.KpiList.kpi_list', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=647, - serialized_end=691, -) - -_KPIDESCRIPTOR.fields_by_name['kpi_sample_type'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_KPIDESCRIPTOR.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIDESCRIPTOR.fields_by_name['endpoint_id'].message_type = context__pb2._ENDPOINTID -_KPIDESCRIPTOR.fields_by_name['service_id'].message_type = context__pb2._SERVICEID -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['floatVal']) -_KPIVALUE.fields_by_name['floatVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPILIST.fields_by_name['kpi_list'].message_type = _KPI -DESCRIPTOR.message_types_by_name['KpiDescriptor'] = _KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -KpiDescriptor = _reflection.GeneratedProtocolMessageType('KpiDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _KPIDESCRIPTOR, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) - }) -_sym_db.RegisterMessage(KpiDescriptor) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=694, - serialized_end=1065, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_KPIDESCRIPTOR, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetKpiDescriptor', - full_name='monitoring.MonitoringService.GetKpiDescriptor', - index=1, - containing_service=None, - input_type=_KPIID, - output_type=_KPIDESCRIPTOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=2, - containing_service=None, - input_type=_KPI, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=3, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/monitoring_pb2_grpc.py b/src/monitoring/proto/monitoring_pb2_grpc.py deleted file mode 100644 index 36c6835938af46b34b37f673bb6d4a1374a57cf0..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/monitoring_pb2_grpc.py +++ /dev/null @@ -1,232 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -class MonitoringServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateKpi = channel.unary_unary( - '/monitoring.MonitoringService/CreateKpi', - request_serializer=monitoring__pb2.KpiDescriptor.SerializeToString, - response_deserializer=monitoring__pb2.KpiId.FromString, - ) - self.GetKpiDescriptor = channel.unary_unary( - '/monitoring.MonitoringService/GetKpiDescriptor', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.KpiDescriptor.FromString, - ) - self.IncludeKpi = channel.unary_unary( - '/monitoring.MonitoringService/IncludeKpi', - request_serializer=monitoring__pb2.Kpi.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.MonitorKpi = channel.unary_unary( - '/monitoring.MonitoringService/MonitorKpi', - request_serializer=monitoring__pb2.MonitorKpiRequest.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetStreamKpi = channel.unary_stream( - '/monitoring.MonitoringService/GetStreamKpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) - self.GetInstantKpi = channel.unary_unary( - '/monitoring.MonitoringService/GetInstantKpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) - - -class MonitoringServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def CreateKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetKpiDescriptor(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def IncludeKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def MonitorKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetStreamKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetInstantKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_MonitoringServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateKpi': grpc.unary_unary_rpc_method_handler( - servicer.CreateKpi, - request_deserializer=monitoring__pb2.KpiDescriptor.FromString, - response_serializer=monitoring__pb2.KpiId.SerializeToString, - ), - 'GetKpiDescriptor': grpc.unary_unary_rpc_method_handler( - servicer.GetKpiDescriptor, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.KpiDescriptor.SerializeToString, - ), - 'IncludeKpi': grpc.unary_unary_rpc_method_handler( - servicer.IncludeKpi, - request_deserializer=monitoring__pb2.Kpi.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'MonitorKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorKpi, - request_deserializer=monitoring__pb2.MonitorKpiRequest.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetStreamKpi': grpc.unary_stream_rpc_method_handler( - servicer.GetStreamKpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - 'GetInstantKpi': grpc.unary_unary_rpc_method_handler( - servicer.GetInstantKpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'monitoring.MonitoringService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class MonitoringService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CreateKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/CreateKpi', - monitoring__pb2.KpiDescriptor.SerializeToString, - monitoring__pb2.KpiId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetKpiDescriptor(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetKpiDescriptor', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.KpiDescriptor.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def IncludeKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/IncludeKpi', - monitoring__pb2.Kpi.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def MonitorKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/MonitorKpi', - monitoring__pb2.MonitorKpiRequest.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetStreamKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/monitoring.MonitoringService/GetStreamKpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetInstantKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetInstantKpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/monitoring/requirements.in b/src/monitoring/requirements.in index 23bff0cd4065e31579d87a7b6355949dc6023769..c77d9683a2372435779db520f9f4c537d5e012b0 100644 --- a/src/monitoring/requirements.in +++ b/src/monitoring/requirements.in @@ -1,12 +1,24 @@ -google-api-core -grpcio-health-checking -grpcio -opencensus[stackdriver] -python-json-logger -google-cloud-profiler -numpy -prometheus-client -pytest -pytest-benchmark -influxdb -redis \ No newline at end of file +anytree==2.8.0 +APScheduler==3.8.1 +fastcache==1.1.0 +#google-api-core +#opencensus[stackdriver] +#google-cloud-profiler +#numpy +Jinja2==3.0.3 +ncclient==0.6.13 +p4runtime==1.3.0 +paramiko==2.9.2 +influx-line-protocol==0.1.4 +python-dateutil==2.8.2 +python-json-logger==2.0.2 +pytz==2021.3 +redis==4.1.2 +requests==2.27.1 +xmltodict==0.12.0 + +# pip's dependency resolver does not take into account installed packages. +# p4runtime does not specify the version of grpcio/protobuf it needs, so it tries to install latest one +# adding here again grpcio==1.47.* and protobuf==3.20.* with explicit versions to prevent collisions +grpcio==1.47.* +protobuf==3.20.* diff --git a/src/monitoring/service/EventTools.py b/src/monitoring/service/EventTools.py index a28ff36a3f469bc0967be71e7b0005c316e9282a..cbcf920f1c5dc98a18b0e48a123bc6490f55737c 100644 --- a/src/monitoring/service/EventTools.py +++ b/src/monitoring/service/EventTools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import threading from queue import Queue @@ -5,27 +19,36 @@ import grpc from common.rpc_method_wrapper.ServiceExceptions import ServiceException from context.client.ContextClient import ContextClient -from context.proto import kpi_sample_types_pb2 -from context.proto.context_pb2 import Empty, EventTypeEnum +#from common.proto import kpi_sample_types_pb2 +from common.proto.context_pb2 import Empty, EventTypeEnum from common.logger import getJSONLogger -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto import monitoring_pb2 +from monitoring.client.MonitoringClient import MonitoringClient +from common.proto import monitoring_pb2 LOGGER = getJSONLogger('monitoringservice-server') LOGGER.setLevel('DEBUG') class EventsDeviceCollector: - def __init__(self, context_client_grpc : ContextClient, monitoring_client_grpc : MonitoringClient) -> None: # pylint: disable=redefined-outer-name + def __init__(self) -> None: # pylint: disable=redefined-outer-name self._events_queue = Queue() - self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) - self._context_client = context_client_grpc - self._monitoring_client = monitoring_client_grpc + self._context_client_grpc = ContextClient() + self._device_stream = self._context_client_grpc.GetDeviceEvents(Empty()) + self._context_client = self._context_client_grpc + self._channel = self._context_client_grpc.channel + self._monitoring_client = MonitoringClient(host='127.0.0.1') + + self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream,), daemon=False) - self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) + def grpc_server_on(self): + try: + grpc.channel_ready_future(self._channel).result(timeout=15) + return True + except grpc.FutureTimeoutError: + return False - def _collect(self, events_stream) -> None: + def _collect(self, events_stream): try: for event in events_stream: self._events_queue.put_nowait(event) @@ -34,47 +57,45 @@ class EventsDeviceCollector: raise # pragma: no cover def start(self): - self._device_thread.start() + try: + self._device_thread.start() + except RuntimeError as e: + LOGGER.exception('Start EventTools exception') def get_event(self, block : bool = True, timeout : float = 0.1): return self._events_queue.get(block=block, timeout=timeout) def stop(self): - self._device_stream.cancel() - self._device_thread.join() def listen_events(self): - LOGGER.info('getting Kpi by KpiID') - qsize = self._events_queue.qsize() try: kpi_id_list = [] - if qsize > 0: - for i in range(qsize): - print("Queue size: "+str(qsize)) - event = self.get_event(block=True) - if event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE: - device = self._context_client.GetDevice(event.device_id) - print("Endpoints value: " + str(len(device.device_endpoints))) - for j,end_point in enumerate(device.device_endpoints): - - # for k,rule in enumerate(device.device_config.config_rules): + + while not self._events_queue.empty(): + LOGGER.info('getting Kpi by KpiID') + event = self.get_event(block=True) + if event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE: + device = self._context_client.GetDevice(event.device_id) + for j,end_point in enumerate(device.device_endpoints): + #for i, value in enumerate(kpi_sample_types_pb2.KpiSampleType.values()): + for i, value in enumerate(end_point.kpi_sample_types): + #if value == kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_UNKNOWN: continue + kpi_descriptor = monitoring_pb2.KpiDescriptor() kpi_descriptor.kpi_description = device.device_type - kpi_descriptor.kpi_sample_type = kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED + kpi_descriptor.kpi_sample_type = value + #kpi_descriptor.service_id.service_uuid.uuid = "" kpi_descriptor.device_id.CopyFrom(device.device_id) kpi_descriptor.endpoint_id.CopyFrom(end_point.endpoint_id) - kpi_descriptor.service_id.service_uuid.uuid = "SERV"+str(i+1) - kpi_id = self._monitoring_client.CreateKpi(kpi_descriptor) + kpi_id = self._monitoring_client.SetKpi(kpi_descriptor) kpi_id_list.append(kpi_id) - return kpi_id_list - except ServiceException as e: LOGGER.exception('ListenEvents exception') - except Exception as e: # pragma: no cover LOGGER.exception('ListenEvents exception') + diff --git a/src/monitoring/service/InfluxTools.py b/src/monitoring/service/InfluxTools.py index df0cf01b2adddff4bcd0410d12505ed65c24e145..f19555437000acc3b44e2872f45d8a8e118a9b22 100644 --- a/src/monitoring/service/InfluxTools.py +++ b/src/monitoring/service/InfluxTools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from influxdb import InfluxDBClient class Influx(): diff --git a/src/monitoring/service/MetricsDBTools.py b/src/monitoring/service/MetricsDBTools.py new file mode 100644 index 0000000000000000000000000000000000000000..ea6180aa072bd48a04f26d019ba1e4ab9e08af88 --- /dev/null +++ b/src/monitoring/service/MetricsDBTools.py @@ -0,0 +1,52 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from influx_line_protocol import Metric +import socket +import requests +import json +import sys + +class MetricsDB(): + def __init__(self, host, ilp_port, rest_port, table): + self.socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.host=host + self.ilp_port=ilp_port + self.rest_port=rest_port + self.table=table + + def write_KPI(self,time,kpi_id,kpi_sample_type,device_id,endpoint_id,service_id,kpi_value): + self.socket.connect((self.host,self.ilp_port)) + metric = Metric(self.table) + metric.with_timestamp(time) + metric.add_tag('kpi_id', kpi_id) + metric.add_tag('kpi_sample_type', kpi_sample_type) + metric.add_tag('device_id', device_id) + metric.add_tag('endpoint_id', endpoint_id) + metric.add_tag('service_id', service_id) + metric.add_value('kpi_value', kpi_value) + str_metric = str(metric) + str_metric += "\n" + self.socket.sendall((str_metric).encode()) + self.socket.close() + + def run_query(self, sql_query): + query_params = {'query': sql_query, 'fmt' : 'json'} + url = f"http://{self.host}:{self.rest_port}/exec" + try: + response = requests.get(url, params=query_params) + json_response = json.loads(response.text) + print(json_response) + except requests.exceptions.RequestException as e: + print(f'Error: {e}', file=sys.stderr) diff --git a/src/monitoring/service/MonitoringService.py b/src/monitoring/service/MonitoringService.py index 665ce44f7e87ca73a92dfd6123ed3aa8935f0e92..1a79ef9c131f8c24e50e62423a06181b4164753b 100644 --- a/src/monitoring/service/MonitoringService.py +++ b/src/monitoring/service/MonitoringService.py @@ -1,59 +1,28 @@ -from concurrent import futures - -import grpc - -from monitoring.service.MonitoringServiceServicerImpl import MonitoringServiceServicerImpl -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server - -from grpc_health.v1 import health -from grpc_health.v1 import health_pb2 -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoringservice-server') -LOGGER.setLevel('DEBUG') - -BIND_ADDRESS = '0.0.0.0' - -class MonitoringService: - def __init__(self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - # create gRPC server - self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=self.max_workers)) # ,interceptors=(tracer_interceptor,)) - - # add monitoring servicer class to gRPC server +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .MonitoringServiceServicerImpl import MonitoringServiceServicerImpl + +class MonitoringService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.MONITORING) + super().__init__(port, cls_name=cls_name) self.monitoring_servicer = MonitoringServiceServicerImpl() - add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - # add gRPC health checker servicer class to gRPC server - self.health_servicer = health.HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - # start server - endpoint = '{}:{}'.format(self.address, self.port) - LOGGER.info('Listening on {}'.format(endpoint)) - self.server.add_insecure_port(endpoint) - self.server.start() - self.health_servicer.set('', health_pb2.HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {} seconds)...'.format(self.grace_period)) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') + def install_servicers(self): + add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) diff --git a/src/monitoring/service/MonitoringServiceServicerImpl.py b/src/monitoring/service/MonitoringServiceServicerImpl.py index fcadaa0c910cf912055ad30efc1ed389f256e3e4..d9f8b1e100bada795f8d6c91a796f458da8d212f 100644 --- a/src/monitoring/service/MonitoringServiceServicerImpl.py +++ b/src/monitoring/service/MonitoringServiceServicerImpl.py @@ -1,51 +1,74 @@ -import os,grpc - -from prometheus_client import Summary -from prometheus_client import Counter - -from monitoring.service import SqliteTools, InfluxTools -from monitoring.proto import monitoring_pb2 -from monitoring.proto import monitoring_pb2_grpc - +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os, grpc, logging + +from typing import Iterator + +from common.Constants import ServiceNameEnum +from common.Settings import get_setting, get_service_port_grpc, get_service_host +from common.proto.context_pb2 import Empty +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2_grpc import MonitoringServiceServicer +from common.proto.monitoring_pb2 import AlarmResponse, AlarmDescriptor, AlarmIDList, SubsIDList, KpiId, \ + KpiDescriptor, KpiList, KpiQuery, SubsDescriptor, SubscriptionID, AlarmID, KpiDescriptorList, \ + MonitorKpiRequest, Kpi, AlarmSubscription from common.rpc_method_wrapper.ServiceExceptions import ServiceException -from common.logger import getJSONLogger +from common.tools.timestamp.Converters import timestamp_float_to_string -from context.proto import context_pb2 - - -from device.Config import GRPC_SERVICE_PORT +from monitoring.service import SqliteTools, MetricsDBTools from device.client.DeviceClient import DeviceClient -from device.proto import device_pb2 -LOGGER = getJSONLogger('monitoringservice-server') -LOGGER.setLevel('DEBUG') +from prometheus_client import Counter, Summary + +LOGGER = logging.getLogger(__name__) -MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary('monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') +MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary( + 'monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') -INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") -INFLUXDB_USER = os.environ.get("INFLUXDB_USER") -INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") -INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") +METRICSDB_HOSTNAME = os.environ.get("METRICSDB_HOSTNAME") +METRICSDB_ILP_PORT = os.environ.get("METRICSDB_ILP_PORT") +METRICSDB_REST_PORT = os.environ.get("METRICSDB_REST_PORT") +METRICSDB_TABLE = os.environ.get("METRICSDB_TABLE") -class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceServicer): +DEVICESERVICE_SERVICE_HOST = get_setting('DEVICESERVICE_SERVICE_HOST', default=get_service_host(ServiceNameEnum.DEVICE) ) +DEVICESERVICE_SERVICE_PORT_GRPC = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=get_service_port_grpc(ServiceNameEnum.DEVICE)) + + +class MonitoringServiceServicerImpl(MonitoringServiceServicer): def __init__(self): LOGGER.info('Init monitoringService') # Init sqlite monitoring db self.sql_db = SqliteTools.SQLite('monitoring.db') + self.deviceClient = DeviceClient(host=DEVICESERVICE_SERVICE_HOST, port=DEVICESERVICE_SERVICE_PORT_GRPC) # instantiate the client - # Create influx_db client - self.influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME,"8086",INFLUXDB_USER,INFLUXDB_PASSWORD,INFLUXDB_DATABASE) + # Set metrics_db client + self.metrics_db = MetricsDBTools.MetricsDB(METRICSDB_HOSTNAME,METRICSDB_ILP_PORT,METRICSDB_REST_PORT,METRICSDB_TABLE) - # CreateKpi (CreateKpiRequest) returns (KpiId) {} - def CreateKpi(self, request : monitoring_pb2.KpiDescriptor, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiId : + # SetKpi (SetKpiRequest) returns (KpiId) {} + def SetKpi( + self, request : KpiDescriptor, grpc_context : grpc.ServicerContext + ) -> KpiId: # CREATEKPI_COUNTER_STARTED.inc() - LOGGER.info('CreateKpi') + LOGGER.info('SetKpi') try: # Here the code to create a sqlite query to crete a KPI and return a KpiID - kpi_id = monitoring_pb2.KpiId() + kpi_id = KpiId() kpi_description = request.kpi_description kpi_sample_type = request.kpi_sample_type @@ -53,98 +76,129 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService kpi_endpoint_id = request.endpoint_id.endpoint_uuid.uuid kpi_service_id = request.service_id.service_uuid.uuid - data = self.sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + data = self.sql_db.insert_KPI( + kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) kpi_id.kpi_id.uuid = str(data) # CREATEKPI_COUNTER_COMPLETED.inc() return kpi_id except ServiceException as e: - LOGGER.exception('CreateKpi exception') + LOGGER.exception('SetKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('CreateKpi exception') + LOGGER.exception('SetKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) + def DeleteKpi ( self, request : KpiId, grpc_context : grpc.ServicerContext) -> Empty: + + LOGGER.info('DeleteKpi') + try: + # TBC + return Empty() + except ServiceException as e: + LOGGER.exception('DeleteKpi exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteKpi exception') + + def GetKpiDescriptorList ( self, request : Empty, grpc_context : grpc.ServicerContext) -> KpiDescriptorList: + + LOGGER.info('GetKpiDescriptorList') + try: + # TBC + return KpiDescriptorList() + except ServiceException as e: + LOGGER.exception('GetKpiDescriptorList exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetKpiDescriptorList exception') + # rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} - def MonitorKpi ( self, request : monitoring_pb2.MonitorKpiRequest, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: + def MonitorKpi ( self, request : MonitorKpiRequest, grpc_context : grpc.ServicerContext) -> Empty: LOGGER.info('MonitorKpi') try: - # Creates the request to send to the device service - monitor_device_request = device_pb2.MonitoringSettings() + # Sets the request to send to the device service + monitor_device_request = MonitoringSettings() kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) monitor_device_request.kpi_descriptor.CopyFrom(kpiDescriptor) - monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid - monitor_device_request.sampling_duration_s = request.sampling_duration_s - monitor_device_request.sampling_interval_s = request.sampling_interval_s + monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid + monitor_device_request.sampling_duration_s = request.monitoring_window_s + monitor_device_request.sampling_interval_s = request.sampling_rate_s - deviceClient = DeviceClient(address="localhost", port=GRPC_SERVICE_PORT ) # instantiate the client - # deviceClient.MonitorDeviceKpi(monitor_device_request) + device_client = DeviceClient() + device_client.MonitorDeviceKpi(monitor_device_request) - return context_pb2.Empty() except ServiceException as e: LOGGER.exception('MonitorKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover LOGGER.exception('MonitorKpi exception') + grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) # CREATEKPI_COUNTER_FAILED.inc() + return Empty() # rpc IncludeKpi(IncludeKpiRequest) returns(context.Empty) {} - def IncludeKpi(self, request : monitoring_pb2.Kpi, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: + def IncludeKpi(self, request : Kpi, grpc_context : grpc.ServicerContext) -> Empty: LOGGER.info('IncludeKpi') try: kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) + if kpiDescriptor is None: + LOGGER.warning('Ignoring sample with KPIId({:s}): not found in database'.format(str(request.kpi_id))) + return Empty() - kpiSampleType = kpiDescriptor.kpi_sample_type + kpiSampleType = KpiSampleType.Name(kpiDescriptor.kpi_sample_type).upper().replace('KPISAMPLETYPE_', '') kpiId = request.kpi_id.kpi_id.uuid deviceId = kpiDescriptor.device_id.device_uuid.uuid endpointId = kpiDescriptor.endpoint_id.endpoint_uuid.uuid serviceId = kpiDescriptor.service_id.service_uuid.uuid - time_stamp = request.timestamp - kpi_value = request.kpi_value.intVal + time_stamp = timestamp_float_to_string(request.timestamp.timestamp) + kpi_value = getattr(request.kpi_value, request.kpi_value.WhichOneof('value')) - # Build the structure to be included as point in the influxDB - self.influx_db.write_KPI(time_stamp,kpiId,kpiSampleType,deviceId,endpointId,serviceId,kpi_value) + # Build the structure to be included as point in the MetricsDB + self.metrics_db.write_KPI(time_stamp,kpiId,kpiSampleType,deviceId,endpointId,serviceId,kpi_value) - self.influx_db.read_KPI_points() + #self.influx_db.read_KPI_points() - return context_pb2.Empty() except ServiceException as e: LOGGER.exception('IncludeKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover + except Exception: # pragma: no cover LOGGER.exception('IncludeKpi exception') # CREATEKPI_COUNTER_FAILED.inc() + return Empty() - def GetStreamKpi ( self, request, grpc_context : grpc.ServicerContext): - # receives monitoring.KpiId returns stream monitoring.Kpi - LOGGER.info('GetStreamKpi') - yield monitoring_pb2.Kpi() - - @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() - def GetInstantKpi ( self, request, grpc_context : grpc.ServicerContext): - # receives monitoring.KpiId returns monitoring.Kpi - LOGGER.info('GetInstantKpi') - return monitoring_pb2.Kpi() + # def GetStreamKpi ( self, request, grpc_context : grpc.ServicerContext): + # + # LOGGER.info('GetStreamKpi') + # yield monitoring_pb2.Kpi() + # + # @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() + # def GetInstantKpi ( self, request, grpc_context : grpc.ServicerContext): + # + # LOGGER.info('GetInstantKpi') + # return monitoring_pb2.Kpi() - def GetKpiDescriptor(self, request : monitoring_pb2.KpiId, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiDescriptor: + def GetKpiDescriptor(self, request : KpiId, grpc_context : grpc.ServicerContext) -> KpiDescriptor: LOGGER.info('getting Kpi by KpiID') try: kpi_db = self.sql_db.get_KPI(int(request.kpi_id.uuid)) - print(self.sql_db.get_KPIS()) + #LOGGER.info('sql_db.get_KPIS={:s}'.format(str(self.sql_db.get_KPIS()))) + #LOGGER.info('kpi_db={:s}'.format(str(kpi_db))) + if kpi_db is None: return None - kpiDescriptor = monitoring_pb2.KpiDescriptor() + kpiDescriptor = KpiDescriptor() kpiDescriptor.kpi_description = kpi_db[1] kpiDescriptor.kpi_sample_type = kpi_db[2] @@ -157,7 +211,127 @@ class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceService LOGGER.exception('GetKpiDescriptor exception') grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover + except Exception: # pragma: no cover LOGGER.exception('GetKpiDescriptor exception') + def QueryKpiData ( self, request : KpiQuery, grpc_context : grpc.ServicerContext) -> KpiList: + + LOGGER.info('QueryKpiData') + try: + # TBC + return KpiQuery() + except ServiceException as e: + LOGGER.exception('QueryKpiData exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('QueryKpiData exception') + + def SubscribeKpi ( self, request : SubsDescriptor, grpc_context : grpc.ServicerContext) -> KpiList: + + LOGGER.info('SubscribeKpi') + try: + # TBC + yield KpiList() + except ServiceException as e: + LOGGER.exception('SubscribeKpi exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('SubscribeKpi exception') + + + def GetSubsDescriptor ( self, request : SubscriptionID, grpc_context : grpc.ServicerContext) -> SubsDescriptor: + + LOGGER.info('GetSubsDescriptor') + try: + # TBC + return SubsDescriptor() + except ServiceException as e: + LOGGER.exception('GetSubsDescriptor exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetSubsDescriptor exception') + + def GetSubscriptions ( self, request : Empty, grpc_context : grpc.ServicerContext) -> SubsIDList: + + LOGGER.info('GetSubscriptions') + try: + # TBC + return SubsIDList() + except ServiceException as e: + LOGGER.exception('GetSubscriptions exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetSubscriptions exception') + + def DeleteSubscription ( self, request : SubscriptionID, grpc_context : grpc.ServicerContext) -> Empty: + + LOGGER.info('DeleteSubscription') + try: + # TBC + return Empty() + except ServiceException as e: + LOGGER.exception('DeleteSubscription exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteSubscription exception') + + def SetKpiAlarm ( self, request : AlarmDescriptor, grpc_context : grpc.ServicerContext) -> AlarmResponse: + + LOGGER.info('SetKpiAlarm') + try: + # TBC + return AlarmResponse() + except ServiceException as e: + LOGGER.exception('SetKpiAlarm exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('SetKpiAlarm exception') + + + def GetAlarms ( self, request : Empty, grpc_context : grpc.ServicerContext) -> AlarmIDList: + + LOGGER.info('GetAlarms') + try: + # TBC + return AlarmIDList() + except ServiceException as e: + LOGGER.exception('GetAlarms exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetAlarms exception') + + def GetAlarmDescriptor ( self, request : AlarmID, grpc_context : grpc.ServicerContext) -> AlarmDescriptor: + + LOGGER.info('GetAlarmDescriptor') + try: + # TBC + return AlarmDescriptor() + except ServiceException as e: + LOGGER.exception('GetAlarmDescriptor exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetAlarmDescriptor exception') + + def GetAlarmResponseStream(self, request : AlarmSubscription, grpc_context : grpc.ServicerContext) -> Iterator[AlarmResponse]: + LOGGER.info('GetAlarmResponseStream') + try: + # TBC + yield AlarmResponse() + except ServiceException as e: + LOGGER.exception('GetAlarmResponseStream exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetAlarmResponseStream exception') + + def DeleteAlarm ( self, request : AlarmID, grpc_context : grpc.ServicerContext) -> Empty: + + LOGGER.info('DeleteAlarm') + try: + # TBC + return Empty() + except ServiceException as e: + LOGGER.exception('DeleteAlarm exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteAlarm exception') diff --git a/src/monitoring/service/SqliteTools.py b/src/monitoring/service/SqliteTools.py index d03d6699b5ff29bc4bad4bd087cb6c0a965e397f..092d07e9b961e98a91bb244bcc992c701ad3cd72 100644 --- a/src/monitoring/service/SqliteTools.py +++ b/src/monitoring/service/SqliteTools.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import sqlite3 as sl class SQLite(): @@ -53,6 +67,7 @@ class SQLite(): def get_KPIS(self): data = self.client.execute("SELECT * FROM KPI") - for row in data: - print(row) + #print("\n") + #for row in data: + # print(row) return data.fetchall() \ No newline at end of file diff --git a/src/monitoring/service/__init__.py b/src/monitoring/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/monitoring/service/__init__.py +++ b/src/monitoring/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/monitoring/service/__main__.py b/src/monitoring/service/__main__.py index ea189e1c905b07f92ef3e9cd100763eb7dffa08f..e37412fa004704d089a8e00bada8033d8abe53bd 100644 --- a/src/monitoring/service/__main__.py +++ b/src/monitoring/service/__main__.py @@ -1,43 +1,42 @@ -import logging, os, signal, sys, threading -import time - -from context.client.ContextClient import ContextClient -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT - -from common.logger import getJSONLogger -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto import monitoring_pb2 -from monitoring.service.EventTools import EventsDeviceCollector -from monitoring.service.MonitoringService import MonitoringService - -LOGGER = getJSONLogger('monitoringservice-server') -LOGGER.setLevel('DEBUG') - +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, signal, sys, threading from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from common.proto import monitoring_pb2 +from .EventTools import EventsDeviceCollector +from .MonitoringService import MonitoringService terminate = threading.Event() -logger = None +LOGGER = None -def signal_handler(signal, frame): - global terminate, logger +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name LOGGER.warning('Terminate signal received') terminate.set() def start_monitoring(): - LOGGER.info('Start Monitoring...') - context_client_grpc = ContextClient(address='localhost', port='2020') - monitoring_client = MonitoringClient(server='localhost', port='7070') # instantiate the client - - while True: - if terminate.is_set(): - LOGGER.warning("Stopping execution...") - - break + LOGGER.info('Start Monitoring...',) - # Start Listening Events - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) - events_collector.start() + events_collector = EventsDeviceCollector() + events_collector.start() + # Iterate while terminate is not set + while not terminate.is_set(): list_new_kpi_ids = events_collector.listen_events() # Monitor Kpis @@ -46,47 +45,50 @@ def start_monitoring(): # Create Monitor Kpi Requests monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() monitor_kpi_request.kpi_id.CopyFrom(kpi_id) - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 - - # MonitorKpi(monitor_kpi_request) - - + monitor_kpi_request.sampling_duration_s = 86400 + monitor_kpi_request.sampling_interval_s = 30 + events_collector._monitoring_client.MonitorKpi(monitor_kpi_request) + else: + # Terminate is set, looping terminates + LOGGER.warning("Stopping execution...") + events_collector.start() def main(): - global terminate, logger - - service_port = GRPC_SERVICE_PORT - max_workers = GRPC_MAX_WORKERS - grace_period = GRPC_GRACE_PERIOD - log_level = LOG_LEVEL - metrics_port = METRICS_PORT + global LOGGER # pylint: disable=global-statement + log_level = get_log_level() logging.basicConfig(level=log_level) - logger = logging.getLogger(__name__) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) - logger.info('Starting...') + LOGGER.info('Starting...') + # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) # Starting monitoring service - grpc_service = MonitoringService(port=service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = MonitoringService() grpc_service.start() - # start_monitoring() + start_monitoring() # Wait for Ctrl+C or termination signal while not terminate.wait(timeout=0.1): pass - logger.info('Terminating...') + LOGGER.info('Terminating...') grpc_service.stop() - logger.info('Bye') + LOGGER.info('Bye') return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/src/monitoring/tests/Messages.py b/src/monitoring/tests/Messages.py new file mode 100644 index 0000000000000000000000000000000000000000..7b7f4150e5c084bbf25c6a4d9c1c47b70e3f76a0 --- /dev/null +++ b/src/monitoring/tests/Messages.py @@ -0,0 +1,51 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.proto import monitoring_pb2 +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.timestamp.Converters import timestamp_string_to_float + + +def kpi(): + _kpi = monitoring_pb2.Kpi() + _kpi.kpi_id.kpi_id.uuid = 'KPIID0000' # pylint: disable=maybe-no-member + return _kpi + +def kpi_id(): + _kpi_id = monitoring_pb2.KpiId() + _kpi_id.kpi_id.uuid = str(1) # pylint: disable=maybe-no-member + return _kpi_id + +def create_kpi_request(): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV1' # pylint: disable=maybe-no-member + _create_kpi_request.service_id.service_uuid.uuid = 'SERV1' # pylint: disable=maybe-no-member + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END1' # pylint: disable=maybe-no-member + return _create_kpi_request + +def monitor_kpi_request(kpi_uuid, monitoring_window_s, sampling_rate_s): + _monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() + _monitor_kpi_request.kpi_id.kpi_id.uuid = kpi_uuid # pylint: disable=maybe-no-member + _monitor_kpi_request.monitoring_window_s = monitoring_window_s + _monitor_kpi_request.sampling_rate_s = sampling_rate_s + return _monitor_kpi_request + +def include_kpi_request(): + _include_kpi_request = monitoring_pb2.Kpi() + _include_kpi_request.kpi_id.kpi_id.uuid = str(1) # pylint: disable=maybe-no-member + _include_kpi_request.timestamp.timestamp = timestamp_string_to_float("2021-10-12T13:14:42Z") + _include_kpi_request.kpi_value.int32Val = 500 # pylint: disable=maybe-no-member + return _include_kpi_request diff --git a/src/monitoring/tests/Objects.py b/src/monitoring/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..699e9e9913dde47773d79094d8737a924f012f7b --- /dev/null +++ b/src/monitoring/tests/Objects.py @@ -0,0 +1,30 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled) + +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +DEVICE_DEV1_UUID = 'DEV1' +ENDPOINT_END1_UUID = 'END1' +DEVICE_DEV1_ENDPOINT_DEFS = [(ENDPOINT_END1_UUID, 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_DEV1 = json_device_emulated_packet_router_disabled(DEVICE_DEV1_UUID) +DEVICE_DEV1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_DEV1_ENDPOINT_DEFS) diff --git a/src/monitoring/tests/__init__.py b/src/monitoring/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/monitoring/tests/__init__.py +++ b/src/monitoring/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/monitoring/tests/test_unitary.py b/src/monitoring/tests/test_unitary.py index b77699c5b00b58d19c724a98516983754097b5f7..f8b4d59bdf61b6897da36258496eb5be7faaf8a2 100644 --- a/src/monitoring/tests/test_unitary.py +++ b/src/monitoring/tests/test_unitary.py @@ -1,29 +1,48 @@ -import logging, grpc -import os -import sqlite3 - -import pytest +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, logging, os, pytest +from time import sleep from typing import Tuple - -from monitoring.proto import context_pb2, kpi_sample_types_pb2 -from monitoring.proto import monitoring_pb2 -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.service import SqliteTools, InfluxTools -from monitoring.service.MonitoringService import MonitoringService -from monitoring.service.EventTools import EventsDeviceCollector - +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) from common.orm.Database import Database from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum from common.message_broker.MessageBroker import MessageBroker +from common.proto.monitoring_pb2 import KpiId, KpiDescriptor -from context.Config import GRPC_SERVICE_PORT as grpc_port_context, GRPC_MAX_WORKERS as grpc_workers_context, GRPC_GRACE_PERIOD as grpc_grace_context from context.client.ContextClient import ContextClient from context.service.grpc_server.ContextService import ContextService -from context.service.Populate import populate -from context.proto.context_pb2 import EventTypeEnum, DeviceEvent, Device -from context.tests.example_objects import (DEVICE1, DEVICE1_UUID) +from common.proto.context_pb2 import EventTypeEnum, DeviceEvent, Device, Empty + +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from device.service.drivers import DRIVERS + +from monitoring.client.MonitoringClient import MonitoringClient +from common.proto import context_pb2, monitoring_pb2 +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from monitoring.service import SqliteTools, MetricsDBTools +from monitoring.service.MonitoringService import MonitoringService +from monitoring.service.EventTools import EventsDeviceCollector +from monitoring.tests.Messages import create_kpi_request, include_kpi_request, kpi, kpi_id, monitor_kpi_request +from monitoring.tests.Objects import DEVICE_DEV1, DEVICE_DEV1_CONNECT_RULES, DEVICE_DEV1_UUID + LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) @@ -32,280 +51,273 @@ LOGGER.setLevel(logging.DEBUG) # Tests Setup ########################### -SERVER_ADDRESS = '127.0.0.1' -LISTEN_ADDRESS = '[::]' -GRPC_PORT_MONITORING = 7070 +LOCAL_HOST = '127.0.0.1' + +CONTEXT_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(CONTEXT_SERVICE_PORT) + +DEVICE_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) -GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports +MONITORING_SERVICE_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.MONITORING) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(MONITORING_SERVICE_PORT) -SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), -] +METRICSDB_HOSTNAME = os.environ.get("METRICSDB_HOSTNAME") +METRICSDB_ILP_PORT = os.environ.get("METRICSDB_ILP_PORT") +METRICSDB_REST_PORT = os.environ.get("METRICSDB_REST_PORT") +METRICSDB_TABLE = os.environ.get("METRICSDB_TABLE") -INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") -INFLUXDB_USER = os.environ.get("INFLUXDB_USER") -INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") -INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) +@pytest.fixture(scope='session') +def context_db_mb() -> Tuple[Database, MessageBroker]: + _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) + _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) yield _database, _message_broker _message_broker.terminate() @pytest.fixture(scope='session') -def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - database = context_db_mb[0] +def context_service(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name + database, message_broker = context_db_mb database.clear_all() - _service = ContextService( - database, context_db_mb[1], port=GRPC_PORT_CONTEXT, max_workers=grpc_workers_context, - grace_period=grpc_grace_context) + _service = ContextService(database, message_broker) _service.start() yield _service _service.stop() @pytest.fixture(scope='session') -def context_client_grpc(context_service_grpc : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='localhost', port=GRPC_PORT_CONTEXT) +def context_client(context_service : ContextService): # pylint: disable=redefined-outer-name + _client = ContextClient() yield _client _client.close() - -# This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') -def monitoring_service(): - LOGGER.warning('monitoring_service begin') +def device_service(context_service : ContextService): # pylint: disable=redefined-outer-name + LOGGER.info('Initializing DeviceService...') + driver_factory = DriverFactory(DRIVERS) + driver_instance_cache = DriverInstanceCache(driver_factory) + _service = DeviceService(driver_instance_cache) + _service.start() - service_port = GRPC_SERVICE_PORT - max_workers = GRPC_MAX_WORKERS - grace_period = GRPC_GRACE_PERIOD + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding DeviceService...') + yield _service + + LOGGER.info('Terminating DeviceService...') + _service.stop() +@pytest.fixture(scope='session') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +# This fixture will be requested by test cases and last during testing session +@pytest.fixture(scope='session') +def monitoring_service( + context_service : ContextService, # pylint: disable=redefined-outer-name + device_service : DeviceService # pylint: disable=redefined-outer-name + ): LOGGER.info('Initializing MonitoringService...') - grpc_service = MonitoringService(port=service_port, max_workers=max_workers, grace_period=grace_period) - server = grpc_service.start() + _service = MonitoringService() + _service.start() # yield the server, when test finishes, execution will resume to stop it - LOGGER.warning('monitoring_service yielding') - yield server + LOGGER.info('Yielding MonitoringService...') + yield _service LOGGER.info('Terminating MonitoringService...') - grpc_service.stop() + _service.stop() # This fixture will be requested by test cases and last during testing session. # The client requires the server, so client fixture has the server as dependency. @pytest.fixture(scope='session') -def monitoring_client(monitoring_service): - LOGGER.warning('monitoring_client begin') - client = MonitoringClient(server=SERVER_ADDRESS, port=GRPC_PORT_MONITORING) # instantiate the client - LOGGER.warning('monitoring_client returning') - return client - -# This fixture will be requested by test cases and last during testing session. -@pytest.fixture(scope='session') -def kpi(): - LOGGER.warning('test_include_kpi begin') - # form request - kpi = monitoring_pb2.Kpi() - kpi.kpi_id.kpi_id.uuid = 'KPIID0000' - kpi.kpiDescription = 'KPI Desc' - return kpi +def monitoring_client(monitoring_service : MonitoringService): # pylint: disable=redefined-outer-name + LOGGER.info('Initializing MonitoringClient...') + _client = MonitoringClient() -@pytest.fixture(scope='session') -def kpi_id(): - LOGGER.warning('test_include_kpi begin') - - # form request - kpi_id = monitoring_pb2.KpiId() - kpi_id.kpi_id.uuid = str(1) + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding MonitoringClient...') + yield _client - return kpi_id + LOGGER.info('Closing MonitoringClient...') + _client.close() @pytest.fixture(scope='session') def sql_db(): - sql_db = SqliteTools.SQLite('monitoring.db') - return sql_db - -@pytest.fixture(scope='session') -def influx_db(): - influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME, "8086", INFLUXDB_USER, INFLUXDB_PASSWORD, INFLUXDB_DATABASE) - return influx_db + _sql_db = SqliteTools.SQLite('monitoring.db') + return _sql_db @pytest.fixture(scope='session') -def create_kpi_request(): - LOGGER.warning('test_include_kpi begin') +def metrics_db(): + _metrics_db = MetricsDBTools.MetricsDB( + METRICSDB_HOSTNAME, METRICSDB_ILP_PORT, METRICSDB_REST_PORT, METRICSDB_TABLE) + return _metrics_db - create_kpi_request = monitoring_pb2.KpiDescriptor() - create_kpi_request.kpi_description = 'KPI Description Test' - create_kpi_request.kpi_sample_type = kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED - create_kpi_request.device_id.device_uuid.uuid = 'DEV1' # pylint: disable=maybe-no-member - create_kpi_request.service_id.service_uuid.uuid = "SERV1" - create_kpi_request.endpoint_id.endpoint_uuid.uuid = "END1" - return create_kpi_request - -@pytest.fixture(scope='session') -def monitor_kpi_request(): - LOGGER.warning('test_monitor_kpi begin') - - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = str(1) - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 - - return monitor_kpi_request - - -@pytest.fixture(scope='session') -def include_kpi_request(): - LOGGER.warning('test_include_kpi begin') - - include_kpi_request = monitoring_pb2.Kpi() - include_kpi_request.kpi_id.kpi_id.uuid = str(1) - include_kpi_request.timestamp = "2021-10-12T13:14:42Z" - include_kpi_request.kpi_value.intVal = 500 - - return include_kpi_request ########################### # Tests Implementation ########################### # Test case that makes use of client fixture to test server's CreateKpi method -def test_create_kpi(monitoring_client,create_kpi_request): +def test_set_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_create_kpi requesting') - response = monitoring_client.CreateKpi(create_kpi_request) + response = monitoring_client.SetKpi(create_kpi_request()) LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.KpiId) + assert isinstance(response, KpiId) # Test case that makes use of client fixture to test server's MonitorKpi method -def test_monitor_kpi(monitoring_client,create_kpi_request): +def test_monitor_kpi( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_monitor_kpi begin') - response = monitoring_client.CreateKpi(create_kpi_request) + context_database = context_db_mb[0] - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = response.kpi_id.uuid - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 + # ----- Clean the database ----------------------------------------------------------------------------------------- + context_database.clear_all() - response = monitoring_client.MonitorKpi(monitor_kpi_request) + # ----- Dump state of database before create the object ------------------------------------------------------------ + db_entries = context_database.dump() + LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) + for db_entry in db_entries: + LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover + LOGGER.info('-----------------------------------------------------------') + assert len(db_entries) == 0 + + # ----- Update the object ------------------------------------------------------------------------------------------ + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + + response = monitoring_client.SetKpi(create_kpi_request()) + _monitor_kpi_request = monitor_kpi_request(response.kpi_id.uuid, 120, 5) # pylint: disable=maybe-no-member + response = monitoring_client.MonitorKpi(_monitor_kpi_request) LOGGER.debug(str(response)) - assert isinstance(response, context_pb2.Empty) + assert isinstance(response, Empty) # Test case that makes use of client fixture to test server's IncludeKpi method -def test_include_kpi(monitoring_client,include_kpi_request): +def test_include_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_include_kpi requesting') - response = monitoring_client.IncludeKpi(include_kpi_request) + response = monitoring_client.IncludeKpi(include_kpi_request()) LOGGER.debug(str(response)) - assert isinstance(response, context_pb2.Empty) + assert isinstance(response, Empty) # Test case that makes use of client fixture to test server's GetStreamKpi method -def test_get_stream_kpi(monitoring_client,include_kpi_request): +def test_get_stream_kpi(monitoring_client): # pylint: disable=redefined-outer-name LOGGER.warning('test_getstream_kpi begin') - response = monitoring_client.GetStreamKpi(kpi) + response = monitoring_client.GetStreamKpi(kpi()) LOGGER.debug(str(response)) - #assert isinstance(response, monitoring_pb2.Kpi) + #assert isinstance(response, Kpi) # Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_instant_kpi(monitoring_client,kpi_id): - LOGGER.warning('test_getinstant_kpi begin') - response = monitoring_client.GetInstantKpi(kpi_id) - LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.Kpi) +# def test_get_instant_kpi(monitoring_client): # pylint: disable=redefined-outer-name +# LOGGER.warning('test_getinstant_kpi begin') +# response = monitoring_client.GetInstantKpi(kpi_id()) +# LOGGER.debug(str(response)) +# # assert isinstance(response, Kpi) # Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_kpidescritor_kpi(monitoring_client,create_kpi_request): +def test_get_kpidescritor_kpi(monitoring_client): # pylint: disable=redefined-outer-name LOGGER.warning('test_getkpidescritor_kpi begin') - - response = monitoring_client.CreateKpi(create_kpi_request) - + response = monitoring_client.SetKpi(create_kpi_request()) response = monitoring_client.GetKpiDescriptor(response) LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.KpiDescriptor) + assert isinstance(response, KpiDescriptor) -def test_sqlitedb_tools_insert_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_insert_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_insert_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member response = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) assert isinstance(response, int) -def test_sqlitedb_tools_get_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_get_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid - - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - - response = sql_db.get_KPI(kpi_id) + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member + + _kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + response = sql_db.get_KPI(_kpi_id) assert isinstance(response, tuple) -def test_sqlitedb_tools_get_kpis(sql_db): +def test_sqlitedb_tools_get_kpis(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpis begin') response = sql_db.get_KPIS() assert isinstance(response, list) -def test_sqlitedb_tools_delete_kpi(sql_db, create_kpi_request): +def test_sqlitedb_tools_delete_kpi(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - response = sql_db.delete_KPI("DEV1",kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) + response = sql_db.delete_KPI("DEV1",KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + if not response: + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_KPI("DEV1", kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) + response = sql_db.delete_KPI("DEV1", KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) - assert response == True + assert response -def test_sqlitedb_tools_delete_kpid_id(sql_db, create_kpi_request): +def test_sqlitedb_tools_delete_kpid_id(sql_db): # pylint: disable=redefined-outer-name LOGGER.warning('test_sqlitedb_tools_delete_kpid_id begin') response = sql_db.delete_kpid_id(1) - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + if not response: + _create_kpi_request = create_kpi_request() + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_kpid_id(kpi_id) + _kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) + response = sql_db.delete_kpid_id(_kpi_id) - assert response == True + assert response -def test_influxdb_tools_write_kpi(influx_db): - LOGGER.warning('test_influxdb_tools_write_kpi begin') +def test_metrics_db_tools_write_kpi(metrics_db): # pylint: disable=redefined-outer-name + LOGGER.warning('test_metric_sdb_tools_write_kpi begin') -def test_influxdb_tools_read_kpi_points(influx_db): - LOGGER.warning('test_influxdb_tools_read_kpi_points begin') +def test_metrics_db_tools_read_kpi_points(metrics_db): # pylint: disable=redefined-outer-name + LOGGER.warning('test_metrics_db_tools_read_kpi_points begin') -def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): + + +def test_events_tools( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_get_device_events begin') context_database = context_db_mb[0] @@ -314,10 +326,10 @@ def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=red context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -325,18 +337,22 @@ def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=red LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetDevice(Device(**DEVICE1)) - assert response.device_uuid.uuid == DEVICE1_UUID + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID events_collector.stop() -def test_get_device_events(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): +def test_get_device_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_get_device_events begin') @@ -346,10 +362,10 @@ def test_get_device_events(context_client_grpc: ContextClient, # pylint: disabl context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -357,20 +373,26 @@ def test_get_device_events(context_client_grpc: ContextClient, # pylint: disabl LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + event = events_collector.get_event(block=True) assert isinstance(event, DeviceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE1_UUID + assert event.device_id.device_uuid.uuid == DEVICE_DEV1_UUID events_collector.stop() -def test_listen_events(monitoring_client: MonitoringClient, - context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - context_db_mb: Tuple[Database, MessageBroker]): +def test_listen_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + context_db_mb : Tuple[Database, MessageBroker] # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_listen_events begin') @@ -380,10 +402,10 @@ def test_listen_events(monitoring_client: MonitoringClient, context_database.clear_all() # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector() events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ + # ----- Dump state of database before create the object ------------------------------------------------------------ db_entries = context_database.dump() LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) for db_entry in db_entries: @@ -391,9 +413,15 @@ def test_listen_events(monitoring_client: MonitoringClient, LOGGER.info('-----------------------------------------------------------') assert len(db_entries) == 0 - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID - kpi_id_list = events_collector.listen_events() + sleep(0.1) - assert bool(kpi_id_list) == True + kpi_id_list = events_collector.listen_events() + assert len(kpi_id_list) > 0 + events_collector.stop() diff --git a/src/opticalattackmitigator/.gitlab-ci.yml b/src/opticalattackmitigator/.gitlab-ci.yml index 47a25be3c9c93c008821b1015fe66d1e06a75920..5b9a133bd0cbf4b7dc4a4b6cf290a3be9adf663e 100644 --- a/src/opticalattackmitigator/.gitlab-ci.yml +++ b/src/opticalattackmitigator/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # build, tag and push the Docker image to the gitlab registry build opticalattackmitigator: variables: @@ -10,8 +24,8 @@ build opticalattackmitigator: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - # after_script: - # - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' @@ -20,7 +34,7 @@ build opticalattackmitigator: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAME.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # apply unit test to the opticalattackmitigator component @@ -37,12 +51,14 @@ unit test opticalattackmitigator: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 10007:10007 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 10007:10007 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - #- docker rm -f $IMAGE_NAME + - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' @@ -54,6 +70,10 @@ unit test opticalattackmitigator: - src/$IMAGE_NAME/tests/Dockerfile - manifests/$IMAGE_NAMEservice.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the opticalattackmitigator service in Kubernetes Cluster @@ -69,7 +89,7 @@ deploy opticalattackmitigator: - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAME.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/opticalattackmitigator/Config.py b/src/opticalattackmitigator/Config.py index 64785206cff4f3b5049d78e15a8d8ac0b82caf9b..130381d8bd1db49803aefa992435808bed3a87d3 100644 --- a/src/opticalattackmitigator/Config.py +++ b/src/opticalattackmitigator/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings diff --git a/src/opticalattackmitigator/Dockerfile b/src/opticalattackmitigator/Dockerfile index 126786edd5466fbfdfadef1af804aba540f0bd3a..40469805410e26b145d8a84beda8247fb7c7a56d 100644 --- a/src/opticalattackmitigator/Dockerfile +++ b/src/opticalattackmitigator/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + FROM python:3-slim # Install dependencies diff --git a/src/opticalattackmitigator/__init__.py b/src/opticalattackmitigator/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalattackmitigator/__init__.py +++ b/src/opticalattackmitigator/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py index f303dcc3fc8593b20b0a0ab1a7f6d46a724edec1..d0c53e57ee54a42955210308492e27d0bb332729 100644 --- a/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py +++ b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse @@ -6,6 +20,7 @@ from opticalattackmitigator.proto.optical_attack_mitigator_pb2_grpc import Attac LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class OpticalAttackMitigatorClient: def __init__(self, address, port): @@ -25,7 +40,7 @@ class OpticalAttackMitigatorClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def NotifyAttack(self, request : AttackDescription) -> AttackResponse: LOGGER.debug('NotifyAttack request: {:s}'.format(str(request))) response = self.stub.NotifyAttack(request) diff --git a/src/opticalattackmitigator/client/__init__.py b/src/opticalattackmitigator/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalattackmitigator/client/__init__.py +++ b/src/opticalattackmitigator/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalattackmitigator/genproto.sh b/src/opticalattackmitigator/genproto.sh index 9f0651441172ee902f16faedf65c6c0c54fba9a7..500fd19301599b1e0370bf4a9fe8d1a6f298b6bb 100755 --- a/src/opticalattackmitigator/genproto.sh +++ b/src/opticalattackmitigator/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__init__.py << EOF > /dev/null +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +EOF # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalattackmitigator/proto/__init__.py b/src/opticalattackmitigator/proto/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalattackmitigator/proto/__init__.py +++ b/src/opticalattackmitigator/proto/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalattackmitigator/proto/context_pb2.py b/src/opticalattackmitigator/proto/context_pb2.py index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalattackmitigator/proto/context_pb2.py +++ b/src/opticalattackmitigator/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3552, - serialized_end=3658, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3661, - serialized_end=3858, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3861, - serialized_end=4004, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4007, - serialized_end=4136, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4139, - serialized_end=4275, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4277, - serialized_end=4370, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,35 +1467,28 @@ _SERVICEEVENT = _descriptor.Descriptor( ) -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, + name='context_id', full_name='context.SliceId.context_id', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1462,40 +1501,61 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2605, - serialized_end=2735, + serialized_start=2604, + serialized_end=2688, ) -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + name='slice_id', full_name='context.Slice.slice_id', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1508,37 +1568,87 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2738, - serialized_end=2872, + serialized_start=2691, + serialized_end=2968, ) -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -1554,30 +1664,30 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2874, - serialized_end=2975, + serialized_start=3085, + serialized_end=3128, ) -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -1593,8 +1703,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2977, - serialized_end=3040, + serialized_start=3130, + serialized_end=3209, ) @@ -1625,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3042, - serialized_end=3096, + serialized_start=3211, + serialized_end=3265, ) @@ -1646,19 +1756,26 @@ _CONNECTION = _descriptor.Descriptor( is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, + name='service_id', full_name='context.Connection.service_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1671,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3099, - serialized_end=3240, + serialized_start=3268, + serialized_end=3464, ) @@ -1703,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3242, - serialized_end=3307, + serialized_start=3466, + serialized_end=3531, ) @@ -1735,8 +1852,224 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3309, - serialized_end=3367, + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, ) @@ -1781,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3369, - serialized_end=3463, + serialized_start=4127, + serialized_end=4221, ) @@ -1820,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3465, - serialized_end=3550, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1875,18 +2208,34 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID _ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID _ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID _ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID _ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID _ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE _CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION _TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID _AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY @@ -1920,14 +2269,21 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM @@ -1935,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2155,33 +2512,47 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) + # @@protoc_insertion_point(class_scope:context.SliceId) }) -_sym_db.RegisterMessage(EndPointId) +_sym_db.RegisterMessage(SliceId) -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) + # @@protoc_insertion_point(class_scope:context.Slice) }) -_sym_db.RegisterMessage(EndPoint) +_sym_db.RegisterMessage(Slice) -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) + # @@protoc_insertion_point(class_scope:context.SliceStatus) }) -_sym_db.RegisterMessage(ConfigRule) +_sym_db.RegisterMessage(SliceStatus) -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) + # @@protoc_insertion_point(class_scope:context.SliceIdList) }) -_sym_db.RegisterMessage(Constraint) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, @@ -2211,6 +2582,41 @@ ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_me }) _sym_db.RegisterMessage(ConnectionList) +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { 'DESCRIPTOR' : _TERAFLOWCONTROLLER, '__module__' : 'context_pb2' @@ -2234,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2537,6 +2943,126 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), ]) _sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) diff --git a/src/opticalattackmitigator/requirements.in b/src/opticalattackmitigator/requirements.in index 00acd77fe30ca10ffe3af04f7cf7ced2cb9256f8..ea6b450c9c240c76b9f54ce4f3c0c6c25ec62289 100644 --- a/src/opticalattackmitigator/requirements.in +++ b/src/opticalattackmitigator/requirements.in @@ -7,3 +7,4 @@ redis # from the monitoring component influxdb python-json-logger +coverage diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py index fc2e86067b437bb4facd1e6608f48439fbf2a03e..875276b4ce80335b9eb0081a05d38bfa2c378e43 100644 --- a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py +++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc import logging from concurrent import futures diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py index d7cbc6b0956f26fb87e7d2567cc1c9065482cfd4..4a2dd041b52eaf89bda65acb7ae1e46beed8c48a 100644 --- a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py +++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, grpc, logging, random from influxdb import InfluxDBClient from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method diff --git a/src/opticalattackmitigator/service/__init__.py b/src/opticalattackmitigator/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalattackmitigator/service/__init__.py +++ b/src/opticalattackmitigator/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalattackmitigator/service/__main__.py b/src/opticalattackmitigator/service/__main__.py index bcbf4e3e4c9c74ef25e6d95f6d70edf5fba25c68..10b50ac8ba5f5c7a11c5963eb8533bf6d05dfee2 100644 --- a/src/opticalattackmitigator/service/__main__.py +++ b/src/opticalattackmitigator/service/__main__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, logging, signal, sys, time, threading, multiprocessing from prometheus_client import start_http_server from common.Settings import get_setting diff --git a/src/opticalattackmitigator/tests/__init__.py b/src/opticalattackmitigator/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalattackmitigator/tests/__init__.py +++ b/src/opticalattackmitigator/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalattackmitigator/tests/test_unitary.py b/src/opticalattackmitigator/tests/test_unitary.py index afcb1a699186fb10408cfdc4309fc790fa91c198..74f91a837bf0c83026c88b28ae45f21493a2599d 100644 --- a/src/opticalattackmitigator/tests/test_unitary.py +++ b/src/opticalattackmitigator/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, pytest from opticalattackmitigator.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from opticalattackmitigator.client.OpticalAttackMitigatorClient import OpticalAttackMitigatorClient diff --git a/src/opticalcentralizedattackdetector/.gitlab-ci.yml b/src/opticalcentralizedattackdetector/.gitlab-ci.yml index 11a2c97e6b1944584d5aa48774f7f7a85b8e902c..c3d91aec6e10c7450cfda0b74d0bc3bbe613558b 100644 --- a/src/opticalcentralizedattackdetector/.gitlab-ci.yml +++ b/src/opticalcentralizedattackdetector/.gitlab-ci.yml @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # build, tag and push the Docker image to the gitlab registry build opticalcentralizedattackdetector: variables: @@ -10,8 +24,8 @@ build opticalcentralizedattackdetector: - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - # after_script: - # - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' @@ -20,7 +34,7 @@ build opticalcentralizedattackdetector: - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAME.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # apply unit test to the opticalcentralizedattackdetector component @@ -37,12 +51,14 @@ unit test opticalcentralizedattackdetector: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 10005:10005 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 10005:10005 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - #- docker rm -f $IMAGE_NAME + - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' @@ -54,6 +70,10 @@ unit test opticalcentralizedattackdetector: - src/$IMAGE_NAME/tests/Dockerfile - manifests/$IMAGE_NAMEservice.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the opticalcentralizedattackdetector service in Kubernetes Cluster @@ -69,7 +89,7 @@ deploy opticalcentralizedattackdetector: - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAME.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/opticalcentralizedattackdetector/Config.py b/src/opticalcentralizedattackdetector/Config.py index 5a6b7aa5651566fb2305f08baec7c6f33872fd36..5fd3e97e9f590bea9cdfc6ebf8e93e90fb0a4fea 100644 --- a/src/opticalcentralizedattackdetector/Config.py +++ b/src/opticalcentralizedattackdetector/Config.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging # General settings @@ -11,7 +25,7 @@ GRPC_GRACE_PERIOD = 60 # service settings MONITORING_INTERVAL = 2 # monitoring interval in seconds #TODO: adjust the addresses below for the specific case -MONITORING_SERVICE_ADDRESS = 'monitoring' # address/name of the monitoring service +MONITORING_SERVICE_ADDRESS = 'monitoringservice' # address/name of the monitoring service # MONITORING_SERVICE_ADDRESS = '10.99.41.20' # address/name of the monitoring service CONTEXT_SERVICE_ADDRESS = 'contextservice' # address/name of the monitoring service # CONTEXT_SERVICE_ADDRESS = '10.107.199.65' # address/name of the monitoring service diff --git a/src/opticalcentralizedattackdetector/Dockerfile b/src/opticalcentralizedattackdetector/Dockerfile index 43f7b9457fe1413ca9d9dc520433f184717d0c2a..190df9beae66e82900a8ab78a12d062e4d319fda 100644 --- a/src/opticalcentralizedattackdetector/Dockerfile +++ b/src/opticalcentralizedattackdetector/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + FROM python:3-slim # Install dependencies diff --git a/src/opticalcentralizedattackdetector/__init__.py b/src/opticalcentralizedattackdetector/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalcentralizedattackdetector/__init__.py +++ b/src/opticalcentralizedattackdetector/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py b/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py index c28507581d99c1df47e92eead1fce6ab1c7db3a7..cfb78b41ec6a6d5385692813e1a839566d1c90e7 100644 --- a/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py +++ b/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential from opticalcentralizedattackdetector.proto.context_pb2 import Empty, Service @@ -7,6 +21,7 @@ from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_ LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class OpticalCentralizedAttackDetectorClient: def __init__(self, address, port): @@ -26,28 +41,28 @@ class OpticalCentralizedAttackDetectorClient: self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def NotifyServiceUpdate(self, request : Service) -> Empty: LOGGER.debug('NotifyServiceUpdate request: {:s}'.format(str(request))) response = self.stub.NotifyServiceUpdate(request) LOGGER.debug('NotifyServiceUpdate result: {:s}'.format(str(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def DetectAttack(self, request : Empty) -> Empty: LOGGER.debug('DetectAttack request: {:s}'.format(str(request))) response = self.stub.DetectAttack(request) LOGGER.debug('DetectAttack result: {:s}'.format(str(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ReportSummarizedKpi(self, request : KpiList) -> Empty: LOGGER.debug('ReportSummarizedKpi request: {:s}'.format(str(request))) response = self.stub.ReportSummarizedKpi(request) LOGGER.debug('ReportSummarizedKpi result: {:s}'.format(str(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def ReportKpi(self, request : KpiList) -> Empty: LOGGER.debug('ReportKpi request: {:s}'.format(str(request))) response = self.stub.ReportKpi(request) diff --git a/src/opticalcentralizedattackdetector/client/__init__.py b/src/opticalcentralizedattackdetector/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalcentralizedattackdetector/client/__init__.py +++ b/src/opticalcentralizedattackdetector/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalcentralizedattackdetector/genproto.sh b/src/opticalcentralizedattackdetector/genproto.sh index 76df9bf83af19ac8f1528c750b7d7f11e0a97cf3..855231cce17081a359cc510423f877d58833430d 100755 --- a/src/opticalcentralizedattackdetector/genproto.sh +++ b/src/opticalcentralizedattackdetector/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__init__.py << EOF > /dev/null +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +EOF # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalcentralizedattackdetector/proto/__init__.py b/src/opticalcentralizedattackdetector/proto/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalcentralizedattackdetector/proto/__init__.py +++ b/src/opticalcentralizedattackdetector/proto/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalcentralizedattackdetector/proto/context_pb2.py b/src/opticalcentralizedattackdetector/proto/context_pb2.py index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalcentralizedattackdetector/proto/context_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3552, - serialized_end=3658, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3661, - serialized_end=3858, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3861, - serialized_end=4004, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4007, - serialized_end=4136, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4139, - serialized_end=4275, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4277, - serialized_end=4370, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,35 +1467,28 @@ _SERVICEEVENT = _descriptor.Descriptor( ) -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, + name='context_id', full_name='context.SliceId.context_id', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1462,40 +1501,61 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2605, - serialized_end=2735, + serialized_start=2604, + serialized_end=2688, ) -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + name='slice_id', full_name='context.Slice.slice_id', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1508,37 +1568,87 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2738, - serialized_end=2872, + serialized_start=2691, + serialized_end=2968, ) -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -1554,30 +1664,30 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2874, - serialized_end=2975, + serialized_start=3085, + serialized_end=3128, ) -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -1593,8 +1703,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2977, - serialized_end=3040, + serialized_start=3130, + serialized_end=3209, ) @@ -1625,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3042, - serialized_end=3096, + serialized_start=3211, + serialized_end=3265, ) @@ -1646,19 +1756,26 @@ _CONNECTION = _descriptor.Descriptor( is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, + name='service_id', full_name='context.Connection.service_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, + name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1671,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3099, - serialized_end=3240, + serialized_start=3268, + serialized_end=3464, ) @@ -1703,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3242, - serialized_end=3307, + serialized_start=3466, + serialized_end=3531, ) @@ -1735,8 +1852,224 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3309, - serialized_end=3367, + serialized_start=3533, + serialized_end=3591, +) + + +_CONNECTIONEVENT = _descriptor.Descriptor( + name='ConnectionEvent', + full_name='context.ConnectionEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.ConnectionEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3593, + serialized_end=3687, +) + + +_ENDPOINTID = _descriptor.Descriptor( + name='EndPointId', + full_name='context.EndPointId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='topology_id', full_name='context.EndPointId.topology_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='device_id', full_name='context.EndPointId.device_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3690, + serialized_end=3820, +) + + +_ENDPOINT = _descriptor.Descriptor( + name='EndPoint', + full_name='context.EndPoint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, + number=3, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3823, + serialized_end=3957, +) + + +_CONFIGRULE = _descriptor.Descriptor( + name='ConfigRule', + full_name='context.ConfigRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='action', full_name='context.ConfigRule.action', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_key', full_name='context.ConfigRule.resource_key', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='resource_value', full_name='context.ConfigRule.resource_value', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3959, + serialized_end=4060, +) + + +_CONSTRAINT = _descriptor.Descriptor( + name='Constraint', + full_name='context.Constraint', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='constraint_type', full_name='context.Constraint.constraint_type', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='constraint_value', full_name='context.Constraint.constraint_value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4062, + serialized_end=4125, ) @@ -1781,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3369, - serialized_end=3463, + serialized_start=4127, + serialized_end=4221, ) @@ -1820,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3465, - serialized_end=3550, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1875,18 +2208,34 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID +_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT +_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID _ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID _ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID _ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID _ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID _ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE _CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION _TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID _AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY @@ -1920,14 +2269,21 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT +DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID +DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT +DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE +DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM @@ -1935,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2155,33 +2512,47 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) + # @@protoc_insertion_point(class_scope:context.SliceId) }) -_sym_db.RegisterMessage(EndPointId) +_sym_db.RegisterMessage(SliceId) -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) + # @@protoc_insertion_point(class_scope:context.Slice) }) -_sym_db.RegisterMessage(EndPoint) +_sym_db.RegisterMessage(Slice) -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) + # @@protoc_insertion_point(class_scope:context.SliceStatus) }) -_sym_db.RegisterMessage(ConfigRule) +_sym_db.RegisterMessage(SliceStatus) -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) + # @@protoc_insertion_point(class_scope:context.SliceIdList) }) -_sym_db.RegisterMessage(Constraint) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, @@ -2211,6 +2582,41 @@ ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_me }) _sym_db.RegisterMessage(ConnectionList) +ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTIONEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConnectionEvent) + }) +_sym_db.RegisterMessage(ConnectionEvent) + +EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINTID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPointId) + }) +_sym_db.RegisterMessage(EndPointId) + +EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { + 'DESCRIPTOR' : _ENDPOINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.EndPoint) + }) +_sym_db.RegisterMessage(EndPoint) + +ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { + 'DESCRIPTOR' : _CONFIGRULE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.ConfigRule) + }) +_sym_db.RegisterMessage(ConfigRule) + +Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { + 'DESCRIPTOR' : _CONSTRAINT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Constraint) + }) +_sym_db.RegisterMessage(Constraint) + TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { 'DESCRIPTOR' : _TERAFLOWCONTROLLER, '__module__' : 'context_pb2' @@ -2234,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2537,6 +2943,126 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnectionIds', + full_name='context.ContextService.ListConnectionIds', + index=36, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListConnections', + full_name='context.ContextService.ListConnections', + index=37, + containing_service=None, + input_type=_SERVICEID, + output_type=_CONNECTIONLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnection', + full_name='context.ContextService.GetConnection', + index=38, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_CONNECTION, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetConnection', + full_name='context.ContextService.SetConnection', + index=39, + containing_service=None, + input_type=_CONNECTION, + output_type=_CONNECTIONID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveConnection', + full_name='context.ContextService.RemoveConnection', + index=40, + containing_service=None, + input_type=_CONNECTIONID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetConnectionEvents', + full_name='context.ContextService.GetConnectionEvents', + index=41, + containing_service=None, + input_type=_EMPTY, + output_type=_CONNECTIONEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), ]) _sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) diff --git a/src/opticalcentralizedattackdetector/proto/service_pb2.py b/src/opticalcentralizedattackdetector/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/opticalcentralizedattackdetector/proto/service_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/src/opticalcentralizedattackdetector/requirements.in b/src/opticalcentralizedattackdetector/requirements.in index 00acd77fe30ca10ffe3af04f7cf7ced2cb9256f8..ea6b450c9c240c76b9f54ce4f3c0c6c25ec62289 100644 --- a/src/opticalcentralizedattackdetector/requirements.in +++ b/src/opticalcentralizedattackdetector/requirements.in @@ -7,3 +7,4 @@ redis # from the monitoring component influxdb python-json-logger +coverage diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py index a017292da6228bdf1ba67b48c1b1dcba5dff6ee8..e29566833a781afc8bf85b41b7d5dd10f2a4a2f5 100644 --- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py +++ b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc import logging from concurrent import futures diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py index 48e72a72d2d68e4107957228fca04c9deb55ae4b..d4c71476f016081f7d230a3cfe87e73b35654987 100644 --- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py +++ b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py @@ -1,12 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, grpc, logging, random from influxdb import InfluxDBClient from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method from context.client.ContextClient import ContextClient -from context.Config import GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT +from monitoring.client.MonitoringClient import MonitoringClient from service.client.ServiceClient import ServiceClient -from service.Config import GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse, Sample from dbscanserving.client.DbscanServingClient import DbscanServingClient from dbscanserving.Config import GRPC_SERVICE_PORT as DBSCANSERVING_GRPC_SERVICE_PORT @@ -21,8 +32,7 @@ from opticalcentralizedattackdetector.proto.monitoring_pb2 import KpiList from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import ( OpticalCentralizedAttackDetectorServiceServicer) from opticalcentralizedattackdetector.Config import ( - CONTEXT_SERVICE_ADDRESS, SERVICE_SERVICE_ADDRESS, INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, - ATTACK_MITIGATOR_SERVICE_ADDRESS) + INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, ATTACK_MITIGATOR_SERVICE_ADDRESS) LOGGER = logging.getLogger(__name__) @@ -35,12 +45,16 @@ INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") INFLUXDB_USER = os.environ.get("INFLUXDB_USER") INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -context_client: ContextClient = ContextClient(address=CONTEXT_SERVICE_ADDRESS, port=CONTEXT_GRPC_SERVICE_PORT) -influxdb_client: InfluxDBClient = InfluxDBClient(host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, database=INFLUXDB_DATABASE) -monitoring_client: MonitoringClient = MonitoringClient(server=MONITORING_SERVICE_ADDRESS, port=MONITORING_GRPC_SERVICE_PORT) -dbscanserving_client: DbscanServingClient = DbscanServingClient(address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) -service_client: ServiceClient = ServiceClient(SERVICE_SERVICE_ADDRESS, SERVICE_GRPC_SERVICE_PORT) -attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient(address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) +context_client: ContextClient = ContextClient() +influxdb_client: InfluxDBClient = InfluxDBClient( + host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, + database=INFLUXDB_DATABASE) +monitoring_client: MonitoringClient = MonitoringClient() +dbscanserving_client: DbscanServingClient = DbscanServingClient( + address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) +service_client: ServiceClient = ServiceClient() +attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient( + address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAttackDetectorServiceServicer): diff --git a/src/opticalcentralizedattackdetector/service/__init__.py b/src/opticalcentralizedattackdetector/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalcentralizedattackdetector/service/__init__.py +++ b/src/opticalcentralizedattackdetector/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalcentralizedattackdetector/service/__main__.py b/src/opticalcentralizedattackdetector/service/__main__.py index 37cff6b7dec1554b69d93148307e074240f2dca2..d21b96cf8adc6f9d9968f3553c9249a3b8cedf31 100644 --- a/src/opticalcentralizedattackdetector/service/__main__.py +++ b/src/opticalcentralizedattackdetector/service/__main__.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import os, logging, signal, sys, time, threading, multiprocessing from prometheus_client import start_http_server diff --git a/src/opticalcentralizedattackdetector/tests/__init__.py b/src/opticalcentralizedattackdetector/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/opticalcentralizedattackdetector/tests/__init__.py +++ b/src/opticalcentralizedattackdetector/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/opticalcentralizedattackdetector/tests/example_objects.py b/src/opticalcentralizedattackdetector/tests/example_objects.py index 206d17cb70869a66cf1739f54a83598b1e031edb..3c5a26b6d0bde888560741f052906e0d2694c91d 100644 --- a/src/opticalcentralizedattackdetector/tests/example_objects.py +++ b/src/opticalcentralizedattackdetector/tests/example_objects.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + from copy import deepcopy from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID from context.proto.context_pb2 import ( diff --git a/src/opticalcentralizedattackdetector/tests/test_unitary.py b/src/opticalcentralizedattackdetector/tests/test_unitary.py index a04afdf2379569ec4d723fa9c5c0895a0d9c47f8..da0f4ca9f78478073354d8645cf0b455a5f7a874 100644 --- a/src/opticalcentralizedattackdetector/tests/test_unitary.py +++ b/src/opticalcentralizedattackdetector/tests/test_unitary.py @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, pytest from unittest.mock import patch from opticalcentralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD diff --git a/src/pathcomp/.gitlab-ci.yml b/src/pathcomp/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..fd52da6fb7bf8dc556b92e4db080c9927bb58a5d --- /dev/null +++ b/src/pathcomp/.gitlab-ci.yml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build pathcomp: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test pathcomp: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build pathcomp + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 10020:10020 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy pathcomp: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test pathcomp + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/pathcomp/Config.py b/src/pathcomp/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/src/pathcomp/Config.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/pathcomp/Dockerfile b/src/pathcomp/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ec1ebbf06616233fb96acb4e54d3de24b8a016a4 --- /dev/null +++ b/src/pathcomp/Dockerfile @@ -0,0 +1,69 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/pathcomp +WORKDIR /var/teraflow/pathcomp +COPY src/pathcomp/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/pathcomp/. pathcomp/ + +# Start the service +ENTRYPOINT ["python", "-m", "pathcomp.service"] diff --git a/src/pathcomp/__init__.py b/src/pathcomp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/src/pathcomp/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/pathcomp/client/PathCompClient.py b/src/pathcomp/client/PathCompClient.py new file mode 100644 index 0000000000000000000000000000000000000000..b5a85b533907ce7744df833aad753c8c38475d02 --- /dev/null +++ b/src/pathcomp/client/PathCompClient.py @@ -0,0 +1,53 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.pathcomp_pb2 import PathCompReply, PathCompRequest +from common.proto.pathcomp_pb2_grpc import PathCompServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class PathCompClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.PATHCOMP) + if not port: port = get_service_port_grpc(ServiceNameEnum.PATHCOMP) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = PathCompServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def Compute(self, request : PathCompRequest) -> PathCompReply: + LOGGER.debug('Compute request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Compute(request) + LOGGER.debug('Compute result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/pathcomp/client/__init__.py b/src/pathcomp/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/pathcomp/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/pathcomp/requirements.in b/src/pathcomp/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..a743bbe341f33f5668aef1fa28c8252af2fc8c00 --- /dev/null +++ b/src/pathcomp/requirements.in @@ -0,0 +1 @@ +requests==2.27.1 diff --git a/src/pathcomp/service/PathCompService.py b/src/pathcomp/service/PathCompService.py new file mode 100644 index 0000000000000000000000000000000000000000..7fd9eab3ba8de53ddc5fdee018519126c44361f0 --- /dev/null +++ b/src/pathcomp/service/PathCompService.py @@ -0,0 +1,28 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from pathcomp.proto.pathcomp_pb2_grpc import add_PathCompServiceServicer_to_server +from .PathCompServiceServicerImpl import PathCompServiceServicerImpl + +class PathCompService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.PATHCOMP) + super().__init__(port, cls_name=cls_name) + self.pathcomp_servicer = PathCompServiceServicerImpl() + + def install_servicers(self): + add_PathCompServiceServicer_to_server(self.pathcomp_servicer, self.server) diff --git a/src/pathcomp/service/PathCompServiceServicerImpl.py b/src/pathcomp/service/PathCompServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..239ab6ab5bbe8b6051115a8200cc1f6f304e75b5 --- /dev/null +++ b/src/pathcomp/service/PathCompServiceServicerImpl.py @@ -0,0 +1,85 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import List +import grpc, logging, uuid +from common.proto.context_pb2 import Connection, Empty, EndPointId +from common.proto.pathcomp_pb2 import PathCompReply, PathCompRequest +from common.proto.pathcomp_pb2_grpc import PathCompServiceServicer +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +SERVICE_NAME = 'PathComp' +METHOD_NAMES = ['Compute'] +METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) + +class PathCompServiceServicerImpl(PathCompServiceServicer): + def __init__(self) -> None: + LOGGER.debug('Creating Servicer...') + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def Compute(self, request : PathCompRequest, context : grpc.ServicerContext) -> PathCompReply: + LOGGER.info('[Compute] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) + + context_client = ContextClient() + + # TODO: consider filtering resources + + grpc_contexts = context_client.ListContexts(Empty()) + grpc_devices = context_client.ListDevices(Empty()) + grpc_links = context_client.ListLinks(Empty()) + for grpc_context in grpc_contexts.contexts: + # TODO: add context to request + grpc_topologies = context_client.ListTopologies(grpc_context.context_id) + for grpc_topology in grpc_topologies.topologies: #pylint: disable=unused-variable + # TODO: add topology to request + pass + for grpc_device in grpc_devices.devices: #pylint: disable=unused-variable + # TODO: add device to request + pass + for grpc_link in grpc_links.links: #pylint: disable=unused-variable + # TODO: add link to request + pass + + reply = PathCompReply() + # TODO: issue path computation request + # TODO: compose reply populating reply.services and reply.connections + + for service in request.services: + # TODO: implement support for multi-point services + service_endpoint_ids = service.service_endpoint_ids + if len(service_endpoint_ids) != 2: raise NotImplementedError('Service must have 2 endpoints') + a_endpoint_id, z_endpoint_id = service_endpoint_ids[0], service_endpoint_ids[-1] + + connection_uuid = str(uuid.uuid4()) + connection_path_hops : List[EndPointId] = [] + connection_path_hops.extend([ + grpc_message_to_json(a_endpoint_id), + grpc_message_to_json(z_endpoint_id), + ]) + connection = Connection(**{ + 'connection_id': {'connection_uuid': {'uuid': connection_uuid}}, + 'service_id': grpc_message_to_json(service.service_id), + 'path_hops_endpoint_ids': connection_path_hops, + 'sub_service_ids': [], + }) + reply.connections.append(connection) #pylint: disable=no-member + reply.services.append(service) #pylint: disable=no-member + + LOGGER.info('[Compute] end ; reply = {:s}'.format(grpc_message_to_json_string(reply))) + return reply diff --git a/src/pathcomp/service/__init__.py b/src/pathcomp/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/pathcomp/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/pathcomp/service/__main__.py b/src/pathcomp/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..a41b9e994f02db725c4adf371d9638fd5135693e --- /dev/null +++ b/src/pathcomp/service/__main__.py @@ -0,0 +1,65 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .PathCompService import PathCompService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting service service + grpc_service = PathCompService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/pathcomp/tests/.gitignore b/src/pathcomp/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6b97d6fe3ad32f39097745229ab7f547f26ecb12 --- /dev/null +++ b/src/pathcomp/tests/.gitignore @@ -0,0 +1 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. diff --git a/src/pathcomp/tests/MockService_Dependencies.py b/src/pathcomp/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..b5fe85aa9cec8dd3e3993493abf8a26956a1a886 --- /dev/null +++ b/src/pathcomp/tests/MockService_Dependencies.py @@ -0,0 +1,58 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server +from common.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +from common.tests.MockServicerImpl_Service import MockServicerImpl_Service +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_DEVICE = ServiceNameEnum.DEVICE +SERVICE_SERVICE = ServiceNameEnum.SERVICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context, Device, and Service to simplify unitary tests of PathComp + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.device_servicer = MockServicerImpl_Device() + add_DeviceServiceServicer_to_server(self.device_servicer, self.server) + + self.service_servicer = MockServicerImpl_Service() + add_ServiceServiceServicer_to_server(self.service_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/pathcomp/tests/Objects.py b/src/pathcomp/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..f4785d7ae670efcc5525d6b00c4baf3acf3f22b1 --- /dev/null +++ b/src/pathcomp/tests/Objects.py @@ -0,0 +1,110 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import json_device_emulated_packet_router_disabled, json_device_id +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +def compose_device(device_uuid, endpoint_uuids): + device_id = json_device_id(device_uuid) + endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + endpoints = json_endpoints(device_id, endpoints, topology_id=TOPOLOGY_A_ID) + device = json_device_emulated_packet_router_disabled(device_uuid, endpoints=endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +TOPOLOGY_ADMIN_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY_ADMIN = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) + +TOPOLOGY_A_ID = json_topology_id('A', context_id=CONTEXT_ID) +TOPOLOGY_A = json_topology('A', context_id=CONTEXT_ID) + +TOPOLOGY_B_ID = json_topology_id('B', context_id=CONTEXT_ID) +TOPOLOGY_B = json_topology('B', context_id=CONTEXT_ID) + +TOPOLOGY_C_ID = json_topology_id('C', context_id=CONTEXT_ID) +TOPOLOGY_C = json_topology('C', context_id=CONTEXT_ID) + +# ----- Devices Domain A ----------------------------------------------------------------------------------------------- +DEVICE_A1_ID, DEVICE_A1_ENDPOINTS, DEVICE_A1 = compose_device('A1', ['1', '2', '2000']) +DEVICE_A2_ID, DEVICE_A2_ENDPOINTS, DEVICE_A2 = compose_device('A2', ['1', '2', '1001']) +DEVICE_A3_ID, DEVICE_A3_ENDPOINTS, DEVICE_A3 = compose_device('A3', ['1', '2']) + +# ----- Devices Domain B ----------------------------------------------------------------------------------------------- +DEVICE_B1_ID, DEVICE_B1_ENDPOINTS, DEVICE_B1 = compose_device('B1', ['1', '2', '2000']) +DEVICE_B2_ID, DEVICE_B2_ENDPOINTS, DEVICE_B2 = compose_device('B2', ['1', '2', '1002']) +DEVICE_B3_ID, DEVICE_B3_ENDPOINTS, DEVICE_B3 = compose_device('B3', ['1', '2']) + +# ----- Devices Domain C ----------------------------------------------------------------------------------------------- +DEVICE_C1_ID, DEVICE_C1_ENDPOINTS, DEVICE_C1 = compose_device('C1', ['1', '2', '1001']) +DEVICE_C2_ID, DEVICE_C2_ENDPOINTS, DEVICE_C2 = compose_device('C2', ['1', '2']) +DEVICE_C3_ID, DEVICE_C3_ENDPOINTS, DEVICE_C3 = compose_device('C3', ['1', '2', '1002']) + +# ----- InterDomain Links ---------------------------------------------------------------------------------------------- +LINK_A2_C3_ID, LINK_A2_C3 = compose_link(DEVICE_A2_ENDPOINTS[2], DEVICE_C3_ENDPOINTS[2]) +LINK_C1_B2_ID, LINK_C1_B2 = compose_link(DEVICE_C1_ENDPOINTS[2], DEVICE_B2_ENDPOINTS[2]) + +# ----- IntraDomain A Links -------------------------------------------------------------------------------------------- +LINK_A1_A2_ID, LINK_A1_A2 = compose_link(DEVICE_A1_ENDPOINTS[0], DEVICE_A2_ENDPOINTS[0]) +LINK_A1_A3_ID, LINK_A1_A3 = compose_link(DEVICE_A1_ENDPOINTS[1], DEVICE_A3_ENDPOINTS[0]) +LINK_A2_A3_ID, LINK_A2_A3 = compose_link(DEVICE_A2_ENDPOINTS[1], DEVICE_A3_ENDPOINTS[1]) + +# ----- IntraDomain B Links -------------------------------------------------------------------------------------------- +LINK_B1_B2_ID, LINK_B1_B2 = compose_link(DEVICE_B1_ENDPOINTS[0], DEVICE_B2_ENDPOINTS[0]) +LINK_B1_B3_ID, LINK_B1_B3 = compose_link(DEVICE_B1_ENDPOINTS[1], DEVICE_B3_ENDPOINTS[0]) +LINK_B2_B3_ID, LINK_B2_B3 = compose_link(DEVICE_B2_ENDPOINTS[1], DEVICE_B3_ENDPOINTS[1]) + +# ----- IntraDomain C Links -------------------------------------------------------------------------------------------- +LINK_C1_C2_ID, LINK_C1_C2 = compose_link(DEVICE_C1_ENDPOINTS[0], DEVICE_C2_ENDPOINTS[0]) +LINK_C1_C3_ID, LINK_C1_C3 = compose_link(DEVICE_C1_ENDPOINTS[1], DEVICE_C3_ENDPOINTS[0]) +LINK_C2_C3_ID, LINK_C2_C3 = compose_link(DEVICE_C2_ENDPOINTS[1], DEVICE_C3_ENDPOINTS[1]) + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_A1_B1 = compose_service(DEVICE_A1_ENDPOINTS[2], DEVICE_B1_ENDPOINTS[2], constraints=[ + json_constraint('bandwidth[gbps]', 10.0), + json_constraint('latency[ms]', 5.0), +]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY_ADMIN, TOPOLOGY_A, TOPOLOGY_B, TOPOLOGY_C] +DEVICES = [ DEVICE_A1, DEVICE_A2, DEVICE_A3, + DEVICE_B1, DEVICE_B2, DEVICE_B3, + DEVICE_C1, DEVICE_C2, DEVICE_C3, ] +LINKS = [ LINK_A2_C3, LINK_C1_B2, + LINK_A1_A2, LINK_A1_A3, LINK_A2_A3, + LINK_B1_B2, LINK_B1_B3, LINK_B2_B3, + LINK_C1_C2, LINK_C1_C3, LINK_C2_C3, ] +SERVICES = [SERVICE_A1_B1] diff --git a/src/pathcomp/tests/PrepareTestScenario.py b/src/pathcomp/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..a4efcbdbfc0d311dfb120ab8124a9d2268660daf --- /dev/null +++ b/src/pathcomp/tests/PrepareTestScenario.py @@ -0,0 +1,65 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from pathcomp.client.PathCompClient import PathCompClient +from pathcomp.service.PathCompService import PathCompService +from pathcomp.tests.MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +PATHCOMP_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.PATHCOMP) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(PATHCOMP_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def pathcomp_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + _service = PathCompService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def pathcomp_client(pathcomp_service : PathCompService): # pylint: disable=redefined-outer-name + _client = PathCompClient() + yield _client + _client.close() diff --git a/src/pathcomp/tests/__init__.py b/src/pathcomp/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/pathcomp/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/pathcomp/tests/test_unitary.py b/src/pathcomp/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..23e574e0e1b512b7a69b69847ef5ef034bd2ca41 --- /dev/null +++ b/src/pathcomp/tests/test_unitary.py @@ -0,0 +1,95 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from common.proto.context_pb2 import Context, ContextId, DeviceId, Link, LinkId, Topology, Device, TopologyId +from common.proto.pathcomp_pb2 import PathCompRequest +from common.tools.grpc.Tools import grpc_message_to_json +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from pathcomp.client.PathCompClient import PathCompClient +from .Objects import CONTEXTS, DEVICES, LINKS, SERVICES, TOPOLOGIES +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, pathcomp_service, context_client, device_client, pathcomp_client) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + for context in CONTEXTS : context_client.SetContext (Context (**context )) + for topology in TOPOLOGIES: context_client.SetTopology(Topology(**topology)) + for device in DEVICES : device_client .AddDevice (Device (**device )) + for link in LINKS : context_client.SetLink (Link (**link )) + + +def test_request_service( + pathcomp_client : PathCompClient): # pylint: disable=redefined-outer-name + + request_services = SERVICES + pathcomp_request = PathCompRequest(services=request_services) + pathcomp_reply = pathcomp_client.Compute(pathcomp_request) + pathcomp_reply = grpc_message_to_json(pathcomp_reply) + reply_services = pathcomp_reply['services'] + reply_connections = pathcomp_reply['connections'] + assert len(request_services) <= len(reply_services) + request_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in request_services + } + reply_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in reply_services + } + # Assert all requested services have a reply + # It permits having other services not requested (i.e., sub-services) + assert len(request_service_ids.difference(reply_service_ids)) == 0 + + reply_connection_service_ids = { + '{:s}/{:s}'.format( + conn['service_id']['context_id']['context_uuid']['uuid'], + conn['service_id']['service_uuid']['uuid'] + ) + for conn in reply_connections + } + # Assert all requested services have a connection associated + # It permits having other connections not requested (i.e., connections for sub-services) + assert len(request_service_ids.difference(reply_connection_service_ids)) == 0 + + # TODO: implement other checks. examples: + # - request service and reply service endpoints match + # - request service and reply connection endpoints match + # - reply sub-service and reply sub-connection endpoints match + # - others? + #for json_service,json_connection in zip(json_services, json_connections): + + +def test_cleanup_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + for link in LINKS : context_client.RemoveLink (LinkId (**link ['link_id' ])) + for device in DEVICES : device_client .DeleteDevice (DeviceId (**device ['device_id' ])) + for topology in TOPOLOGIES: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + for context in CONTEXTS : context_client.RemoveContext (ContextId (**context ['context_id' ])) diff --git a/src/policy/.gitlab-ci.yml b/src/policy/.gitlab-ci.yml index 13a071124e2cac693401e155412dee48e1f36b56..164540a05172666375f503549f098ef3a90cdf06 100644 --- a/src/policy/.gitlab-ci.yml +++ b/src/policy/.gitlab-ci.yml @@ -1,36 +1,82 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +variables: + IMAGE_NAME_POLICY: 'policy' + REPORTS_PATH_POLICY: "src/${IMAGE_NAME_POLICY}/reports" + BUILD_ENV_POLICY: build-policy.env + # Package application needed to run tests & build the image on next stage build policy: - variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.0.1' # tag of the container image (production, development, etc) stage: build script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target builder + - export IMAGE_TAG=$(grep -m1 '' ./src/$IMAGE_NAME_POLICY/pom.xml | grep -oP '(?<=>).*(?=<)') + - echo "IMAGE_TAG=${IMAGE_TAG}" >> ${BUILD_ENV_POLICY} + - cat ${BUILD_ENV_POLICY} + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target builder + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + artifacts: + reports: + dotenv: ${BUILD_ENV_POLICY} rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml # Run tests, build & push the image unit_test policy: variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.0.1' # tag of the container image (production, development, etc) + REPORTS_CONTAINER: "${IMAGE_NAME_POLICY}-reports" stage: unit_test needs: - build policy before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker rm ${REPORTS_CONTAINER} || true script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target unit-test - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target release - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - echo "Running tests for image ${IMAGE_TAG}" + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target unit-test + # Transfer JaCoCo and Surefire reports from within tests image + - docker create --name ${REPORTS_CONTAINER} "$IMAGE_NAME_POLICY:$IMAGE_TAG" + - mkdir -p ${REPORTS_PATH_POLICY} + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/index.html ${REPORTS_PATH_POLICY}/coverage.html + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/jacoco.xml ${REPORTS_PATH_POLICY}/jacoco.xml + - docker cp ${REPORTS_CONTAINER}:/app/target/surefire-reports/ ${REPORTS_PATH_POLICY}/ + - cat ${REPORTS_PATH_POLICY}/coverage.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' + - docker run -v "$(pwd)/src/${IMAGE_NAME_POLICY}:/${IMAGE_NAME_POLICY}" --rm registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 python /opt/cover2cover.py ${IMAGE_NAME_POLICY}/reports/jacoco.xml ${IMAGE_NAME_POLICY}/src/main/java > ${REPORTS_PATH_POLICY}/cobertura.xml + # Build final image + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target release + - docker tag "$IMAGE_NAME_POLICY:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + after_script: + - docker rm ${REPORTS_CONTAINER} + - docker rm -f "$IMAGE_NAME_POLICY:$IMAGE_TAG" + coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' + artifacts: + reports: + junit: + - ${REPORTS_PATH_POLICY}/surefire-reports/TEST-*.xml rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml # Deployment of policy service in Kubernetes Cluster @@ -42,6 +88,12 @@ deploy policy: script: - kubectl version - kubectl get all + - kubectl delete --ignore-not-found=true -f "manifests/policyservice.yaml" - kubectl apply -f "manifests/policyservice.yaml" - kubectl delete pods --selector app=policyservice - - kubectl get all \ No newline at end of file + - kubectl get all + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual \ No newline at end of file diff --git a/src/policy/pom.xml b/src/policy/pom.xml index 399c3a18c8f4fb62c42290191f59b179b1f0f2c3..531cc7ecf96424b3180c1f4471ae0d002de85acc 100644 --- a/src/policy/pom.xml +++ b/src/policy/pom.xml @@ -1,11 +1,27 @@ + + 4.0.0 eu.teraflow policy - 0.0.1 + 0.1.0 TeraFlow Policy Component TeraFlow Policy Component @@ -83,6 +99,12 @@ + + io.github.project-openubl + quarkus-bouncycastle + 1.2.2.Final + + io.quarkus quarkus-grpc @@ -118,6 +140,12 @@ quarkus-arc + + com.google.guava + guava + 31.1-jre + + io.quarkus quarkus-config-yaml @@ -267,6 +295,16 @@ org.jacoco jacoco-maven-plugin ${jacoco.version} + + + policy/* + context/* + monitoring/* + service/* + kpi_sample_types/* + acl/* + + instrument-unit-tests diff --git a/src/policy/src/main/docker/Dockerfile.multistage.jvm b/src/policy/src/main/docker/Dockerfile.multistage.jvm index 1e21abcb49499f7f407602494db9ac91bb9eb187..38920f65e01d8e466aed83bb5d55750253eb96f2 100644 --- a/src/policy/src/main/docker/Dockerfile.multistage.jvm +++ b/src/policy/src/main/docker/Dockerfile.multistage.jvm @@ -1,3 +1,17 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + # Multi-stage Docker image build # Stage 1 @@ -15,7 +29,7 @@ RUN mvn --errors --batch-mode package -Dmaven.test.skip=true # Stage 2 FROM builder AS unit-test -RUN mvn --errors --batch-mode test +RUN mvn --errors --batch-mode -Pgenerate-consolidated-coverage verify # Stage 3 FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4 AS release @@ -46,7 +60,7 @@ COPY --from=builder --chown=1001 /app/target/quarkus-app/app/ /deployments/app/ COPY --from=builder --chown=1001 /app/target/quarkus-app/quarkus/ /deployments/quarkus/ EXPOSE 8080 -EXPOSE 9999 +EXPOSE 6060 USER 1001 ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java index 6ac456cbdbce39376f34c78b739f953d9f61c45f..2e8f9bba41f20c03e1db624f711b824a5fe37c9b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyGateway.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; import policy.PolicyService; diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java index 5b371ceda7f712f0199930653015ed33e3f66b51..c76f8c8c402d454af88349ce14ae53f0a0c69f3d 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyGatewayImpl.java @@ -1,66 +1,116 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; -import context.ContextOuterClass; +import context.ContextOuterClass.ServiceId; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; import policy.Policy; +import policy.Policy.PolicyRuleBasic; +import policy.Policy.PolicyRuleDevice; +import policy.Policy.PolicyRuleId; +import policy.Policy.PolicyRuleService; +import policy.Policy.PolicyRuleServiceList; +import policy.Policy.PolicyRuleState; +import policy.Policy.RuleState; @GrpcService public class PolicyGatewayImpl implements PolicyGateway { private final PolicyService policyService; + private final Serializer serializer; @Inject - public PolicyGatewayImpl(PolicyService policyService) { + public PolicyGatewayImpl(PolicyService policyService, Serializer serializer) { this.policyService = policyService; + this.serializer = serializer; + } + + @Override + public Uni policyAddService(PolicyRuleService request) { + final var policyRuleService = serializer.deserialize(request); + + return policyService + .addPolicyService(policyRuleService) + .onItem() + .transform(serializer::serialize); + } + + @Override + public Uni policyAddDevice(PolicyRuleDevice request) { + final var policyRuleDevice = serializer.deserialize(request); + + return policyService + .addPolicyDevice(policyRuleDevice) + .onItem() + .transform(serializer::serialize); } @Override - public Uni policyAdd(Policy.PolicyRule request) { + public Uni policyUpdateService(PolicyRuleService request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) .build()); } @Override - public Uni policyUpdate(Policy.PolicyRule request) { + public Uni policyUpdateDevice(PolicyRuleDevice request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState( + request.getPolicyRuleBasic().getPolicyRuleState().getPolicyRuleState()) .build()); } @Override - public Uni policyDelete(Policy.PolicyRule request) { + public Uni policyDelete(PolicyRuleId request) { return Uni.createFrom() .item( () -> Policy.PolicyRuleState.newBuilder() - .setPolicyRuleId(request.getPolicyRuleId().getUuid()) + .setPolicyRuleState(RuleState.POLICY_REMOVED) .build()); } @Override - public Uni getPolicy(Policy.PolicyRuleId request) { + public Uni getPolicyService(PolicyRuleId request) { + final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); + return Uni.createFrom() - .item(() -> Policy.PolicyRule.newBuilder().setPolicyRuleId(request).build()); + .item(() -> PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build()); } @Override - public Uni getPolicyByDeviceId(ContextOuterClass.DeviceId request) { + public Uni getPolicyDevice(PolicyRuleId request) { + final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build(); - return Uni.createFrom().item(() -> Policy.PolicyRuleList.newBuilder().build()); + return Uni.createFrom() + .item(() -> PolicyRuleDevice.newBuilder().setPolicyRuleBasic(policyRuleBasic).build()); } @Override - public Uni getPolicyByServiceId(ContextOuterClass.ServiceId request) { - - return Uni.createFrom().item(() -> Policy.PolicyRuleList.newBuilder().build()); + public Uni getPolicyByServiceId(ServiceId request) { + return Uni.createFrom().item(() -> Policy.PolicyRuleServiceList.newBuilder().build()); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java index 40bca174a1015f17a0b43a8cb40d084fac16692a..dcaf43b902c95471cff2c020f0fdc5659c59e6a1 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyService.java @@ -1,10 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; -import eu.teraflow.policy.model.PolicyRule; +import eu.teraflow.policy.model.PolicyRuleDevice; +import eu.teraflow.policy.model.PolicyRuleService; import eu.teraflow.policy.model.PolicyRuleState; import io.smallrye.mutiny.Uni; public interface PolicyService { - Uni addPolicy(PolicyRule policyRule); + Uni addPolicyService(PolicyRuleService policyRuleService); + + Uni addPolicyDevice(PolicyRuleDevice policyRuleDevice); } diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java index c3453c33d97103c8b2042892ff32180b4a4b8235..66994625ddb2eb6a52e1d0a99acd52a2cd1cc2f2 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java @@ -1,9 +1,31 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; -import eu.teraflow.policy.model.PolicyRule; +import eu.teraflow.policy.context.ContextService; +import eu.teraflow.policy.model.PolicyRuleDevice; +import eu.teraflow.policy.model.PolicyRuleService; import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.MonitoringService; +import eu.teraflow.policy.service.ServiceService; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; import org.jboss.logging.Logger; @ApplicationScoped @@ -11,8 +33,31 @@ public class PolicyServiceImpl implements PolicyService { private static final Logger LOGGER = Logger.getLogger(PolicyServiceImpl.class); - public Uni addPolicy(PolicyRule policyRule) { + private final ContextService contextService; + private final MonitoringService monitoringService; + private final ServiceService serviceService; + + @Inject + public PolicyServiceImpl( + ContextService contextService, + MonitoringService monitoringService, + ServiceService serviceService) { + this.contextService = contextService; + this.monitoringService = monitoringService; + this.serviceService = serviceService; + } + + @Override + public Uni addPolicyService(PolicyRuleService policyRuleService) { + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_VALIDATED); + + return Uni.createFrom().item(policyRuleState); + } + + @Override + public Uni addPolicyDevice(PolicyRuleDevice policyRuleDevice) { + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_VALIDATED); - return null; + return Uni.createFrom().item(policyRuleState); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/Serializer.java b/src/policy/src/main/java/eu/teraflow/policy/Serializer.java new file mode 100644 index 0000000000000000000000000000000000000000..35b6e2fd8cebf544d3f4b0f56fffbf4572f1de2b --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/Serializer.java @@ -0,0 +1,2224 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import acl.Acl; +import context.ContextOuterClass; +import context.ContextOuterClass.ConfigRule_ACL; +import context.ContextOuterClass.ConfigRule_Custom; +import context.ContextOuterClass.ContextId; +import context.ContextOuterClass.DeviceId; +import context.ContextOuterClass.DeviceOperationalStatusEnum; +import context.ContextOuterClass.Location.LocationCase; +import context.ContextOuterClass.Uuid; +import eu.teraflow.policy.acl.AclAction; +import eu.teraflow.policy.acl.AclEntry; +import eu.teraflow.policy.acl.AclForwardActionEnum; +import eu.teraflow.policy.acl.AclLogActionEnum; +import eu.teraflow.policy.acl.AclMatch; +import eu.teraflow.policy.acl.AclRuleSet; +import eu.teraflow.policy.acl.AclRuleTypeEnum; +import eu.teraflow.policy.context.model.ConfigActionEnum; +import eu.teraflow.policy.context.model.ConfigRule; +import eu.teraflow.policy.context.model.ConfigRuleAcl; +import eu.teraflow.policy.context.model.ConfigRuleCustom; +import eu.teraflow.policy.context.model.ConfigRuleTypeAcl; +import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; +import eu.teraflow.policy.context.model.Constraint; +import eu.teraflow.policy.context.model.ConstraintCustom; +import eu.teraflow.policy.context.model.ConstraintEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintSchedule; +import eu.teraflow.policy.context.model.ConstraintSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintSlaLatency; +import eu.teraflow.policy.context.model.ConstraintTypeCustom; +import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintTypeSchedule; +import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.DeviceConfig; +import eu.teraflow.policy.context.model.DeviceDriverEnum; +import eu.teraflow.policy.context.model.DeviceOperationalStatus; +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.context.model.EndPoint; +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.Event; +import eu.teraflow.policy.context.model.EventTypeEnum; +import eu.teraflow.policy.context.model.GpsPosition; +import eu.teraflow.policy.context.model.IsolationLevelEnum; +import eu.teraflow.policy.context.model.Location; +import eu.teraflow.policy.context.model.LocationTypeGpsPosition; +import eu.teraflow.policy.context.model.LocationTypeRegion; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceConfig; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.context.model.ServiceStatus; +import eu.teraflow.policy.context.model.ServiceStatusEnum; +import eu.teraflow.policy.context.model.ServiceTypeEnum; +import eu.teraflow.policy.context.model.SliceId; +import eu.teraflow.policy.context.model.TopologyId; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.policy.model.BooleanOperator; +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleAction; +import eu.teraflow.policy.model.PolicyRuleActionEnum; +import eu.teraflow.policy.model.PolicyRuleBasic; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.model.PolicyRuleDevice; +import eu.teraflow.policy.model.PolicyRuleService; +import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.BooleanKpiValue; +import eu.teraflow.policy.monitoring.model.FloatKpiValue; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.KpiValue; +import eu.teraflow.policy.monitoring.model.KpiValueRange; +import eu.teraflow.policy.monitoring.model.StringKpiValue; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import javax.inject.Singleton; +import kpi_sample_types.KpiSampleTypes; +import monitoring.Monitoring; +import monitoring.Monitoring.AlarmID; +import monitoring.Monitoring.KpiId; +import monitoring.Monitoring.SubscriptionID; +import policy.Policy; +import policy.Policy.PolicyRuleId; +import policy.PolicyAction; +import policy.PolicyCondition; + +@Singleton +public class Serializer { + + public DeviceId serializeDeviceId(String expectedDeviceId) { + final var builder = DeviceId.newBuilder(); + final var uuid = serializeUuid(expectedDeviceId); + + builder.setDeviceUuid(uuid); + + return builder.build(); + } + + public String deserialize(DeviceId deviceId) { + return deviceId.getDeviceUuid().getUuid(); + } + + public ContextId serializeContextId(String expectedContextId) { + final var builder = ContextId.newBuilder(); + final var uuid = serializeUuid(expectedContextId); + + builder.setContextUuid(uuid); + + return builder.build(); + } + + public String deserialize(ContextId contextId) { + return contextId.getContextUuid().getUuid(); + } + + public PolicyRuleId serializePolicyRuleId(String expectedPolicyRuleId) { + final var builder = PolicyRuleId.newBuilder(); + final var uuid = serializeUuid(expectedPolicyRuleId); + + builder.setUuid(uuid); + + return builder.build(); + } + + public String deserialize(PolicyRuleId policyRuleId) { + return policyRuleId.getUuid().getUuid(); + } + + public ContextOuterClass.TopologyId serialize(TopologyId topologyId) { + final var builder = ContextOuterClass.TopologyId.newBuilder(); + + final var topologyIdContextId = topologyId.getContextId(); + final var topologyIdId = topologyId.getId(); + + final var contextId = serializeContextId(topologyIdContextId); + final var topologyIdIdUuid = serializeUuid(topologyIdId); + + builder.setContextId(contextId); + builder.setTopologyUuid(topologyIdIdUuid); + + return builder.build(); + } + + public TopologyId deserialize(ContextOuterClass.TopologyId topologyId) { + final var topologyIdContextId = deserialize(topologyId.getContextId()); + final var topologyIdId = deserialize(topologyId.getTopologyUuid()); + + return new TopologyId(topologyIdContextId, topologyIdId); + } + + public ContextOuterClass.ConfigActionEnum serialize(ConfigActionEnum configActionEnum) { + switch (configActionEnum) { + case SET: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET; + case DELETE: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE; + case UNDEFINED: + return ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED; + default: + return ContextOuterClass.ConfigActionEnum.UNRECOGNIZED; + } + } + + public ConfigActionEnum deserialize( + ContextOuterClass.ConfigActionEnum serializedConfigActionEnum) { + switch (serializedConfigActionEnum) { + case CONFIGACTION_SET: + return ConfigActionEnum.SET; + case CONFIGACTION_DELETE: + return ConfigActionEnum.DELETE; + case CONFIGACTION_UNDEFINED: + case UNRECOGNIZED: + default: + return ConfigActionEnum.UNDEFINED; + } + } + + public Acl.AclRuleTypeEnum serialize(AclRuleTypeEnum aclRuleTypeEnum) { + switch (aclRuleTypeEnum) { + case IPV4: + return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4; + case IPV6: + return Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6; + case L2: + return Acl.AclRuleTypeEnum.ACLRULETYPE_L2; + case MPLS: + return Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS; + case MIXED: + return Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED; + case UNDEFINED: + return Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED; + default: + return Acl.AclRuleTypeEnum.UNRECOGNIZED; + } + } + + public AclRuleTypeEnum deserialize(Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) { + switch (serializedAclRuleTypeEnum) { + case ACLRULETYPE_IPV4: + return AclRuleTypeEnum.IPV4; + case ACLRULETYPE_IPV6: + return AclRuleTypeEnum.IPV6; + case ACLRULETYPE_L2: + return AclRuleTypeEnum.L2; + case ACLRULETYPE_MPLS: + return AclRuleTypeEnum.MPLS; + case ACLRULETYPE_MIXED: + return AclRuleTypeEnum.MIXED; + case UNRECOGNIZED: + default: + return AclRuleTypeEnum.UNDEFINED; + } + } + + public Acl.AclMatch serialize(AclMatch aclMatch) { + final var builder = Acl.AclMatch.newBuilder(); + + final var dscp = aclMatch.getDscp(); + final var protocol = aclMatch.getProtocol(); + final var srcAddress = aclMatch.getSrcAddress(); + final var dstAddress = aclMatch.getDstAddress(); + final var srcPort = aclMatch.getSrcPort(); + final var dstPort = aclMatch.getDstPort(); + final var startMplsLabel = aclMatch.getStartMplsLabel(); + final var endMplsLabel = aclMatch.getEndMplsLabel(); + + builder.setDscp(dscp); + builder.setProtocol(protocol); + builder.setSrcAddress(srcAddress); + builder.setDstAddress(dstAddress); + builder.setSrcPort(srcPort); + builder.setDstPort(dstPort); + builder.setStartMplsLabel(startMplsLabel); + builder.setEndMplsLabel(endMplsLabel); + + return builder.build(); + } + + public AclMatch deserialize(Acl.AclMatch serializedAclMatch) { + final var dscp = serializedAclMatch.getDscp(); + final var protocol = serializedAclMatch.getProtocol(); + final var srcAddress = serializedAclMatch.getSrcAddress(); + final var dstAddress = serializedAclMatch.getDstAddress(); + final var srcPort = serializedAclMatch.getSrcPort(); + final var dstPort = serializedAclMatch.getDstPort(); + final var startMplsLabel = serializedAclMatch.getStartMplsLabel(); + final var endMplsLabel = serializedAclMatch.getEndMplsLabel(); + + return new AclMatch( + dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel); + } + + public Acl.AclForwardActionEnum serialize(AclForwardActionEnum aclForwardActionEnum) { + switch (aclForwardActionEnum) { + case DROP: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP; + case ACCEPT: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT; + case REJECT: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT; + case UNDEFINED: + return Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED; + default: + return Acl.AclForwardActionEnum.UNRECOGNIZED; + } + } + + public AclForwardActionEnum deserialize(Acl.AclForwardActionEnum serializedAclForwardActionEnum) { + switch (serializedAclForwardActionEnum) { + case ACLFORWARDINGACTION_DROP: + return AclForwardActionEnum.DROP; + case ACLFORWARDINGACTION_ACCEPT: + return AclForwardActionEnum.ACCEPT; + case ACLFORWARDINGACTION_REJECT: + return AclForwardActionEnum.REJECT; + case UNRECOGNIZED: + default: + return AclForwardActionEnum.UNDEFINED; + } + } + + public Acl.AclLogActionEnum serialize(AclLogActionEnum aclLogActionEnum) { + switch (aclLogActionEnum) { + case NO_LOG: + return Acl.AclLogActionEnum.ACLLOGACTION_NOLOG; + case SYSLOG: + return Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG; + case UNDEFINED: + return Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED; + default: + return Acl.AclLogActionEnum.UNRECOGNIZED; + } + } + + public AclLogActionEnum deserialize(Acl.AclLogActionEnum serializedAclLogActionEnum) { + switch (serializedAclLogActionEnum) { + case ACLLOGACTION_NOLOG: + return AclLogActionEnum.NO_LOG; + case ACLLOGACTION_SYSLOG: + return AclLogActionEnum.SYSLOG; + case UNRECOGNIZED: + default: + return AclLogActionEnum.UNDEFINED; + } + } + + public Acl.AclAction serialize(AclAction aclAction) { + final var builder = Acl.AclAction.newBuilder(); + + final var aclForwardActionEnum = aclAction.getAclForwardActionEnum(); + final var aclLogActionEnum = aclAction.getAclLogActionEnum(); + + final var serializedAclForwardActionEnum = serialize(aclForwardActionEnum); + final var serializedAclLogActionEnum = serialize(aclLogActionEnum); + + builder.setForwardAction(serializedAclForwardActionEnum); + builder.setLogAction(serializedAclLogActionEnum); + + return builder.build(); + } + + public AclAction deserialize(Acl.AclAction serializedAclAction) { + final var serializedAclForwardActionEnum = serializedAclAction.getForwardAction(); + final var serializedAclLogActionEnum = serializedAclAction.getLogAction(); + + final var aclForwardActionEnum = deserialize(serializedAclForwardActionEnum); + final var aclLogActionEnum = deserialize(serializedAclLogActionEnum); + + return new AclAction(aclForwardActionEnum, aclLogActionEnum); + } + + public Acl.AclEntry serialize(AclEntry aclEntry) { + final var builder = Acl.AclEntry.newBuilder(); + + final var sequenceId = aclEntry.getSequenceId(); + final var description = aclEntry.getDescription(); + final var aclMatch = aclEntry.getMatch(); + final var aclAction = aclEntry.getAction(); + + final var serializedAclMatch = serialize(aclMatch); + final var serializedAclAction = serialize(aclAction); + + builder.setSequenceId(sequenceId); + builder.setDescription(description); + builder.setMatch(serializedAclMatch); + builder.setAction(serializedAclAction); + + return builder.build(); + } + + public AclEntry deserialize(Acl.AclEntry serializedAclEntry) { + final var sequenceId = serializedAclEntry.getSequenceId(); + final var description = serializedAclEntry.getDescription(); + final var serializedAclMatch = serializedAclEntry.getMatch(); + final var serializedAclAction = serializedAclEntry.getAction(); + + final var aclMatch = deserialize(serializedAclMatch); + final var aclAction = deserialize(serializedAclAction); + + return new AclEntry(sequenceId, description, aclMatch, aclAction); + } + + public Acl.AclRuleSet serialize(AclRuleSet aclRuleSet) { + final var builder = Acl.AclRuleSet.newBuilder(); + + final var name = aclRuleSet.getName(); + final var type = aclRuleSet.getType(); + final var description = aclRuleSet.getDescription(); + final var userId = aclRuleSet.getUserId(); + final var entries = aclRuleSet.getEntries(); + + final var serializedType = serialize(type); + final var serializedEntries = + entries.stream().map(this::serialize).collect(Collectors.toList()); + + builder.setName(name); + builder.setType(serializedType); + builder.setDescription(description); + builder.setUserId(userId); + builder.addAllEntries(serializedEntries); + + return builder.build(); + } + + public AclRuleSet deserialize(Acl.AclRuleSet serializedAclRuleSet) { + final var serializedName = serializedAclRuleSet.getName(); + final var serializedType = serializedAclRuleSet.getType(); + final var serializedDescription = serializedAclRuleSet.getDescription(); + final var serializedUserId = serializedAclRuleSet.getUserId(); + final var serializedEntries = serializedAclRuleSet.getEntriesList(); + + final var type = deserialize(serializedType); + final var entries = + serializedEntries.stream().map(this::deserialize).collect(Collectors.toList()); + + return new AclRuleSet(serializedName, type, serializedDescription, serializedUserId, entries); + } + + public ConfigRule_ACL serialize(ConfigRuleAcl configRuleAcl) { + final var builder = ContextOuterClass.ConfigRule_ACL.newBuilder(); + + final var endPointId = configRuleAcl.getEndPointId(); + final var aclRuleSet = configRuleAcl.getRuleSet(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedAclRuleSet = serialize(aclRuleSet); + + builder.setEndpointId(serializedEndPointId); + builder.setRuleSet(serializedAclRuleSet); + + return builder.build(); + } + + public ConfigRuleAcl deserialize(ConfigRule_ACL serializedConfigRuleAcl) { + final var serializedEndPointId = serializedConfigRuleAcl.getEndpointId(); + final var serializedAclRuleSet = serializedConfigRuleAcl.getRuleSet(); + + final var endPointId = deserialize(serializedEndPointId); + final var aclRuleSet = deserialize(serializedAclRuleSet); + + return new ConfigRuleAcl(endPointId, aclRuleSet); + } + + public ConfigRule_Custom serialize(ConfigRuleCustom configRuleCustom) { + final var builder = ConfigRule_Custom.newBuilder(); + + final var resourceKey = configRuleCustom.getResourceKey(); + final var resourceValue = configRuleCustom.getResourceValue(); + + builder.setResourceKey(resourceKey); + builder.setResourceValue(resourceValue); + + return builder.build(); + } + + public ConfigRuleCustom deserialize(ConfigRule_Custom serializedConfigRuleCustom) { + final var serializedResourceKey = serializedConfigRuleCustom.getResourceKey(); + final var serializedResourceValue = serializedConfigRuleCustom.getResourceValue(); + + return new ConfigRuleCustom(serializedResourceKey, serializedResourceValue); + } + + public ContextOuterClass.ConfigRule serialize(ConfigRule configRule) { + final var builder = ContextOuterClass.ConfigRule.newBuilder(); + + final var configActionEnum = configRule.getConfigActionEnum(); + final var configRuleType = configRule.getConfigRuleType(); + final var configRuleTypeSpecificType = configRuleType.getConfigRuleType(); + + if (configRuleTypeSpecificType instanceof ConfigRuleAcl) { + final var endPointId = ((ConfigRuleAcl) configRuleTypeSpecificType).getEndPointId(); + final var aclRuleSet = ((ConfigRuleAcl) configRuleTypeSpecificType).getRuleSet(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedAclRuleSet = serialize(aclRuleSet); + + final var serializedConfigRuleAcl = + ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + builder.setAcl(serializedConfigRuleAcl); + } + + if (configRuleTypeSpecificType instanceof ConfigRuleCustom) { + final var configRuleCustomResourceKey = + ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceKey(); + final var configRuleCustomResourceValue = + ((ConfigRuleCustom) configRuleTypeSpecificType).getResourceValue(); + + final var serializedConfigRuleCustom = + ConfigRule_Custom.newBuilder() + .setResourceKey(configRuleCustomResourceKey) + .setResourceValue(configRuleCustomResourceValue) + .build(); + + builder.setCustom(serializedConfigRuleCustom); + } + + final var serializedConfigActionEnum = serialize(configActionEnum); + + builder.setAction(serializedConfigActionEnum); + + return builder.build(); + } + + public ConfigRule deserialize(ContextOuterClass.ConfigRule serializedConfigRule) { + final var serializedConfigActionEnum = serializedConfigRule.getAction(); + final var typeOfConfigRule = serializedConfigRule.getConfigRuleCase(); + + final var configActionEnum = deserialize(serializedConfigActionEnum); + + switch (typeOfConfigRule) { + case ACL: + final var serializedConfigRuleAcl = serializedConfigRule.getAcl(); + + final var configRuleAcl = deserialize(serializedConfigRuleAcl); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + + return new ConfigRule(configActionEnum, configRuleTypeAcl); + case CUSTOM: + final var serializedConfigRuleCustom = serializedConfigRule.getCustom(); + + final var configRuleCustom = deserialize(serializedConfigRuleCustom); + final var configRuleTypeCustom = new ConfigRuleTypeCustom(configRuleCustom); + + return new ConfigRule(configActionEnum, configRuleTypeCustom); + default: + case CONFIGRULE_NOT_SET: + throw new IllegalStateException("Config Rule not set"); + } + } + + public ContextOuterClass.Location serialize(Location location) { + final var builder = ContextOuterClass.Location.newBuilder(); + + final var locationType = location.getLocationType(); + final var locationTypeSpecificType = locationType.getLocationType(); + + if (locationTypeSpecificType instanceof GpsPosition) { + final var latitude = ((GpsPosition) locationTypeSpecificType).getLatitude(); + final var longitude = ((GpsPosition) locationTypeSpecificType).getLongitude(); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + builder.setGpsPosition(serializedGpsPosition); + } + + if (locationTypeSpecificType instanceof String) { + final var region = ((String) locationTypeSpecificType); + + builder.setRegion(region); + } + + return builder.build(); + } + + public Location deserialize(ContextOuterClass.Location serializedLocation) { + final var typeOfLocation = serializedLocation.getLocationCase(); + + switch (typeOfLocation) { + case REGION: + final var region = serializedLocation.getRegion(); + final var locationTypeRegion = new LocationTypeRegion(region); + + return new Location(locationTypeRegion); + case GPS_POSITION: + final var serializedGpsPosition = serializedLocation.getGpsPosition(); + final var latitude = serializedGpsPosition.getLatitude(); + final var longitude = serializedGpsPosition.getLongitude(); + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + + return new Location(locationTypeGpsPosition); + default: + case LOCATION_NOT_SET: + throw new IllegalStateException("Location value not set"); + } + } + + public ContextOuterClass.IsolationLevelEnum serialize(IsolationLevelEnum isolationLevelEnum) { + switch (isolationLevelEnum) { + case NO_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.NO_ISOLATION; + case PHYSICAL_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.PHYSICAL_ISOLATION; + case LOGICAL_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.LOGICAL_ISOLATION; + case PROCESS_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.PROCESS_ISOLATION; + case PHYSICAL_MEMORY_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION; + case PHYSICAL_NETWORK_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.PHYSICAL_NETWORK_ISOLATION; + case VIRTUAL_RESOURCE_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.VIRTUAL_RESOURCE_ISOLATION; + case NETWORK_FUNCTIONS_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.NETWORK_FUNCTIONS_ISOLATION; + case SERVICE_ISOLATION: + return ContextOuterClass.IsolationLevelEnum.SERVICE_ISOLATION; + default: + return ContextOuterClass.IsolationLevelEnum.UNRECOGNIZED; + } + } + + public IsolationLevelEnum deserialize( + ContextOuterClass.IsolationLevelEnum serializedIsolationLevelEnum) { + switch (serializedIsolationLevelEnum) { + case PHYSICAL_ISOLATION: + return IsolationLevelEnum.PHYSICAL_ISOLATION; + case LOGICAL_ISOLATION: + return IsolationLevelEnum.LOGICAL_ISOLATION; + case PROCESS_ISOLATION: + return IsolationLevelEnum.PROCESS_ISOLATION; + case PHYSICAL_MEMORY_ISOLATION: + return IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION; + case PHYSICAL_NETWORK_ISOLATION: + return IsolationLevelEnum.PHYSICAL_NETWORK_ISOLATION; + case VIRTUAL_RESOURCE_ISOLATION: + return IsolationLevelEnum.VIRTUAL_RESOURCE_ISOLATION; + case NETWORK_FUNCTIONS_ISOLATION: + return IsolationLevelEnum.NETWORK_FUNCTIONS_ISOLATION; + case SERVICE_ISOLATION: + return IsolationLevelEnum.SERVICE_ISOLATION; + case UNRECOGNIZED: + default: + return IsolationLevelEnum.NO_ISOLATION; + } + } + + public ContextOuterClass.Constraint_Custom serialize(ConstraintCustom constraintCustom) { + final var builder = ContextOuterClass.Constraint_Custom.newBuilder(); + + final var constraintType = constraintCustom.getConstraintType(); + final var constraintValue = constraintCustom.getConstraintValue(); + + builder.setConstraintType(constraintType); + builder.setConstraintValue(constraintValue); + + return builder.build(); + } + + public ConstraintCustom deserialize( + ContextOuterClass.Constraint_Custom serializedConstraintCustom) { + final var constraintType = serializedConstraintCustom.getConstraintType(); + final var constraintValue = serializedConstraintCustom.getConstraintValue(); + + return new ConstraintCustom(constraintType, constraintValue); + } + + public ContextOuterClass.Constraint_Schedule serialize(ConstraintSchedule constraintSchedule) { + final var builder = ContextOuterClass.Constraint_Schedule.newBuilder(); + + final var startTimestamp = constraintSchedule.getStartTimestamp(); + final var durationDays = constraintSchedule.getDurationDays(); + + builder.setStartTimestamp(startTimestamp); + builder.setDurationDays(durationDays); + + return builder.build(); + } + + public ConstraintSchedule deserialize( + ContextOuterClass.Constraint_Schedule serializedConstraintSchedule) { + final var startTimestamp = serializedConstraintSchedule.getStartTimestamp(); + final var durationDays = serializedConstraintSchedule.getDurationDays(); + + return new ConstraintSchedule(startTimestamp, durationDays); + } + + public ContextOuterClass.Constraint_EndPointLocation serialize( + ConstraintEndPointLocation constraintEndPointLocation) { + final var builder = ContextOuterClass.Constraint_EndPointLocation.newBuilder(); + + final var endPointId = constraintEndPointLocation.getEndPointId(); + final var location = constraintEndPointLocation.getLocation(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedLocation = serialize(location); + + builder.setEndpointId(serializedEndPointId); + builder.setLocation(serializedLocation); + + return builder.build(); + } + + public ConstraintEndPointLocation deserialize( + ContextOuterClass.Constraint_EndPointLocation serializedConstraintEndPointLocation) { + final var serializedEndPointId = serializedConstraintEndPointLocation.getEndpointId(); + final var serializedLocation = serializedConstraintEndPointLocation.getLocation(); + + final var endPointId = deserialize(serializedEndPointId); + final var location = deserialize(serializedLocation); + + return new ConstraintEndPointLocation(endPointId, location); + } + + public ContextOuterClass.Constraint_SLA_Availability serialize( + ConstraintSlaAvailability constraintSlaAvailability) { + final var builder = ContextOuterClass.Constraint_SLA_Availability.newBuilder(); + + final var numDisjointPaths = constraintSlaAvailability.getNumDisjointPaths(); + final var isAllActive = constraintSlaAvailability.isAllActive(); + + builder.setNumDisjointPaths(numDisjointPaths); + builder.setAllActive(isAllActive); + + return builder.build(); + } + + public ConstraintSlaAvailability deserialize( + ContextOuterClass.Constraint_SLA_Availability serializedConstraintSlaAvailability) { + final var numDisjointPaths = serializedConstraintSlaAvailability.getNumDisjointPaths(); + final var isAllActive = serializedConstraintSlaAvailability.getAllActive(); + + return new ConstraintSlaAvailability(numDisjointPaths, isAllActive); + } + + public ContextOuterClass.Constraint_SLA_Capacity serialize( + ConstraintSlaCapacity constraintSlaCapacity) { + final var builder = ContextOuterClass.Constraint_SLA_Capacity.newBuilder(); + + final var capacityGbps = constraintSlaCapacity.getCapacityGbps(); + + builder.setCapacityGbps(capacityGbps); + + return builder.build(); + } + + public ConstraintSlaCapacity deserialize( + ContextOuterClass.Constraint_SLA_Capacity serializedConstraintSlaCapacity) { + final var capacityGbps = serializedConstraintSlaCapacity.getCapacityGbps(); + + return new ConstraintSlaCapacity(capacityGbps); + } + + public ContextOuterClass.Constraint_SLA_Isolation_level serialize( + ConstraintSlaIsolationLevel constraintSlaIsolationLevel) { + final var builder = ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder(); + + final var isolationLevelEnums = constraintSlaIsolationLevel.getIsolationLevelEnums(); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream().map(this::serialize).collect(Collectors.toList()); + + builder.addAllIsolationLevel(serializedIsolationLevelEnums); + + return builder.build(); + } + + public ConstraintSlaIsolationLevel deserialize( + ContextOuterClass.Constraint_SLA_Isolation_level serializedConstraintIsolationLevel) { + final var serializedIsolationLevelEnums = + serializedConstraintIsolationLevel.getIsolationLevelList(); + + final var isolationLevelEnums = + serializedIsolationLevelEnums.stream().map(this::deserialize).collect(Collectors.toList()); + + return new ConstraintSlaIsolationLevel(isolationLevelEnums); + } + + public ContextOuterClass.Constraint_SLA_Latency serialize( + ConstraintSlaLatency constraintSlaLatency) { + final var builder = ContextOuterClass.Constraint_SLA_Latency.newBuilder(); + + final var e2eLatencyMs = constraintSlaLatency.getE2eLatencyMs(); + + builder.setE2ELatencyMs(e2eLatencyMs); + + return builder.build(); + } + + public ConstraintSlaLatency deserialize( + ContextOuterClass.Constraint_SLA_Latency serializedConstraintSlaLatency) { + final var e2ELatencyMs = serializedConstraintSlaLatency.getE2ELatencyMs(); + + return new ConstraintSlaLatency(e2ELatencyMs); + } + + public ContextOuterClass.Constraint serialize(Constraint constraint) { + final var builder = ContextOuterClass.Constraint.newBuilder(); + + final var constraintType = constraint.getConstraintType(); + final var constraintTypeSpecificType = constraintType.getConstraintType(); + + if (constraintTypeSpecificType instanceof ConstraintCustom) { + final var constraintCustomType = + ((ConstraintCustom) constraintTypeSpecificType).getConstraintType(); + final var constraintCustomValue = + ((ConstraintCustom) constraintTypeSpecificType).getConstraintValue(); + + final var serializedConstraintCustom = + ContextOuterClass.Constraint_Custom.newBuilder() + .setConstraintType(constraintCustomType) + .setConstraintValue(constraintCustomValue) + .build(); + + builder.setCustom(serializedConstraintCustom); + } + + if (constraintTypeSpecificType instanceof ConstraintSchedule) { + final var startTimestamp = + ((ConstraintSchedule) constraintTypeSpecificType).getStartTimestamp(); + final var durationDays = ((ConstraintSchedule) constraintTypeSpecificType).getDurationDays(); + + final var serializedConstraintSchedule = + ContextOuterClass.Constraint_Schedule.newBuilder() + .setStartTimestamp(startTimestamp) + .setDurationDays(durationDays) + .build(); + + builder.setSchedule(serializedConstraintSchedule); + } + + if (constraintTypeSpecificType instanceof ConstraintEndPointLocation) { + final var endPointId = + ((ConstraintEndPointLocation) constraintTypeSpecificType).getEndPointId(); + final var location = ((ConstraintEndPointLocation) constraintTypeSpecificType).getLocation(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedLocation = serialize(location); + + final var serializedConstraintEndPointLocation = + ContextOuterClass.Constraint_EndPointLocation.newBuilder() + .setEndpointId(serializedEndPointId) + .setLocation(serializedLocation) + .build(); + + builder.setEndpointLocation(serializedConstraintEndPointLocation); + } + + if (constraintTypeSpecificType instanceof ConstraintSlaAvailability) { + final var numDisJointPaths = + ((ConstraintSlaAvailability) constraintTypeSpecificType).getNumDisjointPaths(); + final var isAllActive = + ((ConstraintSlaAvailability) constraintTypeSpecificType).isAllActive(); + + final var serializedConstraintSlaAvailability = + ContextOuterClass.Constraint_SLA_Availability.newBuilder() + .setNumDisjointPaths(numDisJointPaths) + .setAllActive(isAllActive) + .build(); + + builder.setSlaAvailability(serializedConstraintSlaAvailability); + } + + if (constraintTypeSpecificType instanceof ConstraintSlaCapacity) { + final var capacityGbps = + ((ConstraintSlaCapacity) constraintTypeSpecificType).getCapacityGbps(); + + final var serializedConstraintSlaCapacity = + ContextOuterClass.Constraint_SLA_Capacity.newBuilder() + .setCapacityGbps(capacityGbps) + .build(); + + builder.setSlaCapacity(serializedConstraintSlaCapacity); + } + + if (constraintTypeSpecificType instanceof ConstraintSlaIsolationLevel) { + final var isolationLevelEnums = + ((ConstraintSlaIsolationLevel) constraintTypeSpecificType).getIsolationLevelEnums(); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedConstraintSlaIsolationLevel = + ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() + .addAllIsolationLevel(serializedIsolationLevelEnums) + .build(); + + builder.setSlaIsolation(serializedConstraintSlaIsolationLevel); + } + + if (constraintTypeSpecificType instanceof ConstraintSlaLatency) { + final var e2eLatencyMs = + ((ConstraintSlaLatency) constraintTypeSpecificType).getE2eLatencyMs(); + + final var serializedConstraintSlaLatency = + ContextOuterClass.Constraint_SLA_Latency.newBuilder() + .setE2ELatencyMs(e2eLatencyMs) + .build(); + + builder.setSlaLatency(serializedConstraintSlaLatency); + } + + return builder.build(); + } + + public Constraint deserialize(ContextOuterClass.Constraint serializedConstraint) { + final var typeOfConstraint = serializedConstraint.getConstraintCase(); + + switch (typeOfConstraint) { + case CUSTOM: + final var serializedConstraintCustom = serializedConstraint.getCustom(); + final var constraintType = serializedConstraintCustom.getConstraintType(); + final var constraintValue = serializedConstraintCustom.getConstraintValue(); + + final var constraintCustom = new ConstraintCustom(constraintType, constraintValue); + final var constraintTypeCustom = new ConstraintTypeCustom(constraintCustom); + + return new Constraint(constraintTypeCustom); + case SCHEDULE: + final var serializedConstraintSchedule = serializedConstraint.getSchedule(); + final var startTimestamp = serializedConstraintSchedule.getStartTimestamp(); + final var durationDays = serializedConstraintSchedule.getDurationDays(); + + final var constraintSchedule = new ConstraintSchedule(startTimestamp, durationDays); + final var constraintTypeSchedule = new ConstraintTypeSchedule(constraintSchedule); + + return new Constraint(constraintTypeSchedule); + case ENDPOINT_LOCATION: + final var serializedConstrainEndPointLocation = serializedConstraint.getEndpointLocation(); + final var serializedEndPointId = serializedConstrainEndPointLocation.getEndpointId(); + final var serializedLocation = serializedConstrainEndPointLocation.getLocation(); + + final var endPointId = deserialize(serializedEndPointId); + final var location = deserialize(serializedLocation); + final var constraintEndPointLocation = new ConstraintEndPointLocation(endPointId, location); + final var constraintTypeEndPointLocation = + new ConstraintTypeEndPointLocation(constraintEndPointLocation); + + return new Constraint(constraintTypeEndPointLocation); + case SLA_CAPACITY: + final var serializedConstrainSlaCapacity = serializedConstraint.getSlaCapacity(); + final var capacityGbps = serializedConstrainSlaCapacity.getCapacityGbps(); + + final var constraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + final var constraintTypeSlaCapacity = new ConstraintTypeSlaCapacity(constraintSlaCapacity); + + return new Constraint(constraintTypeSlaCapacity); + case SLA_LATENCY: + final var serializedConstrainSlaLatency = serializedConstraint.getSlaLatency(); + final var e2ELatencyMs = serializedConstrainSlaLatency.getE2ELatencyMs(); + + final var constraintSlaLatency = new ConstraintSlaLatency(e2ELatencyMs); + final var constraintTypeSlaLatency = new ConstraintTypeSlaLatency(constraintSlaLatency); + + return new Constraint(constraintTypeSlaLatency); + case SLA_AVAILABILITY: + final var serializedConstrainSlaAvailability = serializedConstraint.getSlaAvailability(); + final var numDisjointPaths = serializedConstrainSlaAvailability.getNumDisjointPaths(); + final var isAllActive = serializedConstrainSlaAvailability.getAllActive(); + + final var constraintSlaAvailability = + new ConstraintSlaAvailability(numDisjointPaths, isAllActive); + final var constraintTypeSlaAvailability = + new ConstraintTypeSlaAvailability(constraintSlaAvailability); + + return new Constraint(constraintTypeSlaAvailability); + case SLA_ISOLATION: + final var serializedConstrainSlaIsolation = serializedConstraint.getSlaIsolation(); + final var serializedIsolationLevelEnums = + serializedConstrainSlaIsolation.getIsolationLevelList(); + + final var isolationLevelEnums = + serializedIsolationLevelEnums.stream() + .map(this::deserialize) + .collect(Collectors.toList()); + final var constraintSlaIsolation = new ConstraintSlaIsolationLevel(isolationLevelEnums); + final var constraintTypeSlaIsolation = + new ConstraintTypeSlaIsolationLevel(constraintSlaIsolation); + + return new Constraint(constraintTypeSlaIsolation); + + default: + case CONSTRAINT_NOT_SET: + throw new IllegalStateException("Constraint value not set"); + } + } + + public ContextOuterClass.EndPointId serialize(EndPointId endPointId) { + final var builder = ContextOuterClass.EndPointId.newBuilder(); + + final var endPointIdTopologyId = endPointId.getTopologyId(); + final var endPointIdDeviceId = endPointId.getDeviceId(); + final var endPointIdId = endPointId.getId(); + + final var serializedTopologyId = serialize(endPointIdTopologyId); + final var serializedDeviceId = serializeDeviceId(endPointIdDeviceId); + final var serializedEndPointIdId = serializeUuid(endPointIdId); + + builder.setTopologyId(serializedTopologyId); + builder.setDeviceId(serializedDeviceId); + builder.setEndpointUuid(serializedEndPointIdId); + + return builder.build(); + } + + public EndPointId deserialize(ContextOuterClass.EndPointId serializedEndPointId) { + final var serializedTopologyId = serializedEndPointId.getTopologyId(); + final var serializedDeviceId = serializedEndPointId.getDeviceId(); + final var serializedId = serializedEndPointId.getEndpointUuid(); + + final var topologyId = deserialize(serializedTopologyId); + final var deviceId = deserialize(serializedDeviceId); + final var id = deserialize(serializedId); + + return new EndPointId(topologyId, deviceId, id); + } + + public ContextOuterClass.EventTypeEnum serialize(EventTypeEnum eventTypeEnum) { + switch (eventTypeEnum) { + case CREATE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE; + case REMOVE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE; + case UPDATE: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE; + case UNDEFINED: + return ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED; + default: + return ContextOuterClass.EventTypeEnum.UNRECOGNIZED; + } + } + + public EventTypeEnum deserialize(ContextOuterClass.EventTypeEnum serializedEventType) { + switch (serializedEventType) { + case EVENTTYPE_CREATE: + return EventTypeEnum.CREATE; + case EVENTTYPE_REMOVE: + return EventTypeEnum.REMOVE; + case EVENTTYPE_UPDATE: + return EventTypeEnum.UPDATE; + case EVENTTYPE_UNDEFINED: + case UNRECOGNIZED: + default: + return EventTypeEnum.UNDEFINED; + } + } + + public ContextOuterClass.Timestamp serialize(double timestamp) { + final var builder = ContextOuterClass.Timestamp.newBuilder(); + + builder.setTimestamp(timestamp); + + return builder.build(); + } + + public double deserialize(ContextOuterClass.Timestamp serializedTimeStamp) { + + return serializedTimeStamp.getTimestamp(); + } + + public ContextOuterClass.Event serialize(Event event) { + final var builder = ContextOuterClass.Event.newBuilder(); + + final var eventType = serialize(event.getEventTypeEnum()); + final var timestamp = serialize(event.getTimestamp()); + builder.setEventType(eventType); + builder.setTimestamp(timestamp); + + return builder.build(); + } + + public Event deserialize(ContextOuterClass.Event serializedEvent) { + final var timestamp = deserialize(serializedEvent.getTimestamp()); + final var eventType = deserialize(serializedEvent.getEventType()); + + return new Event(timestamp, eventType); + } + + public ContextOuterClass.ServiceId serialize(ServiceId serviceId) { + final var builder = ContextOuterClass.ServiceId.newBuilder(); + + final var contextId = serviceId.getContextId(); + final var id = serviceId.getId(); + + final var serializedContextId = serializeContextId(contextId); + final var serializedId = serializeUuid(id); + + builder.setContextId(serializedContextId); + builder.setServiceUuid(serializedId); + + return builder.build(); + } + + public ServiceId deserialize(ContextOuterClass.ServiceId serializedServiceId) { + final var serializedContextId = serializedServiceId.getContextId(); + final var serializedId = serializedServiceId.getServiceUuid(); + + final var contextId = deserialize(serializedContextId); + final var id = deserialize(serializedId); + + return new ServiceId(contextId, id); + } + + public ContextOuterClass.SliceId serialize(SliceId sliceId) { + final var builder = ContextOuterClass.SliceId.newBuilder(); + + final var contextId = sliceId.getContextId(); + final var id = sliceId.getId(); + + final var serializedContextId = serializeContextId(contextId); + final var serializedId = serializeUuid(id); + + builder.setContextId(serializedContextId); + builder.setSliceUuid(serializedId); + + return builder.build(); + } + + public SliceId deserialize(ContextOuterClass.SliceId serializedSliceId) { + final var serializedContextId = serializedSliceId.getContextId(); + final var serializedId = serializedSliceId.getSliceUuid(); + + final var contextId = deserialize(serializedContextId); + final var id = deserialize(serializedId); + + return new SliceId(contextId, id); + } + + public ContextOuterClass.ServiceStatusEnum serialize(ServiceStatusEnum serviceStatusEnum) { + switch (serviceStatusEnum) { + case ACTIVE: + return ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_ACTIVE; + case PLANNED: + return ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_PLANNED; + case PENDING_REMOVAL: + return ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_PENDING_REMOVAL; + case UNDEFINED: + return ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED; + default: + return ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED; + } + } + + public ServiceStatusEnum deserialize( + ContextOuterClass.ServiceStatusEnum serializedServiceStatusEnum) { + switch (serializedServiceStatusEnum) { + case SERVICESTATUS_ACTIVE: + return ServiceStatusEnum.ACTIVE; + case SERVICESTATUS_PLANNED: + return ServiceStatusEnum.PLANNED; + case SERVICESTATUS_PENDING_REMOVAL: + return ServiceStatusEnum.PENDING_REMOVAL; + case SERVICESTATUS_UNDEFINED: + case UNRECOGNIZED: + default: + return ServiceStatusEnum.UNDEFINED; + } + } + + public ContextOuterClass.ServiceTypeEnum serialize(ServiceTypeEnum serviceTypeEnum) { + switch (serviceTypeEnum) { + case L2NM: + return ContextOuterClass.ServiceTypeEnum.SERVICETYPE_L2NM; + case L3NM: + return ContextOuterClass.ServiceTypeEnum.SERVICETYPE_L3NM; + case TAPI_CONNECTIVITY_SERVICE: + return ContextOuterClass.ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE; + case UNKNOWN: + return ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN; + default: + return ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED; + } + } + + public ServiceTypeEnum deserialize(ContextOuterClass.ServiceTypeEnum serializedServiceTypeEnum) { + switch (serializedServiceTypeEnum) { + case SERVICETYPE_L2NM: + return ServiceTypeEnum.L2NM; + case SERVICETYPE_L3NM: + return ServiceTypeEnum.L3NM; + case SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + return ServiceTypeEnum.TAPI_CONNECTIVITY_SERVICE; + case SERVICETYPE_UNKNOWN: + case UNRECOGNIZED: + default: + return ServiceTypeEnum.UNKNOWN; + } + } + + public ContextOuterClass.ServiceStatus serialize(ServiceStatus serviceStatus) { + final var builder = ContextOuterClass.ServiceStatus.newBuilder(); + + final var serviceStatusEnum = serviceStatus.getServiceStatus(); + final var serializedServiceStatusEnum = serialize(serviceStatusEnum); + + builder.setServiceStatus(serializedServiceStatusEnum); + + return builder.build(); + } + + public ServiceStatus deserialize(ContextOuterClass.ServiceStatus serializedServiceStatus) { + final var serializedServiceStatusEnum = serializedServiceStatus.getServiceStatus(); + final var serviceStatusEnum = deserialize(serializedServiceStatusEnum); + + return new ServiceStatus(serviceStatusEnum); + } + + public ContextOuterClass.ServiceConfig serialize(ServiceConfig serviceConfig) { + final var builder = ContextOuterClass.ServiceConfig.newBuilder(); + + final var serializedConfigRules = + serviceConfig.getConfigRules().stream().map(this::serialize).collect(Collectors.toList()); + + builder.addAllConfigRules(serializedConfigRules); + + return builder.build(); + } + + public ServiceConfig deserialize(ContextOuterClass.ServiceConfig serviceConfig) { + final var configRules = + serviceConfig.getConfigRulesList().stream() + .map(this::deserialize) + .collect(Collectors.toList()); + + return new ServiceConfig(configRules); + } + + public ContextOuterClass.Service serialize(Service service) { + final var builder = ContextOuterClass.Service.newBuilder(); + + final var serviceId = service.getServiceId(); + final var serviceType = service.getServiceType(); + final var serviceEndPointIds = service.getServiceEndPointIds(); + final var serviceConstraints = service.getServiceConstraints(); + final var serviceStatus = service.getServiceStatus(); + final var serviceConfig = service.getServiceConfig(); + final var serviceTimestamp = service.getTimestamp(); + + final var serializedServiceId = serialize(serviceId); + final var serializedServiceType = serialize(serviceType); + final var serializedServiceEndPointIds = + serviceEndPointIds.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedServiceConstraints = + serviceConstraints.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedServiceStatus = serialize(serviceStatus); + final var serializedServiceConfig = serialize(serviceConfig); + final var serializedTimestamp = serialize(serviceTimestamp); + + builder.setServiceId(serializedServiceId); + builder.setServiceType(serializedServiceType); + builder.addAllServiceEndpointIds(serializedServiceEndPointIds); + builder.addAllServiceConstraints(serializedServiceConstraints); + builder.setServiceStatus(serializedServiceStatus); + builder.setServiceConfig(serializedServiceConfig); + builder.setTimestamp(serializedTimestamp); + + return builder.build(); + } + + public Service deserialize(ContextOuterClass.Service serializedService) { + + final var serializedServiceId = serializedService.getServiceId(); + final var serializedServiceType = serializedService.getServiceType(); + final var serializedServiceEndPointIds = serializedService.getServiceEndpointIdsList(); + final var serializedServiceConstraints = serializedService.getServiceConstraintsList(); + final var serializedServiceStatus = serializedService.getServiceStatus(); + final var serializedServiceConfig = serializedService.getServiceConfig(); + final var serializedTimestamp = serializedService.getTimestamp(); + + final var serviceId = deserialize(serializedServiceId); + final var serviceType = deserialize(serializedServiceType); + final var serviceEndPointIds = + serializedServiceEndPointIds.stream().map(this::deserialize).collect(Collectors.toList()); + final var serviceConstraints = + serializedServiceConstraints.stream().map(this::deserialize).collect(Collectors.toList()); + final var serviceStatus = deserialize(serializedServiceStatus); + final var serviceConfig = deserialize(serializedServiceConfig); + final var timestamp = deserialize(serializedTimestamp); + + return new Service( + serviceId, + serviceType, + serviceEndPointIds, + serviceConstraints, + serviceStatus, + serviceConfig, + timestamp); + } + + public KpiSampleTypes.KpiSampleType serialize(KpiSampleType kpiSampleType) { + switch (kpiSampleType) { + case PACKETS_TRANSMITTED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED; + case PACKETS_RECEIVED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED; + case BYTES_TRANSMITTED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED; + case BYTES_RECEIVED: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED; + case UNKNOWN: + return KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN; + default: + return KpiSampleTypes.KpiSampleType.UNRECOGNIZED; + } + } + + public KpiSampleType deserialize(KpiSampleTypes.KpiSampleType serializedKpiSampleType) { + switch (serializedKpiSampleType) { + case KPISAMPLETYPE_PACKETS_TRANSMITTED: + return KpiSampleType.PACKETS_TRANSMITTED; + case KPISAMPLETYPE_PACKETS_RECEIVED: + return KpiSampleType.PACKETS_RECEIVED; + case KPISAMPLETYPE_BYTES_TRANSMITTED: + return KpiSampleType.BYTES_TRANSMITTED; + case KPISAMPLETYPE_BYTES_RECEIVED: + return KpiSampleType.BYTES_RECEIVED; + case KPISAMPLETYPE_UNKNOWN: + default: + return KpiSampleType.UNKNOWN; + } + } + + public Policy.RuleState serialize(RuleState rulestate) { + switch (rulestate) { + case POLICY_FAILED: + return Policy.RuleState.POLICY_FAILED; + case POLICY_INSERTED: + return Policy.RuleState.POLICY_INSERTED; + case POLICY_VALIDATED: + return Policy.RuleState.POLICY_VALIDATED; + case POLICY_PROVISIONED: + return Policy.RuleState.POLICY_PROVISIONED; + case POLICY_ACTIVE: + return Policy.RuleState.POLICY_ACTIVE; + case POLICY_ENFORCED: + return Policy.RuleState.POLICY_ENFORCED; + case POLICY_INEFFECTIVE: + return Policy.RuleState.POLICY_INEFFECTIVE; + case POLICY_EFFECTIVE: + return Policy.RuleState.POLICY_EFFECTIVE; + case POLICY_UPDATED: + return Policy.RuleState.POLICY_UPDATED; + case POLICY_REMOVED: + return Policy.RuleState.POLICY_REMOVED; + case POLICY_UNDEFINED: + return Policy.RuleState.POLICY_UNDEFINED; + default: + return Policy.RuleState.UNRECOGNIZED; + } + } + + public RuleState deserialize(Policy.RuleState serializedRuleState) { + switch (serializedRuleState) { + case POLICY_INSERTED: + return RuleState.POLICY_INSERTED; + case POLICY_VALIDATED: + return RuleState.POLICY_VALIDATED; + case POLICY_PROVISIONED: + return RuleState.POLICY_PROVISIONED; + case POLICY_ACTIVE: + return RuleState.POLICY_ACTIVE; + case POLICY_ENFORCED: + return RuleState.POLICY_ENFORCED; + case POLICY_INEFFECTIVE: + return RuleState.POLICY_INEFFECTIVE; + case POLICY_EFFECTIVE: + return RuleState.POLICY_EFFECTIVE; + case POLICY_UPDATED: + return RuleState.POLICY_UPDATED; + case POLICY_REMOVED: + return RuleState.POLICY_REMOVED; + case POLICY_FAILED: + return RuleState.POLICY_FAILED; + case POLICY_UNDEFINED: + case UNRECOGNIZED: + default: + return RuleState.POLICY_UNDEFINED; + } + } + + public Policy.PolicyRuleState serialize(PolicyRuleState policyRuleState) { + final var builder = Policy.PolicyRuleState.newBuilder(); + + final var ruleState = policyRuleState.getRuleState(); + + final var serializedRuleState = serialize(ruleState); + + builder.setPolicyRuleState(serializedRuleState); + + return builder.build(); + } + + public PolicyRuleState deserialize(Policy.PolicyRuleState serializedPolicyRuleState) { + final var serializedRuleState = serializedPolicyRuleState.getPolicyRuleState(); + + final var ruleState = deserialize(serializedRuleState); + + return new PolicyRuleState(ruleState); + } + + public PolicyCondition.NumericalOperator serialize(NumericalOperator numericalOperator) { + switch (numericalOperator) { + case POLICY_RULE_CONDITION_NUMERICAL_EQUAL: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_EQUAL; + case POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL; + case POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN; + case POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL; + case POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN; + case POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL; + case POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED: + return PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED; + default: + return PolicyCondition.NumericalOperator.UNRECOGNIZED; + } + } + + public NumericalOperator deserialize( + PolicyCondition.NumericalOperator serializedNumericalOperator) { + switch (serializedNumericalOperator) { + case POLICYRULE_CONDITION_NUMERICAL_EQUAL: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_EQUAL; + case POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL; + case POLICYRULE_CONDITION_NUMERICAL_LESS_THAN: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN; + case POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL; + case POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN; + case POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL; + case POLICYRULE_CONDITION_NUMERICAL_UNDEFINED: + case UNRECOGNIZED: + default: + return NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED; + } + } + + public Monitoring.KpiValue serializeStringKpiValue(KpiValue kpiValue) { + final var builder = Monitoring.KpiValue.newBuilder(); + + return builder.setStringVal(kpiValue.getValue()).build(); + } + + public String deserializeStringKpiValue(Monitoring.KpiValue serializedKpiValue) { + + return serializedKpiValue.getStringVal(); + } + + public Monitoring.KpiValue serializeBooleanKpiValue(KpiValue kpiValue) { + final var builder = Monitoring.KpiValue.newBuilder(); + + return builder.setBoolVal(kpiValue.getValue()).build(); + } + + public boolean deserializeBooleanKpiValue(Monitoring.KpiValue serializedKpiValue) { + + return serializedKpiValue.getBoolVal(); + } + + public Monitoring.KpiValue serializeFloatKpiValue(KpiValue kpiValue) { + final var builder = Monitoring.KpiValue.newBuilder(); + + return builder.setFloatVal(kpiValue.getValue()).build(); + } + + public float deserializeFloatKpiValue(Monitoring.KpiValue serializedKpiValue) { + + return serializedKpiValue.getFloatVal(); + } + + public Monitoring.KpiValue serializeIntegerKpiValue(KpiValue kpiValue) { + final var builder = Monitoring.KpiValue.newBuilder(); + + return builder.setIntVal(kpiValue.getValue()).build(); + } + + public int deserializeIntegerKpiValue(Monitoring.KpiValue serializedKpiValue) { + + return serializedKpiValue.getIntVal(); + } + + public Monitoring.KpiValue serialize(KpiValue kpiValue) { + final var builder = Monitoring.KpiValue.newBuilder(); + + if (kpiValue.getValue() instanceof Integer) { + final var serializedIntegerKpiValue = serializeIntegerKpiValue((KpiValue) kpiValue); + builder.setIntVal(serializedIntegerKpiValue.getIntVal()); + } + if (kpiValue.getValue() instanceof Float) { + final var serializedFloatKpiValue = serializeFloatKpiValue((KpiValue) kpiValue); + builder.setFloatVal(serializedFloatKpiValue.getFloatVal()); + } + if (kpiValue.getValue() instanceof String) { + final var serializedStringKpiValue = serializeStringKpiValue((KpiValue) kpiValue); + builder.setStringVal(serializedStringKpiValue.getStringVal()); + } + if (kpiValue.getValue() instanceof Boolean) { + final var serializedBooleanKpiValue = serializeBooleanKpiValue((KpiValue) kpiValue); + builder.setBoolVal(serializedBooleanKpiValue.getBoolVal()); + } + + return builder.build(); + } + + public KpiValue deserialize(Monitoring.KpiValue serializedKpiValue) { + + final var typeOfKpiValue = serializedKpiValue.getValueCase(); + + switch (typeOfKpiValue) { + case INTVAL: + final var intValue = deserializeIntegerKpiValue(serializedKpiValue); + return new IntegerKpiValue(intValue); + case BOOLVAL: + final var booleanValue = deserializeBooleanKpiValue(serializedKpiValue); + return new BooleanKpiValue(booleanValue); + case FLOATVAL: + final var floatValue = deserializeFloatKpiValue(serializedKpiValue); + return new FloatKpiValue(floatValue); + case STRINGVAL: + final var stringValue = deserializeStringKpiValue(serializedKpiValue); + return new StringKpiValue(stringValue); + default: + case VALUE_NOT_SET: + throw new IllegalStateException("Kpi value not set"); + } + } + + public Monitoring.KpiValueRange serialize(KpiValueRange kpiValueRange) { + final var builder = Monitoring.KpiValueRange.newBuilder(); + + final var kpiValueMin = kpiValueRange.getKpiMinValue(); + final var kpiValueMax = kpiValueRange.getKpiMaxValue(); + + final var serializedKpiValueMin = serialize(kpiValueMin); + final var serializedKpiValueMax = serialize(kpiValueMax); + + builder.setKpiMinValue(serializedKpiValueMin); + builder.setKpiMaxValue(serializedKpiValueMax); + + return builder.build(); + } + + public KpiValueRange deserialize(Monitoring.KpiValueRange serializedKpiValueRange) { + final var serializedMinKpiValue = serializedKpiValueRange.getKpiMinValue(); + final var serializedMaxKpiValue = serializedKpiValueRange.getKpiMaxValue(); + + final var minKpiValue = deserialize(serializedMinKpiValue); + final var maxKpiValue = deserialize(serializedMaxKpiValue); + + return new KpiValueRange(minKpiValue, maxKpiValue); + } + + public AlarmID serializeAlarmId(String alarmId) { + final var builder = Monitoring.AlarmID.newBuilder(); + + final var serializedAlarmIdUuid = serializeUuid(alarmId); + builder.setAlarmId(serializedAlarmIdUuid); + + return builder.build(); + } + + public String deserialize(AlarmID serializedAlarmId) { + final var serializedAlarmIdUuid = serializedAlarmId.getAlarmId(); + + return deserialize(serializedAlarmIdUuid); + } + + public Monitoring.AlarmDescriptor serialize(AlarmDescriptor alarmDescriptor) { + final var builder = Monitoring.AlarmDescriptor.newBuilder(); + + final var alarmDescription = alarmDescriptor.getAlarmDescription(); + final var name = alarmDescriptor.getName(); + final var kpiId = alarmDescriptor.getKpiId(); + final var kpiValueRange = alarmDescriptor.getKpiValueRange(); + final var timestamp = alarmDescriptor.getTimestamp(); + + final var serializedKpiIdUuid = serializeUuid(kpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + final var serializedKpiValueRange = serialize(kpiValueRange); + + builder.setAlarmDescription(alarmDescription); + builder.setName(name); + builder.setKpiId(serializedKpiId); + builder.setKpiValueRange(serializedKpiValueRange); + builder.setTimestamp(timestamp); + + return builder.build(); + } + + public AlarmDescriptor deserialize(Monitoring.AlarmDescriptor serializedAlarmDescriptor) { + + final var alarmDescription = serializedAlarmDescriptor.getAlarmDescription(); + final var name = serializedAlarmDescriptor.getName(); + final var serializedKpiId = serializedAlarmDescriptor.getKpiId(); + final var serializedKpiValueRange = serializedAlarmDescriptor.getKpiValueRange(); + final var timestamp = serializedAlarmDescriptor.getTimestamp(); + + final var kpiId = deserialize(serializedKpiId); + final var kpiValueRange = deserialize(serializedKpiValueRange); + + return new AlarmDescriptor(alarmDescription, name, kpiId, kpiValueRange, timestamp); + } + + public Monitoring.AlarmResponse serialize(AlarmResponse alarmResponse) { + final var builder = Monitoring.AlarmResponse.newBuilder(); + + final var alarmId = alarmResponse.getAlarmId(); + final var text = alarmResponse.getText(); + final var kpiValue = alarmResponse.getKpiValue(); + + final var serializedAlarmIdUuid = serializeUuid(alarmId); + final var serializedAlarmId = + Monitoring.AlarmID.newBuilder().setAlarmId(serializedAlarmIdUuid).build(); + final var serializedKpiValue = serialize(kpiValue); + + builder.setAlarmId(serializedAlarmId); + builder.setText(text); + builder.setKpiValue(serializedKpiValue); + + return builder.build(); + } + + public AlarmResponse deserialize(Monitoring.AlarmResponse serializedAlarmResponse) { + final var serializedAlarmId = serializedAlarmResponse.getAlarmId().getAlarmId(); + final var text = serializedAlarmResponse.getText(); + final var serializedKpiValue = serializedAlarmResponse.getKpiValue(); + + final var alarmId = deserialize(serializedAlarmId); + final var kpiValue = deserialize(serializedKpiValue); + + return new AlarmResponse(alarmId, text, kpiValue); + } + + public Monitoring.SubsDescriptor serialize(SubsDescriptor subDescriptor) { + final var builder = Monitoring.SubsDescriptor.newBuilder(); + + final var kpiId = subDescriptor.getKpiId(); + final var samplingDurationS = subDescriptor.getSamplingDurationS(); + final var samplingIntervalS = subDescriptor.getSamplingIntervalS(); + final var startDate = subDescriptor.getStartDate(); + final var endDate = subDescriptor.getEndDate(); + + final var serializedKpiIdUuid = serializeUuid(kpiId); + final var serializedKpiId = Monitoring.KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + + builder.setKpiId(serializedKpiId); + builder.setSamplingDurationS(samplingDurationS); + builder.setSamplingIntervalS(samplingIntervalS); + builder.setStartDate(startDate); + builder.setEndDate(endDate); + + return builder.build(); + } + + public SubsDescriptor deserialize(Monitoring.SubsDescriptor serializedSubDescriptor) { + final var serializedKpiId = serializedSubDescriptor.getKpiId(); + final var samplingDurationS = serializedSubDescriptor.getSamplingDurationS(); + final var samplingIntervalS = serializedSubDescriptor.getSamplingIntervalS(); + final var startDate = serializedSubDescriptor.getStartDate(); + final var endDate = serializedSubDescriptor.getEndDate(); + + final var kpiId = deserialize(serializedKpiId); + + return new SubsDescriptor(kpiId, samplingDurationS, samplingIntervalS, startDate, endDate); + } + + public SubscriptionID serializeSubscriptionIdId(String subscriptionId) { + final var builder = Monitoring.SubscriptionID.newBuilder(); + + final var serializedSubscriptionIdUuid = serializeUuid(subscriptionId); + builder.setSubsId(serializedSubscriptionIdUuid); + + return builder.build(); + } + + public String deserialize(SubscriptionID serializedSubscriptionId) { + final var serializedSubscriptionIdUuid = serializedSubscriptionId.getSubsId(); + + return deserialize(serializedSubscriptionIdUuid); + } + + public PolicyCondition.PolicyRuleCondition serialize(PolicyRuleCondition policyRuleCondition) { + final var builder = PolicyCondition.PolicyRuleCondition.newBuilder(); + + final var policyRuleConditionKpiId = policyRuleCondition.getKpiId(); + final var numericalOperator = policyRuleCondition.getNumericalOperator(); + final var policyRuleConditionKpiValue = policyRuleCondition.getKpiValue(); + + final var serializedKpiIdUuid = serializeUuid(policyRuleConditionKpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + final var serializedNumericalOperator = serialize(numericalOperator); + final var serializedPolicyRuleConditionKpiValue = serialize(policyRuleConditionKpiValue); + + builder.setKpiId(serializedKpiId); + builder.setNumericalOperator(serializedNumericalOperator); + builder.setKpiValue(serializedPolicyRuleConditionKpiValue); + + return builder.build(); + } + + public PolicyRuleCondition deserialize( + PolicyCondition.PolicyRuleCondition serializedPolicyRuleCondition) { + + final var serializedPolicyRuleConditionKpiId = + serializedPolicyRuleCondition.getKpiId().getKpiId(); + final var serializedNumericalOperator = serializedPolicyRuleCondition.getNumericalOperator(); + final var serializedPolicyRuleConditionKpiValue = serializedPolicyRuleCondition.getKpiValue(); + + final var policyRuleConditionKpiId = deserialize(serializedPolicyRuleConditionKpiId); + final var numericalOperator = deserialize(serializedNumericalOperator); + final var policyRuleConditionKpiValue = deserialize(serializedPolicyRuleConditionKpiValue); + + return new PolicyRuleCondition( + policyRuleConditionKpiId, numericalOperator, policyRuleConditionKpiValue); + } + + public PolicyAction.PolicyRuleActionEnum serialize(PolicyRuleActionEnum policyRuleActionEnum) { + switch (policyRuleActionEnum) { + case POLICY_RULE_ACTION_SET_DEVICE_STATUS: + return PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_SET_DEVICE_STATUS; + case POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE: + return PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE; + case POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT: + return PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT; + case POLICY_RULE_ACTION_NO_ACTION: + return PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION; + default: + return PolicyAction.PolicyRuleActionEnum.UNRECOGNIZED; + } + } + + public PolicyRuleActionEnum deserialize( + PolicyAction.PolicyRuleActionEnum serializePolicyRuleActionEnum) { + switch (serializePolicyRuleActionEnum) { + case POLICYRULE_ACTION_SET_DEVICE_STATUS: + return PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS; + case POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE: + return PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE; + case POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT: + return PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT; + case POLICYRULE_ACTION_NO_ACTION: + case UNRECOGNIZED: + default: + return PolicyRuleActionEnum.POLICY_RULE_ACTION_NO_ACTION; + } + } + + public PolicyAction.PolicyRuleAction serialize(PolicyRuleAction policyRuleAction) { + final var builder = PolicyAction.PolicyRuleAction.newBuilder(); + + final var policyRuleActionEnum = policyRuleAction.getPolicyRuleActionEnum(); + final var policyRuleActionParameters = policyRuleAction.getPolicyRuleActionParameters(); + + final var serializedPolicyRuleActionEnum = serialize(policyRuleActionEnum); + + builder.setAction(serializedPolicyRuleActionEnum); + builder.addAllParameters(policyRuleActionParameters); + + return builder.build(); + } + + public PolicyRuleAction deserialize(PolicyAction.PolicyRuleAction serializedPolicyRuleAction) { + final var serializedPolicyRuleActionEnum = serializedPolicyRuleAction.getAction(); + final var policyRuleActionParameters = serializedPolicyRuleAction.getParametersList(); + + final var policyRuleActionEnum = deserialize(serializedPolicyRuleActionEnum); + + return new PolicyRuleAction(policyRuleActionEnum, policyRuleActionParameters); + } + + public PolicyCondition.BooleanOperator serialize(BooleanOperator booleanOperator) { + switch (booleanOperator) { + case POLICYRULE_CONDITION_BOOLEAN_AND: + return PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND; + case POLICYRULE_CONDITION_BOOLEAN_OR: + return PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR; + case POLICYRULE_CONDITION_BOOLEAN_UNDEFINED: + return PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED; + default: + return PolicyCondition.BooleanOperator.UNRECOGNIZED; + } + } + + public BooleanOperator deserialize(PolicyCondition.BooleanOperator serializedBooleanOperator) { + switch (serializedBooleanOperator) { + case POLICYRULE_CONDITION_BOOLEAN_OR: + return BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR; + case POLICYRULE_CONDITION_BOOLEAN_AND: + return BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND; + case POLICYRULE_CONDITION_BOOLEAN_UNDEFINED: + case UNRECOGNIZED: + default: + return BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED; + } + } + + public Policy.PolicyRuleBasic serialize(PolicyRuleBasic policyRuleBasic) { + final var builder = Policy.PolicyRuleBasic.newBuilder(); + + final var policyRuleId = policyRuleBasic.getPolicyRuleId(); + final var policyRuleState = policyRuleBasic.getPolicyRuleState(); + final var priority = policyRuleBasic.getPriority(); + final var policyRuleConditions = policyRuleBasic.getPolicyRuleConditions(); + final var booleanOperator = policyRuleBasic.getBooleanOperator(); + final var policyRuleActions = policyRuleBasic.getPolicyRuleActions(); + + final var serializedPolicyRuleId = serializePolicyRuleId(policyRuleId); + final var serializedPolicyRuleState = serialize(policyRuleState); + final var serializedPolicyRuleConditions = + policyRuleConditions.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedBooleanOperator = serialize(booleanOperator); + final var serializedPolicyRuleActions = + policyRuleActions.stream().map(this::serialize).collect(Collectors.toList()); + + builder.setPolicyRuleId(serializedPolicyRuleId); + builder.setPolicyRuleState(serializedPolicyRuleState); + builder.setPriority(priority); + builder.addAllConditionList(serializedPolicyRuleConditions); + builder.setBooleanOperator(serializedBooleanOperator); + builder.addAllActionList(serializedPolicyRuleActions); + + return builder.build(); + } + + public PolicyRuleBasic deserialize(Policy.PolicyRuleBasic serializedPolicyRuleBasic) { + final var serializedPolicyRuleId = serializedPolicyRuleBasic.getPolicyRuleId(); + final var serializedPolicyRuleState = serializedPolicyRuleBasic.getPolicyRuleState(); + final var priority = serializedPolicyRuleBasic.getPriority(); + final var serializedPolicyRuleConditions = serializedPolicyRuleBasic.getConditionListList(); + final var serializedBooleanOperator = serializedPolicyRuleBasic.getBooleanOperator(); + final var serializedPolicyRuleActions = serializedPolicyRuleBasic.getActionListList(); + + final var policyRuleId = deserialize(serializedPolicyRuleId); + final var policyRuleState = deserialize(serializedPolicyRuleState); + final var policyRuleConditions = + serializedPolicyRuleConditions.stream().map(this::deserialize).collect(Collectors.toList()); + final var booleanOperator = deserialize(serializedBooleanOperator); + final var policyRuleActions = + serializedPolicyRuleActions.stream().map(this::deserialize).collect(Collectors.toList()); + + return new PolicyRuleBasic( + policyRuleId, + policyRuleState, + priority, + policyRuleConditions, + booleanOperator, + policyRuleActions); + } + + public Policy.PolicyRuleService serialize(PolicyRuleService policyRuleService) { + final var builder = Policy.PolicyRuleService.newBuilder(); + + final var policyRuleBasic = policyRuleService.getPolicyRuleBasic(); + final var policyRuleServiceId = policyRuleService.getServiceId(); + final var policyRuleDeviceIds = policyRuleService.getDeviceIds(); + + final var serializedPolicyRuleBasic = serialize(policyRuleBasic); + final var serializedPolicyRuleServiceId = serialize(policyRuleServiceId); + final var serializedPolicyRuleDeviceIds = + policyRuleDeviceIds.stream().map(this::serializeDeviceId).collect(Collectors.toList()); + + builder.setPolicyRuleBasic(serializedPolicyRuleBasic); + builder.setServiceId(serializedPolicyRuleServiceId); + builder.addAllDeviceList(serializedPolicyRuleDeviceIds); + + return builder.build(); + } + + public PolicyRuleService deserialize(Policy.PolicyRuleService serializedPolicyRuleService) { + final var serializedPolicyRuleBasic = serializedPolicyRuleService.getPolicyRuleBasic(); + final var serializedPolicyRuleServiceId = serializedPolicyRuleService.getServiceId(); + final var serializedPolicyRuleDeviceIds = serializedPolicyRuleService.getDeviceListList(); + + final var policyRuleBasic = deserialize(serializedPolicyRuleBasic); + final var policyRuleServiceId = deserialize(serializedPolicyRuleServiceId); + final var policyRuleDeviceIds = + serializedPolicyRuleDeviceIds.stream().map(this::deserialize).collect(Collectors.toList()); + + return new PolicyRuleService(policyRuleBasic, policyRuleServiceId, policyRuleDeviceIds); + } + + public Policy.PolicyRuleDevice serialize(PolicyRuleDevice policyRuleDevice) { + final var builder = Policy.PolicyRuleDevice.newBuilder(); + + final var policyRuleBasic = policyRuleDevice.getPolicyRuleBasic(); + final var policyRuleDeviceIds = policyRuleDevice.getDeviceIds(); + + final var serializedPolicyRuleBasic = serialize(policyRuleBasic); + final var serializedPolicyRuleDeviceIds = + policyRuleDeviceIds.stream().map(this::serializeDeviceId).collect(Collectors.toList()); + + builder.setPolicyRuleBasic(serializedPolicyRuleBasic); + builder.addAllDeviceList(serializedPolicyRuleDeviceIds); + + return builder.build(); + } + + public PolicyRuleDevice deserialize(Policy.PolicyRuleDevice serializedPolicyRuleDevice) { + final var serializedPolicyRuleBasic = serializedPolicyRuleDevice.getPolicyRuleBasic(); + final var serializedPolicyRuleDeviceIds = serializedPolicyRuleDevice.getDeviceListList(); + + final var policyRuleBasic = deserialize(serializedPolicyRuleBasic); + final var policyRuleDeviceIds = + serializedPolicyRuleDeviceIds.stream().map(this::deserialize).collect(Collectors.toList()); + + return new PolicyRuleDevice(policyRuleBasic, policyRuleDeviceIds); + } + + public KpiId serializeKpiId(String kpiId) { + final var builder = Monitoring.KpiId.newBuilder(); + + final var serializedKpiIdUuid = serializeUuid(kpiId); + builder.setKpiId(serializedKpiIdUuid); + + return builder.build(); + } + + public String deserialize(KpiId serializedKpiId) { + final var serializedKpiIdUuid = serializedKpiId.getKpiId(); + + return deserialize(serializedKpiIdUuid); + } + + public Monitoring.Kpi serialize(Kpi kpi) { + final var builder = Monitoring.Kpi.newBuilder(); + + final var kpiId = kpi.getKpiId(); + final var timestamp = kpi.getTimestamp(); + final var kpiValue = kpi.getKpiValue(); + + final var serializedKpiId = serializeKpiId(kpiId); + final var serializedKpiValue = serialize(kpiValue); + + builder.setKpiId(serializedKpiId); + builder.setTimestamp(timestamp); + builder.setKpiValue(serializedKpiValue); + + return builder.build(); + } + + public Kpi deserialize(Monitoring.Kpi serializedKpi) { + + final var serializedKpiId = serializedKpi.getKpiId(); + final var timestamp = serializedKpi.getTimestamp(); + final var serializedKpiValue = serializedKpi.getKpiValue(); + + final var kpiId = deserialize(serializedKpiId); + final var kpiValue = deserialize(serializedKpiValue); + + return new Kpi(kpiId, timestamp, kpiValue); + } + + public List serialize(List kpis) { + List serializedKpis = new ArrayList<>(); + + for (Kpi kpi : kpis) { + final var serializedKpi = serialize(kpi); + + serializedKpis.add(serializedKpi); + } + return serializedKpis; + } + + public List deserialize(List serializedKpis) { + List kpis = new ArrayList<>(); + + for (Monitoring.Kpi serializedKpi : serializedKpis) { + final var kpi = deserialize(serializedKpi); + + kpis.add(kpi); + } + return kpis; + } + + public Monitoring.KpiDescriptor serialize(KpiDescriptor kpiDescriptor) { + final var builder = Monitoring.KpiDescriptor.newBuilder(); + + final var kpiDescriptorDescription = kpiDescriptor.getKpiDescription(); + final var kpiDescriptorKpiSampleType = kpiDescriptor.getKpiSampleType(); + final var kpiDescriptorDeviceId = kpiDescriptor.getDeviceId(); + final var kpiDescriptorEndPointId = kpiDescriptor.getEndPointId(); + final var kpiDescriptorServiceId = kpiDescriptor.getServiceId(); + final var kpiDescriptorSliceId = kpiDescriptor.getSliceId(); + + final var serializedKpiDescriptorKpiSampleType = serialize(kpiDescriptorKpiSampleType); + final var serializedKpiDescriptorDeviceId = serializeDeviceId(kpiDescriptorDeviceId); + final var serializedKpiDescriptorEndPointId = serialize(kpiDescriptorEndPointId); + final var serializedKpiDescriptorServiceId = serialize(kpiDescriptorServiceId); + final var serializedKpiDescriptorSliceId = serialize(kpiDescriptorSliceId); + + builder.setKpiDescription(kpiDescriptorDescription); + builder.setKpiSampleType(serializedKpiDescriptorKpiSampleType); + builder.setDeviceId(serializedKpiDescriptorDeviceId); + builder.setEndpointId(serializedKpiDescriptorEndPointId); + builder.setServiceId(serializedKpiDescriptorServiceId); + builder.setSliceId(serializedKpiDescriptorSliceId); + + return builder.build(); + } + + public KpiDescriptor deserialize(Monitoring.KpiDescriptor serializedKpiDescriptor) { + + final var serializedKpiDescriptorDescription = serializedKpiDescriptor.getKpiDescription(); + final var serializedKpiDescriptorKpiSampleType = serializedKpiDescriptor.getKpiSampleType(); + final var serializedKpiDescriptorDeviceId = serializedKpiDescriptor.getDeviceId(); + final var serializedKpiDescriptorEndPointId = serializedKpiDescriptor.getEndpointId(); + final var serializedKpiDescriptorServiceId = serializedKpiDescriptor.getServiceId(); + final var serializedKpiDescriptorSLiceId = serializedKpiDescriptor.getSliceId(); + + final var kpiSampleType = deserialize(serializedKpiDescriptorKpiSampleType); + final var deviceId = deserialize(serializedKpiDescriptorDeviceId); + final var endPointId = deserialize(serializedKpiDescriptorEndPointId); + final var serviceId = deserialize(serializedKpiDescriptorServiceId); + final var sliceId = deserialize(serializedKpiDescriptorSLiceId); + + return new KpiDescriptor( + serializedKpiDescriptorDescription, + kpiSampleType, + deviceId, + endPointId, + serviceId, + sliceId); + } + + public ContextOuterClass.DeviceConfig serialize(DeviceConfig deviceConfig) { + final var builder = ContextOuterClass.DeviceConfig.newBuilder(); + + final var serializedConfigRules = + deviceConfig.getConfigRules().stream().map(this::serialize).collect(Collectors.toList()); + builder.addAllConfigRules(serializedConfigRules); + + return builder.build(); + } + + public DeviceConfig deserialize(ContextOuterClass.DeviceConfig deviceConfig) { + final var configRules = + deviceConfig.getConfigRulesList().stream() + .map(this::deserialize) + .collect(Collectors.toList()); + + return new DeviceConfig(configRules); + } + + public ContextOuterClass.DeviceOperationalStatusEnum serialize(DeviceOperationalStatus opStatus) { + switch (opStatus) { + case ENABLED: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED; + case DISABLED: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED; + case UNDEFINED: + default: + return DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED; + } + } + + public DeviceOperationalStatus deserialize( + ContextOuterClass.DeviceOperationalStatusEnum opStatus) { + switch (opStatus) { + case DEVICEOPERATIONALSTATUS_ENABLED: + return DeviceOperationalStatus.ENABLED; + case DEVICEOPERATIONALSTATUS_DISABLED: + return DeviceOperationalStatus.DISABLED; + case DEVICEOPERATIONALSTATUS_UNDEFINED: + case UNRECOGNIZED: + default: + return DeviceOperationalStatus.UNDEFINED; + } + } + + public ContextOuterClass.DeviceDriverEnum serialize(DeviceDriverEnum deviceDriverEnum) { + switch (deviceDriverEnum) { + case OPENCONFIG: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG; + case TRANSPORT_API: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API; + case P4: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4; + case IETF_NETWORK_TOPOLOGY: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; + case ONF_TR_352: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352; + case UNDEFINED: + default: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED; + } + } + + public DeviceDriverEnum deserialize( + ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) { + switch (serializedDeviceDriverEnum) { + case DEVICEDRIVER_OPENCONFIG: + return DeviceDriverEnum.OPENCONFIG; + case DEVICEDRIVER_TRANSPORT_API: + return DeviceDriverEnum.TRANSPORT_API; + case DEVICEDRIVER_P4: + return DeviceDriverEnum.P4; + case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY: + return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY; + case DEVICEDRIVER_ONF_TR_352: + return DeviceDriverEnum.ONF_TR_352; + case DEVICEDRIVER_UNDEFINED: + case UNRECOGNIZED: + default: + return DeviceDriverEnum.UNDEFINED; + } + } + + public ContextOuterClass.EndPoint serialize(EndPoint endPoint) { + final var builder = ContextOuterClass.EndPoint.newBuilder(); + + final var endPointId = endPoint.getEndPointId(); + final var endPointType = endPoint.getEndPointType(); + final var kpiSampleTypes = endPoint.getKpiSampleTypes(); + final var endPointLocation = endPoint.getEndPointLocation(); + + final var serializedEndPointId = serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream().map(this::serialize).collect(Collectors.toList()); + if (endPointLocation != null) { + final var serializedEndPointLocation = serialize(endPointLocation); + builder.setEndpointLocation(serializedEndPointLocation); + } + + builder.setEndpointId(serializedEndPointId); + builder.setEndpointType(endPointType); + builder.addAllKpiSampleTypes(serializedKpiSampleTypes); + + return builder.build(); + } + + public EndPoint deserialize(ContextOuterClass.EndPoint serializedEndPoint) { + final var serializedEndPointId = serializedEndPoint.getEndpointId(); + final var endPointType = serializedEndPoint.getEndpointType(); + final var serializedKpiSampleTypes = serializedEndPoint.getKpiSampleTypesList(); + final var serializedEndPointLocation = serializedEndPoint.getEndpointLocation(); + + final var endPointId = deserialize(serializedEndPointId); + final var kpiSampleTypes = + serializedKpiSampleTypes.stream().map(this::deserialize).collect(Collectors.toList()); + + if (serializedEndPointLocation.getLocationCase() != LocationCase.LOCATION_NOT_SET) { + final var endPointLocation = deserialize(serializedEndPointLocation); + return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes) + .location(endPointLocation) + .build(); + } + + return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build(); + } + + public ContextOuterClass.Device serialize(Device device) { + final var builder = ContextOuterClass.Device.newBuilder(); + + final var deviceIdUuid = serializeUuid(device.getDeviceId()); + final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceIdUuid); + final var deviceType = device.getDeviceType(); + final var deviceConfig = device.getDeviceConfig(); + final var deviceOperationalStatus = device.getDeviceOperationalStatus(); + final var deviceDrivers = device.getDeviceDrivers(); + final var deviceEndPoints = device.getEndPoints(); + + final var serializedDeviceConfig = serialize(deviceConfig); + final var serializedDeviceOperationalStatus = serialize(deviceOperationalStatus); + final var serializedDeviceDrivers = + deviceDrivers.stream().map(this::serialize).collect(Collectors.toList()); + final var serializedDeviceEndPoints = + deviceEndPoints.stream().map(this::serialize).collect(Collectors.toList()); + + builder.setDeviceId(deviceId); + builder.setDeviceType(deviceType); + builder.setDeviceConfig(serializedDeviceConfig); + builder.setDeviceOperationalStatus(serializedDeviceOperationalStatus); + builder.addAllDeviceDrivers(serializedDeviceDrivers); + builder.addAllDeviceEndpoints(serializedDeviceEndPoints); + + return builder.build(); + } + + public Device deserialize(ContextOuterClass.Device device) { + + final var serializedDeviceId = device.getDeviceId(); + final var deviceType = device.getDeviceType(); + final var serializedDeviceConfig = device.getDeviceConfig(); + final var serializedDeviceOperationalStatus = device.getDeviceOperationalStatus(); + final var serializedDeviceDrivers = device.getDeviceDriversList(); + final var serializedDeviceEndPoints = device.getDeviceEndpointsList(); + + final var deviceId = deserialize(serializedDeviceId); + final var deviceConfig = deserialize(serializedDeviceConfig); + final var deviceOperationalStatus = deserialize(serializedDeviceOperationalStatus); + final var deviceDrivers = + serializedDeviceDrivers.stream().map(this::deserialize).collect(Collectors.toList()); + final var deviceEndPoints = + serializedDeviceEndPoints.stream().map(this::deserialize).collect(Collectors.toList()); + + return new Device( + deviceId, + deviceType, + deviceConfig, + deviceOperationalStatus, + deviceDrivers, + deviceEndPoints); + } + + public ContextOuterClass.Empty serializeEmpty(Empty empty) { + + final var builder = ContextOuterClass.Empty.newBuilder(); + + return builder.build(); + } + + public Empty deserializeEmpty(ContextOuterClass.Empty serializedEmpty) { + return new Empty(); + } + + public Uuid serializeUuid(String uuid) { + return Uuid.newBuilder().setUuid(uuid).build(); + } + + public String deserialize(Uuid uuid) { + return uuid.getUuid(); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java b/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java index 8619e304c77d1f557e62f4db69a8f7fb21b05c00..bee4157d08ada23e738282e5f7732c1db99a9dee 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java +++ b/src/policy/src/main/java/eu/teraflow/policy/SimpleLivenessCheck.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; import javax.enterprise.context.ApplicationScoped; @@ -11,6 +27,6 @@ public class SimpleLivenessCheck implements HealthCheck { @Override public HealthCheckResponse call() { - return HealthCheckResponse.up("Policy Service"); + return HealthCheckResponse.up("Policy Service is live"); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java b/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..0fe0c43b0cf98fd6a9432ed26ff57f03e1816095 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/SimpleReadinessCheck.java @@ -0,0 +1,32 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import javax.enterprise.context.ApplicationScoped; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.Readiness; + +@Readiness +@ApplicationScoped +public class SimpleReadinessCheck implements HealthCheck { + + @Override + public HealthCheckResponse call() { + return HealthCheckResponse.up("Policy Service is ready"); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclAction.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclAction.java new file mode 100644 index 0000000000000000000000000000000000000000..66771968ceb5525558bebfd95c3e13af24b4d2dd --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclAction.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public class AclAction { + + private final AclForwardActionEnum aclForwardActionEnum; + private final AclLogActionEnum aclLogActionEnum; + + public AclAction(AclForwardActionEnum aclForwardActionEnum, AclLogActionEnum aclLogActionEnum) { + this.aclForwardActionEnum = aclForwardActionEnum; + this.aclLogActionEnum = aclLogActionEnum; + } + + public AclForwardActionEnum getAclForwardActionEnum() { + return aclForwardActionEnum; + } + + public AclLogActionEnum getAclLogActionEnum() { + return aclLogActionEnum; + } + + @Override + public String toString() { + return String.format( + "%s:{aclForwardActionEnum:\"%s\", aclLogActionEnum:\"%s\"}", + getClass().getSimpleName(), aclForwardActionEnum.toString(), aclLogActionEnum.toString()); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclEntry.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclEntry.java new file mode 100644 index 0000000000000000000000000000000000000000..a85aff9e6c28b1a63e28d62de22e01e354b47ce3 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclEntry.java @@ -0,0 +1,55 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public class AclEntry { + + private final int sequenceId; + private final String description; + private final AclMatch match; + private final AclAction action; + + public AclEntry(int sequenceId, String description, AclMatch match, AclAction action) { + this.sequenceId = sequenceId; + this.description = description; + this.match = match; + this.action = action; + } + + public int getSequenceId() { + return sequenceId; + } + + public String getDescription() { + return description; + } + + public AclMatch getMatch() { + return match; + } + + public AclAction getAction() { + return action; + } + + @Override + public String toString() { + return String.format( + "%s:{sequenceId:\"%d\", description:\"%s\", %s, %s}", + getClass().getSimpleName(), sequenceId, description, match, action); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclForwardActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclForwardActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..be2a896b48a77543232bdd41685d9d0ed8290711 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclForwardActionEnum.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public enum AclForwardActionEnum { + UNDEFINED, + DROP, + ACCEPT, + REJECT, +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclLogActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclLogActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..e0ff362e7154307f934ed0afbfcfa77adcd49acb --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclLogActionEnum.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public enum AclLogActionEnum { + UNDEFINED, + NO_LOG, + SYSLOG +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclMatch.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclMatch.java new file mode 100644 index 0000000000000000000000000000000000000000..89528a58dde8d39c6bc777fe9220dce85c855a65 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclMatch.java @@ -0,0 +1,95 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public class AclMatch { + + private final int dscp; + private final int protocol; + private final String srcAddress; + private final String dstAddress; + private final int srcPort; + private final int dstPort; + private final int startMplsLabel; + private final int endMplsLabel; + + public AclMatch( + int dscp, + int protocol, + String srcAddress, + String dstAddress, + int srcPort, + int dstPort, + int startMplsLabel, + int endMplsLabel) { + this.dscp = dscp; + this.protocol = protocol; + this.srcAddress = srcAddress; + this.dstAddress = dstAddress; + this.srcPort = srcPort; + this.dstPort = dstPort; + this.startMplsLabel = startMplsLabel; + this.endMplsLabel = endMplsLabel; + } + + public int getDscp() { + return dscp; + } + + public int getProtocol() { + return protocol; + } + + public String getSrcAddress() { + return srcAddress; + } + + public String getDstAddress() { + return dstAddress; + } + + public int getSrcPort() { + return srcPort; + } + + public int getDstPort() { + return dstPort; + } + + public int getStartMplsLabel() { + return startMplsLabel; + } + + public int getEndMplsLabel() { + return endMplsLabel; + } + + @Override + public String toString() { + return String.format( + "%s:{dscp:\"%d\", protocol:\"%d\", srcAddress:\"%s\", dstAddress:\"%s\", srcPort:\"%d\", dstPort:\"%d\", startMplsLabel:\"%d\", endMplsLabel:\"%d\"}", + getClass().getSimpleName(), + dscp, + protocol, + srcAddress, + dstAddress, + srcPort, + dstPort, + startMplsLabel, + endMplsLabel); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleSet.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleSet.java new file mode 100644 index 0000000000000000000000000000000000000000..4eec8e7a31fb8bad151f6ad9f7704a8246d78d1e --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleSet.java @@ -0,0 +1,74 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class AclRuleSet { + + private final String name; + private final AclRuleTypeEnum type; + private final String description; + private final String userId; + private final List entries; + + public AclRuleSet( + String name, + AclRuleTypeEnum type, + String description, + String userId, + List entries) { + this.name = name; + this.type = type; + this.description = description; + this.userId = userId; + this.entries = entries; + } + + public String getName() { + return name; + } + + public AclRuleTypeEnum getType() { + return type; + } + + public String getDescription() { + return description; + } + + public String getUserId() { + return userId; + } + + public List getEntries() { + return entries; + } + + @Override + public String toString() { + return String.format( + "%s:{name:\"%s\", type:\"%s\", description:\"%s\", userId:\"%s\", [%s]}", + getClass().getSimpleName(), + name, + type.toString(), + description, + userId, + Util.toString(entries)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleTypeEnum.java b/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleTypeEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..0dc11277140d5d092cbc3d4dd0b23f21ce855e65 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/acl/AclRuleTypeEnum.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.acl; + +public enum AclRuleTypeEnum { + UNDEFINED, + IPV4, + IPV6, + L2, + MPLS, + MIXED +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/common/Util.java b/src/policy/src/main/java/eu/teraflow/policy/common/Util.java new file mode 100644 index 0000000000000000000000000000000000000000..2fe37e47e806de047d53241bddead5b686bc5329 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/common/Util.java @@ -0,0 +1,13 @@ +package eu.teraflow.policy.common; + +import java.util.List; +import java.util.stream.Collectors; + +public class Util { + + private Util() {} + + public static String toString(List list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java b/src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java new file mode 100644 index 0000000000000000000000000000000000000000..1f1c2446aeeec7e2dc62d8732187255df8c477a1 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/ContextGateway.java @@ -0,0 +1,38 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context; + +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.model.PolicyRuleBasic; +import io.smallrye.mutiny.Uni; + +public interface ContextGateway { + + // Context related methods + Uni getService(ServiceId serviceId); + + Uni setService(Service service); + + Uni getDevice(String deviceId); + + // Context-policy related methods + Uni getPolicyRule(String policyRuleId); + + Uni setPolicyRule(PolicyRuleBasic policyRuleBasic); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java b/src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..6185b4e9a334f5b5c24faec348877c352e945511 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/ContextGatewayImpl.java @@ -0,0 +1,99 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context; + +import context.MutinyContextServiceGrpc.MutinyContextServiceStub; +import context_policy.MutinyContextPolicyServiceGrpc.MutinyContextPolicyServiceStub; +import eu.teraflow.policy.Serializer; +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.model.PolicyRuleBasic; +import io.quarkus.grpc.GrpcClient; +import io.smallrye.mutiny.Uni; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +@ApplicationScoped +public class ContextGatewayImpl implements ContextGateway { + + @GrpcClient("context") + MutinyContextServiceStub streamingDelegateContext; + + // TODO remove client when RPCs declared in context_policy.proto are moved in context.proto + // and use streamingDelegateContext for all methods + @GrpcClient("context_policy") + MutinyContextPolicyServiceStub streamingDelegateContextPolicy; + + private final Serializer serializer; + + @Inject + public ContextGatewayImpl(Serializer serializer) { + this.serializer = serializer; + } + + @Override + public Uni getService(ServiceId serviceId) { + + final var serializedServiceId = serializer.serialize(serviceId); + + return streamingDelegateContext + .getService(serializedServiceId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni setService(Service service) { + final var serializedService = serializer.serialize(service); + + return streamingDelegateContext + .setService(serializedService) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni getDevice(String deviceId) { + final var serializedDeviceId = serializer.serializeDeviceId(deviceId); + + return streamingDelegateContext + .getDevice(serializedDeviceId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni getPolicyRule(String policyRuleId) { + final var serializedPolicyRuleId = serializer.serializePolicyRuleId(policyRuleId); + + return streamingDelegateContextPolicy + .getPolicyRule(serializedPolicyRuleId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni setPolicyRule(PolicyRuleBasic policyRuleBasic) { + final var serializedPolicyRuleBasic = serializer.serialize(policyRuleBasic); + + return streamingDelegateContextPolicy + .setPolicyRule(serializedPolicyRuleBasic) + .onItem() + .transform(serializer::deserialize); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java b/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java index ce3a46158115ffb1d06243c4f4fdd849aa72f81e..133318a05bad7f8a2fd4b7d2ae423e1375d34287 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/ContextService.java @@ -1,3 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context; -public interface ContextService {} +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.model.PolicyRuleBasic; +import io.smallrye.mutiny.Uni; + +public interface ContextService { + + Uni getService(ServiceId serviceId); + + Uni setService(Service service); + + Uni getDevice(String deviceId); + + Uni getPolicyRule(String policyRuleId); + + Uni setPolicyRule(PolicyRuleBasic policyRuleBasic); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..bb5c8d61bd5f73375b531f43bcfb744dc5bf2c20 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/ContextServiceImpl.java @@ -0,0 +1,61 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context; + +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.model.PolicyRuleBasic; +import io.smallrye.mutiny.Uni; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +@ApplicationScoped +public class ContextServiceImpl implements ContextService { + + private final ContextGateway contextGateway; + + @Inject + public ContextServiceImpl(ContextGateway contextGateway) { + this.contextGateway = contextGateway; + } + + @Override + public Uni getService(ServiceId serviceId) { + return contextGateway.getService(serviceId); + } + + @Override + public Uni setService(Service service) { + return contextGateway.setService(service); + } + + @Override + public Uni getDevice(String deviceId) { + return contextGateway.getDevice(deviceId); + } + + @Override + public Uni getPolicyRule(String policyRuleId) { + return contextGateway.getPolicyRule(policyRuleId); + } + + @Override + public Uni setPolicyRule(PolicyRuleBasic policyRuleBasic) { + return contextGateway.setPolicyRule(policyRuleBasic); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..6cc8e844182505ed104fae7766c1ea63474c7929 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigActionEnum.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum ConfigActionEnum { + UNDEFINED, + SET, + DELETE +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java new file mode 100644 index 0000000000000000000000000000000000000000..38b2aa29bba6e43c736f0d9abd9b3243c5470d56 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRule.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConfigRule { + + private final ConfigActionEnum configActionEnum; + private final ConfigRuleType configRuleType; + + public ConfigRule(ConfigActionEnum configActionEnum, ConfigRuleType configRuleType) { + this.configActionEnum = configActionEnum; + this.configRuleType = configRuleType; + } + + public ConfigActionEnum getConfigActionEnum() { + return configActionEnum; + } + + public ConfigRuleType getConfigRuleType() { + return configRuleType; + } + + @Override + public String toString() { + return String.format( + "%s:{configActionEnum:\"%s\", %s}", + getClass().getSimpleName(), configActionEnum.toString(), configRuleType); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleAcl.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleAcl.java new file mode 100644 index 0000000000000000000000000000000000000000..ab05331c76f7daa178bd748cfb62dd1b7c3e915a --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleAcl.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.acl.AclRuleSet; + +public class ConfigRuleAcl { + + private final EndPointId endPointId; + private final AclRuleSet ruleSet; + + public ConfigRuleAcl(EndPointId endPointId, AclRuleSet ruleSet) { + this.endPointId = endPointId; + this.ruleSet = ruleSet; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public AclRuleSet getRuleSet() { + return ruleSet; + } + + @Override + public String toString() { + return String.format("%s:{%s, %s}", getClass().getSimpleName(), endPointId, ruleSet); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..0046286179c4c20425bd028ede2465d2604d534f --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleCustom.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConfigRuleCustom { + + private final String resourceKey; + private final String resourceValue; + + public ConfigRuleCustom(String resourceKey, String resourceValue) { + this.resourceKey = resourceKey; + this.resourceValue = resourceValue; + } + + public String getResourceKey() { + return resourceKey; + } + + public String getResourceValue() { + return resourceValue; + } + + @Override + public String toString() { + return String.format( + "%s:{resourceKey:\"%s\", resourceValue:\"%s\"}", + getClass().getSimpleName(), resourceKey, resourceValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleType.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleType.java new file mode 100644 index 0000000000000000000000000000000000000000..6b7daa12893fc75fdb797ec5e20e2300850ec146 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleType.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public interface ConfigRuleType { + + public T getConfigRuleType(); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java new file mode 100644 index 0000000000000000000000000000000000000000..3a93cc7f33f1e60f9d36b6fae333556339298207 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeAcl.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConfigRuleTypeAcl implements ConfigRuleType { + + private final ConfigRuleAcl configRuleAcl; + + public ConfigRuleTypeAcl(ConfigRuleAcl configRuleAcl) { + this.configRuleAcl = configRuleAcl; + } + + @Override + public ConfigRuleAcl getConfigRuleType() { + return this.configRuleAcl; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), configRuleAcl); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..c98df91c4027f9ea0089261504ffeeda23d56aea --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConfigRuleTypeCustom.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConfigRuleTypeCustom implements ConfigRuleType { + + private final ConfigRuleCustom configRuleCustom; + + public ConfigRuleTypeCustom(ConfigRuleCustom configRuleCustom) { + this.configRuleCustom = configRuleCustom; + } + + @Override + public ConfigRuleCustom getConfigRuleType() { + return this.configRuleCustom; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), configRuleCustom); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java new file mode 100644 index 0000000000000000000000000000000000000000..a7097bc0bfe9ac72e1dd74ed272559ad8bc3e231 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Constraint.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class Constraint { + + private final ConstraintType constraintType; + + public Constraint(ConstraintType constraintType) { + this.constraintType = constraintType; + } + + public ConstraintType getConstraintType() { + return constraintType; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintType); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..3fe3443cca7315613784781040d4be7a988daa54 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintCustom.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintCustom { + + private final String constraintType; + private final String constraintValue; + + public ConstraintCustom(String constraintType, String constraintValue) { + this.constraintType = constraintType; + this.constraintValue = constraintValue; + } + + public String getConstraintType() { + return constraintType; + } + + public String getConstraintValue() { + return constraintValue; + } + + @Override + public String toString() { + return String.format( + "%s:{constraintType:\"%s\", constraintValue:\"%s\"}", + getClass().getSimpleName(), constraintType, constraintValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java new file mode 100644 index 0000000000000000000000000000000000000000..12e6ec41c3095529f9807b5449309d966814e3c1 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintEndPointLocation.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintEndPointLocation { + + private final EndPointId endPointId; + private final Location location; + + public ConstraintEndPointLocation(EndPointId endPointId, Location location) { + this.endPointId = endPointId; + this.location = location; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public Location getLocation() { + return location; + } + + @Override + public String toString() { + return String.format("%s:{%s, %s}", getClass().getSimpleName(), endPointId, location); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java new file mode 100644 index 0000000000000000000000000000000000000000..b374c022cf85c27f191e3d2607ed13b8078241ba --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSchedule.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintSchedule { + + private final float startTimestamp; + private final float durationDays; + + public ConstraintSchedule(float startTimestamp, float durationDays) { + this.startTimestamp = startTimestamp; + this.durationDays = durationDays; + } + + public float getStartTimestamp() { + return startTimestamp; + } + + public float getDurationDays() { + return durationDays; + } + + @Override + public String toString() { + return String.format( + "%s:{startTimestamp:\"%f\", durationDays:\"%f\"}", + getClass().getSimpleName(), startTimestamp, durationDays); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java new file mode 100644 index 0000000000000000000000000000000000000000..c8a69f3120eb183f5d0b34c73d9653afe1bd7ce3 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaAvailability.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintSlaAvailability { + + private final int numDisjointPaths; + private final boolean allActive; + + public ConstraintSlaAvailability(int numDisjointPaths, boolean allActive) { + this.numDisjointPaths = numDisjointPaths; + this.allActive = allActive; + } + + public int getNumDisjointPaths() { + return numDisjointPaths; + } + + public boolean isAllActive() { + return allActive; + } + + @Override + public String toString() { + return String.format( + "%s:{numDisjointPaths:%d, allActive:%b}", + getClass().getSimpleName(), numDisjointPaths, allActive); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java new file mode 100644 index 0000000000000000000000000000000000000000..3d3f9a25b6dd7eae7dd27a846549b325b72b6cd2 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaCapacity.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintSlaCapacity { + + private final float capacityGbps; + + public ConstraintSlaCapacity(float capacityGbps) { + this.capacityGbps = capacityGbps; + } + + public float getCapacityGbps() { + return capacityGbps; + } + + @Override + public String toString() { + return String.format("%s:{capacityGbps:\"%f\"}", getClass().getSimpleName(), capacityGbps); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java new file mode 100644 index 0000000000000000000000000000000000000000..d965e2f420479f6a0922a13f04c67db724b53924 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaIsolationLevel.java @@ -0,0 +1,40 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class ConstraintSlaIsolationLevel { + + private final List isolationLevelEnums; + + public ConstraintSlaIsolationLevel(List isolationLevelEnums) { + this.isolationLevelEnums = isolationLevelEnums; + } + + public List getIsolationLevelEnums() { + return isolationLevelEnums; + } + + @Override + public String toString() { + return String.format( + "%s:{isolationLevelEnums:\"%s\"}", + getClass().getSimpleName(), Util.toString(isolationLevelEnums)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java new file mode 100644 index 0000000000000000000000000000000000000000..0f0c8fe20816394b450bdcd092206b3d7c257b89 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintSlaLatency.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintSlaLatency { + + private final float e2eLatencyMs; + + public ConstraintSlaLatency(float e2eLatencyMs) { + this.e2eLatencyMs = e2eLatencyMs; + } + + public float getE2eLatencyMs() { + return e2eLatencyMs; + } + + @Override + public String toString() { + return String.format("%s:{e2eLatencyMs:\"%f\"}", getClass().getSimpleName(), e2eLatencyMs); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java new file mode 100644 index 0000000000000000000000000000000000000000..e582859e6858a531e3a2c918deaed4d12d8618e4 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintType.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public interface ConstraintType { + + public T getConstraintType(); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java new file mode 100644 index 0000000000000000000000000000000000000000..94d0052a9ee4faef3c65856f59c5d1b7e8448b99 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeCustom.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeCustom implements ConstraintType { + + private final ConstraintCustom constraintCustom; + + public ConstraintTypeCustom(ConstraintCustom constraintCustom) { + this.constraintCustom = constraintCustom; + } + + @Override + public ConstraintCustom getConstraintType() { + return this.constraintCustom; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintCustom); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java new file mode 100644 index 0000000000000000000000000000000000000000..197bea58a6c9471a0ff1d50815cbb5ca75db9392 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeEndPointLocation.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeEndPointLocation implements ConstraintType { + private final ConstraintEndPointLocation constraintEndPointLocation; + + public ConstraintTypeEndPointLocation(ConstraintEndPointLocation constraintEndPointLocation) { + this.constraintEndPointLocation = constraintEndPointLocation; + } + + @Override + public ConstraintEndPointLocation getConstraintType() { + return this.constraintEndPointLocation; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintEndPointLocation); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java new file mode 100644 index 0000000000000000000000000000000000000000..20169427ac81d5d631cf92faf33b13f06947468c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSchedule.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeSchedule implements ConstraintType { + private final ConstraintSchedule constraintSchedule; + + public ConstraintTypeSchedule(ConstraintSchedule constraintSchedule) { + this.constraintSchedule = constraintSchedule; + } + + @Override + public ConstraintSchedule getConstraintType() { + return this.constraintSchedule; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintSchedule); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java new file mode 100644 index 0000000000000000000000000000000000000000..10a60e8dce42a3031cac0a666ee1f4decc9814c8 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaAvailability.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeSlaAvailability implements ConstraintType { + + private final ConstraintSlaAvailability constraintSlaAvailability; + + public ConstraintTypeSlaAvailability(ConstraintSlaAvailability constraintSlaAvailability) { + this.constraintSlaAvailability = constraintSlaAvailability; + } + + @Override + public ConstraintSlaAvailability getConstraintType() { + return this.constraintSlaAvailability; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintSlaAvailability); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java new file mode 100644 index 0000000000000000000000000000000000000000..c43cc5948c31317226cd3233b5c63ab7716222ed --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaCapacity.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeSlaCapacity implements ConstraintType { + + private final ConstraintSlaCapacity constraintSlaCapacity; + + public ConstraintTypeSlaCapacity(ConstraintSlaCapacity constraintSlaCapacity) { + this.constraintSlaCapacity = constraintSlaCapacity; + } + + @Override + public ConstraintSlaCapacity getConstraintType() { + return this.constraintSlaCapacity; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintSlaCapacity); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java new file mode 100644 index 0000000000000000000000000000000000000000..572df6e45a11ccb4f9a6ef55bad26ec512e0e8f3 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaIsolationLevel.java @@ -0,0 +1,37 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeSlaIsolationLevel + implements ConstraintType { + + private final ConstraintSlaIsolationLevel constraintSlaIsolationLevel; + + public ConstraintTypeSlaIsolationLevel(ConstraintSlaIsolationLevel constraintSlaIsolationLevel) { + this.constraintSlaIsolationLevel = constraintSlaIsolationLevel; + } + + @Override + public ConstraintSlaIsolationLevel getConstraintType() { + return this.constraintSlaIsolationLevel; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintSlaIsolationLevel); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java new file mode 100644 index 0000000000000000000000000000000000000000..2ff80daa53283e0ed3f80095d61c55626093fb64 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ConstraintTypeSlaLatency.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ConstraintTypeSlaLatency implements ConstraintType { + + private final ConstraintSlaLatency constraintSlaLatency; + + public ConstraintTypeSlaLatency(ConstraintSlaLatency constraintSlaLatency) { + this.constraintSlaLatency = constraintSlaLatency; + } + + @Override + public ConstraintSlaLatency getConstraintType() { + return this.constraintSlaLatency; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), constraintSlaLatency); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java deleted file mode 100644 index c1390aaf7f45a8ca77ee2d5f9a86a8f84b629018..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ContextId.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.context.model; - -public class ContextId { - - private final Uuid contextId; - - public ContextId(Uuid contextId) { - this.contextId = contextId; - } - - public Uuid getContextId() { - return contextId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java new file mode 100644 index 0000000000000000000000000000000000000000..b00fd235cbcd2c65606d357646fa41bd10716569 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Device.java @@ -0,0 +1,83 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class Device { + + private final String deviceId; + private final String deviceType; + private DeviceConfig deviceConfig; + private DeviceOperationalStatus deviceOperationalStatus; + private List deviceDrivers; + private List endPoints; + + public Device( + String deviceId, + String deviceType, + DeviceConfig deviceConfig, + DeviceOperationalStatus deviceOperationalStatus, + List deviceDrivers, + List endPoints) { + + this.deviceId = deviceId; + this.deviceType = deviceType; + this.deviceConfig = deviceConfig; + this.deviceOperationalStatus = deviceOperationalStatus; + this.deviceDrivers = deviceDrivers; + this.endPoints = endPoints; + } + + public String getDeviceId() { + return deviceId; + } + + public String getDeviceType() { + return deviceType; + } + + public DeviceConfig getDeviceConfig() { + return deviceConfig; + } + + public DeviceOperationalStatus getDeviceOperationalStatus() { + return deviceOperationalStatus; + } + + public List getDeviceDrivers() { + return deviceDrivers; + } + + public List getEndPoints() { + return endPoints; + } + + @Override + public String toString() { + return String.format( + "%s:{deviceId:\"%s\", deviceType:\"%s\", %s, deviceOperationalStatus=\"%s\", [%s], [%s]}", + getClass().getSimpleName(), + deviceId, + deviceType, + deviceConfig, + deviceOperationalStatus.toString(), + Util.toString(deviceDrivers), + Util.toString(endPoints)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..e6fa702dd66c9ee315856f08cb85910b4da78ce1 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceConfig.java @@ -0,0 +1,39 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class DeviceConfig { + + private final List configRules; + + public DeviceConfig(List configRules) { + + this.configRules = configRules; + } + + public List getConfigRules() { + return configRules; + } + + @Override + public String toString() { + return String.format("%s:{[%s]}", getClass().getSimpleName(), Util.toString(configRules)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..c98fc1fce545974a8067db2667ec1e519a058ae2 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum DeviceDriverEnum { + UNDEFINED, + OPENCONFIG, + TRANSPORT_API, + P4, + IETF_NETWORK_TOPOLOGY, + ONF_TR_352 +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java deleted file mode 100644 index aed8752b67075387a4b04a7dd1d7c91895e5fc7f..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.context.model; - -public class DeviceId { - - private final Uuid deviceId; - - public DeviceId(Uuid deviceId) { - this.deviceId = deviceId; - } - - public Uuid getDeviceId() { - return deviceId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceOperationalStatus.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceOperationalStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..2efe9052ec96decc74bd1f5a254fd32bca88a9e8 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceOperationalStatus.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum DeviceOperationalStatus { + UNDEFINED, + DISABLED, + ENABLED +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Empty.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Empty.java new file mode 100644 index 0000000000000000000000000000000000000000..d19dd9776e9688999007761e969e5c1b53d37176 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Empty.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class Empty { + + public Empty() { + // Empty constructor to represent the Empty rpc message of context service + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPoint.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPoint.java new file mode 100644 index 0000000000000000000000000000000000000000..b40952b85a39226738e03261be0084acd0155b22 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPoint.java @@ -0,0 +1,105 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; +import java.util.List; + +public class EndPoint { + private final EndPointId endPointId; + private final String endPointType; + private final List kpiSampleTypes; + private final Location endPointLocation; + + EndPoint(EndPointBuilder builder) { + this.endPointId = builder.endPointId; + this.endPointType = builder.endPointType; + this.kpiSampleTypes = builder.kpiSampleTypes; + this.endPointLocation = builder.endPointLocation; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public String getEndPointType() { + return endPointType; + } + + public List getKpiSampleTypes() { + return kpiSampleTypes; + } + + public Location getEndPointLocation() { + return endPointLocation; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, endPointType:\"%s\", [%s], %s}", + getClass().getSimpleName(), + endPointId, + endPointType, + Util.toString(kpiSampleTypes), + endPointLocation); + } + + public static class EndPointBuilder { + private final EndPointId endPointId; + private final String endPointType; + private final List kpiSampleTypes; + private Location endPointLocation; + + public EndPointBuilder( + EndPointId endPointId, String endPointType, List kpiSampleTypes) { + this.endPointId = endPointId; + this.endPointType = endPointType; + this.kpiSampleTypes = kpiSampleTypes; + } + + public EndPointBuilder location(Location endPointLocation) { + this.endPointLocation = endPointLocation; + return this; + } + + public EndPoint build() { + EndPoint endPoint = new EndPoint(this); + validateEndPointObject(endPoint); + return endPoint; + } + + private void validateEndPointObject(EndPoint endPoint) { + final var validatedEndPointId = endPoint.getEndPointId(); + final var validatedEndPointType = endPoint.getEndPointType(); + final var validatedKpiSampleTypes = endPoint.getKpiSampleTypes(); + + if (validatedEndPointId == null) { + throw new IllegalStateException("EndPoint ID cannot be null"); + } + + if (validatedEndPointType == null) { + throw new IllegalStateException("EndPoint type cannot be null"); + } + + if (validatedKpiSampleTypes == null) { + throw new IllegalStateException("Kpi sample types cannot be null"); + } + } + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java new file mode 100644 index 0000000000000000000000000000000000000000..e9a3cbeb074eb166452b94c8b87db5edd17f346c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/EndPointId.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class EndPointId { + + private final TopologyId topologyId; + private final String deviceId; + private final String id; + + public EndPointId(TopologyId topologyId, String deviceId, String id) { + this.topologyId = topologyId; + this.deviceId = deviceId; + this.id = id; + } + + public TopologyId getTopologyId() { + return topologyId; + } + + public String getDeviceId() { + return deviceId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, deviceId:\"%s\", id:\"%s\"}", + getClass().getSimpleName(), topologyId, deviceId, id); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java index a13f4baf5b303236a26d51828945e3bd702106e5..67da36b5c075134051a56929a39d07579381551a 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Event.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; public class Event { @@ -17,4 +33,11 @@ public class Event { public EventTypeEnum getEventTypeEnum() { return eventType; } + + @Override + public String toString() { + return String.format( + "%s:{timestamp:\"%f\", eventType:\"%s\"}", + getClass().getSimpleName(), timestamp, eventType.toString()); + } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java index 70a47815ddbb5f9e9c78c1dd67c1e681461caeb7..2a45a89a7b026ad17ff12c8a725ebab0ed0c0af5 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/EventTypeEnum.java @@ -1,3 +1,19 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; public enum EventTypeEnum { diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/GpsPosition.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/GpsPosition.java new file mode 100644 index 0000000000000000000000000000000000000000..f5d7b488490c08a2c049ef301b3ecb3290da4ccc --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/GpsPosition.java @@ -0,0 +1,42 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class GpsPosition { + + private final float latitude; + private final float longitude; + + public GpsPosition(float latitude, float longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public float getLatitude() { + return latitude; + } + + public float getLongitude() { + return longitude; + } + + @Override + public String toString() { + return String.format( + "%s:{latitude:\"%f\", longitude:\"%f\"}", getClass().getSimpleName(), latitude, longitude); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..f7c3a12673ea1e12d2a82e3ddf3c6f8f916ee0db --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/IsolationLevelEnum.java @@ -0,0 +1,29 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum IsolationLevelEnum { + NO_ISOLATION, + PHYSICAL_ISOLATION, + LOGICAL_ISOLATION, + PROCESS_ISOLATION, + PHYSICAL_MEMORY_ISOLATION, + PHYSICAL_NETWORK_ISOLATION, + VIRTUAL_RESOURCE_ISOLATION, + NETWORK_FUNCTIONS_ISOLATION, + SERVICE_ISOLATION +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Location.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Location.java new file mode 100644 index 0000000000000000000000000000000000000000..692e1f01b71d6205d2b6eb9d78dad2b0d3e1bcf4 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Location.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class Location { + + private final LocationType locationType; + + public Location(LocationType locationType) { + this.locationType = locationType; + } + + public LocationType getLocationType() { + return locationType; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), locationType); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationType.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationType.java new file mode 100644 index 0000000000000000000000000000000000000000..49bf9e9af37eff86a1a6717d0bbd8924f01e2d31 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationType.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public interface LocationType { + + public T getLocationType(); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java new file mode 100644 index 0000000000000000000000000000000000000000..4bc44cc4e8c098e1347f43f38f6eafae325da1ee --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeGpsPosition.java @@ -0,0 +1,19 @@ +package eu.teraflow.policy.context.model; + +public class LocationTypeGpsPosition implements LocationType { + private final GpsPosition gpsPosition; + + public LocationTypeGpsPosition(GpsPosition gpsPosition) { + this.gpsPosition = gpsPosition; + } + + @Override + public GpsPosition getLocationType() { + return this.gpsPosition; + } + + @Override + public String toString() { + return String.format("%s:{%s}", getClass().getSimpleName(), gpsPosition); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeRegion.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeRegion.java new file mode 100644 index 0000000000000000000000000000000000000000..f857aa507439465dc3c3d7b3e514b8ed1185b532 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/LocationTypeRegion.java @@ -0,0 +1,35 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class LocationTypeRegion implements LocationType { + private final String region; + + public LocationTypeRegion(String region) { + this.region = region; + } + + @Override + public String getLocationType() { + return this.region; + } + + @Override + public String toString() { + return String.format("%s:{region:\"%s\"}", getClass().getSimpleName(), region); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..e61179bcfa1dcc1736d81362f434fda01003696a --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/Service.java @@ -0,0 +1,90 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class Service { + + private final ServiceId serviceId; + private final ServiceTypeEnum serviceType; + private final List serviceEndPointIds; + private final List serviceConstraints; + private final ServiceStatus serviceStatus; + private final ServiceConfig serviceConfig; + private final double timestamp; + + public Service( + ServiceId serviceId, + ServiceTypeEnum serviceType, + List serviceEndPointIds, + List serviceConstraints, + ServiceStatus serviceStatus, + ServiceConfig serviceConfig, + double timestamp) { + this.serviceId = serviceId; + this.serviceType = serviceType; + this.serviceEndPointIds = serviceEndPointIds; + this.serviceConstraints = serviceConstraints; + this.serviceStatus = serviceStatus; + this.serviceConfig = serviceConfig; + this.timestamp = timestamp; + } + + public ServiceId getServiceId() { + return serviceId; + } + + public ServiceTypeEnum getServiceType() { + return serviceType; + } + + public List getServiceEndPointIds() { + return serviceEndPointIds; + } + + public List getServiceConstraints() { + return serviceConstraints; + } + + public ServiceStatus getServiceStatus() { + return serviceStatus; + } + + public ServiceConfig getServiceConfig() { + return serviceConfig; + } + + public double getTimestamp() { + return timestamp; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, serviceType:\"%s\", [%s], [%s], %s, %s, timestamp:\"%f\"}", + getClass().getSimpleName(), + serviceId, + serviceType.toString(), + Util.toString(serviceEndPointIds), + Util.toString(serviceConstraints), + serviceStatus, + serviceConfig, + timestamp); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..e2e9c8e242f56602030e809de6edce67ee524281 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceConfig.java @@ -0,0 +1,38 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class ServiceConfig { + + private final List configRules; + + public ServiceConfig(List configRules) { + this.configRules = configRules; + } + + public List getConfigRules() { + return configRules; + } + + @Override + public String toString() { + return String.format("%s:{[%s]}", getClass().getSimpleName(), Util.toString(configRules)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java index f76613ac4644a8e1867c2f8c0b15737e91695a12..6229c1de7541dc63e3d9f18706cf33c4b4df57e9 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceId.java @@ -1,21 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; public class ServiceId { - private final ContextId contextId; - private final Uuid serviceUuid; + private final String contextId; + private final String id; - public ServiceId(ContextId contextId, Uuid serviceUuid) { + public ServiceId(String contextId, String id) { this.contextId = contextId; - this.serviceUuid = serviceUuid; + this.id = id; } - public ContextId getContextId() { + public String getContextId() { return contextId; } - public Uuid getServiceUuid() { - return serviceUuid; + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java new file mode 100644 index 0000000000000000000000000000000000000000..e936f635c8f259d450b77588025e0b68e1ef7799 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatus.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class ServiceStatus { + + private final ServiceStatusEnum status; + + public ServiceStatus(ServiceStatusEnum status) { + this.status = status; + } + + public ServiceStatusEnum getServiceStatus() { + return status; + } + + @Override + public String toString() { + return String.format( + "%s:{serviceStatus:\"%s\"}", getClass().getSimpleName(), status.toString()); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..e39e2fa2c8b4e279a355221c0c246e142d38b51e --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceStatusEnum.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum ServiceStatusEnum { + UNDEFINED, + PLANNED, + ACTIVE, + PENDING_REMOVAL +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..f13a408f987f6e753e801e2ae804a8db8d951f4d --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/ServiceTypeEnum.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public enum ServiceTypeEnum { + UNKNOWN, + L3NM, + L2NM, + TAPI_CONNECTIVITY_SERVICE +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java new file mode 100644 index 0000000000000000000000000000000000000000..57dbe5ff9fac4e88560f8d1ccecf4b2113705afc --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/SliceId.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class SliceId { + private final String contextId; + private final String id; + + public SliceId(String contextId, String id) { + this.contextId = contextId; + this.id = id; + } + + public String getContextId() { + return contextId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java new file mode 100644 index 0000000000000000000000000000000000000000..95157ba8c6ec6ed3d91886282ef845f59e9f9d91 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/TopologyId.java @@ -0,0 +1,43 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.context.model; + +public class TopologyId { + + private final String contextId; + private final String id; + + public TopologyId(String contextId, String id) { + + this.contextId = contextId; + this.id = id; + } + + public String getContextId() { + return contextId; + } + + public String getId() { + return id; + } + + @Override + public String toString() { + return String.format( + "%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java deleted file mode 100644 index f805ce40a6c728dae39687f3b15d228a0c8abed3..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.context.model; - -public class Uuid { - - private String id; - - public Uuid(String id) { - this.id = id; - } - - public String getId() { - return id; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java b/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java new file mode 100644 index 0000000000000000000000000000000000000000..1bedde35212383e42c7fabfe832d4bd4df34e99b --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/kpi_sample_types/model/KpiSampleType.java @@ -0,0 +1,25 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.kpi_sample_types.model; + +public enum KpiSampleType { + UNKNOWN, + PACKETS_TRANSMITTED, + PACKETS_RECEIVED, + BYTES_TRANSMITTED, + BYTES_RECEIVED +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java b/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java new file mode 100644 index 0000000000000000000000000000000000000000..7231c02e5895ba08379abe39454259b79e1cc90a --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/BooleanOperator.java @@ -0,0 +1,23 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +public enum BooleanOperator { + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, + POLICYRULE_CONDITION_BOOLEAN_AND, + POLICYRULE_CONDITION_BOOLEAN_OR +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java b/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java new file mode 100644 index 0000000000000000000000000000000000000000..48029e550acf53f7b23816e3b2c409701ce03f30 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/NumericalOperator.java @@ -0,0 +1,27 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +public enum NumericalOperator { + POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, + POLICY_RULE_CONDITION_NUMERICAL_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL, + POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java deleted file mode 100644 index 17e403e6372891a6defc6b9fcc6cad03e546cb07..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRule.java +++ /dev/null @@ -1,67 +0,0 @@ -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.ContextId; -import eu.teraflow.policy.context.model.ServiceId; - -public class PolicyRule { - - private final PolicyRuleId policyRuleId; - private final PolicyRuleType policyRuleType; - private final PolicyRulePriority policyRulePriority; - private final PolicyRuleEvent policyRuleEvent; - private final PolicyRuleCondition policyRuleCondition; - private final PolicyRuleAction policyRuleAction; - private final ServiceId serviceId; - private final ContextId contextId; - - public PolicyRule( - PolicyRuleId policyRuleId, - PolicyRuleType policyRuleType, - PolicyRulePriority policyRulePriority, - PolicyRuleEvent policyRuleEvent, - PolicyRuleCondition policyRuleCondition, - PolicyRuleAction policyRuleAction, - ServiceId serviceId, - ContextId contextId) { - this.policyRuleId = policyRuleId; - this.policyRuleType = policyRuleType; - this.policyRulePriority = policyRulePriority; - this.policyRuleEvent = policyRuleEvent; - this.policyRuleCondition = policyRuleCondition; - this.policyRuleAction = policyRuleAction; - this.serviceId = serviceId; - this.contextId = contextId; - } - - public PolicyRuleId getPolicyRuleId() { - return policyRuleId; - } - - public PolicyRuleType getPolicyRuleType() { - return policyRuleType; - } - - public PolicyRulePriority getPolicyRulePriority() { - return policyRulePriority; - } - - public PolicyRuleEvent getPolicyRuleEvent() { - return policyRuleEvent; - } - - public PolicyRuleCondition getPolicyRuleCondition() { - return policyRuleCondition; - } - - public PolicyRuleAction getPolicyRuleAction() { - return policyRuleAction; - } - - public ServiceId getServiceId() { - return serviceId; - } - - public ContextId getContextId() { - return contextId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java index 2ad0a1cf78d704aca860f2c057a8135123e15a77..baa19cb8d0016895de9d5eccf5bd0e36d9659b61 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleAction.java @@ -1,21 +1,51 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; +import java.util.List; +import java.util.stream.Collectors; + public class PolicyRuleAction { - private final PolicyRuleVariable policyRuleVariable; - private final PolicyRuleValue policyRuleValue; + private final PolicyRuleActionEnum policyRuleActionEnum; + private final List parameters; + + public PolicyRuleAction(PolicyRuleActionEnum policyRuleActionEnum, List parameters) { - public PolicyRuleAction(PolicyRuleVariable policyRuleVariable, PolicyRuleValue policyRuleValue) { + this.policyRuleActionEnum = policyRuleActionEnum; + this.parameters = parameters; + } + + public PolicyRuleActionEnum getPolicyRuleActionEnum() { + return policyRuleActionEnum; + } - this.policyRuleVariable = policyRuleVariable; - this.policyRuleValue = policyRuleValue; + public List getPolicyRuleActionParameters() { + return parameters; } - public PolicyRuleVariable getPolicyRuleVariable() { - return policyRuleVariable; + @Override + public String toString() { + return String.format( + "%s:{policyRuleActionEnum:\"%s\", [%s]}", + getClass().getSimpleName(), policyRuleActionEnum.toString(), toString(parameters)); } - public PolicyRuleValue getPolicyRuleValue() { - return policyRuleValue; + private String toString(List list) { + return list.stream().map(T::toString).collect(Collectors.joining(", ")); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java new file mode 100644 index 0000000000000000000000000000000000000000..7d9354a05ff42b556caefdcf635234d706da8352 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleActionEnum.java @@ -0,0 +1,24 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +public enum PolicyRuleActionEnum { + POLICY_RULE_ACTION_NO_ACTION, + POLICY_RULE_ACTION_SET_DEVICE_STATUS, + POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java new file mode 100644 index 0000000000000000000000000000000000000000..b32d3cf3008611ea67aee53f5234f1e45b98be8c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleBasic.java @@ -0,0 +1,95 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class PolicyRuleBasic { + + private final String policyRuleId; + private final PolicyRuleState policyRuleState; + private final int priority; + private final List policyRuleConditions; + private final BooleanOperator booleanOperator; + private final List policyRuleActions; + + public PolicyRuleBasic( + String policyRuleId, + PolicyRuleState policyRuleState, + int priority, + List policyRuleConditions, + BooleanOperator booleanOperator, + List policyRuleActions) { + checkNotNull(policyRuleId, "Policy rule ID must not be null."); + checkArgument(!policyRuleId.isBlank(), "Policy rule ID must not be empty."); + this.policyRuleId = policyRuleId; + this.policyRuleState = policyRuleState; + checkArgument(priority >= 0, "Priority value must be greater or equal than zero."); + this.priority = priority; + checkNotNull(policyRuleConditions, "Policy Rule conditions cannot be null."); + checkArgument(!policyRuleConditions.isEmpty(), "Policy Rule conditions cannot be empty."); + this.policyRuleConditions = policyRuleConditions; + checkArgument( + booleanOperator != BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, + "Boolean operator cannot be undefined"); + this.booleanOperator = booleanOperator; + checkNotNull(policyRuleActions, "Policy Rule actions cannot be null."); + checkArgument(!policyRuleActions.isEmpty(), "Policy Rule actions cannot be empty."); + this.policyRuleActions = policyRuleActions; + } + + public String getPolicyRuleId() { + return policyRuleId; + } + + public PolicyRuleState getPolicyRuleState() { + return policyRuleState; + } + + public int getPriority() { + return priority; + } + + public List getPolicyRuleConditions() { + return policyRuleConditions; + } + + public BooleanOperator getBooleanOperator() { + return booleanOperator; + } + + public List getPolicyRuleActions() { + return policyRuleActions; + } + + @Override + public String toString() { + return String.format( + "%s:{policyRuleId:\"%s\", %s, priority:%d, [%s], booleanOperator:\"%s\", [%s]}", + getClass().getSimpleName(), + policyRuleId, + policyRuleState, + priority, + Util.toString(policyRuleConditions), + booleanOperator.toString(), + Util.toString(policyRuleActions)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java index e9430ba33b00ccba8a47ee599487f6868127e731..e835a818846a1cb87e1accc66a90ff2fa4c51b30 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleCondition.java @@ -1,22 +1,83 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import eu.teraflow.policy.monitoring.model.KpiValue; + public class PolicyRuleCondition { - private final PolicyRuleVariable policyRuleVariable; - private final PolicyRuleValue policyRuleValue; + private final String kpiId; + private final NumericalOperator numericalOperator; + private final KpiValue kpiValue; public PolicyRuleCondition( - PolicyRuleVariable policyRuleVariable, PolicyRuleValue policyRuleValue) { + String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + checkNotNull(kpiId, "Kpi ID must not be null."); + checkArgument(!kpiId.isBlank(), "Kpi ID must not be empty."); + this.kpiId = kpiId; + checkArgument( + numericalOperator != NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, + "Numerical operator cannot be undefined"); + this.numericalOperator = numericalOperator; + checkNotNull(kpiValue, "Kpi value must not be null."); + checkArgument( + isKpiValueValid(kpiValue), + "Kpi value must be: String, Float, Boolean or Integer but it was [%s].", + kpiValue.getValue().getClass().getName()); + this.kpiValue = kpiValue; + } + + public String getKpiId() { + return kpiId; + } - this.policyRuleVariable = policyRuleVariable; - this.policyRuleValue = policyRuleValue; + public NumericalOperator getNumericalOperator() { + return numericalOperator; } - public PolicyRuleVariable getPolicyRuleVariable() { - return policyRuleVariable; + public KpiValue getKpiValue() { + return kpiValue; + } + + private boolean isKpiValueValid(KpiValue kpiValue) { + final var kpiValueType = kpiValue.getValue(); + + if (kpiValueType instanceof String) { + return true; + } + + if (kpiValueType instanceof Boolean) { + return true; + } + + if (kpiValueType instanceof Integer) { + return true; + } + + return kpiValueType instanceof Float; } - public PolicyRuleValue getPolicyRuleValue() { - return policyRuleValue; + @Override + public String toString() { + return String.format( + "%s:{kpiId:\"%s\", numericalOperator:\"%s\", %s}", + getClass().getSimpleName(), kpiId, numericalOperator.toString(), kpiValue); } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java new file mode 100644 index 0000000000000000000000000000000000000000..6dbbe2e00949ca1cfbb00f2db4b2aa01981417c3 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleDevice.java @@ -0,0 +1,51 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import eu.teraflow.policy.common.Util; +import java.util.List; + +public class PolicyRuleDevice { + + private final PolicyRuleBasic policyRuleBasic; + private final List deviceIds; + + public PolicyRuleDevice(PolicyRuleBasic policyRuleBasic, List deviceIds) { + checkNotNull(policyRuleBasic, "PolicyRuleBasic must not be null."); + this.policyRuleBasic = policyRuleBasic; + checkNotNull(deviceIds, "Device Ids must not be null."); + checkArgument(!deviceIds.isEmpty(), "Device Ids must not be empty."); + this.deviceIds = deviceIds; + } + + public PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic; + } + + public List getDeviceIds() { + return deviceIds; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, [%s]}", getClass().getSimpleName(), policyRuleBasic, Util.toString(deviceIds)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java deleted file mode 100644 index 09906960376e9b5e44b8b76f6b18a99b4f361120..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.Event; - -public class PolicyRuleEvent { - - private final Event event; - - public PolicyRuleEvent(Event event) { - this.event = event; - } - - public Event getEvent() { - return event; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java deleted file mode 100644 index 27920ae4a8a7877212f229ec236010aacf67f47a..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleId.java +++ /dev/null @@ -1,16 +0,0 @@ -package eu.teraflow.policy.model; - -import eu.teraflow.policy.context.model.Uuid; - -public class PolicyRuleId { - - private final Uuid policyRuleId; - - public PolicyRuleId(Uuid policyRuleId) { - this.policyRuleId = policyRuleId; - } - - public Uuid getPolicyRuleId() { - return policyRuleId; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java deleted file mode 100644 index f9e42aef28f7ee43ee33e77d38a54dd92851ddbd..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRulePriority.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.model; - -public class PolicyRulePriority { - - private final int policyRulePriority; - - public PolicyRulePriority(int policyRulePriority) { - this.policyRulePriority = policyRulePriority; - } - - public int getPolicyRulePriority() { - return policyRulePriority; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java new file mode 100644 index 0000000000000000000000000000000000000000..fcdfffdb64ae68738adca5e417f7e852902c544b --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleService.java @@ -0,0 +1,59 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; + +import static com.google.common.base.Preconditions.checkNotNull; + +import eu.teraflow.policy.common.Util; +import eu.teraflow.policy.context.model.ServiceId; +import java.util.List; + +public class PolicyRuleService { + + private final PolicyRuleBasic policyRuleBasic; + private final ServiceId serviceId; + private final List deviceIds; + + public PolicyRuleService( + PolicyRuleBasic policyRuleBasic, ServiceId serviceId, List deviceIds) { + checkNotNull(policyRuleBasic, "PolicyRuleBasic must not be null."); + this.policyRuleBasic = policyRuleBasic; + checkNotNull(serviceId, "Service Id must not be null."); + this.serviceId = serviceId; + checkNotNull(deviceIds, "Device Ids must not be null."); + this.deviceIds = deviceIds; + } + + public PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic; + } + + public ServiceId getServiceId() { + return serviceId; + } + + public List getDeviceIds() { + return deviceIds; + } + + @Override + public String toString() { + return String.format( + "%s:{%s, %s, [%s]}", + getClass().getSimpleName(), policyRuleBasic, serviceId, Util.toString(deviceIds)); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java index 97d3280e3ab2dcec8e5c732315bd4562616ea370..566c3b785c05ed52060e907b7950dfa56b3452de 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleState.java @@ -1,22 +1,35 @@ -package eu.teraflow.policy.model; +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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. +*/ -import eu.teraflow.policy.context.model.Uuid; +package eu.teraflow.policy.model; public class PolicyRuleState { - private final Uuid policeRuleId; private final RuleState ruleState; - public PolicyRuleState(Uuid policeRuleId, RuleState ruleState) { - this.policeRuleId = policeRuleId; + public PolicyRuleState(RuleState ruleState) { this.ruleState = ruleState; } - public Uuid getPolicyRuleId() { - return policeRuleId; - } - public RuleState getRuleState() { return ruleState; } + + @Override + public String toString() { + return String.format("%s:{ruleState:\"%s\"}", getClass().getSimpleName(), ruleState.toString()); + } } diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java deleted file mode 100644 index 89dfd30013e2f9c2a86609c878f2ef59ce62e27a..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleType.java +++ /dev/null @@ -1,6 +0,0 @@ -package eu.teraflow.policy.model; - -public enum PolicyRuleType { - DEVICE, - NETWORK -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java deleted file mode 100644 index 60f7c00568905a0ee7cfa7eb1ababf85d310f79b..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleValue.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.model; - -public class PolicyRuleValue { - - private final String policyRuleValue; - - public PolicyRuleValue(String policyRuleValue) { - this.policyRuleValue = policyRuleValue; - } - - public String getPolicyRuleValue() { - return policyRuleValue; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java b/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java deleted file mode 100644 index 1998cb7c65289182d854ed3d14c76239e7d0ac5d..0000000000000000000000000000000000000000 --- a/src/policy/src/main/java/eu/teraflow/policy/model/PolicyRuleVariable.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.teraflow.policy.model; - -public class PolicyRuleVariable { - - private final String policyRuleVariable; - - public PolicyRuleVariable(String policyRuleVariable) { - this.policyRuleVariable = policyRuleVariable; - } - - public String getPolicyRuleVariable() { - return policyRuleVariable; - } -} diff --git a/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java b/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java index ec1ba135fee4a98d9b22f7ec2511c6769c8c693c..2d01a6b94004158b6e2a4d06fead888ad54b76b1 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java +++ b/src/policy/src/main/java/eu/teraflow/policy/model/RuleState.java @@ -1,7 +1,31 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.model; public enum RuleState { - POLICY_INACTIVE, - POLICY_PLANNED, - POLICY_ACTIVE + POLICY_UNDEFINED, + POLICY_FAILED, + POLICY_INSERTED, + POLICY_VALIDATED, + POLICY_PROVISIONED, + POLICY_ACTIVE, + POLICY_ENFORCED, + POLICY_INEFFECTIVE, + POLICY_EFFECTIVE, + POLICY_UPDATED, + POLICY_REMOVED } diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java new file mode 100644 index 0000000000000000000000000000000000000000..4b9849a7649894cb4109fb458dac611e834bd916 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGateway.java @@ -0,0 +1,48 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring; + +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; +import java.util.List; + +public interface MonitoringGateway { + + Uni createKpi(KpiDescriptor kpiDescriptor); + + Uni getKpiDescriptor(String kpiId); + + Multi> subscribeKpi(SubsDescriptor subsDescriptor); + + Uni getSubsDescriptor(String subscriptionId); + + Uni editKpiSubscription(SubsDescriptor subsDescriptor); + + Uni createKpiAlarm(AlarmDescriptor alarmDescriptor); + + Uni editKpiAlarm(AlarmDescriptor alarmDescriptor); + + Uni getAlarmDescriptor(String alarmId); + + Multi getAlarmResponseStream(String alarmId); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..e0b4e088a9e23387f56d956bed5f6e104a68ea56 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringGatewayImpl.java @@ -0,0 +1,136 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring; + +import eu.teraflow.policy.Serializer; +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import io.quarkus.grpc.GrpcClient; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import monitoring.MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub; + +@ApplicationScoped +public class MonitoringGatewayImpl implements MonitoringGateway { + + @GrpcClient("monitoring") + MutinyMonitoringServiceStub streamingDelegateMonitoring; + + private final Serializer serializer; + + @Inject + public MonitoringGatewayImpl(Serializer serializer) { + this.serializer = serializer; + } + + @Override + public Uni createKpi(KpiDescriptor kpiDescriptor) { + final var serializedKpiDescriptor = serializer.serialize(kpiDescriptor); + + return streamingDelegateMonitoring + .createKpi(serializedKpiDescriptor) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni getKpiDescriptor(String kpiId) { + final var serializedKpiId = serializer.serializeKpiId(kpiId); + + return streamingDelegateMonitoring + .getKpiDescriptor(serializedKpiId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Multi> subscribeKpi(SubsDescriptor subsDescriptor) { + final var serializedSubsDescriptor = serializer.serialize(subsDescriptor); + + return streamingDelegateMonitoring + .subscribeKpi(serializedSubsDescriptor) + .onItem() + .transform(kpiList -> serializer.deserialize(kpiList.getKpiListList())); + } + + @Override + public Uni getSubsDescriptor(String subscriptionId) { + final var serializedSubscriptionId = serializer.serializeSubscriptionIdId(subscriptionId); + + return streamingDelegateMonitoring + .getSubsDescriptor(serializedSubscriptionId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni editKpiSubscription(SubsDescriptor subsDescriptor) { + final var serializedSubsDescriptor = serializer.serialize(subsDescriptor); + + return streamingDelegateMonitoring + .editKpiSubscription(serializedSubsDescriptor) + .onItem() + .transform(serializer::deserializeEmpty); + } + + @Override + public Uni createKpiAlarm(AlarmDescriptor alarmDescriptor) { + final var serializedAlarmDescriptor = serializer.serialize(alarmDescriptor); + + return streamingDelegateMonitoring + .createKpiAlarm(serializedAlarmDescriptor) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Uni editKpiAlarm(AlarmDescriptor alarmDescriptor) { + final var serializedAlarmDescriptor = serializer.serialize(alarmDescriptor); + + return streamingDelegateMonitoring + .editKpiAlarm(serializedAlarmDescriptor) + .onItem() + .transform(serializer::deserializeEmpty); + } + + @Override + public Uni getAlarmDescriptor(String alarmId) { + final var serializedAlarmId = serializer.serializeAlarmId(alarmId); + + return streamingDelegateMonitoring + .getAlarmDescriptor(serializedAlarmId) + .onItem() + .transform(serializer::deserialize); + } + + @Override + public Multi getAlarmResponseStream(String alarmId) { + final var serializedAlarmId = serializer.serializeAlarmId(alarmId); + + return streamingDelegateMonitoring + .getAlarmResponseStream(serializedAlarmId) + .onItem() + .transform(serializer::deserialize); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java new file mode 100644 index 0000000000000000000000000000000000000000..276a9d3632655cf684ae4dff0469d477ff15a88e --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringService.java @@ -0,0 +1,48 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring; + +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; +import java.util.List; + +public interface MonitoringService { + + Uni createKpi(KpiDescriptor kpiDescriptor); + + Uni getKpiDescriptor(String kpiId); + + Multi> subscribeKpi(SubsDescriptor subsDescriptor); + + Uni getSubsDescriptor(String subscriptionId); + + Uni editKpiSubscription(SubsDescriptor subsDescriptor); + + Uni createKpiAlarm(AlarmDescriptor alarmDescriptor); + + Uni editKpiAlarm(AlarmDescriptor alarmDescriptor); + + Uni getAlarmDescriptor(String alarmId); + + Multi getAlarmResponseStream(String alarmId); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..e1e79af757b9866360040b785fd41dd1f0c70cd4 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/MonitoringServiceImpl.java @@ -0,0 +1,85 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring; + +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; +import java.util.List; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +@ApplicationScoped +public class MonitoringServiceImpl implements MonitoringService { + + private final MonitoringGateway monitoringGateway; + + @Inject + public MonitoringServiceImpl(MonitoringGateway monitoringGateway) { + this.monitoringGateway = monitoringGateway; + } + + @Override + public Uni createKpi(KpiDescriptor kpiDescriptor) { + return monitoringGateway.createKpi(kpiDescriptor); + } + + @Override + public Uni getKpiDescriptor(String kpiId) { + return monitoringGateway.getKpiDescriptor(kpiId); + } + + @Override + public Multi> subscribeKpi(SubsDescriptor subsDescriptor) { + return monitoringGateway.subscribeKpi(subsDescriptor); + } + + @Override + public Uni getSubsDescriptor(String subscriptionId) { + return monitoringGateway.getSubsDescriptor(subscriptionId); + } + + @Override + public Uni editKpiSubscription(SubsDescriptor subsDescriptor) { + return monitoringGateway.editKpiSubscription(subsDescriptor); + } + + @Override + public Uni createKpiAlarm(AlarmDescriptor alarmDescriptor) { + return monitoringGateway.createKpiAlarm(alarmDescriptor); + } + + @Override + public Uni editKpiAlarm(AlarmDescriptor alarmDescriptor) { + return monitoringGateway.editKpiAlarm(alarmDescriptor); + } + + @Override + public Uni getAlarmDescriptor(String alarmId) { + return monitoringGateway.getAlarmDescriptor(alarmId); + } + + @Override + public Multi getAlarmResponseStream(String alarmId) { + return monitoringGateway.getAlarmResponseStream(alarmId); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..ac216ee7cec55efbd7f169679b4e0eebad0f3950 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmDescriptor.java @@ -0,0 +1,65 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class AlarmDescriptor { + private final String alarmDescription; + private final String name; + private final String kpiId; + private final KpiValueRange kpiValueRange; + private final String timestamp; + + public AlarmDescriptor( + String alarmDescription, + String name, + String kpiId, + KpiValueRange kpiValueRange, + String timestamp) { + this.alarmDescription = alarmDescription; + this.name = name; + this.kpiId = kpiId; + this.kpiValueRange = kpiValueRange; + this.timestamp = timestamp; + } + + public String getAlarmDescription() { + return alarmDescription; + } + + public String getName() { + return name; + } + + public String getKpiId() { + return kpiId; + } + + public KpiValueRange getKpiValueRange() { + return kpiValueRange; + } + + public String getTimestamp() { + return timestamp; + } + + @Override + public String toString() { + return String.format( + "%s:{alarmDescription:\"%s\", name:\"%s\", kpiId:\"%s\", %s, timestamp:\"%s\"}", + getClass().getSimpleName(), alarmDescription, name, kpiId, kpiValueRange, timestamp); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..4730c18d068e2372dffee9507d0d74f9208abae9 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/AlarmResponse.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class AlarmResponse { + + private final String alarmId; + private final String text; + private final KpiValue kpiValue; + + public AlarmResponse(String alarmId, String text, KpiValue kpiValue) { + this.alarmId = alarmId; + this.text = text; + this.kpiValue = kpiValue; + } + + public String getAlarmId() { + return alarmId; + } + + public String getText() { + return text; + } + + public KpiValue getKpiValue() { + return kpiValue; + } + + @Override + public String toString() { + return String.format( + "%s:{alarmId:\"%s\", text:\"%s\", %s}", + getClass().getSimpleName(), alarmId, text, kpiValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..07152f0e3d5cc0194a878e2c43639cfcfc120f2f --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/BooleanKpiValue.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class BooleanKpiValue implements KpiValue { + + private final boolean value; + + public BooleanKpiValue(boolean value) { + this.value = value; + } + + @Override + public Boolean getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%b\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..93ffdf4fda7b29041991791bf231b10326574e95 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/FloatKpiValue.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class FloatKpiValue implements KpiValue { + + private final float value; + + public FloatKpiValue(float value) { + this.value = value; + } + + @Override + public Float getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%f\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..2161084d0fc722843cc20f928c24d9becc7f2a23 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/IntegerKpiValue.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class IntegerKpiValue implements KpiValue { + + private final int value; + + public IntegerKpiValue(int value) { + this.value = value; + } + + @Override + public Integer getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%d\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java new file mode 100644 index 0000000000000000000000000000000000000000..c042240298fdea49ca1509ac2563e849b16575c5 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/Kpi.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class Kpi { + + private final String kpiId; + private final String timestamp; + private final KpiValue kpiValue; + + public Kpi(String kpiId, String timestamp, KpiValue kpiValue) { + this.kpiId = kpiId; + this.timestamp = timestamp; + this.kpiValue = kpiValue; + } + + public String getKpiId() { + return kpiId; + } + + public String getTimestamp() { + return timestamp; + } + + public KpiValue getKpiValue() { + return kpiValue; + } + + @Override + public String toString() { + return String.format( + "%s:{kpiId:\"%s\", timeStamp:\"%s\", %s}", + getClass().getSimpleName(), kpiId, timestamp, kpiValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..107c1033549facafc843e182090c0d8cd95e51e5 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiDescriptor.java @@ -0,0 +1,84 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.context.model.SliceId; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; + +public class KpiDescriptor { + + private final String kpiDescription; + private final KpiSampleType kpiSampleType; + private final String deviceId; + private final EndPointId endPointId; + private final ServiceId serviceId; + private final SliceId sliceId; + + public KpiDescriptor( + String kpiDescription, + KpiSampleType kpiSampleType, + String deviceId, + EndPointId endPointId, + ServiceId serviceId, + SliceId sliceId) { + this.kpiDescription = kpiDescription; + this.kpiSampleType = kpiSampleType; + this.deviceId = deviceId; + this.endPointId = endPointId; + this.serviceId = serviceId; + this.sliceId = sliceId; + } + + public String getKpiDescription() { + return kpiDescription; + } + + public KpiSampleType getKpiSampleType() { + return kpiSampleType; + } + + public String getDeviceId() { + return deviceId; + } + + public EndPointId getEndPointId() { + return endPointId; + } + + public ServiceId getServiceId() { + return serviceId; + } + + public SliceId getSliceId() { + return sliceId; + } + + @Override + public String toString() { + return String.format( + "%s:{kpiDescription:\"%s\", kpiSampleType:\"%s\", deviceId:\"%s\", %s, %s, %s}", + getClass().getSimpleName(), + kpiDescription, + kpiSampleType.toString(), + deviceId, + endPointId, + serviceId, + sliceId); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..5c3c4c3906dead563d19657c5a6da126e2aeb698 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValue.java @@ -0,0 +1,22 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public interface KpiValue { + + public T getValue(); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java new file mode 100644 index 0000000000000000000000000000000000000000..baa7c32c4e59afc47f3c91c8c65691457b4c6df4 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/KpiValueRange.java @@ -0,0 +1,41 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class KpiValueRange { + + private final KpiValue kpiMinValue; + private final KpiValue kpiMaxValue; + + public KpiValueRange(KpiValue kpiMinValue, KpiValue kpiMaxValue) { + this.kpiMinValue = kpiMinValue; + this.kpiMaxValue = kpiMaxValue; + } + + public KpiValue getKpiMinValue() { + return kpiMinValue; + } + + public KpiValue getKpiMaxValue() { + return kpiMaxValue; + } + + @Override + public String toString() { + return String.format("%s:{%s, %s}", getClass().getSimpleName(), kpiMinValue, kpiMaxValue); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java new file mode 100644 index 0000000000000000000000000000000000000000..52f26356fce02138f91e1bd4a889571a5d1a6e0c --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/StringKpiValue.java @@ -0,0 +1,36 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class StringKpiValue implements KpiValue { + + private final String value; + + public StringKpiValue(String value) { + this.value = value; + } + + @Override + public String getValue() { + return this.value; + } + + @Override + public String toString() { + return String.format("%s:{value:\"%s\"}", getClass().getSimpleName(), value); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java new file mode 100644 index 0000000000000000000000000000000000000000..ced38b3f9f76239ee83687f14587da168dc7c320 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/monitoring/model/SubsDescriptor.java @@ -0,0 +1,70 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.monitoring.model; + +public class SubsDescriptor { + private final String kpiId; + private final float samplingDurationS; + private final float samplingIntervalS; + private final String startDate; + private final String endDate; + + public SubsDescriptor( + String kpiId, + float samplingDurationS, + float samplingIntervalS, + String startDate, + String endDate) { + this.kpiId = kpiId; + this.samplingDurationS = samplingDurationS; + this.samplingIntervalS = samplingIntervalS; + this.startDate = startDate; + this.endDate = endDate; + } + + public String getKpiId() { + return kpiId; + } + + public float getSamplingDurationS() { + return samplingDurationS; + } + + public float getSamplingIntervalS() { + return samplingIntervalS; + } + + public String getStartDate() { + return startDate; + } + + public String getEndDate() { + return endDate; + } + + @Override + public String toString() { + return String.format( + "%s:{kpiId:\"%s\", samplingDurationS:\"%f\", samplingIntervalS:\"%f\", startDate:\"%s\", endDate:\"%s\"}", + getClass().getSimpleName(), + kpiId, + samplingDurationS, + samplingIntervalS, + startDate, + endDate); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java new file mode 100644 index 0000000000000000000000000000000000000000..d8b338f4fb8f12bd77749529a92f920c525af5b7 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGateway.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.service; + +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import io.smallrye.mutiny.Uni; + +public interface ServiceGateway { + + Uni updateService(Service service); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..b69994ce42c81a0b52bec02b34ac5a4572bfe800 --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceGatewayImpl.java @@ -0,0 +1,50 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.service; + +import eu.teraflow.policy.Serializer; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import io.quarkus.grpc.GrpcClient; +import io.smallrye.mutiny.Uni; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import service.MutinyServiceServiceGrpc.MutinyServiceServiceStub; + +@ApplicationScoped +public class ServiceGatewayImpl implements ServiceGateway { + + @GrpcClient("service") + MutinyServiceServiceStub streamingDelegateService; + + private final Serializer serializer; + + @Inject + public ServiceGatewayImpl(Serializer serializer) { + this.serializer = serializer; + } + + @Override + public Uni updateService(Service service) { + final var serializedService = serializer.serialize(service); + + return streamingDelegateService + .updateService(serializedService) + .onItem() + .transform(serializer::deserialize); + } +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java new file mode 100644 index 0000000000000000000000000000000000000000..e6ab0871f0e5f7d8392cc6a3358b584e11911a6a --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceService.java @@ -0,0 +1,26 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.service; + +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import io.smallrye.mutiny.Uni; + +public interface ServiceService { + + Uni updateService(Service service); +} diff --git a/src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..921560e0f3d1805d9307d73fa7942ceeb451fb1d --- /dev/null +++ b/src/policy/src/main/java/eu/teraflow/policy/service/ServiceServiceImpl.java @@ -0,0 +1,39 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy.service; + +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceId; +import io.smallrye.mutiny.Uni; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +@ApplicationScoped +public class ServiceServiceImpl implements ServiceService { + + private final ServiceGateway serviceGateway; + + @Inject + public ServiceServiceImpl(ServiceGateway serviceGateway) { + this.serviceGateway = serviceGateway; + } + + @Override + public Uni updateService(Service service) { + return serviceGateway.updateService(service); + } +} diff --git a/src/policy/src/main/proto/acl.proto b/src/policy/src/main/proto/acl.proto new file mode 120000 index 0000000000000000000000000000000000000000..158ae78eb5bdea534ba7008114c2b97ed6dffed8 --- /dev/null +++ b/src/policy/src/main/proto/acl.proto @@ -0,0 +1 @@ +../../../../../proto/acl.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/context_policy.proto b/src/policy/src/main/proto/context_policy.proto new file mode 120000 index 0000000000000000000000000000000000000000..d41593ddeb8b8b89878587e4fb389c94394ab340 --- /dev/null +++ b/src/policy/src/main/proto/context_policy.proto @@ -0,0 +1 @@ +../../../../../proto/context_policy.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/kpi_sample_types.proto b/src/policy/src/main/proto/kpi_sample_types.proto new file mode 120000 index 0000000000000000000000000000000000000000..98e748bbf4fbadbc04c3657f458d733f1bc7bdb8 --- /dev/null +++ b/src/policy/src/main/proto/kpi_sample_types.proto @@ -0,0 +1 @@ +../../../../../proto/kpi_sample_types.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/monitoring.proto b/src/policy/src/main/proto/monitoring.proto new file mode 120000 index 0000000000000000000000000000000000000000..aceaa7328099fe736163be048ee1ad21a61d79a2 --- /dev/null +++ b/src/policy/src/main/proto/monitoring.proto @@ -0,0 +1 @@ +../../../../../proto/monitoring.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/policy_action.proto b/src/policy/src/main/proto/policy_action.proto new file mode 120000 index 0000000000000000000000000000000000000000..63dcef3d2c6753f9b732dc7491baa5f449e55eff --- /dev/null +++ b/src/policy/src/main/proto/policy_action.proto @@ -0,0 +1 @@ +../../../../../proto/policy_action.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/policy_condition.proto b/src/policy/src/main/proto/policy_condition.proto new file mode 120000 index 0000000000000000000000000000000000000000..31f7d9d10539de8c0a1bf06cf6393b86ab223c16 --- /dev/null +++ b/src/policy/src/main/proto/policy_condition.proto @@ -0,0 +1 @@ +../../../../../proto/policy_condition.proto \ No newline at end of file diff --git a/src/policy/src/main/proto/service.proto b/src/policy/src/main/proto/service.proto new file mode 120000 index 0000000000000000000000000000000000000000..5ca543da01298ca25912a534f460d4a7183e3a60 --- /dev/null +++ b/src/policy/src/main/proto/service.proto @@ -0,0 +1 @@ +../../../../../proto/service.proto \ No newline at end of file diff --git a/src/policy/src/main/resources/application.yml b/src/policy/src/main/resources/application.yml index 45c42a3c15c5c1b5521cdc4b55e2f472c7728640..3d992763422c9044136c38f21cf6d609281f86ca 100644 --- a/src/policy/src/main/resources/application.yml +++ b/src/policy/src/main/resources/application.yml @@ -1,31 +1,65 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + quarkus: + banner: + path: teraflow-policy-banner.txt grpc: server: - port: 9999 + port: 6060 enable-reflection-service: true + clients: + context: + host: ${quarkus.kubernetes.env.vars.context-service-host} + port: 1010 + monitoring: + host: ${quarkus.kubernetes.env.vars.monitoring-service-host} + port: 7070 + service: + host: ${quarkus.kubernetes.env.vars.service-service-host} + port: 3030 + http: port: 8080 + container-image: group: teraflow-h2020 name: controller/policy - tag: 0.0.1 registry: registry.gitlab.com + kubernetes: name: policyservice image-pull-policy: Always - service-type: NodePort labels: app: policyservice + add-version-to-label-selectors: false readiness-probe: - initial-delay: 5s - period: 45s + initial-delay: 2s + period: 10s liveness-probe: - initial-delay: 5s - period: 45s + initial-delay: 2s + period: 10s ports: http: host-port: 8080 container-port: 8080 - grpc-server: - host-port: 9999 - container-port: 9999 + grpc: + host-port: 6060 + container-port: 6060 + env: + vars: + context-service-host: "contextservice" + monitoring-service-host: "monitoringservice" + service-service-host: "serviceservice" + diff --git a/src/policy/src/main/resources/teraflow-policy-banner.txt b/src/policy/src/main/resources/teraflow-policy-banner.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5effd98e7cf1fae8cd623674a3675181b00296f --- /dev/null +++ b/src/policy/src/main/resources/teraflow-policy-banner.txt @@ -0,0 +1,9 @@ + + _______ ______ _ _____ _ _ + |__ __| | ____| | | __ \ | (_) + | | ___ _ __ __ _| |__ | | _____ __ | |__) |__ | |_ ___ _ _ + | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / | ___/ _ \| | |/ __| | | | + | | __/ | | (_| | | | | (_) \ V V / | | | (_) | | | (__| |_| | + |_|\___|_| \__,_|_| |_|\___/ \_/\_/ |_| \___/|_|_|\___|\__, | + __/ | + |___/ diff --git a/src/policy/src/test/java/eu/teraflow/policy/ConfigRuleTypeTest.java b/src/policy/src/test/java/eu/teraflow/policy/ConfigRuleTypeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..faaa49c3488cfa7e81f696637a8a7a4393d8f824 --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/ConfigRuleTypeTest.java @@ -0,0 +1,90 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; + +import eu.teraflow.policy.acl.AclAction; +import eu.teraflow.policy.acl.AclEntry; +import eu.teraflow.policy.acl.AclForwardActionEnum; +import eu.teraflow.policy.acl.AclLogActionEnum; +import eu.teraflow.policy.acl.AclMatch; +import eu.teraflow.policy.acl.AclRuleSet; +import eu.teraflow.policy.acl.AclRuleTypeEnum; +import eu.teraflow.policy.context.model.ConfigRuleAcl; +import eu.teraflow.policy.context.model.ConfigRuleCustom; +import eu.teraflow.policy.context.model.ConfigRuleTypeAcl; +import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.TopologyId; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class ConfigRuleTypeTest { + + private AclMatch createAclMatch() { + + return new AclMatch(1, 2, "192.168.3.52", "192.168.4.192", 3224, 3845, 5, 10); + } + + private AclAction createAclAction() { + + return new AclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + } + + private AclEntry createAclEntry(AclMatch aclMatch, AclAction aclAction) { + + return new AclEntry(1, "aclEntryDescription", aclMatch, aclAction); + } + + @Test + void shouldExtractConfigRuleCustomFromConfigRuleTypeCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + final var configRuleTypeCustom = new ConfigRuleTypeCustom(expectedConfigRuleCustom); + + assertThat(configRuleTypeCustom.getConfigRuleType()).isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldExtractConfigRuleAclFromConfigRuleTypeAcl() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + + final var aclMatch = createAclMatch(); + final var aclAction = createAclAction(); + final var aclEntry = createAclEntry(aclMatch, aclAction); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); + + final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(expectedConfigRuleAcl); + + assertThat(configRuleTypeAcl.getConfigRuleType()).isEqualTo(expectedConfigRuleAcl); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java b/src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6389a359974c0accf6b248de5a43367a553c13d9 --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/ConstraintTypeTest.java @@ -0,0 +1,136 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; + +import eu.teraflow.policy.context.model.ConstraintCustom; +import eu.teraflow.policy.context.model.ConstraintEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintSchedule; +import eu.teraflow.policy.context.model.ConstraintSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintSlaLatency; +import eu.teraflow.policy.context.model.ConstraintTypeCustom; +import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintTypeSchedule; +import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.IsolationLevelEnum; +import eu.teraflow.policy.context.model.Location; +import eu.teraflow.policy.context.model.LocationTypeRegion; +import eu.teraflow.policy.context.model.TopologyId; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class ConstraintTypeTest { + + @Test + void shouldExtractConstraintCustomFromConstraintTypeCustom() { + final var constraintType = "constraintType"; + final var constraintValue = "constraintValue"; + + final var expectedConstraintCustom = new ConstraintCustom(constraintType, constraintValue); + final var constraintTypeCustom = new ConstraintTypeCustom(expectedConstraintCustom); + + assertThat(constraintTypeCustom.getConstraintType()).isEqualTo(expectedConstraintCustom); + } + + @Test + void shouldExtractConstraintEndPointLocationFromConstraintTypeEndPointLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var locationType = new LocationTypeRegion("ATH"); + final var location = new Location(locationType); + + final var expectedConstraintEndPointLocation = + new ConstraintEndPointLocation(endPointId, location); + final var constraintTypeEndPointLocation = + new ConstraintTypeEndPointLocation(expectedConstraintEndPointLocation); + + assertThat(constraintTypeEndPointLocation.getConstraintType()) + .isEqualTo(expectedConstraintEndPointLocation); + } + + @Test + void shouldExtractConstraintScheduleFromConstraintTypeSchedule() { + final var startTimestamp = 4.7f; + final var durationDays = 97.4f; + + final var expectedConstraintSchedule = new ConstraintSchedule(startTimestamp, durationDays); + final var constraintTypeSchedule = new ConstraintTypeSchedule(expectedConstraintSchedule); + + assertThat(constraintTypeSchedule.getConstraintType()).isEqualTo(expectedConstraintSchedule); + } + + @Test + void shouldExtractConstraintSlaAvailabilityFromConstraintTypeSlaAvailability() { + final var numDisjointPaths = 88; + final var allActive = false; + + final var expectedConstraintSlaAvailability = + new ConstraintSlaAvailability(numDisjointPaths, allActive); + final var constraintTypeSlaAvailability = + new ConstraintTypeSlaAvailability(expectedConstraintSlaAvailability); + + assertThat(constraintTypeSlaAvailability.getConstraintType()) + .isEqualTo(expectedConstraintSlaAvailability); + } + + @Test + void shouldExtractConstraintSlaCapacityFromConstraintTypeSlaCapacity() { + final var capacityGbps = 0.2f; + + final var expectedConstraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + final var constraintTypeSlaCapacity = + new ConstraintTypeSlaCapacity(expectedConstraintSlaCapacity); + + assertThat(constraintTypeSlaCapacity.getConstraintType()) + .isEqualTo(expectedConstraintSlaCapacity); + } + + @Test + void shouldExtractConstraintSlaIsolationLevelFromConstraintTypeSlaIsolationLevel() { + final var expectedConstraintSlaIsolationLevel = + new ConstraintSlaIsolationLevel( + List.of(IsolationLevelEnum.PHYSICAL_ISOLATION, IsolationLevelEnum.LOGICAL_ISOLATION)); + final var constraintTypeSlaIsolationLevel = + new ConstraintTypeSlaIsolationLevel(expectedConstraintSlaIsolationLevel); + + assertThat(constraintTypeSlaIsolationLevel.getConstraintType()) + .isEqualTo(expectedConstraintSlaIsolationLevel); + } + + @Test + void shouldExtractConstraintSlaLatencyFromConstraintTypeSlaLatency() { + final var capacityGbps = 0.2f; + + final var expectedConstraintSlaLatency = new ConstraintSlaLatency(capacityGbps); + final var constraintTypeSlaLatency = new ConstraintTypeSlaLatency(expectedConstraintSlaLatency); + + assertThat(constraintTypeSlaLatency.getConstraintType()) + .isEqualTo(expectedConstraintSlaLatency); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/EndPointCreationTest.java b/src/policy/src/test/java/eu/teraflow/policy/EndPointCreationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..4c113dc95fda5160959505bfc90c02c4bd39acf7 --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/EndPointCreationTest.java @@ -0,0 +1,124 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.policy.context.model.EndPoint; +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.Location; +import eu.teraflow.policy.context.model.LocationTypeRegion; +import eu.teraflow.policy.context.model.TopologyId; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class EndPointCreationTest { + + @Test + void shouldCreateEndPointObjectGivenAllAvailableFields() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedLocationType = new LocationTypeRegion("ATH"); + final var expectedEndPointLocation = new Location(expectedLocationType); + + final var expectedEndPoint = + new EndPoint.EndPointBuilder( + expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes) + .location(expectedEndPointLocation) + .build(); + + assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId); + assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType); + assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes); + assertThat(expectedEndPoint.getEndPointLocation()).isEqualTo(expectedEndPointLocation); + } + + @Test + void shouldCreateEndPointObjectGivenAllFieldsExceptFromLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedEndPoint = + new EndPoint.EndPointBuilder( + expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes) + .build(); + + assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId); + assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType); + assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointId() { + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var endPoint = + new EndPoint.EndPointBuilder(null, expectedEndPointType, expectedKpiSampleTypes); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointType() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var endPoint = + new EndPoint.EndPointBuilder(expectedEndPointId, null, expectedKpiSampleTypes); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } + + @Test + void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingKpiSampleTypes() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + + final var endPoint = + new EndPoint.EndPointBuilder(expectedEndPointId, expectedEndPointType, null); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/LocationTypeTest.java b/src/policy/src/test/java/eu/teraflow/policy/LocationTypeTest.java new file mode 100644 index 0000000000000000000000000000000000000000..d89d62c63486cf571f2606786b805abdc066204c --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/LocationTypeTest.java @@ -0,0 +1,49 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; + +import eu.teraflow.policy.context.model.GpsPosition; +import eu.teraflow.policy.context.model.LocationTypeGpsPosition; +import eu.teraflow.policy.context.model.LocationTypeRegion; +import io.quarkus.test.junit.QuarkusTest; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class LocationTypeTest { + + @Test + void shouldExtractRegionFromLocationTypeRegion() { + final var expectedRegion = "ATH"; + + final var locationTypeRegion = new LocationTypeRegion(expectedRegion); + + assertThat(locationTypeRegion.getLocationType()).isEqualTo(expectedRegion); + } + + @Test + void shouldExtractLocationGpsPositionFromLocationTypeGpsPosition() { + final var latitude = 3.99f; + final var longitude = 77.32f; + + final var expectedLocationGpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(expectedLocationGpsPosition); + + assertThat(locationTypeGpsPosition.getLocationType()).isEqualTo(expectedLocationGpsPosition); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..53cddf6bea05162a9ee046c528da0055a1f8b467 --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleBasicValidationTest.java @@ -0,0 +1,359 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.policy.model.BooleanOperator; +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleAction; +import eu.teraflow.policy.model.PolicyRuleActionEnum; +import eu.teraflow.policy.model.PolicyRuleBasic; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.KpiValue; +import io.quarkus.test.junit.QuarkusTest; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class PolicyRuleBasicValidationTest { + + private PolicyRuleBasic createPolicyRuleBasic( + String policyRuleId, + int priority, + PolicyRuleState policyRuleState, + BooleanOperator booleanOperator, + List policyRuleConditions, + List policyRuleActions) { + + return new PolicyRuleBasic( + policyRuleId, + policyRuleState, + priority, + policyRuleConditions, + booleanOperator, + policyRuleActions); + } + + private List createPolicyRuleConditions( + String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + final var policyRuleCondition = new PolicyRuleCondition(kpiId, numericalOperator, kpiValue); + + return List.of(policyRuleCondition); + } + + private List createPolicyRuleActions( + PolicyRuleActionEnum policyRuleActionEnum, List parameters) { + final var policyRuleAction = new PolicyRuleAction(policyRuleActionEnum, parameters); + + return List.of(policyRuleAction); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullPolicyRuleId() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + null, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenEmptyPolicyRuleId() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_ENFORCED); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + "", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenWhiteSpacedPolicyRuleId() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_NO_ACTION, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_ENFORCED); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + " ", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenNegativePriority() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_INSERTED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + -3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullPolicyRuleConditions() { + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_ENFORCED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + null, + policyRuleActions)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenEmptyPolicyRuleConditions() { + final var policyRuleConditions = Collections.emptyList(); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_REMOVED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenUndefinedBooleanOperator() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_VALIDATED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullPolicyRuleActions() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(3)); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_PROVISIONED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + null)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenEmptyPolicyPolicyRuleActions() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = Collections.emptyList(); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_FAILED); + + final var policyRuleId = UUID.randomUUID().toString(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleBasic( + policyRuleId, + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions)); + } + + @Test + void shouldCreatePolicyRuleBasicObject() { + final var expectedPolicyRuleId = "expectedPolicyRuleId"; + final var expectedPolicyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + final var expectedPriority = 3; + + final var firstKpiValue = new IntegerKpiValue(22); + + final var firstExpectedPolicyRuleCondition = + new PolicyRuleCondition( + "firstExpectedPolicyRuleConditionVariable", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + firstKpiValue); + + final var expectedPolicyRuleConditions = List.of(firstExpectedPolicyRuleCondition); + + final var expectedBooleanOperator = BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR; + + final var firstExpectedPolicyRuleAction = + new PolicyRuleAction( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of("parameter1", "parameter2")); + + final var expectedPolicyRuleActions = List.of(firstExpectedPolicyRuleAction); + + final var expectedPolicyRuleBasic = + new PolicyRuleBasic( + expectedPolicyRuleId, + expectedPolicyRuleState, + expectedPriority, + expectedPolicyRuleConditions, + expectedBooleanOperator, + expectedPolicyRuleActions); + + final var policyRuleConditions = + createPolicyRuleConditions( + "firstExpectedPolicyRuleConditionVariable", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(22)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of("parameter1", "parameter2")); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "expectedPolicyRuleId", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions); + + assertThat(policyRuleBasic).usingRecursiveComparison().isEqualTo(expectedPolicyRuleBasic); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..635876dcba59eef27273ff2bc24a7921991e2975 --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleConditionValidationTest.java @@ -0,0 +1,139 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.monitoring.model.BooleanKpiValue; +import eu.teraflow.policy.monitoring.model.FloatKpiValue; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.KpiValue; +import eu.teraflow.policy.monitoring.model.StringKpiValue; +import io.quarkus.test.junit.QuarkusTest; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.Mockito; + +@QuarkusTest +class PolicyRuleConditionValidationTest { + + private PolicyRuleCondition createPolicyRuleCondition( + String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + + return new PolicyRuleCondition(kpiId, numericalOperator, kpiValue); + } + + private static Stream provideKpiValues() { + return Stream.of( + Arguments.of(new StringKpiValue("stringKpiValue")), + Arguments.of(new BooleanKpiValue(true)), + Arguments.of(new IntegerKpiValue(44)), + Arguments.of(new FloatKpiValue(12.3f))); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldThrowNullPointerExceptionGivenNullKpiId(KpiValue kpiValue) { + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + null, + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + kpiValue)); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldThrowIllegalArgumentExceptionGivenEmptyKpiId(KpiValue kpiValue) { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + "", NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, kpiValue)); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldThrowIllegalArgumentExceptionGivenWhiteSpacedKpiId(KpiValue kpiValue) { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + " ", NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, kpiValue)); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldThrowIllegalArgumentExceptionGivenUndefinedNumericalOperator(KpiValue kpiValue) { + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + "kpiId", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, + kpiValue)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullKpiValue() { + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + "kpiId", NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, null)); + } + + @Test + void shouldThrowIllegalArgumentExceptionIfIsKpiValueIsOfInvalidType() { + final var kpiValue = Mockito.mock(KpiValue.class); + Mockito.when(kpiValue.getValue()).thenReturn(1_2L); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy( + () -> + createPolicyRuleCondition( + "kpiId", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + kpiValue)); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldCreatePolicyRuleConditionObject(KpiValue kpiValue) { + final var expectedKpiId = "expectedKpiId"; + final var expectedNumericalOperator = + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN; + + final var expectedPolicyRuleCondition = + new PolicyRuleCondition(expectedKpiId, expectedNumericalOperator, kpiValue); + + final var policyRuleCondition = + createPolicyRuleCondition( + "expectedKpiId", NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, kpiValue); + + assertThat(policyRuleCondition) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleCondition); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..064cd7ee03a35d453f8de46d12c8f205f4ab804d --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleDeviceValidationTest.java @@ -0,0 +1,178 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.policy.model.BooleanOperator; +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleAction; +import eu.teraflow.policy.model.PolicyRuleActionEnum; +import eu.teraflow.policy.model.PolicyRuleBasic; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.model.PolicyRuleDevice; +import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.KpiValue; +import io.quarkus.test.junit.QuarkusTest; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class PolicyRuleDeviceValidationTest { + + private PolicyRuleBasic createPolicyRuleBasic( + String policyRuleId, + int priority, + PolicyRuleState policyRuleState, + BooleanOperator booleanOperator, + List policyRuleConditions, + List policyRuleActions) { + + return new PolicyRuleBasic( + policyRuleId, + policyRuleState, + priority, + policyRuleConditions, + booleanOperator, + policyRuleActions); + } + + private List createPolicyRuleConditions( + String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + final var policyRuleCondition = new PolicyRuleCondition(kpiId, numericalOperator, kpiValue); + + return List.of(policyRuleCondition); + } + + private List createPolicyRuleActions( + PolicyRuleActionEnum policyRuleActionEnum, List parameters) { + final var policyRuleAction = new PolicyRuleAction(policyRuleActionEnum, parameters); + + return List.of(policyRuleAction); + } + + private PolicyRuleDevice createPolicyRuleDevice( + PolicyRuleBasic policyRuleBasic, List deviceIds) { + + return new PolicyRuleDevice(policyRuleBasic, deviceIds); + } + + private List createDeviceIds() { + return List.of("deviceId1", "deviceId2"); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullPolicyRuleBasic() { + final var deviceIds = createDeviceIds(); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> createPolicyRuleDevice(null, deviceIds)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullDeviceIds() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> createPolicyRuleDevice(policyRuleBasic, null)); + } + + @Test + void shouldThrowIllegalArgumentExceptionGivenEmptyDeviceIds() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId1", + 213, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND, + policyRuleConditions, + policyRuleActions); + + final var deviceIds = Collections.emptyList(); + + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> createPolicyRuleDevice(policyRuleBasic, deviceIds)); + } + + @Test + void shouldCreatePolicyRuleDeviceObject() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions); + + final var deviceIds = createDeviceIds(); + + final var expectedPolicyRuleDevice = new PolicyRuleDevice(policyRuleBasic, deviceIds); + + final var policyRuleDevice = createPolicyRuleDevice(policyRuleBasic, deviceIds); + + assertThat(policyRuleDevice).usingRecursiveComparison().isEqualTo(expectedPolicyRuleDevice); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java new file mode 100644 index 0000000000000000000000000000000000000000..b565b7e75b5cf9eb7748d0ba92e4fa3416b3b52e --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyRuleServiceValidationTest.java @@ -0,0 +1,222 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.model.BooleanOperator; +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleAction; +import eu.teraflow.policy.model.PolicyRuleActionEnum; +import eu.teraflow.policy.model.PolicyRuleBasic; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.model.PolicyRuleService; +import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.KpiValue; +import io.quarkus.test.junit.QuarkusTest; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class PolicyRuleServiceValidationTest { + + private List createPolicyRuleConditions( + String kpiId, NumericalOperator numericalOperator, KpiValue kpiValue) { + final var policyRuleCondition = new PolicyRuleCondition(kpiId, numericalOperator, kpiValue); + + return List.of(policyRuleCondition); + } + + private List createPolicyRuleActions( + PolicyRuleActionEnum policyRuleActionEnum, List parameters) { + final var policyRuleAction = new PolicyRuleAction(policyRuleActionEnum, parameters); + + return List.of(policyRuleAction); + } + + private PolicyRuleBasic createPolicyRuleBasic( + String policyRuleId, + int priority, + PolicyRuleState policyRuleState, + BooleanOperator booleanOperator, + List policyRuleConditions, + List policyRuleActions) { + + return new PolicyRuleBasic( + policyRuleId, + policyRuleState, + priority, + policyRuleConditions, + booleanOperator, + policyRuleActions); + } + + private ServiceId createServiceId(String contextId, String id) { + return new ServiceId(contextId, id); + } + + private List createDeviceIds() { + return List.of("deviceIdA", "deviceIdB"); + } + + private PolicyRuleService createPolicyRuleService( + PolicyRuleBasic policyRuleBasic, ServiceId serviceId, List deviceIds) { + + return new PolicyRuleService(policyRuleBasic, serviceId, deviceIds); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullPolicyRuleBasic() { + final var serviceId = createServiceId("CONTEXT_ID", "id"); + final var deviceIds = createDeviceIds(); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> createPolicyRuleService(null, serviceId, deviceIds)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullServiceId() { + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var deviceIds = createDeviceIds(); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId1", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> createPolicyRuleService(policyRuleBasic, null, deviceIds)); + } + + @Test + void shouldThrowNullPointerExceptionGivenNullDeviceIds() { + final var serviceId = createServiceId("contextId", "ID"); + + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId2", + 2, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND, + policyRuleConditions, + policyRuleActions); + + assertThatExceptionOfType(NullPointerException.class) + .isThrownBy(() -> createPolicyRuleService(policyRuleBasic, serviceId, null)); + } + + @Test + void shouldCreatePolicyRuleServiceObjectGivenEmptyDeviceIds() { + final var serviceId = createServiceId("contextId", "id"); + final var deviceIds = Collections.emptyList(); + + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId", + 777, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND, + policyRuleConditions, + policyRuleActions); + + final var expectedPolicyRuleService = + new PolicyRuleService(policyRuleBasic, serviceId, deviceIds); + + final var policyRuleService = createPolicyRuleService(policyRuleBasic, serviceId, deviceIds); + + assertThat(policyRuleService).usingRecursiveComparison().isEqualTo(expectedPolicyRuleService); + } + + @Test + void shouldCreatePolicyRuleServiceObject() { + final var serviceId = createServiceId("contextId", "id"); + final var deviceIds = List.of("deviceIdA", "deviceIdB"); + + final var policyRuleConditions = + createPolicyRuleConditions( + UUID.randomUUID().toString(), + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + new IntegerKpiValue(3)); + final var policyRuleActions = + createPolicyRuleActions( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT, + List.of(UUID.randomUUID().toString(), UUID.randomUUID().toString())); + + final var policyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + + final var policyRuleBasic = + createPolicyRuleBasic( + "policyRuleId", + 3, + policyRuleState, + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + policyRuleConditions, + policyRuleActions); + + final var expectedPolicyRuleService = + new PolicyRuleService(policyRuleBasic, serviceId, deviceIds); + + final var policyRuleService = createPolicyRuleService(policyRuleBasic, serviceId, deviceIds); + + assertThat(policyRuleService).usingRecursiveComparison().isEqualTo(expectedPolicyRuleService); + } +} diff --git a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java b/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java index a9ba00bdf1ff4c7190df717c07802336073ec5aa..3f123243204d46db6794a5ca067276d4cbfb7e14 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java +++ b/src/policy/src/test/java/eu/teraflow/policy/PolicyServiceTest.java @@ -1,18 +1,48 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 eu.teraflow.policy; import static org.assertj.core.api.Assertions.assertThat; import context.ContextOuterClass; +import context.ContextOuterClass.Uuid; +import eu.teraflow.policy.monitoring.model.FloatKpiValue; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; import io.quarkus.grpc.GrpcClient; import io.quarkus.test.junit.QuarkusTest; +import java.util.List; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.inject.Inject; +import monitoring.Monitoring.KpiId; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import policy.Policy; +import policy.Policy.PolicyRuleBasic; +import policy.Policy.RuleState; +import policy.PolicyAction; +import policy.PolicyAction.PolicyRuleActionEnum; +import policy.PolicyCondition; +import policy.PolicyCondition.BooleanOperator; +import policy.PolicyCondition.NumericalOperator; +import policy.PolicyCondition.PolicyRuleCondition; import policy.PolicyService; @QuarkusTest @@ -20,49 +50,172 @@ class PolicyServiceTest { private static final Logger LOGGER = Logger.getLogger(PolicyServiceTest.class); @GrpcClient PolicyService client; + private final Serializer serializer; + + @Inject + PolicyServiceTest(Serializer serializer) { + this.serializer = serializer; + } + + private PolicyRuleBasic createPolicyRuleBasic() { + final var expectedPolicyRuleIdUuid = + serializer.serializeUuid("571eabc1-0f59-48da-b608-c45876c3fa8a"); + + final var expectedPolicyRuleId = + Policy.PolicyRuleId.newBuilder().setUuid(expectedPolicyRuleIdUuid).build(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_VALIDATED).build(); + + final var expectedFirstKpiValue = new IntegerKpiValue(22); + final var expectedSecondKpiValue = new FloatKpiValue(69.1f); + + final var serializedExpectedFirstKpiValue = serializer.serialize(expectedFirstKpiValue); + final var serializedExpectedSecondKpiValue = serializer.serialize(expectedSecondKpiValue); + + final var firstExpectedPolicyRuleCondition = + PolicyRuleCondition.newBuilder() + .setKpiId( + KpiId.newBuilder() + .setKpiId( + Uuid.newBuilder().setUuid("79e49ba3-a7b4-4b4b-8aaa-28b05c6f888e").build())) + .setNumericalOperator(NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_EQUAL) + .setKpiValue(serializedExpectedFirstKpiValue) + .build(); + + final var secondExpectedPolicyRuleCondition = + PolicyCondition.PolicyRuleCondition.newBuilder() + .setKpiId( + KpiId.newBuilder() + .setKpiId( + Uuid.newBuilder().setUuid("eae900e5-2703-467d-82f2-97aae8b55c15").build())) + .setNumericalOperator(NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN) + .setKpiValue(serializedExpectedSecondKpiValue) + .build(); + + final var expectedPolicyRuleConditions = + List.of(firstExpectedPolicyRuleCondition, secondExpectedPolicyRuleCondition); + + final var firstExpectedPolicyRuleAction = + PolicyAction.PolicyRuleAction.newBuilder() + .setAction(PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE) + .addAllParameters(List.of("parameter1", "parameter2")) + .build(); + + final var secondExpectedPolicyRuleAction = + PolicyAction.PolicyRuleAction.newBuilder() + .setAction(PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT) + .addAllParameters(List.of("parameter3", "parameter4")) + .build(); + + final var expectedPolicyRuleActions = + List.of(firstExpectedPolicyRuleAction, secondExpectedPolicyRuleAction); + + return PolicyRuleBasic.newBuilder() + .setPolicyRuleId(expectedPolicyRuleId) + .setPolicyRuleState(expectedPolicyRuleState) + .addAllConditionList(expectedPolicyRuleConditions) + .setBooleanOperator(BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR) + .addAllActionList(expectedPolicyRuleActions) + .build(); + } @Test - void shouldAddPolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldAddPolicyService() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); - final var uuid = - ContextOuterClass.Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) - .build(); - final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); + final var policyRuleBasic = createPolicyRuleBasic(); + + final var expectedPolicyRuleState = policyRuleBasic.getPolicyRuleState(); + + final var policyRuleService = + Policy.PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); client - .policyAdd(policyRule) + .policyAddService(policyRuleService) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Adding policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test - void shouldUpdatePolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldAddPolicyDevice() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); - final var uuid = - ContextOuterClass.Uuid.newBuilder() - .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) + final var expectedDeviceIdUuid1 = + serializer.serializeUuid("20db867c-772d-4872-9179-244ecafb3257"); + final var expectedDeviceIdUuid2 = + serializer.serializeUuid("095974ac-d757-412d-b317-bcf355220aa9"); + + final var expectedDeviceId1 = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(expectedDeviceIdUuid1).build(); + final var expectedDeviceId2 = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(expectedDeviceIdUuid2).build(); + + final var policyRuleBasic = createPolicyRuleBasic(); + final var deviceIds = List.of(expectedDeviceId1, expectedDeviceId2); + + final var expectedPolicyRuleState = policyRuleBasic.getPolicyRuleState(); + + final var policyRuleDevice = + Policy.PolicyRuleDevice.newBuilder() + .setPolicyRuleBasic(policyRuleBasic) + .addAllDeviceList(deviceIds) .build(); - final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); client - .policyUpdate(policyRule) + .policyAddDevice(policyRuleDevice) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Updating policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); + } + + @Test + void shouldUpdatePolicyService() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture message = new CompletableFuture<>(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_ENFORCED).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleService = + Policy.PolicyRuleService.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); + + client + .policyUpdateService(policyRuleService) + .subscribe() + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); + } + + @Test + void shouldUpdatePolicyDevice() + throws ExecutionException, InterruptedException, TimeoutException { + CompletableFuture message = new CompletableFuture<>(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_ENFORCED).build(); + + final var policyRuleBasic = + PolicyRuleBasic.newBuilder().setPolicyRuleState(expectedPolicyRuleState).build(); + final var policyRuleDevice = + Policy.PolicyRuleDevice.newBuilder().setPolicyRuleBasic(policyRuleBasic).build(); + + client + .policyUpdateDevice(policyRuleDevice) + .subscribe() + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test @@ -74,21 +227,21 @@ class PolicyServiceTest { .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) .build(); final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); - final var policyRule = Policy.PolicyRule.newBuilder().setPolicyRuleId(policyRuleId).build(); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(RuleState.POLICY_REMOVED).build(); client - .policyDelete(policyRule) + .policyDelete(policyRuleId) .subscribe() - .with( - policyRuleState -> { - LOGGER.infof("Deleting policy: %s", policyRuleState.getPolicyRuleId().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid()); - }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); + .with(policyRuleState -> message.complete(policyRuleState.getPolicyRuleState().toString())); + + assertThat(message.get(5, TimeUnit.SECONDS)) + .isEqualTo(expectedPolicyRuleState.getPolicyRuleState().toString()); } @Test - void shouldGetPolicy() throws ExecutionException, InterruptedException, TimeoutException { + void shouldGetPolicyService() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); final var uuid = @@ -98,40 +251,43 @@ class PolicyServiceTest { final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); client - .getPolicy(policyRuleId) + .getPolicyService(policyRuleId) .subscribe() .with( - policyRuleState -> { + policyRuleService -> { LOGGER.infof( "Getting policy with ID: %s", - policyRuleState.getPolicyRuleId().getUuid().getUuid()); - message.complete(policyRuleState.getPolicyRuleId().getUuid().getUuid()); + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid()); + message.complete( + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid().getUuid()); }); + assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); } @Test - void shouldGetPolicyByDeviceId() - throws ExecutionException, InterruptedException, TimeoutException { - + void shouldGetPolicyDevice() throws ExecutionException, InterruptedException, TimeoutException { CompletableFuture message = new CompletableFuture<>(); final var uuid = ContextOuterClass.Uuid.newBuilder() .setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString()) .build(); - final var deviceId = ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuid).build(); + final var policyRuleId = Policy.PolicyRuleId.newBuilder().setUuid(uuid).build(); client - .getPolicyByDeviceId(deviceId) + .getPolicyDevice(policyRuleId) .subscribe() .with( - policyRuleList -> { - LOGGER.infof("Getting policyRuleList with ID: %s", policyRuleList); - message.complete(policyRuleList.toString()); + policyRuleService -> { + LOGGER.infof( + "Getting policy with ID: %s", + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid()); + message.complete( + policyRuleService.getPolicyRuleBasic().getPolicyRuleId().getUuid().getUuid()); }); - assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty(); + assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(policyRuleId.getUuid().getUuid()); } @Test diff --git a/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java b/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..05f835d58f6552f3bd21f467b02026c9c509a67c --- /dev/null +++ b/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java @@ -0,0 +1,3811 @@ +/* +* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +* +* 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 +*provideKpiValueRanges +* 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 eu.teraflow.policy; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import acl.Acl; +import context.ContextOuterClass; +import context.ContextOuterClass.ContextId; +import context.ContextOuterClass.DeviceId; +import context.ContextOuterClass.DeviceOperationalStatusEnum; +import context.ContextOuterClass.Uuid; +import eu.teraflow.policy.acl.AclAction; +import eu.teraflow.policy.acl.AclEntry; +import eu.teraflow.policy.acl.AclForwardActionEnum; +import eu.teraflow.policy.acl.AclLogActionEnum; +import eu.teraflow.policy.acl.AclMatch; +import eu.teraflow.policy.acl.AclRuleSet; +import eu.teraflow.policy.acl.AclRuleTypeEnum; +import eu.teraflow.policy.context.model.ConfigActionEnum; +import eu.teraflow.policy.context.model.ConfigRule; +import eu.teraflow.policy.context.model.ConfigRuleAcl; +import eu.teraflow.policy.context.model.ConfigRuleCustom; +import eu.teraflow.policy.context.model.ConfigRuleTypeAcl; +import eu.teraflow.policy.context.model.ConfigRuleTypeCustom; +import eu.teraflow.policy.context.model.Constraint; +import eu.teraflow.policy.context.model.ConstraintCustom; +import eu.teraflow.policy.context.model.ConstraintEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintSchedule; +import eu.teraflow.policy.context.model.ConstraintSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintSlaLatency; +import eu.teraflow.policy.context.model.ConstraintTypeCustom; +import eu.teraflow.policy.context.model.ConstraintTypeEndPointLocation; +import eu.teraflow.policy.context.model.ConstraintTypeSchedule; +import eu.teraflow.policy.context.model.ConstraintTypeSlaAvailability; +import eu.teraflow.policy.context.model.ConstraintTypeSlaCapacity; +import eu.teraflow.policy.context.model.ConstraintTypeSlaIsolationLevel; +import eu.teraflow.policy.context.model.ConstraintTypeSlaLatency; +import eu.teraflow.policy.context.model.Device; +import eu.teraflow.policy.context.model.DeviceConfig; +import eu.teraflow.policy.context.model.DeviceDriverEnum; +import eu.teraflow.policy.context.model.DeviceOperationalStatus; +import eu.teraflow.policy.context.model.Empty; +import eu.teraflow.policy.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.policy.context.model.EndPointId; +import eu.teraflow.policy.context.model.Event; +import eu.teraflow.policy.context.model.EventTypeEnum; +import eu.teraflow.policy.context.model.GpsPosition; +import eu.teraflow.policy.context.model.IsolationLevelEnum; +import eu.teraflow.policy.context.model.Location; +import eu.teraflow.policy.context.model.LocationTypeGpsPosition; +import eu.teraflow.policy.context.model.LocationTypeRegion; +import eu.teraflow.policy.context.model.Service; +import eu.teraflow.policy.context.model.ServiceConfig; +import eu.teraflow.policy.context.model.ServiceId; +import eu.teraflow.policy.context.model.ServiceStatus; +import eu.teraflow.policy.context.model.ServiceStatusEnum; +import eu.teraflow.policy.context.model.ServiceTypeEnum; +import eu.teraflow.policy.context.model.SliceId; +import eu.teraflow.policy.context.model.TopologyId; +import eu.teraflow.policy.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.policy.model.BooleanOperator; +import eu.teraflow.policy.model.NumericalOperator; +import eu.teraflow.policy.model.PolicyRuleAction; +import eu.teraflow.policy.model.PolicyRuleActionEnum; +import eu.teraflow.policy.model.PolicyRuleBasic; +import eu.teraflow.policy.model.PolicyRuleCondition; +import eu.teraflow.policy.model.PolicyRuleDevice; +import eu.teraflow.policy.model.PolicyRuleService; +import eu.teraflow.policy.model.PolicyRuleState; +import eu.teraflow.policy.model.RuleState; +import eu.teraflow.policy.monitoring.model.AlarmDescriptor; +import eu.teraflow.policy.monitoring.model.AlarmResponse; +import eu.teraflow.policy.monitoring.model.BooleanKpiValue; +import eu.teraflow.policy.monitoring.model.FloatKpiValue; +import eu.teraflow.policy.monitoring.model.IntegerKpiValue; +import eu.teraflow.policy.monitoring.model.Kpi; +import eu.teraflow.policy.monitoring.model.KpiDescriptor; +import eu.teraflow.policy.monitoring.model.KpiValue; +import eu.teraflow.policy.monitoring.model.KpiValueRange; +import eu.teraflow.policy.monitoring.model.StringKpiValue; +import eu.teraflow.policy.monitoring.model.SubsDescriptor; +import io.quarkus.test.junit.QuarkusTest; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.inject.Inject; +import kpi_sample_types.KpiSampleTypes; +import monitoring.Monitoring; +import monitoring.Monitoring.AlarmID; +import monitoring.Monitoring.KpiId; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import policy.Policy; +import policy.Policy.PolicyRuleId; +import policy.PolicyAction; +import policy.PolicyCondition; + +@QuarkusTest +class SerializerTest { + @Inject Serializer serializer; + + private AclMatch createAclMatch( + int dscp, + int protocol, + String srcAddress, + String dstAddress, + int srcPort, + int dstPort, + int startMplsLabel, + int endMplsLabel) { + return new AclMatch( + dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel); + } + + private AclAction createAclAction( + AclForwardActionEnum forwardActionEnum, AclLogActionEnum logActionEnum) { + + return new AclAction(forwardActionEnum, logActionEnum); + } + + private AclEntry createAclEntry( + int sequenceId, String description, AclMatch aclMatch, AclAction aclAction) { + + return new AclEntry(sequenceId, description, aclMatch, aclAction); + } + + private PolicyRuleBasic createPolicyRuleBasic() { + final var expectedPolicyRuleId = "expectedPolicyRuleId"; + final var expectedPolicyRuleState = new PolicyRuleState(RuleState.POLICY_EFFECTIVE); + final var expectedPriority = 3; + + final var firstKpiValue = new IntegerKpiValue(22); + final var secondKpiValue = new FloatKpiValue(69.1f); + + final var firstExpectedPolicyRuleCondition = + new PolicyRuleCondition( + "firstExpectedPolicyRuleConditionVariable", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + firstKpiValue); + final var secondExpectedPolicyRuleCondition = + new PolicyRuleCondition( + "secondExpectedPolicyRuleConditionVariable", + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_EQUAL, + secondKpiValue); + + final var expectedPolicyRuleConditions = + List.of(firstExpectedPolicyRuleCondition, secondExpectedPolicyRuleCondition); + + final var expectedBooleanOperator = BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR; + + final var firstExpectedPolicyRuleAction = + new PolicyRuleAction( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + List.of("parameter1", "parameter2")); + + final var secondExpectedPolicyRuleAction = + new PolicyRuleAction( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + List.of("parameter3", "parameter4")); + + final var expectedPolicyRuleActions = + List.of(firstExpectedPolicyRuleAction, secondExpectedPolicyRuleAction); + + return new PolicyRuleBasic( + expectedPolicyRuleId, + expectedPolicyRuleState, + expectedPriority, + expectedPolicyRuleConditions, + expectedBooleanOperator, + expectedPolicyRuleActions); + } + + private ConfigRule createConfigRule() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + + final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + + return new ConfigRule(ConfigActionEnum.SET, configRuleTypeAcl); + } + + @Test + void shouldSerializeDeviceId() { + final var deviceId = "deviceId"; + + final var deviceIdUuid = serializer.serializeUuid(deviceId); + final var expectedDeviceId = + ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build(); + + final var serializedDeviceId = serializer.serializeDeviceId(deviceId); + + assertThat(serializedDeviceId).usingRecursiveComparison().isEqualTo(expectedDeviceId); + } + + @Test + void shouldDeserializeDeviceId() { + final var expectedDeviceId = "expectedDeviceId"; + + final var serializedDeviceIdUuid = serializer.serializeUuid(expectedDeviceId); + final var serializedDeviceId = + DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build(); + + final var deviceId = serializer.deserialize(serializedDeviceId); + + assertThat(deviceId).isEqualTo(expectedDeviceId); + } + + @Test + void shouldSerializeContextId() { + final var contextId = "contextId"; + + final var contextIdUuid = serializer.serializeUuid(contextId); + + final var expectedContextId = + ContextOuterClass.ContextId.newBuilder().setContextUuid(contextIdUuid).build(); + + final var serializedContextId = serializer.serializeContextId(contextId); + + assertThat(serializedContextId).usingRecursiveComparison().isEqualTo(expectedContextId); + } + + @Test + void shouldDeserializeContextId() { + final var expectedContextId = "expectedContextId"; + + final var serializedContextIdUuid = serializer.serializeUuid(expectedContextId); + final var serializedContextId = + ContextId.newBuilder().setContextUuid(serializedContextIdUuid).build(); + + final var contextId = serializer.deserialize(serializedContextId); + + assertThat(contextId).isEqualTo(expectedContextId); + } + + @Test + void shouldSerializePolicyRuleId() { + final var policyRuleId = "policyRuleId"; + + final var policyRuleIdUuid = serializer.serializeUuid(policyRuleId); + final var expectedPolicyRuleId = + Policy.PolicyRuleId.newBuilder().setUuid(policyRuleIdUuid).build(); + + final var serializedPolicyRuleId = serializer.serializePolicyRuleId(policyRuleId); + + assertThat(serializedPolicyRuleId).usingRecursiveComparison().isEqualTo(expectedPolicyRuleId); + } + + @Test + void shouldDeserializePolicyRuleId() { + final var expectedPolicyRuleId = "expectedPolicyRuleId"; + + final var serializedPolicyRuleIdUuid = serializer.serializeUuid(expectedPolicyRuleId); + final var serializedPolicyRuleId = + PolicyRuleId.newBuilder().setUuid(serializedPolicyRuleIdUuid).build(); + + final var policyRuleId = serializer.deserialize(serializedPolicyRuleId); + + assertThat(policyRuleId).isEqualTo(expectedPolicyRuleId); + } + + @Test + void shouldSerializeTopologyId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + final var topologyId = new TopologyId(expectedContextId, expectedId); + + final var serializedContextId = serializer.serializeContextId(expectedContextId); + final var serializedIdUuid = serializer.serializeUuid(expectedId); + + final var expectedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(serializedContextId) + .setTopologyUuid(serializedIdUuid) + .build(); + + final var serializedTopologyId = serializer.serialize(topologyId); + + assertThat(serializedTopologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId); + } + + @Test + void shouldDeserializeTopologyId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + + final var expectedTopologyId = new TopologyId(expectedContextId, expectedId); + + final var serializedTopologyId = serializer.serialize(expectedTopologyId); + final var topologyId = serializer.deserialize(serializedTopologyId); + + assertThat(topologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId); + } + + private static Stream provideConfigActionEnum() { + return Stream.of( + Arguments.of(ConfigActionEnum.SET, ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET), + Arguments.of( + ConfigActionEnum.DELETE, ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE), + Arguments.of( + ConfigActionEnum.UNDEFINED, ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideConfigActionEnum") + void shouldSerializeConfigActionEnum( + ConfigActionEnum configActionEnum, + ContextOuterClass.ConfigActionEnum expectedConfigActionEnum) { + final var serializedType = serializer.serialize(configActionEnum); + assertThat(serializedType.getNumber()).isEqualTo(expectedConfigActionEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideConfigActionEnum") + void shouldDeserializeConfigActionEnum( + ConfigActionEnum expectedConfigActionEnum, + ContextOuterClass.ConfigActionEnum serializedConfigActionEnum) { + + final var configActionEnum = serializer.deserialize(serializedConfigActionEnum); + + assertThat(configActionEnum).isEqualTo(expectedConfigActionEnum); + } + + private static Stream provideAclRuleTypeEnum() { + return Stream.of( + Arguments.of(AclRuleTypeEnum.IPV4, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4), + Arguments.of(AclRuleTypeEnum.IPV6, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6), + Arguments.of(AclRuleTypeEnum.L2, Acl.AclRuleTypeEnum.ACLRULETYPE_L2), + Arguments.of(AclRuleTypeEnum.MPLS, Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS), + Arguments.of(AclRuleTypeEnum.MIXED, Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED), + Arguments.of(AclRuleTypeEnum.UNDEFINED, Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclRuleTypeEnum") + void shouldSerializeAclRuleTypeEnum( + AclRuleTypeEnum aclRuleTypeEnum, Acl.AclRuleTypeEnum expectedAclRuleTypeEnum) { + final var serializedAclRuleTypeEnum = serializer.serialize(aclRuleTypeEnum); + assertThat(serializedAclRuleTypeEnum.getNumber()) + .isEqualTo(expectedAclRuleTypeEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideAclRuleTypeEnum") + void shouldDeserializeAclRuleTypeEnum( + AclRuleTypeEnum expectedAclRuleTypeEnum, Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) { + final var aclRuleTypeEnum = serializer.deserialize(serializedAclRuleTypeEnum); + assertThat(aclRuleTypeEnum).isEqualTo(expectedAclRuleTypeEnum); + } + + private static Stream provideAclForwardActionEnum() { + return Stream.of( + Arguments.of(AclForwardActionEnum.DROP, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP), + Arguments.of( + AclForwardActionEnum.ACCEPT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT), + Arguments.of( + AclForwardActionEnum.REJECT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT), + Arguments.of( + AclForwardActionEnum.UNDEFINED, + Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclForwardActionEnum") + void shouldSerializeAclForwardActionEnum( + AclForwardActionEnum aclForwardActionEnum, + Acl.AclForwardActionEnum expectedAclForwardActionEnum) { + final var serializedAclForwardActionEnum = serializer.serialize(aclForwardActionEnum); + assertThat(serializedAclForwardActionEnum.getNumber()) + .isEqualTo(expectedAclForwardActionEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideAclForwardActionEnum") + void shouldDeserializeAclForwardActionEnum( + AclForwardActionEnum expectedAclForwardActionEnum, + Acl.AclForwardActionEnum serializedAclForwardActionEnum) { + final var aclForwardActionEnum = serializer.deserialize(serializedAclForwardActionEnum); + assertThat(aclForwardActionEnum).isEqualTo(expectedAclForwardActionEnum); + } + + private static Stream provideAclLogActionEnum() { + return Stream.of( + Arguments.of(AclLogActionEnum.NO_LOG, Acl.AclLogActionEnum.ACLLOGACTION_NOLOG), + Arguments.of(AclLogActionEnum.SYSLOG, Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG), + Arguments.of(AclLogActionEnum.UNDEFINED, Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideAclLogActionEnum") + void shouldSerializeAclLogActionEnum( + AclLogActionEnum aclLogActionEnum, Acl.AclLogActionEnum expectedAclLogActionEnum) { + final var serializedAclLogActionEnum = serializer.serialize(aclLogActionEnum); + assertThat(serializedAclLogActionEnum.getNumber()) + .isEqualTo(expectedAclLogActionEnum.getNumber()); + } + + @Test + void shouldSerializeAclAction() { + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + + final var expectedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var serializedAclAction = serializer.serialize(aclAction); + + assertThat(serializedAclAction).usingRecursiveComparison().isEqualTo(expectedAclAction); + } + + @Test + void shouldDeserializeAclAction() { + final var expectedAclAction = + createAclAction(AclForwardActionEnum.DROP, AclLogActionEnum.NO_LOG); + + final var serializedAclAction = serializer.serialize(expectedAclAction); + final var aclAction = serializer.deserialize(serializedAclAction); + + assertThat(aclAction).usingRecursiveComparison().isEqualTo(expectedAclAction); + } + + @Test + void shouldSerializeAclMatch() { + final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2); + + final var expectedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(1) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(1) + .setEndMplsLabel(2) + .build(); + + final var serializedAclMatch = serializer.serialize(aclMatch); + + assertThat(serializedAclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch); + } + + @Test + void shouldDeserializeAclMatch() { + final var expectedAclMatch = createAclMatch(7, 2, "127.0.0.5", "127.0.0.6", 32456, 3123, 5, 10); + + final var serializedAclMatch = serializer.serialize(expectedAclMatch); + final var aclMatch = serializer.deserialize(serializedAclMatch); + + assertThat(aclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch); + } + + @Test + void shouldSerializeAclEntry() { + final var sequenceId = 1; + final var description = "aclEntryDescription"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction); + + final var serializedAclMatch = serializer.serialize(aclMatch); + final var serializedAclAction = serializer.serialize(aclAction); + + final var expectedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(sequenceId) + .setDescription(description) + .setMatch(serializedAclMatch) + .setAction(serializedAclAction) + .build(); + + final var serializedAclEntry = serializer.serialize(aclEntry); + + assertThat(serializedAclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry); + } + + @Test + void shouldDeserializeAclEntry() { + final var sequenceId = 7; + final var description = "aclEntryDescriptor"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var expectedAclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction); + + final var serializedAclEntry = serializer.serialize(expectedAclEntry); + final var aclEntry = serializer.deserialize(serializedAclEntry); + + assertThat(aclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry); + } + + @Test + void shouldSerializeAclRuleSet() { + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var serializedAclEntry = serializer.serialize(aclEntry); + final var serializedAclEntries = List.of(serializedAclEntry); + + final var expectedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName(aclRuleSetName) + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED) + .setDescription(aclRuleSetDescription) + .setUserId(aclRuleSetUserId) + .addAllEntries(serializedAclEntries) + .build(); + + final var serializedAclRuleset = serializer.serialize(aclRuleSet); + + assertThat(serializedAclRuleset).usingRecursiveComparison().isEqualTo(expectedAclRuleSet); + } + + @Test + void shouldDeserializeAclRuleSet() { + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var expectedAclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var serializedAclRuleSet = serializer.serialize(expectedAclRuleSet); + final var aclRuleSet = serializer.deserialize(serializedAclRuleSet); + + assertThat(aclRuleSet).usingRecursiveComparison().isEqualTo(expectedAclRuleSet); + } + + @ParameterizedTest + @MethodSource("provideAclLogActionEnum") + void shouldDeserializeAclLogActionEnum( + AclLogActionEnum expectedAclLogActionEnum, Acl.AclLogActionEnum serializedAclLogActionEnum) { + final var aclLogActionEnum = serializer.deserialize(serializedAclLogActionEnum); + assertThat(aclLogActionEnum).isEqualTo(expectedAclLogActionEnum); + } + + @Test + void shouldSerializeConfigRuleAcl() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedAclRuleSet = serializer.serialize(aclRuleSet); + + final var expectedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + final var serializedConfigRuleAcl = serializer.serialize(configRuleAcl); + + assertThat(serializedConfigRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl); + } + + @Test + void shouldDeserializeConfigRuleAcl() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var sequenceId = 1; + final var aclEntryDescription = "aclEntryDescription"; + + final var aclRuleSetName = "aclRuleSetName"; + final var aclRuleSetDescription = "aclRuleSetDescription"; + final var aclRuleSetUserId = "aclRuleSetUserId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction); + final var aclRuleSet = + new AclRuleSet( + aclRuleSetName, + AclRuleTypeEnum.MIXED, + aclRuleSetDescription, + aclRuleSetUserId, + List.of(aclEntry)); + + final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var serializedConfigRuleAcl = serializer.serialize(expectedConfigRuleAcl); + final var configRuleAcl = serializer.deserialize(serializedConfigRuleAcl); + + assertThat(configRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl); + } + + @Test + void shouldSerializeConfigRuleCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var configRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + + final var expectedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey(resourceKey) + .setResourceValue(resourceValue) + .build(); + + final var serializedConfigRuleCustom = serializer.serialize(configRuleCustom); + + assertThat(serializedConfigRuleCustom) + .usingRecursiveComparison() + .isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldDeserializeConfigRuleCustom() { + final var resourceKey = "resourceKey"; + final var resourceValue = "resourceValue"; + + final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue); + + final var serializedConfigRuleCustom = serializer.serialize(expectedConfigRuleCustom); + final var configRuleCustom = serializer.deserialize(serializedConfigRuleCustom); + + assertThat(configRuleCustom).usingRecursiveComparison().isEqualTo(expectedConfigRuleCustom); + } + + @Test + void shouldSerializeConfigRuleofTypeConfigRuleAcl() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var expectedSerializedContextId = serializer.serializeContextId(contextIdUuid); + final var expectedSerializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid); + final var expectedSerializedDeviceId = serializer.serializeDeviceId(deviceIdUuid); + final var expectedSerializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid); + + final var expectedSerializedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(expectedSerializedContextId) + .setTopologyUuid(expectedSerializedTopologyIdUuid) + .build(); + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + + final var expectedSerializedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(expectedSerializedTopologyId) + .setDeviceId(expectedSerializedDeviceId) + .setEndpointUuid(expectedSerializedEndPointIdUuid) + .build(); + + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + + final var expectedSerializedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(1) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(1) + .setEndMplsLabel(2) + .build(); + + final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2); + + final var expectedSerializedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + + final var expectedSerializedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(1) + .setDescription("aclEntryDescription") + .setMatch(expectedSerializedAclMatch) + .setAction(expectedSerializedAclAction) + .build(); + + final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction); + + final var expectedSerializedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName("aclRuleName") + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4) + .setDescription("AclRuleDescription") + .setUserId("userId") + .addEntries(expectedSerializedAclEntry) + .build(); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); + + final var expectedSerializedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(expectedSerializedEndPointId) + .setRuleSet(expectedSerializedAclRuleSet) + .build(); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + + final var expectedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setAcl(expectedSerializedConfigRuleAcl) + .build(); + + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeAcl); + final var serializedConfigRule = serializer.serialize(configRule); + + assertThat(serializedConfigRule).isEqualTo(expectedConfigRule); + } + + @Test + void shouldDeserializeConfigRuleOfTypeConfigRuleAcl() { + final var contextIdUuid = "contextId"; + final var topologyIdUuid = "topologyUuid"; + final var deviceIdUuid = "deviceIdUuid"; + final var endpointIdUuid = "endpointIdUuid"; + + final var serializedContextId = serializer.serializeContextId(contextIdUuid); + final var serializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid); + final var serializedDeviceId = serializer.serializeDeviceId(deviceIdUuid); + final var serializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid); + + final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid); + final var serializedTopologyId = + ContextOuterClass.TopologyId.newBuilder() + .setContextId(serializedContextId) + .setTopologyUuid(serializedTopologyIdUuid) + .build(); + + final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid); + final var serializedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(serializedTopologyId) + .setDeviceId(serializedDeviceId) + .setEndpointUuid(serializedEndPointIdUuid) + .build(); + + final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10); + final var serializedAclMatch = + Acl.AclMatch.newBuilder() + .setDscp(1) + .setProtocol(2) + .setSrcAddress("127.0.0.1") + .setDstAddress("127.0.0.2") + .setSrcPort(5601) + .setDstPort(5602) + .setStartMplsLabel(5) + .setEndMplsLabel(10) + .build(); + + final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG); + final var serializedAclAction = + Acl.AclAction.newBuilder() + .setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT) + .setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG) + .build(); + + final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction); + + final var serializedAclEntry = + Acl.AclEntry.newBuilder() + .setSequenceId(1) + .setDescription("aclEntryDescription") + .setMatch(serializedAclMatch) + .setAction(serializedAclAction) + .build(); + + final var aclRuleSet = + new AclRuleSet( + "aclRuleName", + eu.teraflow.policy.acl.AclRuleTypeEnum.IPV4, + "AclRuleDescription", + "userId", + List.of(aclEntry)); + + final var serializedAclRuleSet = + Acl.AclRuleSet.newBuilder() + .setName("aclRuleName") + .setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4) + .setDescription("AclRuleDescription") + .setUserId("userId") + .addEntries(serializedAclEntry) + .build(); + + final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet); + final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl); + + final var expectedConfigRule = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeAcl); + + final var serializedConfigRuleAcl = + ContextOuterClass.ConfigRule_ACL.newBuilder() + .setEndpointId(serializedEndPointId) + .setRuleSet(serializedAclRuleSet) + .build(); + + final var serializedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setAcl(serializedConfigRuleAcl) + .build(); + + final var configRule = serializer.deserialize(serializedConfigRule); + + assertThat(configRule).usingRecursiveComparison().isEqualTo(expectedConfigRule); + } + + @Test + void shouldSerializeConfigRuleOfTypeConfigRuleCustom() { + final var expectedSerializedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKey") + .setResourceValue("resourceValue") + .build(); + + final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue"); + + final var expectedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(expectedSerializedConfigRuleCustom) + .build(); + + final var configRuleTypeCustom = new ConfigRuleTypeCustom(configRuleCustom); + final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeCustom); + final var serializedConfigRule = serializer.serialize(configRule); + + assertThat(serializedConfigRule).isEqualTo(expectedConfigRule); + } + + @Test + void shouldDeserializeConfigRuleOfTypeConfigRuleCustom() { + final var serializedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKey") + .setResourceValue("resourceValue") + .build(); + + final var expectedConfigRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue"); + final var configRuleTypeCustom = new ConfigRuleTypeCustom(expectedConfigRuleCustom); + final var expectedConfigRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeCustom); + + final var serializedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(serializedConfigRuleCustom) + .build(); + + final var configRule = serializer.deserialize(serializedConfigRule); + + assertThat(configRule).usingRecursiveComparison().isEqualTo(expectedConfigRule); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedConfigRule() { + final var serializedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedConfigRule)); + } + + @Test + void shouldSerializeConstraintCustom() { + final var expectedConstraintType = "constraintType"; + final var expectedConstraintValue = "constraintValue"; + + final var constraintCustom = + new ConstraintCustom(expectedConstraintType, expectedConstraintValue); + + final var expectedConstraintCustom = + ContextOuterClass.Constraint_Custom.newBuilder() + .setConstraintType(expectedConstraintType) + .setConstraintValue(expectedConstraintValue) + .build(); + + final var serializedConstraintCustom = serializer.serialize(constraintCustom); + + assertThat(serializedConstraintCustom) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintCustom); + } + + @Test + void shouldDeserializeConstraintCustom() { + final var expectedConstraintType = "constraintType"; + final var expectedConstraintValue = "constraintValue"; + final var expectedConstraintCustom = + new ConstraintCustom(expectedConstraintType, expectedConstraintValue); + + final var serializedConstraintCustom = + ContextOuterClass.Constraint_Custom.newBuilder() + .setConstraintType(expectedConstraintType) + .setConstraintValue(expectedConstraintValue) + .build(); + + final var constraintCustom = serializer.deserialize(serializedConstraintCustom); + + assertThat(constraintCustom).usingRecursiveComparison().isEqualTo(expectedConstraintCustom); + } + + @Test + void shouldSerializeConstraintSchedule() { + final var expectedStartTimestamp = 10; + final var expectedDurationDays = 2.2f; + + final var constraintSchedule = + new ConstraintSchedule(expectedStartTimestamp, expectedDurationDays); + + final var expectedConstraintSchedule = + ContextOuterClass.Constraint_Schedule.newBuilder() + .setStartTimestamp(expectedStartTimestamp) + .setDurationDays(expectedDurationDays) + .build(); + + final var serializedConstraintSchedule = serializer.serialize(constraintSchedule); + + assertThat(serializedConstraintSchedule) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSchedule); + } + + @Test + void shouldDeserializeConstraintSchedule() { + final var expectedStartTimestamp = 10; + final var expectedDurationDays = 2.2f; + + final var expectedConstraintSchedule = + new ConstraintSchedule(expectedStartTimestamp, expectedDurationDays); + + final var serializedConstraintSchedule = + ContextOuterClass.Constraint_Schedule.newBuilder() + .setStartTimestamp(expectedStartTimestamp) + .setDurationDays(expectedDurationDays) + .build(); + + final var constraintSchedule = serializer.deserialize(serializedConstraintSchedule); + + assertThat(constraintSchedule).usingRecursiveComparison().isEqualTo(expectedConstraintSchedule); + } + + @Test + void shouldSerializeLocationOfTypeRegion() { + final var region = "Tokyo"; + + final var locationTypeRegion = new LocationTypeRegion(region); + final var location = new Location(locationTypeRegion); + + final var expectedLocation = ContextOuterClass.Location.newBuilder().setRegion(region).build(); + + final var serializedLocation = serializer.serialize(location); + + assertThat(serializedLocation).isEqualTo(expectedLocation); + } + + @Test + void shouldDeserializeLocationOfTypeRegion() { + final var region = "Tokyo"; + + final var locationTypeRegion = new LocationTypeRegion(region); + final var expectedLocation = new Location(locationTypeRegion); + + final var serializedLocation = + ContextOuterClass.Location.newBuilder().setRegion(region).build(); + + final var location = serializer.deserialize(serializedLocation); + + assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation); + } + + @Test + void shouldSerializeLocationOfTypeGpsPosition() { + final var latitude = 33.3f; + final var longitude = 86.4f; + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + final var location = new Location(locationTypeGpsPosition); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + final var expectedLocation = + ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build(); + + final var serializedLocation = serializer.serialize(location); + + assertThat(serializedLocation).isEqualTo(expectedLocation); + } + + @Test + void shouldDeserializeLocationOfTypeGpsPosition() { + final var latitude = 33.3f; + final var longitude = 86.4f; + + final var gpsPosition = new GpsPosition(latitude, longitude); + final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition); + final var expectedLocation = new Location(locationTypeGpsPosition); + + final var serializedGpsPosition = + ContextOuterClass.GPS_Position.newBuilder() + .setLatitude(latitude) + .setLongitude(longitude) + .build(); + + final var serializedLocation = + ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build(); + + final var location = serializer.deserialize(serializedLocation); + + assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedLocation() { + final var serializedLocation = ContextOuterClass.Location.newBuilder().build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedLocation)); + } + + private static Stream provideIsolationLevelEnum() { + return Stream.of( + Arguments.of( + IsolationLevelEnum.NO_ISOLATION, ContextOuterClass.IsolationLevelEnum.NO_ISOLATION), + Arguments.of( + IsolationLevelEnum.PHYSICAL_ISOLATION, + ContextOuterClass.IsolationLevelEnum.PHYSICAL_ISOLATION), + Arguments.of( + IsolationLevelEnum.LOGICAL_ISOLATION, + ContextOuterClass.IsolationLevelEnum.LOGICAL_ISOLATION), + Arguments.of( + IsolationLevelEnum.PROCESS_ISOLATION, + ContextOuterClass.IsolationLevelEnum.PROCESS_ISOLATION), + Arguments.of( + IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION, + ContextOuterClass.IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION), + Arguments.of( + IsolationLevelEnum.PHYSICAL_NETWORK_ISOLATION, + ContextOuterClass.IsolationLevelEnum.PHYSICAL_NETWORK_ISOLATION), + Arguments.of( + IsolationLevelEnum.VIRTUAL_RESOURCE_ISOLATION, + ContextOuterClass.IsolationLevelEnum.VIRTUAL_RESOURCE_ISOLATION), + Arguments.of( + IsolationLevelEnum.NETWORK_FUNCTIONS_ISOLATION, + ContextOuterClass.IsolationLevelEnum.NETWORK_FUNCTIONS_ISOLATION), + Arguments.of( + IsolationLevelEnum.SERVICE_ISOLATION, + ContextOuterClass.IsolationLevelEnum.SERVICE_ISOLATION)); + } + + @ParameterizedTest + @MethodSource("provideIsolationLevelEnum") + void shouldSerializeIsolationLevelEnum( + IsolationLevelEnum isolationLevelEnum, + ContextOuterClass.IsolationLevelEnum expectedIsolationLevelEnum) { + final var serializedIsolationLevelEnum = serializer.serialize(isolationLevelEnum); + + assertThat(serializedIsolationLevelEnum.getNumber()) + .isEqualTo(expectedIsolationLevelEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideIsolationLevelEnum") + void shouldDeserializeIsolationLevelEnum( + IsolationLevelEnum expectedIsolationLevelEnum, + ContextOuterClass.IsolationLevelEnum serializedIsolationLevelEnum) { + final var isolationLevelEnum = serializer.deserialize(serializedIsolationLevelEnum); + + assertThat(isolationLevelEnum).isEqualTo(expectedIsolationLevelEnum); + } + + @Test + void shouldSerializeConstraintEndPointLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var locationType = new LocationTypeRegion("ATH"); + final var location = new Location(locationType); + + final var constraintEndPointLocation = new ConstraintEndPointLocation(endPointId, location); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedLocation = serializer.serialize(location); + + final var expectedConstraintEndPointLocation = + ContextOuterClass.Constraint_EndPointLocation.newBuilder() + .setEndpointId(serializedEndPointId) + .setLocation(serializedLocation) + .build(); + + final var serializedConstraintEndPointLocation = + serializer.serialize(constraintEndPointLocation); + + assertThat(serializedConstraintEndPointLocation) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintEndPointLocation); + } + + @Test + void shouldDeserializeConstraintEndPointLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var latitude = 54.6f; + final var longitude = 123.7f; + final var gpsPosition = new GpsPosition(latitude, longitude); + + final var locationType = new LocationTypeGpsPosition(gpsPosition); + final var location = new Location(locationType); + + final var expectedConstraintEndPointLocation = + new ConstraintEndPointLocation(endPointId, location); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedLocation = serializer.serialize(location); + + final var serializedConstraintEndPointLocation = + ContextOuterClass.Constraint_EndPointLocation.newBuilder() + .setEndpointId(serializedEndPointId) + .setLocation(serializedLocation) + .build(); + + final var constraintEndPointLocation = + serializer.deserialize(serializedConstraintEndPointLocation); + + assertThat(constraintEndPointLocation) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintEndPointLocation); + } + + @Test + void shouldSerializeConstraintSlaAvailability() { + final var numDisJointPaths = 2; + final var isAllActive = true; + + final var constraintSlaAvailability = + new ConstraintSlaAvailability(numDisJointPaths, isAllActive); + + final var expectedConstraintSlaAvailability = + ContextOuterClass.Constraint_SLA_Availability.newBuilder() + .setNumDisjointPaths(numDisJointPaths) + .setAllActive(isAllActive) + .build(); + + final var serializedConstraintSlaAvailability = serializer.serialize(constraintSlaAvailability); + + assertThat(serializedConstraintSlaAvailability) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaAvailability); + } + + @Test + void shouldDeserializeConstraintSlaAvailability() { + final var numDisJointPaths = 2; + final var isAllActive = true; + + final var expectedConstraintSlaAvailability = + new ConstraintSlaAvailability(numDisJointPaths, isAllActive); + + final var serializedConstraintSlaAvailability = + ContextOuterClass.Constraint_SLA_Availability.newBuilder() + .setNumDisjointPaths(numDisJointPaths) + .setAllActive(isAllActive) + .build(); + + final var constraintSlaAvailability = + serializer.deserialize(serializedConstraintSlaAvailability); + + assertThat(constraintSlaAvailability) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaAvailability); + } + + @Test + void shouldSerializeConstraintSlaCapacity() { + final var capacityGbps = 5; + + final var constraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + + final var expectedConstraintSlaCapacity = + ContextOuterClass.Constraint_SLA_Capacity.newBuilder() + .setCapacityGbps(capacityGbps) + .build(); + + final var serializedConstraintSlaCapacity = serializer.serialize(constraintSlaCapacity); + + assertThat(serializedConstraintSlaCapacity) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaCapacity); + } + + @Test + void shouldDeserializeConstraintSlaCapacity() { + final var capacityGbps = 5; + + final var expectedConstraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + + final var serializedConstraintSlaCapacity = + ContextOuterClass.Constraint_SLA_Capacity.newBuilder() + .setCapacityGbps(capacityGbps) + .build(); + + final var constraintSlaCapacity = serializer.deserialize(serializedConstraintSlaCapacity); + + assertThat(constraintSlaCapacity) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaCapacity); + } + + @Test + void shouldSerializeConstraintSlaIsolationLevel() { + final var isolationLevelEnums = + List.of( + IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION, + IsolationLevelEnum.NETWORK_FUNCTIONS_ISOLATION); + + final var constraintSlaIsolationLevel = new ConstraintSlaIsolationLevel(isolationLevelEnums); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream() + .map(isolationLevelEnum -> serializer.serialize(isolationLevelEnum)) + .collect(Collectors.toList()); + final var expectedConstraintSlaIsolationLevel = + ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() + .addAllIsolationLevel(serializedIsolationLevelEnums) + .build(); + + final var serializedConstraintSlaIsolationLevel = + serializer.serialize(constraintSlaIsolationLevel); + + assertThat(serializedConstraintSlaIsolationLevel) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaIsolationLevel); + } + + @Test + void shouldDeserializeConstraintSlaIsolationLevel() { + final var isolationLevelEnums = + List.of(IsolationLevelEnum.PROCESS_ISOLATION, IsolationLevelEnum.SERVICE_ISOLATION); + + final var expectedConstraintSlaIsolationLevel = + new ConstraintSlaIsolationLevel(isolationLevelEnums); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream() + .map(isolationLevelEnum -> serializer.serialize(isolationLevelEnum)) + .collect(Collectors.toList()); + final var serializedConstraintSlaIsolationLevel = + ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() + .addAllIsolationLevel(serializedIsolationLevelEnums) + .build(); + + final var constraintSlaIsolationLevel = + serializer.deserialize(serializedConstraintSlaIsolationLevel); + + assertThat(constraintSlaIsolationLevel) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaIsolationLevel); + } + + @Test + void shouldSerializeConstraintSlaLatency() { + final var e2eLatencyMs = 5.7f; + + final var constraintSlaLatency = new ConstraintSlaLatency(e2eLatencyMs); + + final var expectedConstraintSlaLatency = + ContextOuterClass.Constraint_SLA_Latency.newBuilder().setE2ELatencyMs(e2eLatencyMs).build(); + + final var serializedConstraintSlaLatency = serializer.serialize(constraintSlaLatency); + + assertThat(serializedConstraintSlaLatency) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaLatency); + } + + @Test + void shouldDeserializeConstraintSlaLatency() { + final var e2eLatencyMs = 5.7f; + + final var expectedConstraintSlaLatency = new ConstraintSlaLatency(e2eLatencyMs); + + final var serializedConstraintSlaLatency = + ContextOuterClass.Constraint_SLA_Latency.newBuilder().setE2ELatencyMs(e2eLatencyMs).build(); + + final var constraintSlaLatency = serializer.deserialize(serializedConstraintSlaLatency); + + assertThat(constraintSlaLatency) + .usingRecursiveComparison() + .isEqualTo(expectedConstraintSlaLatency); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintCustom() { + final var expectedConstraintType = "constraintType"; + final var expectedConstraintValue = "constraintValue"; + + final var constraintCustom = + new ConstraintCustom(expectedConstraintType, expectedConstraintValue); + final var constraintTypeCustom = new ConstraintTypeCustom(constraintCustom); + final var constraint = new Constraint(constraintTypeCustom); + + final var expectedConstraintCustom = + ContextOuterClass.Constraint_Custom.newBuilder() + .setConstraintType(expectedConstraintType) + .setConstraintValue(expectedConstraintValue) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder().setCustom(expectedConstraintCustom).build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintCustom() { + final var expectedConstraintType = "constraintType"; + final var expectedConstraintValue = "constraintValue"; + + final var constraintCustom = + new ConstraintCustom(expectedConstraintType, expectedConstraintValue); + final var constraintTypeCustom = new ConstraintTypeCustom(constraintCustom); + final var expectedConstraint = new Constraint(constraintTypeCustom); + + final var serializedConstraintCustom = + ContextOuterClass.Constraint_Custom.newBuilder() + .setConstraintType(expectedConstraintType) + .setConstraintValue(expectedConstraintValue) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder().setCustom(serializedConstraintCustom).build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintSchedule() { + final var startTimeSTamp = 2.2f; + final var durationDays = 5.73f; + + final var constraintSchedule = new ConstraintSchedule(startTimeSTamp, durationDays); + final var constraintTypeSchedule = new ConstraintTypeSchedule(constraintSchedule); + final var constraint = new Constraint(constraintTypeSchedule); + + final var expectedConstraintSchedule = + ContextOuterClass.Constraint_Schedule.newBuilder() + .setStartTimestamp(startTimeSTamp) + .setDurationDays(durationDays) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder().setSchedule(expectedConstraintSchedule).build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintSchedule() { + final var startTimeSTamp = 2.2f; + final var durationDays = 5.73f; + + final var expectedConstraintSchedule = new ConstraintSchedule(startTimeSTamp, durationDays); + final var expectedConstraintTypeSchedule = + new ConstraintTypeSchedule(expectedConstraintSchedule); + final var expectedConstraint = new Constraint(expectedConstraintTypeSchedule); + + final var serializedConstraintSchedule = + ContextOuterClass.Constraint_Schedule.newBuilder() + .setStartTimestamp(startTimeSTamp) + .setDurationDays(durationDays) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder().setSchedule(serializedConstraintSchedule).build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintEndPointLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var locationType = new LocationTypeRegion("ATH"); + final var location = new Location(locationType); + + final var constraintEndPointLocation = new ConstraintEndPointLocation(endPointId, location); + final var constraintTypeEndPointLocation = + new ConstraintTypeEndPointLocation(constraintEndPointLocation); + final var constraint = new Constraint(constraintTypeEndPointLocation); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedLocation = serializer.serialize(location); + + final var expectedConstraintEndPointLocation = + ContextOuterClass.Constraint_EndPointLocation.newBuilder() + .setEndpointId(serializedEndPointId) + .setLocation(serializedLocation) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setEndpointLocation(expectedConstraintEndPointLocation) + .build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintEndPointLocation() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var locationType = new LocationTypeRegion("ATH"); + final var location = new Location(locationType); + + final var expectedConstraintEndPointLocation = + new ConstraintEndPointLocation(endPointId, location); + final var expectedConstraintTypeEndPointLocation = + new ConstraintTypeEndPointLocation(expectedConstraintEndPointLocation); + final var expectedConstraint = new Constraint(expectedConstraintTypeEndPointLocation); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedLocation = serializer.serialize(location); + + final var serializedEndPointLocation = + ContextOuterClass.Constraint_EndPointLocation.newBuilder() + .setEndpointId(serializedEndPointId) + .setLocation(serializedLocation) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setEndpointLocation(serializedEndPointLocation) + .build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintSlaAvailability() { + final var numDisjointPaths = 2; + final var isAllActive = true; + + final var constraintSlaAvailability = + new ConstraintSlaAvailability(numDisjointPaths, isAllActive); + final var constraintTypeSlaAvailability = + new ConstraintTypeSlaAvailability(constraintSlaAvailability); + final var constraint = new Constraint(constraintTypeSlaAvailability); + + final var expectedConstraintSlaAvailability = + ContextOuterClass.Constraint_SLA_Availability.newBuilder() + .setNumDisjointPaths(numDisjointPaths) + .setAllActive(isAllActive) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaAvailability(expectedConstraintSlaAvailability) + .build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintSlaAvailability() { + final var numDisjointPaths = 2; + final var isAllActive = true; + + final var expectedConstraintSlaAvailability = + new ConstraintSlaAvailability(numDisjointPaths, isAllActive); + final var expectedConstraintTypeSlaAvailability = + new ConstraintTypeSlaAvailability(expectedConstraintSlaAvailability); + final var expectedConstraint = new Constraint(expectedConstraintTypeSlaAvailability); + + final var serializedConstraintSlaAvailability = + ContextOuterClass.Constraint_SLA_Availability.newBuilder() + .setNumDisjointPaths(numDisjointPaths) + .setAllActive(isAllActive) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaAvailability(serializedConstraintSlaAvailability) + .build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintSlaCapacity() { + final var capacityGbps = 77.3f; + + final var constraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + final var constraintTypeSlaCapacity = new ConstraintTypeSlaCapacity(constraintSlaCapacity); + final var constraint = new Constraint(constraintTypeSlaCapacity); + + final var expectedConstraintSlaCapacity = + ContextOuterClass.Constraint_SLA_Capacity.newBuilder() + .setCapacityGbps(capacityGbps) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaCapacity(expectedConstraintSlaCapacity) + .build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintSlaCapacity() { + final var capacityGbps = 77.3f; + + final var expectedConstraintSlaCapacity = new ConstraintSlaCapacity(capacityGbps); + final var expectedConstraintTypeSlaCapacity = + new ConstraintTypeSlaCapacity(expectedConstraintSlaCapacity); + final var expectedConstraint = new Constraint(expectedConstraintTypeSlaCapacity); + + final var serializedConstraintSlaCapacity = + ContextOuterClass.Constraint_SLA_Capacity.newBuilder() + .setCapacityGbps(capacityGbps) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaCapacity(serializedConstraintSlaCapacity) + .build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintSlaIsolationLevel() { + final var isolationLevelEnums = + List.of(IsolationLevelEnum.PHYSICAL_ISOLATION, IsolationLevelEnum.NO_ISOLATION); + + final var expectedConstraintSlaIsolationLevel = + new ConstraintSlaIsolationLevel(isolationLevelEnums); + final var expectedConstraintTypeSlaIsolationLevel = + new ConstraintTypeSlaIsolationLevel(expectedConstraintSlaIsolationLevel); + final var expectedConstraint = new Constraint(expectedConstraintTypeSlaIsolationLevel); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream() + .map(isolationLevelEnum -> serializer.serialize(isolationLevelEnum)) + .collect(Collectors.toList()); + + final var serializedConstraintSlaIsolationLevel = + ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() + .addAllIsolationLevel(serializedIsolationLevelEnums) + .build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaIsolation(serializedConstraintSlaIsolationLevel) + .build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintSlaIsolationLevel() { + final var isolationLevelEnums = + List.of( + IsolationLevelEnum.VIRTUAL_RESOURCE_ISOLATION, + IsolationLevelEnum.PHYSICAL_MEMORY_ISOLATION); + + final var constraintSlaIsolationLevel = new ConstraintSlaIsolationLevel(isolationLevelEnums); + final var constraintTypeSlaIsolationLevel = + new ConstraintTypeSlaIsolationLevel(constraintSlaIsolationLevel); + final var constraint = new Constraint(constraintTypeSlaIsolationLevel); + + final var serializedIsolationLevelEnums = + isolationLevelEnums.stream() + .map(isolationLevelEnum -> serializer.serialize(isolationLevelEnum)) + .collect(Collectors.toList()); + + final var expectedConstraintSlaIsolationLevel = + ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() + .addAllIsolationLevel(serializedIsolationLevelEnums) + .build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaIsolation(expectedConstraintSlaIsolationLevel) + .build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldSerializeConstraintOfTypeConstraintSlaLatency() { + final var e2eLatencyMs = 45.32f; + + final var constraintSlaLatency = new ConstraintSlaLatency(e2eLatencyMs); + final var constraintTypeSlaLatency = new ConstraintTypeSlaLatency(constraintSlaLatency); + final var constraint = new Constraint(constraintTypeSlaLatency); + + final var expectedConstraintSlaLatency = + ContextOuterClass.Constraint_SLA_Latency.newBuilder().setE2ELatencyMs(e2eLatencyMs).build(); + + final var expectedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaLatency(expectedConstraintSlaLatency) + .build(); + + final var serializedConstraint = serializer.serialize(constraint); + + assertThat(serializedConstraint).isEqualTo(expectedConstraint); + } + + @Test + void shouldDeserializeConstraintOfTypeConstraintSlaLatency() { + final var e2eLatencyMs = 45.32f; + + final var expectedConstraintSlaLatency = new ConstraintSlaLatency(e2eLatencyMs); + final var expectedConstraintTypeSlaLatency = + new ConstraintTypeSlaLatency(expectedConstraintSlaLatency); + final var expectedConstraint = new Constraint(expectedConstraintTypeSlaLatency); + + final var serializedConstraintSlaLatency = + ContextOuterClass.Constraint_SLA_Latency.newBuilder().setE2ELatencyMs(e2eLatencyMs).build(); + + final var serializedConstraint = + ContextOuterClass.Constraint.newBuilder() + .setSlaLatency(serializedConstraintSlaLatency) + .build(); + + final var constraint = serializer.deserialize(serializedConstraint); + + assertThat(constraint).usingRecursiveComparison().isEqualTo(expectedConstraint); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedConstraint() { + final var serializedKpiValue = ContextOuterClass.Constraint.newBuilder().build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedKpiValue)); + } + + @Test + void shouldSerializeEndPointId() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var serializedTopologyId = serializer.serialize(expectedTopologyId); + final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); + final var serializedEndPointUuid = serializer.serializeUuid(expectedId); + + final var expectedEndPointId = + ContextOuterClass.EndPointId.newBuilder() + .setTopologyId(serializedTopologyId) + .setDeviceId(serializedDeviceId) + .setEndpointUuid(serializedEndPointUuid) + .build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + + assertThat(serializedEndPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId); + } + + @Test + void shouldDeserializeEndPointId() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + + final var serializedEndPointId = serializer.serialize(expectedEndPointId); + final var endPointId = serializer.deserialize(serializedEndPointId); + + assertThat(endPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId); + } + + private static Stream provideEventTypeEnum() { + return Stream.of( + Arguments.of(EventTypeEnum.CREATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE), + Arguments.of(EventTypeEnum.REMOVE, ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE), + Arguments.of(EventTypeEnum.UNDEFINED, ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED), + Arguments.of(EventTypeEnum.UPDATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE)); + } + + @ParameterizedTest + @MethodSource("provideEventTypeEnum") + void shouldSerializeEventType( + EventTypeEnum eventType, ContextOuterClass.EventTypeEnum expectedSerializedType) { + final var serializedType = serializer.serialize(eventType); + + assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideEventTypeEnum") + void shouldDeserializeEventType( + EventTypeEnum expectedEventType, ContextOuterClass.EventTypeEnum serializedEventType) { + final var eventType = serializer.deserialize(serializedEventType); + + assertThat(eventType).isEqualTo(expectedEventType); + } + + @Test + void shouldSerializeEvent() { + final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var expectedEvent = + ContextOuterClass.Event.newBuilder() + .setTimestamp(timestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) + .build(); + + final var event = new Event(1, EventTypeEnum.CREATE); + final var serializedEvent = serializer.serialize(event); + + assertThat(serializedEvent).usingRecursiveComparison().isEqualTo(expectedEvent); + } + + @Test + void shouldDeserializeEvent() { + final var expectedEvent = new Event(1, EventTypeEnum.CREATE); + final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build(); + + final var serializedEvent = + ContextOuterClass.Event.newBuilder() + .setTimestamp(timestamp) + .setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE) + .build(); + final var event = serializer.deserialize(serializedEvent); + + assertThat(event).usingRecursiveComparison().isEqualTo(expectedEvent); + } + + @Test + void shouldSerializeServiceId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + final var serviceId = new ServiceId(expectedContextId, expectedId); + + final var serializedContextId = serializer.serializeContextId(expectedContextId); + final var serializedIdUuid = serializer.serializeUuid(expectedId); + + final var expectedServiceId = + ContextOuterClass.ServiceId.newBuilder() + .setContextId(serializedContextId) + .setServiceUuid(serializedIdUuid) + .build(); + + final var serializedServiceId = serializer.serialize(serviceId); + + assertThat(serializedServiceId).usingRecursiveComparison().isEqualTo(expectedServiceId); + } + + @Test + void shouldDeserializeServiceId() { + final var expectedContextId = "expectedContextId"; + final var expectedId = "expectedId"; + + final var expectedServiceId = new ServiceId(expectedContextId, expectedId); + + final var serializedServiceId = serializer.serialize(expectedServiceId); + + final var serviceId = serializer.deserialize(serializedServiceId); + + assertThat(serviceId).usingRecursiveComparison().isEqualTo(expectedServiceId); + } + + private static Stream provideServiceStatusEnum() { + return Stream.of( + Arguments.of( + ServiceStatusEnum.ACTIVE, ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_ACTIVE), + Arguments.of( + ServiceStatusEnum.PLANNED, ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_PLANNED), + Arguments.of( + ServiceStatusEnum.PENDING_REMOVAL, + ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_PENDING_REMOVAL), + Arguments.of( + ServiceStatusEnum.UNDEFINED, + ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideServiceStatusEnum") + void shouldSerializeServiceStatusEnum( + ServiceStatusEnum serviceStatusEnum, + ContextOuterClass.ServiceStatusEnum expectedSerializedType) { + final var serializedServiceStatusEnum = serializer.serialize(serviceStatusEnum); + + assertThat(serializedServiceStatusEnum.getNumber()) + .isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideServiceStatusEnum") + void shouldDeserializeServiceStatusEnum( + ServiceStatusEnum expectedServiceStatusEnum, + ContextOuterClass.ServiceStatusEnum serializedServiceStatusEnum) { + final var serviceStatusEnum = serializer.deserialize(serializedServiceStatusEnum); + + assertThat(serviceStatusEnum).isEqualTo(expectedServiceStatusEnum); + } + + private static Stream provideServiceTypeEnum() { + return Stream.of( + Arguments.of(ServiceTypeEnum.L2NM, ContextOuterClass.ServiceTypeEnum.SERVICETYPE_L2NM), + Arguments.of(ServiceTypeEnum.L3NM, ContextOuterClass.ServiceTypeEnum.SERVICETYPE_L3NM), + Arguments.of( + ServiceTypeEnum.TAPI_CONNECTIVITY_SERVICE, + ContextOuterClass.ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE), + Arguments.of( + ServiceTypeEnum.UNKNOWN, ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN)); + } + + @ParameterizedTest + @MethodSource("provideServiceTypeEnum") + void shouldSerializeServiceTypeEnum( + ServiceTypeEnum serviceTypeEnum, ContextOuterClass.ServiceTypeEnum expectedSerializedType) { + final var serializedServiceTypeEnum = serializer.serialize(serviceTypeEnum); + + assertThat(serializedServiceTypeEnum.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideServiceTypeEnum") + void shouldDeserializeServiceTypeEnum( + ServiceTypeEnum expectedServiceTypeEnum, + ContextOuterClass.ServiceTypeEnum serializedServiceTypeEnum) { + final var serviceTypeEnum = serializer.deserialize(serializedServiceTypeEnum); + + assertThat(serviceTypeEnum).isEqualTo(expectedServiceTypeEnum); + } + + @Test + void shouldSerializeServiceStatus() { + final var expectedServiceStatusEnum = ServiceStatusEnum.ACTIVE; + final var serviceStatus = new ServiceStatus(expectedServiceStatusEnum); + + final var serializedServiceStatusEnum = serializer.serialize(expectedServiceStatusEnum); + + final var expectedServiceStatus = + ContextOuterClass.ServiceStatus.newBuilder() + .setServiceStatus(serializedServiceStatusEnum) + .build(); + + final var serializedServiceStatus = serializer.serialize(serviceStatus); + + assertThat(serializedServiceStatus).usingRecursiveComparison().isEqualTo(expectedServiceStatus); + } + + @Test + void shouldDeserializeServiceStatus() { + final var expectedServiceStatus = new ServiceStatus(ServiceStatusEnum.PENDING_REMOVAL); + + final var serializedServiceStatus = serializer.serialize(expectedServiceStatus); + final var serviceStatus = serializer.deserialize(serializedServiceStatus); + + assertThat(serviceStatus).usingRecursiveComparison().isEqualTo(expectedServiceStatus); + } + + @Test + void shouldSerializeServiceConfig() { + final var configRuleA = createConfigRule(); + final var configRuleB = createConfigRule(); + final var serviceConfig = new ServiceConfig(List.of(configRuleA, configRuleB)); + + final var expectedConfigRuleA = serializer.serialize(configRuleA); + final var expectedConfigRuleB = serializer.serialize(configRuleB); + + final var expectedServiceConfig = + ContextOuterClass.ServiceConfig.newBuilder() + .addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB)) + .build(); + + final var serializedServiceConfig = serializer.serialize(serviceConfig); + + assertThat(serializedServiceConfig).usingRecursiveComparison().isEqualTo(expectedServiceConfig); + } + + @Test + void shouldDeserializeServiceConfig() { + final var expectedConfigRuleA = createConfigRule(); + final var expectedConfigRuleB = createConfigRule(); + final var expectedServiceConfig = + new ServiceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB)); + + final var configRuleA = serializer.serialize(expectedConfigRuleA); + final var configRuleB = serializer.serialize(expectedConfigRuleB); + final var serializedServiceConfig = + ContextOuterClass.ServiceConfig.newBuilder() + .addAllConfigRules(List.of(configRuleA, configRuleB)) + .build(); + + final var serviceConfig = serializer.deserialize(serializedServiceConfig); + + assertThat(serviceConfig).usingRecursiveComparison().isEqualTo(expectedServiceConfig); + } + + @Test + void shouldSerializeService() { + final var expectedServiceId = new ServiceId("contextId", "serviceId"); + final var expectedServiceTypeEnum = ServiceTypeEnum.TAPI_CONNECTIVITY_SERVICE; + final var firstExpectedTopologyId = new TopologyId("contextId", "firstTopologyId"); + final var secondExpectedTopologyId = new TopologyId("contextId", "secondTopologyId"); + + final var firstExpectedEndPointId = + new EndPointId(firstExpectedTopologyId, "firstDeviceId", "firstEndPointId"); + final var secondExpectedEndPointId = + new EndPointId(secondExpectedTopologyId, "firstDeviceId", "firstEndPointId"); + final var expectedServiceEndPointIds = + List.of(firstExpectedEndPointId, secondExpectedEndPointId); + + final var expectedConstraintTypeA = "constraintTypeA"; + final var expectedConstraintValueA = "constraintValueA"; + + final var constraintCustomA = + new ConstraintCustom(expectedConstraintTypeA, expectedConstraintValueA); + final var constraintTypeCustomA = new ConstraintTypeCustom(constraintCustomA); + final var firstExpectedConstraint = new Constraint(constraintTypeCustomA); + + final var expectedConstraintTypeB = "constraintTypeB"; + final var expectedConstraintValueB = "constraintValueB"; + + final var constraintCustomB = + new ConstraintCustom(expectedConstraintTypeB, expectedConstraintValueB); + final var constraintTypeCustomB = new ConstraintTypeCustom(constraintCustomB); + final var secondExpectedConstraint = new Constraint(constraintTypeCustomB); + + final var expectedServiceConstraints = + List.of(firstExpectedConstraint, secondExpectedConstraint); + + final var expectedServiceStatus = new ServiceStatus(ServiceStatusEnum.PLANNED); + + final var expectedConfigRuleA = createConfigRule(); + final var expectedConfigRuleB = createConfigRule(); + + final var expectedConfigRules = List.of(expectedConfigRuleA, expectedConfigRuleB); + + final var expectedServiceConfig = new ServiceConfig(expectedConfigRules); + + final var expectedTimestamp = 2.3; + + final var service = + new Service( + expectedServiceId, + expectedServiceTypeEnum, + expectedServiceEndPointIds, + expectedServiceConstraints, + expectedServiceStatus, + expectedServiceConfig, + expectedTimestamp); + + final var serializedServiceId = serializer.serialize(expectedServiceId); + final var serializedServiceType = serializer.serialize(expectedServiceTypeEnum); + final var serializedServiceEndPointIds = + expectedServiceEndPointIds.stream() + .map(endPointId -> serializer.serialize(endPointId)) + .collect(Collectors.toList()); + final var serializedServiceConstraints = + expectedServiceConstraints.stream() + .map(constraint -> serializer.serialize(constraint)) + .collect(Collectors.toList()); + final var serializedServiceStatus = serializer.serialize(expectedServiceStatus); + final var serializedServiceConfig = serializer.serialize(expectedServiceConfig); + final var serializedTimestamp = serializer.serialize(expectedTimestamp); + + final var expectedService = + ContextOuterClass.Service.newBuilder() + .setServiceId(serializedServiceId) + .setServiceType(serializedServiceType) + .addAllServiceEndpointIds(serializedServiceEndPointIds) + .addAllServiceConstraints(serializedServiceConstraints) + .setServiceStatus(serializedServiceStatus) + .setServiceConfig(serializedServiceConfig) + .setTimestamp(serializedTimestamp) + .build(); + + final var serializedService = serializer.serialize(service); + + assertThat(serializedService).isEqualTo(expectedService); + } + + @Test + void shouldDeserializeService() { + final var expectedServiceId = new ServiceId("contextId", "serviceId"); + final var expectedServiceTypeEnum = ServiceTypeEnum.TAPI_CONNECTIVITY_SERVICE; + final var firstExpectedTopologyId = new TopologyId("contextId", "firstTopologyId"); + final var secondExpectedTopologyId = new TopologyId("contextId", "secondTopologyId"); + + final var firstExpectedEndPointId = + new EndPointId(firstExpectedTopologyId, "firstDeviceId", "firstEndPointId"); + final var secondExpectedEndPointId = + new EndPointId(secondExpectedTopologyId, "firstDeviceId", "firstEndPointId"); + final var expectedServiceEndPointIds = + List.of(firstExpectedEndPointId, secondExpectedEndPointId); + + final var expectedConstraintTypeA = "constraintTypeA"; + final var expectedConstraintValueA = "constraintValueA"; + + final var constraintCustomA = + new ConstraintCustom(expectedConstraintTypeA, expectedConstraintValueA); + final var constraintTypeCustomA = new ConstraintTypeCustom(constraintCustomA); + final var firstExpectedConstraint = new Constraint(constraintTypeCustomA); + + final var expectedConstraintTypeB = "constraintTypeB"; + final var expectedConstraintValueB = "constraintValueB"; + + final var constraintCustomB = + new ConstraintCustom(expectedConstraintTypeB, expectedConstraintValueB); + final var constraintTypeCustomB = new ConstraintTypeCustom(constraintCustomB); + final var secondExpectedConstraint = new Constraint(constraintTypeCustomB); + + final var expectedServiceConstraints = + List.of(firstExpectedConstraint, secondExpectedConstraint); + + final var expectedServiceStatus = new ServiceStatus(ServiceStatusEnum.PLANNED); + + final var firstExpectedConfigRuleA = createConfigRule(); + final var secondExpectedConfigRuleB = createConfigRule(); + + final var expectedConfigRules = List.of(firstExpectedConfigRuleA, secondExpectedConfigRuleB); + + final var expectedServiceConfig = new ServiceConfig(expectedConfigRules); + + final var expectedTimestamp = 7.8; + + final var expectedService = + new Service( + expectedServiceId, + expectedServiceTypeEnum, + expectedServiceEndPointIds, + expectedServiceConstraints, + expectedServiceStatus, + expectedServiceConfig, + expectedTimestamp); + + final var serializedServiceId = serializer.serialize(expectedServiceId); + final var serializedServiceType = serializer.serialize(expectedServiceTypeEnum); + final var serializedServiceEndPointIds = + expectedServiceEndPointIds.stream() + .map(endPointId -> serializer.serialize(endPointId)) + .collect(Collectors.toList()); + final var serializedServiceConstraints = + expectedServiceConstraints.stream() + .map(constraint -> serializer.serialize(constraint)) + .collect(Collectors.toList()); + final var serializedServiceStatus = serializer.serialize(expectedServiceStatus); + final var serializedServiceConfig = serializer.serialize(expectedServiceConfig); + final var serializedTimestamp = serializer.serialize(expectedTimestamp); + + final var serializedService = + ContextOuterClass.Service.newBuilder() + .setServiceId(serializedServiceId) + .setServiceType(serializedServiceType) + .addAllServiceEndpointIds(serializedServiceEndPointIds) + .addAllServiceConstraints(serializedServiceConstraints) + .setServiceStatus(serializedServiceStatus) + .setServiceConfig(serializedServiceConfig) + .setTimestamp(serializedTimestamp) + .build(); + + final var service = serializer.deserialize(serializedService); + + assertThat(service).usingRecursiveComparison().isEqualTo(expectedService); + } + + private static Stream provideKpiSampleType() { + return Stream.of( + Arguments.of( + KpiSampleType.PACKETS_TRANSMITTED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED), + Arguments.of( + KpiSampleType.PACKETS_RECEIVED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED), + Arguments.of( + KpiSampleType.BYTES_TRANSMITTED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED), + Arguments.of( + KpiSampleType.BYTES_RECEIVED, + KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED), + Arguments.of(KpiSampleType.UNKNOWN, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN)); + } + + @ParameterizedTest + @MethodSource("provideKpiSampleType") + void shouldSerializeKpiSampleType( + KpiSampleType kpiSampleType, KpiSampleTypes.KpiSampleType expectedSerializedType) { + final var serializedKpiSampleType = serializer.serialize(kpiSampleType); + + assertThat(serializedKpiSampleType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideKpiSampleType") + void shouldDeserializeKpiSampleType( + KpiSampleType expectedKpiSampleType, KpiSampleTypes.KpiSampleType serializedKpiSampleType) { + final var kpiSampleType = serializer.deserialize(serializedKpiSampleType); + + assertThat(kpiSampleType).isEqualTo(expectedKpiSampleType); + } + + private static Stream provideRuleState() { + return Stream.of( + Arguments.of(RuleState.POLICY_UNDEFINED, Policy.RuleState.POLICY_UNDEFINED), + Arguments.of(RuleState.POLICY_FAILED, Policy.RuleState.POLICY_FAILED), + Arguments.of(RuleState.POLICY_INSERTED, Policy.RuleState.POLICY_INSERTED), + Arguments.of(RuleState.POLICY_VALIDATED, Policy.RuleState.POLICY_VALIDATED), + Arguments.of(RuleState.POLICY_PROVISIONED, Policy.RuleState.POLICY_PROVISIONED), + Arguments.of(RuleState.POLICY_ACTIVE, Policy.RuleState.POLICY_ACTIVE), + Arguments.of(RuleState.POLICY_ENFORCED, Policy.RuleState.POLICY_ENFORCED), + Arguments.of(RuleState.POLICY_INEFFECTIVE, Policy.RuleState.POLICY_INEFFECTIVE), + Arguments.of(RuleState.POLICY_EFFECTIVE, Policy.RuleState.POLICY_EFFECTIVE), + Arguments.of(RuleState.POLICY_UPDATED, Policy.RuleState.POLICY_UPDATED), + Arguments.of(RuleState.POLICY_REMOVED, Policy.RuleState.POLICY_REMOVED)); + } + + @ParameterizedTest + @MethodSource("provideRuleState") + void shouldSerializeRuleState(RuleState ruleState, Policy.RuleState expectedSerializedType) { + final var serializedRuleState = serializer.serialize(ruleState); + + assertThat(serializedRuleState.getNumber()).isEqualTo(expectedSerializedType.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideRuleState") + void shouldDeserializeRuleState( + RuleState expectedRuleState, Policy.RuleState serializedRuleState) { + final var ruleState = serializer.deserialize(serializedRuleState); + + assertThat(ruleState).isEqualTo(expectedRuleState); + } + + @Test + void shouldSerializePolicyRuleState() { + final var expectedRuleState = RuleState.POLICY_ACTIVE; + final var policyRuleState = new PolicyRuleState(expectedRuleState); + + final var serializedRuleState = serializer.serialize(expectedRuleState); + + final var expectedPolicyRuleState = + Policy.PolicyRuleState.newBuilder().setPolicyRuleState(serializedRuleState).build(); + + final var serializedPolicyRuleState = serializer.serialize(policyRuleState); + + assertThat(serializedPolicyRuleState) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleState); + } + + @Test + void shouldDeserializePolicyRuleState() { + final var expectedRuleState = RuleState.POLICY_ENFORCED; + final var expectedPolicyRuleState = new PolicyRuleState(expectedRuleState); + + final var serializedPolicyRuleState = serializer.serialize(expectedPolicyRuleState); + + final var policyRuleState = serializer.deserialize(serializedPolicyRuleState); + + assertThat(policyRuleState).usingRecursiveComparison().isEqualTo(expectedPolicyRuleState); + } + + private static Stream provideNumericalOperator() { + return Stream.of( + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_UNDEFINED, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideNumericalOperator") + void shouldSerializeNumericalOperator( + NumericalOperator numericalOperator, + PolicyCondition.NumericalOperator expectedNumericalOperator) { + final var serializedNumericalOperator = serializer.serialize(numericalOperator); + + assertThat(serializedNumericalOperator).isEqualTo(expectedNumericalOperator); + } + + @ParameterizedTest + @MethodSource("provideNumericalOperator") + void shouldDeserializeNumericalOperator( + NumericalOperator expectedNumericalOperator, + PolicyCondition.NumericalOperator serializedNumericalOperator) { + final var numericalOperator = serializer.deserialize(serializedNumericalOperator); + + assertThat(numericalOperator).isEqualTo(expectedNumericalOperator); + } + + @Test + void shouldSerializeSubscriptionId() { + final var subscriptionId = "subscriptionId"; + + final var subscriptionIdUuid = serializer.serializeUuid(subscriptionId); + + final var expectedSubscriptionId = + Monitoring.SubscriptionID.newBuilder().setSubsId(subscriptionIdUuid).build(); + + final var serializedSubscriptionId = serializer.serializeSubscriptionIdId(subscriptionId); + + assertThat(serializedSubscriptionId) + .usingRecursiveComparison() + .isEqualTo(expectedSubscriptionId); + } + + @Test + void shouldDeserializeSubscriptionId() { + final var expectedSubscriptionId = "expectedSubscriptionId"; + + final var serializedSubscriptionIdUuid = serializer.serializeUuid(expectedSubscriptionId); + final var serializedSubscriptionId = + Monitoring.SubscriptionID.newBuilder().setSubsId(serializedSubscriptionIdUuid).build(); + + final var subscriptionId = serializer.deserialize(serializedSubscriptionId); + + assertThat(subscriptionId).isEqualTo(expectedSubscriptionId); + } + + private static Stream provideNumericalOperators() { + return Stream.of( + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_NOT_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN), + Arguments.of( + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL, + PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL)); + } + + @ParameterizedTest + @MethodSource("provideNumericalOperators") + void shouldSerializePolicyRuleConditionGivenMultipleNumericalOperators( + NumericalOperator expectedNumericalOperator) { + final var expectedPolicyRuleConditionKpiId = "expectedPolicyRuleConditionKpiId"; + final var expectedPolicyRuleConditionKpiValue = new IntegerKpiValue(34); + + final var policyRuleCondition = + new PolicyRuleCondition( + expectedPolicyRuleConditionKpiId, + expectedNumericalOperator, + expectedPolicyRuleConditionKpiValue); + + final var serializedPolicyRuleConditionKpiIdUuid = + serializer.serializeUuid(expectedPolicyRuleConditionKpiId); + final var serializedPolicyRuleConditionKpiId = + KpiId.newBuilder().setKpiId(serializedPolicyRuleConditionKpiIdUuid).build(); + final var serializedNumericalOperator = serializer.serialize(expectedNumericalOperator); + final var serializedPolicyRuleConditionKpiValue = + serializer.serializeIntegerKpiValue(expectedPolicyRuleConditionKpiValue); + + final var expectedPolicyRuleCondition = + PolicyCondition.PolicyRuleCondition.newBuilder() + .setKpiId(serializedPolicyRuleConditionKpiId) + .setNumericalOperator(serializedNumericalOperator) + .setKpiValue(serializedPolicyRuleConditionKpiValue) + .build(); + + final var serializedPolicyRuleCondition = serializer.serialize(policyRuleCondition); + + assertThat(serializedPolicyRuleCondition) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleCondition); + } + + private static Stream provideKpiValues() { + return Stream.of( + Arguments.of( + new StringKpiValue("stringKpiValue"), + Monitoring.KpiValue.newBuilder().setStringVal("stringKpiValue").build()), + Arguments.of( + new BooleanKpiValue(true), Monitoring.KpiValue.newBuilder().setBoolVal(true).build()), + Arguments.of( + new IntegerKpiValue(44), Monitoring.KpiValue.newBuilder().setIntVal(44).build()), + Arguments.of( + new FloatKpiValue(12.3f), Monitoring.KpiValue.newBuilder().setFloatVal(12.3f).build())); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldSerializeKpiValues(KpiValue kpiValue, Monitoring.KpiValue expectedKpiValue) { + final var serializedKpiValue = serializer.serialize(kpiValue); + + assertThat(serializedKpiValue).isEqualTo(expectedKpiValue); + } + + @ParameterizedTest + @MethodSource("provideKpiValues") + void shouldDeserializeKpiValues( + KpiValue expectedKpiValue, Monitoring.KpiValue serializedKpiValue) { + final var kpiValue = serializer.deserialize(serializedKpiValue); + + assertThat(kpiValue).usingRecursiveComparison().isEqualTo(expectedKpiValue); + } + + @Test + void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedKpiValue() { + final var serializedKpiValue = Monitoring.KpiValue.newBuilder().build(); + + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> serializer.deserialize(serializedKpiValue)); + } + + @Test + void shouldDeserializeIntegerKpiValue() { + final var expectedKpiValue = new IntegerKpiValue(66); + + final var intValue = serializer.serializeIntegerKpiValue(expectedKpiValue); + final var deserializedKpiValue = serializer.deserializeIntegerKpiValue(intValue); + + assertThat(deserializedKpiValue).isEqualTo(expectedKpiValue.getValue()); + } + + @Test + void shouldDeserializeStringKpiValue() { + final var expectedKpiValue = new StringKpiValue("StringKpiValue"); + + final var stringValue = serializer.serializeStringKpiValue(expectedKpiValue); + final var deserializedKpiValue = serializer.deserializeStringKpiValue(stringValue); + + assertThat(deserializedKpiValue).isEqualTo(expectedKpiValue.getValue()); + } + + @Test + void shouldDeserializeFloatKpiValue() { + final var expectedKpiValue = new FloatKpiValue(2.2f); + + final var floatValue = serializer.serializeFloatKpiValue(expectedKpiValue); + final var deserializedKpiValue = serializer.deserializeFloatKpiValue(floatValue); + + assertThat(deserializedKpiValue).isEqualTo(expectedKpiValue.getValue()); + } + + @Test + void shouldDeserializeBooleanKpiValue() { + final var expectedKpiValue = new BooleanKpiValue(true); + + final var booleanValue = serializer.serializeBooleanKpiValue(expectedKpiValue); + final var deserializedKpiValue = serializer.deserializeBooleanKpiValue(booleanValue); + + assertThat(deserializedKpiValue).isEqualTo(expectedKpiValue.getValue()); + } + + private static Stream provideKpiValueRanges() { + return Stream.of( + Arguments.of( + new KpiValueRange(new IntegerKpiValue(32), new IntegerKpiValue(42)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setIntVal(32).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setIntVal(42).build()) + .build()), + Arguments.of( + new KpiValueRange(new IntegerKpiValue(32), new FloatKpiValue(42.2f)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setIntVal(32).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setFloatVal(42.2f).build()) + .build()), + Arguments.of( + new KpiValueRange(new IntegerKpiValue(32), new BooleanKpiValue(true)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setIntVal(32).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .build()), + Arguments.of( + new KpiValueRange(new IntegerKpiValue(32), new StringKpiValue("string")), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setIntVal(32).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .build()), + Arguments.of( + new KpiValueRange(new FloatKpiValue(56.2f), new IntegerKpiValue(42)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setFloatVal(56.2f).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setIntVal(42).build()) + .build()), + Arguments.of( + new KpiValueRange(new FloatKpiValue(56.2f), new FloatKpiValue(42.2f)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setFloatVal(56.2f).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setFloatVal(42.2f).build()) + .build()), + Arguments.of( + new KpiValueRange(new FloatKpiValue(56.2f), new BooleanKpiValue(true)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setFloatVal(56.2f).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .build()), + Arguments.of( + new KpiValueRange(new FloatKpiValue(56.2f), new StringKpiValue("string")), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setFloatVal(56.2f).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .build()), + Arguments.of( + new KpiValueRange(new BooleanKpiValue(true), new IntegerKpiValue(42)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setIntVal(42).build()) + .build()), + Arguments.of( + new KpiValueRange(new BooleanKpiValue(false), new FloatKpiValue(42.2f)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setBoolVal(false).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setFloatVal(42.2f).build()) + .build()), + Arguments.of( + new KpiValueRange(new BooleanKpiValue(true), new BooleanKpiValue(true)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .build()), + Arguments.of( + new KpiValueRange(new BooleanKpiValue(false), new StringKpiValue("string")), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setBoolVal(false).build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .build()), + Arguments.of( + new KpiValueRange(new StringKpiValue("string"), new IntegerKpiValue(42)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setIntVal(42).build()) + .build()), + Arguments.of( + new KpiValueRange(new StringKpiValue("string"), new FloatKpiValue(42.2f)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setFloatVal(42.2f).build()) + .build()), + Arguments.of( + new KpiValueRange(new StringKpiValue("string"), new BooleanKpiValue(true)), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setBoolVal(true).build()) + .build()), + Arguments.of( + new KpiValueRange(new StringKpiValue("string"), new StringKpiValue("string")), + Monitoring.KpiValueRange.newBuilder() + .setKpiMinValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .setKpiMaxValue(Monitoring.KpiValue.newBuilder().setStringVal("string").build()) + .build())); + } + + @ParameterizedTest + @MethodSource("provideKpiValueRanges") + void shouldSerializeKpiValueRange( + KpiValueRange kpiValueRange, Monitoring.KpiValueRange expectedKpiValueRange) { + final var serializedKpiValueRange = serializer.serialize(kpiValueRange); + + assertThat(serializedKpiValueRange.getKpiMinValue()) + .isEqualTo(expectedKpiValueRange.getKpiMinValue()); + assertThat(serializedKpiValueRange.getKpiMaxValue()) + .isEqualTo(expectedKpiValueRange.getKpiMaxValue()); + } + + @ParameterizedTest + @MethodSource("provideKpiValueRanges") + void shouldDeserializeKpiValueRange( + KpiValueRange expectedKpiValueRange, Monitoring.KpiValueRange serializedKpiValueRange) { + final var kpiValueRange = serializer.deserialize(serializedKpiValueRange); + + assertThat(kpiValueRange.getKpiMinValue()) + .usingRecursiveComparison() + .isEqualTo(expectedKpiValueRange.getKpiMinValue()); + assertThat(kpiValueRange.getKpiMaxValue()) + .usingRecursiveComparison() + .isEqualTo(expectedKpiValueRange.getKpiMaxValue()); + } + + @Test + void shouldSerializeAlarmId() { + final var alarmId = "alarmId"; + + final var alarmIdUuid = serializer.serializeUuid(alarmId); + + final var expectedAlarmId = Monitoring.AlarmID.newBuilder().setAlarmId(alarmIdUuid).build(); + + final var serializedAlarmId = serializer.serializeAlarmId(alarmId); + + assertThat(serializedAlarmId).usingRecursiveComparison().isEqualTo(expectedAlarmId); + } + + @Test + void shouldDeserializeAlarmId() { + final var expectedAlarmId = "expectedAlarmId"; + + final var serializedAlarmIdUuid = serializer.serializeUuid(expectedAlarmId); + final var serializedAlarmId = + Monitoring.KpiId.newBuilder().setKpiId(serializedAlarmIdUuid).build(); + + final var alarmId = serializer.deserialize(serializedAlarmId); + + assertThat(alarmId).isEqualTo(expectedAlarmId); + } + + @Test + void shouldSerializeAlarmDescriptor() { + final var alarmDescription = "alarmDescription"; + final var name = "name"; + final var kpiId = "kpiId"; + final var timestamp = "timestamp"; + + final var kpiValueRange = new KpiValueRange(new IntegerKpiValue(23), new IntegerKpiValue(1800)); + final var alarmDescriptor = + new AlarmDescriptor(alarmDescription, name, kpiId, kpiValueRange, timestamp); + + final var serializedKpiIdUuid = serializer.serializeUuid(kpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + final var serializedKpiValueRange = serializer.serialize(kpiValueRange); + + final var expectedAlarmDescriptor = + Monitoring.AlarmDescriptor.newBuilder() + .setAlarmDescription(alarmDescription) + .setName(name) + .setKpiId(serializedKpiId) + .setKpiValueRange(serializedKpiValueRange) + .setTimestamp(timestamp) + .build(); + + final var serializedAlarmDescriptor = serializer.serialize(alarmDescriptor); + + assertThat(serializedAlarmDescriptor).isEqualTo(expectedAlarmDescriptor); + } + + @Test + void shouldDeserializeAlarmDescriptor() { + final var alarmDescription = "alarmDescription"; + final var name = "name"; + final var kpiId = "kpiId"; + final var timestamp = "timestamp"; + + final var kpiValueRange = new KpiValueRange(new IntegerKpiValue(23), new IntegerKpiValue(1800)); + final var expectedAlarmDescriptor = + new AlarmDescriptor(alarmDescription, name, kpiId, kpiValueRange, timestamp); + + final var serializedKpiIdUuid = serializer.serializeUuid(kpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + final var serializedKpiValueRange = serializer.serialize(kpiValueRange); + + final var serializedAlarmDescriptor = + Monitoring.AlarmDescriptor.newBuilder() + .setAlarmDescription(alarmDescription) + .setName(name) + .setKpiId(serializedKpiId) + .setKpiValueRange(serializedKpiValueRange) + .setTimestamp(timestamp) + .build(); + + final var alarmDescriptor = serializer.deserialize(serializedAlarmDescriptor); + + assertThat(alarmDescriptor).usingRecursiveComparison().isEqualTo(expectedAlarmDescriptor); + } + + @Test + void shouldSerializeAlarmResponse() { + final var alarmId = "alarmId"; + final var text = "text"; + final var kpiValue = new IntegerKpiValue(12); + + final var alarmResponse = new AlarmResponse(alarmId, text, kpiValue); + + final var serializedAlarmIdUuid = serializer.serializeUuid(alarmId); + final var serializedAlarmId = AlarmID.newBuilder().setAlarmId(serializedAlarmIdUuid).build(); + final var serializedKpiValue = serializer.serialize(kpiValue); + + final var expectedAlarmResponse = + Monitoring.AlarmResponse.newBuilder() + .setAlarmId(serializedAlarmId) + .setText(text) + .setKpiValue(serializedKpiValue) + .build(); + + final var serializedAlarmResponse = serializer.serialize(alarmResponse); + + assertThat(serializedAlarmResponse).isEqualTo(expectedAlarmResponse); + } + + @Test + void shouldDeserializeAlarmResponse() { + final var alarmId = "alarmId"; + final var text = "text"; + final var kpiValue = new IntegerKpiValue(12); + + final var expectedAlarmResponse = new AlarmResponse(alarmId, text, kpiValue); + + final var serializedAlarmIdUuid = serializer.serializeUuid(alarmId); + final var serializedAlarmId = AlarmID.newBuilder().setAlarmId(serializedAlarmIdUuid).build(); + final var serializedKpiValue = serializer.serialize(kpiValue); + + final var serializedAlarmResponse = + Monitoring.AlarmResponse.newBuilder() + .setAlarmId(serializedAlarmId) + .setText(text) + .setKpiValue(serializedKpiValue) + .build(); + + final var alarmResponse = serializer.deserialize(serializedAlarmResponse); + + assertThat(alarmResponse).usingRecursiveComparison().isEqualTo(expectedAlarmResponse); + } + + @Test + void shouldSerializeSubDescriptor() { + final var kpiId = "kpiId"; + final var samplingDurationS = 10f; + final var samplingIntervalS = 45f; + final var startDate = "01/07/2022"; + final var endDate = "02/07/2022"; + + final var subDescriptor = + new SubsDescriptor(kpiId, samplingDurationS, samplingIntervalS, startDate, endDate); + + final var serializedKpiIdUuid = serializer.serializeUuid(kpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + + final var expectedSubDescriptor = + Monitoring.SubsDescriptor.newBuilder() + .setKpiId(serializedKpiId) + .setSamplingDurationS(samplingDurationS) + .setSamplingIntervalS(samplingIntervalS) + .setStartDate(startDate) + .setEndDate(endDate) + .build(); + + final var serializedSubDescriptor = serializer.serialize(subDescriptor); + + assertThat(serializedSubDescriptor).isEqualTo(expectedSubDescriptor); + } + + @Test + void shouldDeserializeSubDescriptor() { + final var kpiId = "kpiId"; + final var samplingDurationS = 10f; + final var samplingIntervalS = 45f; + final var startDate = "01/07/2022"; + final var endDate = "02/07/2022"; + + final var expectedSubDescriptor = + new SubsDescriptor(kpiId, samplingDurationS, samplingIntervalS, startDate, endDate); + + final var serializedKpiIdUuid = serializer.serializeUuid(kpiId); + final var serializedKpiId = KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + + final var serializedSubDescriptor = + Monitoring.SubsDescriptor.newBuilder() + .setKpiId(serializedKpiId) + .setSamplingDurationS(samplingDurationS) + .setSamplingIntervalS(samplingIntervalS) + .setStartDate(startDate) + .setEndDate(endDate) + .build(); + + final var subDescriptor = serializer.deserialize(serializedSubDescriptor); + + assertThat(subDescriptor).usingRecursiveComparison().isEqualTo(expectedSubDescriptor); + } + + @Test + void shouldDeserializePolicyRuleCondition() { + final var expectedPolicyRuleConditionKpiId = "expectedPolicyRuleConditionKpiId"; + final var expectedPolicyRuleConditionNumericalOperator = + NumericalOperator.POLICY_RULE_CONDITION_NUMERICAL_GREATER_THAN; + final var expectedPolicyRuleConditionKpiValue = new IntegerKpiValue(34); + + final var expectedPolicyRuleCondition = + new PolicyRuleCondition( + expectedPolicyRuleConditionKpiId, + expectedPolicyRuleConditionNumericalOperator, + expectedPolicyRuleConditionKpiValue); + + final var serializedPolicyRuleCondition = serializer.serialize(expectedPolicyRuleCondition); + + final var policyRuleCondition = serializer.deserialize(serializedPolicyRuleCondition); + + assertThat(policyRuleCondition) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleCondition); + } + + private static Stream provideBooleanOperators() { + return Stream.of( + Arguments.of( + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND, + PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_AND), + Arguments.of( + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR, + PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_OR), + Arguments.of( + BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED, + PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideBooleanOperators") + void shouldSerializeBooleanOperator( + BooleanOperator booleanOperator, PolicyCondition.BooleanOperator expectedBooleanOperator) { + final var serializedBooleanOperator = serializer.serialize(booleanOperator); + + assertThat(serializedBooleanOperator).isEqualTo(expectedBooleanOperator); + } + + @ParameterizedTest + @MethodSource("provideBooleanOperators") + void shouldDeserializeBooleanOperator( + BooleanOperator expectedBooleanOperator, + PolicyCondition.BooleanOperator serializedBooleanOperator) { + final var booleanOperator = serializer.deserialize(serializedBooleanOperator); + + assertThat(booleanOperator).isEqualTo(expectedBooleanOperator); + } + + private static Stream providePolicyRuleActionEnum() { + return Stream.of( + Arguments.of( + PolicyRuleActionEnum.POLICY_RULE_ACTION_SET_DEVICE_STATUS, + PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_SET_DEVICE_STATUS), + Arguments.of( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONFIGRULE, + PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE), + Arguments.of( + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT, + PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT), + Arguments.of( + PolicyRuleActionEnum.POLICY_RULE_ACTION_NO_ACTION, + PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION)); + } + + @ParameterizedTest + @MethodSource("providePolicyRuleActionEnum") + void shouldSerializePolicyRuleActionEnum( + PolicyRuleActionEnum policyRuleActionEnum, + PolicyAction.PolicyRuleActionEnum expectedPolicyRuleActionEnum) { + final var serializedPolicyRuleActionEnum = serializer.serialize(policyRuleActionEnum); + + assertThat(serializedPolicyRuleActionEnum).isEqualTo(expectedPolicyRuleActionEnum); + } + + @ParameterizedTest + @MethodSource("providePolicyRuleActionEnum") + void shouldDeserializePolicyRuleActionEnum( + PolicyRuleActionEnum expectedPolicyRuleActionEnum, + PolicyAction.PolicyRuleActionEnum serializedPolicyRuleActionEnum) { + final var policyRuleActionEnum = serializer.deserialize(serializedPolicyRuleActionEnum); + + assertThat(policyRuleActionEnum).isEqualTo(expectedPolicyRuleActionEnum); + } + + @Test + void shouldSerializePolicyRuleAction() { + final var expectedPolicyRuleActionEnum = + PolicyRuleActionEnum.POLICY_RULE_ACTION_ADD_SERVICE_CONSTRAINT; + final var expectedPolicyRuleActionParameters = List.of("parameter1", "parameter2"); + final var policyRuleAction = + new PolicyRuleAction(expectedPolicyRuleActionEnum, expectedPolicyRuleActionParameters); + + final var serializedPolicyRuleActionEnum = serializer.serialize(expectedPolicyRuleActionEnum); + + final var expectedPolicyRuleAction = + PolicyAction.PolicyRuleAction.newBuilder() + .setAction(serializedPolicyRuleActionEnum) + .addAllParameters(expectedPolicyRuleActionParameters) + .build(); + + final var serializedPolicyRuleAction = serializer.serialize(policyRuleAction); + + assertThat(serializedPolicyRuleAction) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleAction); + } + + @Test + void shouldDeserializePolicyRuleAction() { + final var expectedPolicyRuleActionEnum = PolicyRuleActionEnum.POLICY_RULE_ACTION_NO_ACTION; + final var expectedPolicyRuleActionParameters = List.of("parameter1", "parameter2"); + final var expectedPolicyRuleAction = + new PolicyRuleAction(expectedPolicyRuleActionEnum, expectedPolicyRuleActionParameters); + + final var serializedPolicyRuleAction = serializer.serialize(expectedPolicyRuleAction); + + final var policyRuleAction = serializer.deserialize(serializedPolicyRuleAction); + + assertThat(policyRuleAction).usingRecursiveComparison().isEqualTo(expectedPolicyRuleAction); + } + + @Test + void shouldSerializePolicyRuleBasic() { + final var policyRuleBasic = createPolicyRuleBasic(); + + final var expectedPolicyRuleId = policyRuleBasic.getPolicyRuleId(); + final var expectedPolicyRuleState = policyRuleBasic.getPolicyRuleState(); + final var expectedPriority = policyRuleBasic.getPriority(); + final var expectedPolicyRuleConditions = policyRuleBasic.getPolicyRuleConditions(); + final var expectedBooleanOperator = policyRuleBasic.getBooleanOperator(); + final var expectedPolicyRuleActions = policyRuleBasic.getPolicyRuleActions(); + + final var serializedPolicyRuleId = serializer.serializePolicyRuleId(expectedPolicyRuleId); + final var serializedPolicyRuleState = serializer.serialize(expectedPolicyRuleState); + final var serializedPolicyRuleConditions = + expectedPolicyRuleConditions.stream() + .map(policyRuleCondition -> serializer.serialize(policyRuleCondition)) + .collect(Collectors.toList()); + final var serializedBooleanOperator = serializer.serialize(expectedBooleanOperator); + final var serializedPolicyRuleActions = + expectedPolicyRuleActions.stream() + .map(policyRuleAction -> serializer.serialize(policyRuleAction)) + .collect(Collectors.toList()); + + final var expectedPolicyRuleBasic = + Policy.PolicyRuleBasic.newBuilder() + .setPolicyRuleId(serializedPolicyRuleId) + .setPolicyRuleState(serializedPolicyRuleState) + .setPriority(expectedPriority) + .addAllConditionList(serializedPolicyRuleConditions) + .setBooleanOperator(serializedBooleanOperator) + .addAllActionList(serializedPolicyRuleActions) + .build(); + + final var serializedPolicyRuleBasic = serializer.serialize(policyRuleBasic); + + assertThat(serializedPolicyRuleBasic) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleBasic); + } + + @Test + void shouldDeserializePolicyRuleBasic() { + final var expectedPolicyRuleBasic = createPolicyRuleBasic(); + + final var expectedPolicyRuleId = expectedPolicyRuleBasic.getPolicyRuleId(); + final var expectedPolicyRuleState = expectedPolicyRuleBasic.getPolicyRuleState(); + final var expectedPriority = expectedPolicyRuleBasic.getPriority(); + final var expectedPolicyRuleConditions = expectedPolicyRuleBasic.getPolicyRuleConditions(); + final var expectedBooleanOperator = expectedPolicyRuleBasic.getBooleanOperator(); + final var expectedPolicyRuleActions = expectedPolicyRuleBasic.getPolicyRuleActions(); + + final var serializedPolicyRuleId = serializer.serializePolicyRuleId(expectedPolicyRuleId); + final var serializedPolicyRuleState = serializer.serialize(expectedPolicyRuleState); + final var serializedPolicyRuleConditions = + expectedPolicyRuleConditions.stream() + .map(policyRuleCondition -> serializer.serialize(policyRuleCondition)) + .collect(Collectors.toList()); + final var serializedBooleanOperator = serializer.serialize(expectedBooleanOperator); + final var serializedPolicyRuleActions = + expectedPolicyRuleActions.stream() + .map(policyRuleAction -> serializer.serialize(policyRuleAction)) + .collect(Collectors.toList()); + + final var serializedPolicyRuleBasic = + Policy.PolicyRuleBasic.newBuilder() + .setPolicyRuleId(serializedPolicyRuleId) + .setPolicyRuleState(serializedPolicyRuleState) + .setPriority(expectedPriority) + .addAllConditionList(serializedPolicyRuleConditions) + .setBooleanOperator(serializedBooleanOperator) + .addAllActionList(serializedPolicyRuleActions) + .build(); + + final var policyRuleBasic = serializer.deserialize(serializedPolicyRuleBasic); + + assertThat(policyRuleBasic).usingRecursiveComparison().isEqualTo(expectedPolicyRuleBasic); + } + + @Test + void shouldSerializePolicyRuleService() { + final var policyRuleBasic = createPolicyRuleBasic(); + final var serviceId = new ServiceId("contextId", "serviceId"); + final var deviceIds = List.of("deviceId1", "deviceId2"); + + final var policyRuleService = new PolicyRuleService(policyRuleBasic, serviceId, deviceIds); + + final var serializedPolicyRuleBasic = serializer.serialize(policyRuleBasic); + final var serializedPolicyRuleServiceId = serializer.serialize(serviceId); + final var serializedPolicyRuleDeviceIds = + deviceIds.stream() + .map(deviceId -> serializer.serializeDeviceId(deviceId)) + .collect(Collectors.toList()); + + final var expectedPolicyRuleService = + Policy.PolicyRuleService.newBuilder() + .setPolicyRuleBasic(serializedPolicyRuleBasic) + .setServiceId(serializedPolicyRuleServiceId) + .addAllDeviceList(serializedPolicyRuleDeviceIds) + .build(); + + final var serializedPolicyRuleService = serializer.serialize(policyRuleService); + + assertThat(serializedPolicyRuleService) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleService); + } + + @Test + void shouldDeserializePolicyRuleService() { + final var expectedPolicyRuleBasic = createPolicyRuleBasic(); + final var expectedServiceId = new ServiceId("contextId", "serviceId"); + final var expectedDeviceIds = List.of("deviceId1", "deviceId2"); + final var expectedPolicyRuleService = + new PolicyRuleService(expectedPolicyRuleBasic, expectedServiceId, expectedDeviceIds); + + final var serializedPolicyRuleBasic = serializer.serialize(expectedPolicyRuleBasic); + final var serializedPolicyRuleServiceId = serializer.serialize(expectedServiceId); + final var serializedPolicyRuleDeviceIds = + expectedDeviceIds.stream() + .map(deviceId -> serializer.serializeDeviceId(deviceId)) + .collect(Collectors.toList()); + + final var serializedPolicyRuleService = + Policy.PolicyRuleService.newBuilder() + .setPolicyRuleBasic(serializedPolicyRuleBasic) + .setServiceId(serializedPolicyRuleServiceId) + .addAllDeviceList(serializedPolicyRuleDeviceIds) + .build(); + + final var policyRuleService = serializer.deserialize(serializedPolicyRuleService); + + assertThat(policyRuleService).usingRecursiveComparison().isEqualTo(expectedPolicyRuleService); + } + + @Test + void shouldSerializePolicyRuleDevice() { + final var policyRuleBasic = createPolicyRuleBasic(); + final var deviceIds = List.of("deviceId1", "deviceId2"); + + final var policyRuleDevice = new PolicyRuleDevice(policyRuleBasic, deviceIds); + + final var serializedPolicyRuleBasic = serializer.serialize(policyRuleBasic); + final var serializedPolicyRuleDeviceIds = + deviceIds.stream() + .map(deviceId -> serializer.serializeDeviceId(deviceId)) + .collect(Collectors.toList()); + + final var expectedPolicyRuleDevice = + Policy.PolicyRuleDevice.newBuilder() + .setPolicyRuleBasic(serializedPolicyRuleBasic) + .addAllDeviceList(serializedPolicyRuleDeviceIds) + .build(); + + final var serializedPolicyRuleDevice = serializer.serialize(policyRuleDevice); + + assertThat(serializedPolicyRuleDevice) + .usingRecursiveComparison() + .isEqualTo(expectedPolicyRuleDevice); + } + + @Test + void shouldDeserializePolicyRuleDevice() { + final var expectedPolicyRuleBasic = createPolicyRuleBasic(); + final var expectedDeviceIds = List.of("deviceId1", "deviceId2"); + final var expectedPolicyRuleDevice = + new PolicyRuleDevice(expectedPolicyRuleBasic, expectedDeviceIds); + + final var serializedPolicyRuleBasic = serializer.serialize(expectedPolicyRuleBasic); + final var serializedPolicyRuleDeviceIds = + expectedDeviceIds.stream() + .map(deviceId -> serializer.serializeDeviceId(deviceId)) + .collect(Collectors.toList()); + + final var serializedPolicyRuleDevice = + Policy.PolicyRuleDevice.newBuilder() + .setPolicyRuleBasic(serializedPolicyRuleBasic) + .addAllDeviceList(serializedPolicyRuleDeviceIds) + .build(); + + final var policyRuleDevice = serializer.deserialize(serializedPolicyRuleDevice); + + assertThat(policyRuleDevice).usingRecursiveComparison().isEqualTo(expectedPolicyRuleDevice); + } + + @Test + void shouldSerializeKpiId() { + final var kpiId = "kpiId"; + + final var kpiIdUuid = serializer.serializeUuid(kpiId); + + final var expectedKpiId = Monitoring.KpiId.newBuilder().setKpiId(kpiIdUuid).build(); + + final var serializedKpiId = serializer.serializeKpiId(kpiId); + + assertThat(serializedKpiId).usingRecursiveComparison().isEqualTo(expectedKpiId); + } + + @Test + void shouldDeserializeKpiId() { + final var expectedKpiId = "expectedKpiId"; + + final var serializedKpiIdUuid = serializer.serializeUuid(expectedKpiId); + final var serializedKpiId = Monitoring.KpiId.newBuilder().setKpiId(serializedKpiIdUuid).build(); + + final var kpiId = serializer.deserialize(serializedKpiId); + + assertThat(kpiId).isEqualTo(expectedKpiId); + } + + @Test + void shouldSerializeKpi() { + final var expectedKpiId = "expectedKpiId"; + final var expectedTimestamp = "expectedTimestamp"; + final var expectedKpiValue = new FloatKpiValue(643.45f); + + final var kpi = new Kpi(expectedKpiId, expectedTimestamp, expectedKpiValue); + + final var serializedKpiId = serializer.serializeKpiId(expectedKpiId); + final var serializedKpiValue = serializer.serialize(expectedKpiValue); + + final var expectedKpi = + Monitoring.Kpi.newBuilder() + .setKpiId(serializedKpiId) + .setTimestamp(expectedTimestamp) + .setKpiValue(serializedKpiValue) + .build(); + + final var serializedKpi = serializer.serialize(kpi); + + assertThat(serializedKpi).usingRecursiveComparison().isEqualTo(expectedKpi); + } + + @Test + void shouldDeserializeKpi() { + final var expectedKpiId = "expectedKpiId"; + final var expectedTimestamp = "expectedTimestamp"; + final var expectedKpiValue = new BooleanKpiValue(true); + final var expectedKpi = new Kpi(expectedKpiId, expectedTimestamp, expectedKpiValue); + + final var serializedKpi = serializer.serialize(expectedKpi); + + final var kpi = serializer.deserialize(serializedKpi); + + assertThat(kpi).usingRecursiveComparison().isEqualTo(expectedKpi); + } + + @Test + void shouldSerializeKpisList() { + final var expectedKpiIdA = "expectedKpiIdA"; + final var expectedTimestampA = "expectedTimestampA"; + final var expectedKpiValueA = new FloatKpiValue(643.45f); + final var serializedKpiIdA = serializer.serializeKpiId(expectedKpiIdA); + final var serializedKpiValueA = serializer.serialize(expectedKpiValueA); + final var kpiA = new Kpi(expectedKpiIdA, expectedTimestampA, expectedKpiValueA); + + final var expectedKpiIdB = "expectedKpiIdB"; + final var expectedTimestampB = "expectedTimestampB"; + final var expectedKpiValueB = new IntegerKpiValue(32); + final var serializedKpiIdB = serializer.serializeKpiId(expectedKpiIdB); + final var serializedKpiValueB = serializer.serialize(expectedKpiValueB); + final var kpiB = new Kpi(expectedKpiIdB, expectedTimestampB, expectedKpiValueB); + + final var kpis = List.of(kpiA, kpiB); + + final var expectedKpiA = + Monitoring.Kpi.newBuilder() + .setKpiId(serializedKpiIdA) + .setTimestamp(expectedTimestampA) + .setKpiValue(serializedKpiValueA) + .build(); + + final var expectedKpiB = + Monitoring.Kpi.newBuilder() + .setKpiId(serializedKpiIdB) + .setTimestamp(expectedTimestampB) + .setKpiValue(serializedKpiValueB) + .build(); + + final var expectedKpis = List.of(expectedKpiA, expectedKpiB); + + final var serializedKpis = serializer.serialize(kpis); + + assertThat(serializedKpis).usingRecursiveComparison().isEqualTo(expectedKpis); + } + + @Test + void shouldDeserializeKpisList() { + final var expectedKpiIdA = "expectedKpiIdA"; + final var expectedTimestampA = "expectedTimestampA"; + final var expectedKpiValueA = new FloatKpiValue(643.45f); + final var serializedKpiIdA = serializer.serializeKpiId(expectedKpiIdA); + final var serializedKpiValueA = serializer.serialize(expectedKpiValueA); + final var expectedKpiA = new Kpi(expectedKpiIdA, expectedTimestampA, expectedKpiValueA); + + final var expectedKpiIdB = "expectedKpiIdB"; + final var expectedTimestampB = "expectedTimestampB"; + final var expectedKpiValueB = new IntegerKpiValue(32); + final var serializedKpiIdB = serializer.serializeKpiId(expectedKpiIdB); + final var serializedKpiValueB = serializer.serialize(expectedKpiValueB); + final var expectedKpiB = new Kpi(expectedKpiIdB, expectedTimestampB, expectedKpiValueB); + + final var expectedKpis = List.of(expectedKpiA, expectedKpiB); + + final var serializedKpiA = + Monitoring.Kpi.newBuilder() + .setKpiId(serializedKpiIdA) + .setTimestamp(expectedTimestampA) + .setKpiValue(serializedKpiValueA) + .build(); + + final var serializedKpiB = + Monitoring.Kpi.newBuilder() + .setKpiId(serializedKpiIdB) + .setTimestamp(expectedTimestampB) + .setKpiValue(serializedKpiValueB) + .build(); + + final var serializedKpis = List.of(serializedKpiA, serializedKpiB); + + final var kpis = serializer.deserialize(serializedKpis); + + assertThat(kpis).usingRecursiveComparison().isEqualTo(expectedKpis); + } + + @Test + void shouldSerializeKpiDescriptor() { + final var expectedKpiDescription = "expectedKpiDescription"; + final var expectedKpiSampleType = KpiSampleType.BYTES_RECEIVED; + final var expectedDeviceId = "expectedDeviceId"; + + final var expectedTopologyId = new TopologyId("contextId", "topologyId"); + final var expectedEndPointId = + new EndPointId(expectedTopologyId, expectedDeviceId, "endpointId"); + final var expectedServiceId = new ServiceId("contextId", "serviceId"); + final var expectedSliceId = new SliceId("contextId", "sliceId"); + + final var kpiDescriptor = + new KpiDescriptor( + expectedKpiDescription, + expectedKpiSampleType, + expectedDeviceId, + expectedEndPointId, + expectedServiceId, + expectedSliceId); + + final var serializedKpiSampleType = serializer.serialize(expectedKpiSampleType); + final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); + final var serializedEndPointId = serializer.serialize(expectedEndPointId); + final var serializedServiceId = serializer.serialize(expectedServiceId); + final var serializedSliceId = serializer.serialize(expectedSliceId); + + final var expectedKpiDescriptor = + Monitoring.KpiDescriptor.newBuilder() + .setKpiDescription(expectedKpiDescription) + .setKpiSampleType(serializedKpiSampleType) + .setDeviceId(serializedDeviceId) + .setEndpointId(serializedEndPointId) + .setServiceId(serializedServiceId) + .setSliceId(serializedSliceId) + .build(); + + final var serializedKpiDescriptor = serializer.serialize(kpiDescriptor); + + assertThat(serializedKpiDescriptor).usingRecursiveComparison().isEqualTo(expectedKpiDescriptor); + } + + @Test + void shouldDeserializeKpiDescriptor() { + final var expectedKpiDescription = "expectedKpiDescription"; + final var expectedKpiSampleType = KpiSampleType.BYTES_RECEIVED; + final var expectedDeviceId = "expectedDeviceId"; + + final var expectedTopologyId = new TopologyId("contextId", "topologyId"); + final var expectedEndPointId = + new EndPointId(expectedTopologyId, expectedDeviceId, "endpointId"); + final var expectedServiceId = new ServiceId("contextId", "serviceId"); + final var expectedSliceId = new SliceId("contextId", "sliceId"); + + final var expectedKpiDescriptor = + new KpiDescriptor( + expectedKpiDescription, + expectedKpiSampleType, + expectedDeviceId, + expectedEndPointId, + expectedServiceId, + expectedSliceId); + + final var serializedKpiSampleType = serializer.serialize(expectedKpiSampleType); + final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId); + final var serializedEndPointId = serializer.serialize(expectedEndPointId); + final var serializedServiceId = serializer.serialize(expectedServiceId); + final var serializedSliceId = serializer.serialize(expectedSliceId); + + final var serializedKpiDescriptor = + Monitoring.KpiDescriptor.newBuilder() + .setKpiDescription(expectedKpiDescription) + .setKpiSampleType(serializedKpiSampleType) + .setDeviceId(serializedDeviceId) + .setEndpointId(serializedEndPointId) + .setServiceId(serializedServiceId) + .setSliceId(serializedSliceId) + .build(); + + final var kpiDescriptor = serializer.deserialize(serializedKpiDescriptor); + + assertThat(kpiDescriptor).usingRecursiveComparison().isEqualTo(expectedKpiDescriptor); + } + + @Test + void shouldSerializeDeviceConfig() { + final var expectedConfigRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + + final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + + final var expectedConfigRuleCustomB = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyB") + .setResourceValue("resourceValueB") + .build(); + + final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB"); + + final var expectedConfigRuleA = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(expectedConfigRuleCustomA) + .build(); + final var expectedConfigRuleB = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(expectedConfigRuleCustomB) + .build(); + + final var expectedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder() + .addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB)) + .build(); + + final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA); + final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB); + + final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA); + final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB); + + final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB)); + final var serializedDeviceConfig = serializer.serialize(deviceConfig); + + assertThat(serializedDeviceConfig).isEqualTo(expectedDeviceConfig); + } + + @Test + void shouldDeserializeDeviceConfig() { + final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB"); + + final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA); + final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB); + + final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA); + final var expectedConfigRuleB = + new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB); + + final var expectedDeviceConfig = + new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB)); + + final var configRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + + final var configRuleCustomB = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyB") + .setResourceValue("resourceValueB") + .build(); + + final var configRuleA = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(configRuleCustomA) + .build(); + final var configRuleB = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(configRuleCustomB) + .build(); + final var serializedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder() + .addAllConfigRules(List.of(configRuleA, configRuleB)) + .build(); + final var deviceConfig = serializer.deserialize(serializedDeviceConfig); + + assertThat(deviceConfig).usingRecursiveComparison().isEqualTo(expectedDeviceConfig); + } + + private static Stream provideOperationalStatusEnum() { + return Stream.of( + Arguments.of( + DeviceOperationalStatus.ENABLED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED), + Arguments.of( + DeviceOperationalStatus.DISABLED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED), + Arguments.of( + DeviceOperationalStatus.UNDEFINED, + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideOperationalStatusEnum") + void shouldSerializeOperationalStatusEnum( + DeviceOperationalStatus opStatus, + ContextOuterClass.DeviceOperationalStatusEnum expectedOpStatus) { + final var serializedOpStatus = serializer.serialize(opStatus); + assertThat(serializedOpStatus.getNumber()).isEqualTo(expectedOpStatus.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideOperationalStatusEnum") + void shouldDeserializeOperationalStatusEnum( + DeviceOperationalStatus expectedOpStatus, + ContextOuterClass.DeviceOperationalStatusEnum serializedOpStatus) { + final var operationalStatus = serializer.deserialize(serializedOpStatus); + assertThat(operationalStatus).isEqualTo(expectedOpStatus); + } + + private static Stream provideDeviceDriverEnum() { + return Stream.of( + Arguments.of( + DeviceDriverEnum.OPENCONFIG, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG), + Arguments.of( + DeviceDriverEnum.TRANSPORT_API, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API), + Arguments.of(DeviceDriverEnum.P4, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4), + Arguments.of( + DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY), + Arguments.of( + DeviceDriverEnum.ONF_TR_352, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352), + Arguments.of( + DeviceDriverEnum.UNDEFINED, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED)); + } + + @ParameterizedTest + @MethodSource("provideDeviceDriverEnum") + void shouldSerializeDeviceDriverEnum( + DeviceDriverEnum deviceDriverEnum, + ContextOuterClass.DeviceDriverEnum expectedDeviceDriverEnum) { + final var serializedDeviceDriverEnum = serializer.serialize(deviceDriverEnum); + + assertThat(serializedDeviceDriverEnum.getNumber()) + .isEqualTo(expectedDeviceDriverEnum.getNumber()); + } + + @ParameterizedTest + @MethodSource("provideDeviceDriverEnum") + void shouldDeserializeDeviceDriverEnum( + DeviceDriverEnum expectedDeviceDriverEnum, + ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) { + final var deviceDriverEnum = serializer.deserialize(serializedDeviceDriverEnum); + + assertThat(deviceDriverEnum).isEqualTo(expectedDeviceDriverEnum); + } + + @Test + void shouldSerializeEndPoint() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var endPointType = "endPointType"; + final var kpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var locationTypeRegion = new LocationTypeRegion("ATH"); + final var location = new Location(locationTypeRegion); + final var endPoint = + new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build(); + + final var serializedEndPointId = serializer.serialize(endPointId); + final var serializedKpiSampleTypes = + kpiSampleTypes.stream() + .map(kpiSampleType -> serializer.serialize(kpiSampleType)) + .collect(Collectors.toList()); + final var serializedLocation = serializer.serialize(location); + + final var expectedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(endPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .setEndpointLocation(serializedLocation) + .build(); + + final var serializedEndPoint = serializer.serialize(endPoint); + + assertThat(serializedEndPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint); + } + + @Test + void shouldDeserializeEndPoint() { + final var expectedTopologyId = new TopologyId("contextId", "id"); + final var expectedDeviceId = "expectedDeviceId"; + final var expectedId = "expectedId"; + final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId); + final var expectedEndPointType = "expectedEndPointType"; + final var expectedKpiSampleTypes = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + + final var expectedLocationTypeRegion = new LocationTypeRegion("ATH"); + final var expectedLocation = new Location(expectedLocationTypeRegion); + + final var expectedEndPoint = + new EndPointBuilder(expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes) + .location(expectedLocation) + .build(); + + final var serializedEndPointId = serializer.serialize(expectedEndPointId); + final var serializedKpiSampleTypes = + expectedKpiSampleTypes.stream() + .map(kpiSampleType -> serializer.serialize(kpiSampleType)) + .collect(Collectors.toList()); + final var serializedLocation = serializer.serialize(expectedLocation); + + final var serializedEndPoint = + ContextOuterClass.EndPoint.newBuilder() + .setEndpointId(serializedEndPointId) + .setEndpointType(expectedEndPointType) + .addAllKpiSampleTypes(serializedKpiSampleTypes) + .setEndpointLocation(serializedLocation) + .build(); + + final var endPoint = serializer.deserialize(serializedEndPoint); + + assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint); + } + + @Test + void shouldSerializeDevice() { + final var expectedConfigRuleCustomA = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + + final var expectedConfigRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET) + .setCustom(expectedConfigRuleCustomA) + .build(); + + final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA); + final var deviceConfig = + new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA))); + + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var expectedTopologyIdA = new TopologyId("contextIdA", "idA"); + final var expectedDeviceIdA = "expectedDeviceIdA"; + final var expectedIdA = "expectedIdA"; + final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); + + final var expectedTopologyIdB = new TopologyId("contextIdB", "idB"); + final var expectedDeviceIdB = "expectedDeviceIdB"; + final var expectedIdB = "expectedIdB"; + final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB); + + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + + final var expectedDeviceConfig = + ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(expectedConfigRule).build(); + + final var serializedDeviceId = serializer.serializeDeviceId("deviceId"); + final var serializedDrivers = + deviceDrivers.stream() + .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum)) + .collect(Collectors.toList()); + + final var serializedEndPoints = + endPoints.stream() + .map(endPoint -> serializer.serialize(endPoint)) + .collect(Collectors.toList()); + + final var deviceBuilder = ContextOuterClass.Device.newBuilder(); + + deviceBuilder.setDeviceId(serializedDeviceId); + deviceBuilder.setDeviceType("deviceType"); + deviceBuilder.setDeviceConfig(expectedDeviceConfig); + deviceBuilder.setDeviceOperationalStatus(serializer.serialize(DeviceOperationalStatus.ENABLED)); + deviceBuilder.addAllDeviceDrivers(serializedDrivers); + deviceBuilder.addAllDeviceEndpoints(serializedEndPoints); + + final var expectedDevice = deviceBuilder.build(); + + final var device = + new Device( + "deviceId", + "deviceType", + deviceConfig, + DeviceOperationalStatus.ENABLED, + deviceDrivers, + endPoints); + final var serializedDevice = serializer.serialize(device); + + assertThat(serializedDevice).isEqualTo(expectedDevice); + } + + @Test + void shouldDeserializeDevice() { + final var configRuleCustom = new ConfigRuleCustom("resourceKeyA", "resourceValueA"); + final var expectedConfigRuleCustom = + ContextOuterClass.ConfigRule_Custom.newBuilder() + .setResourceKey("resourceKeyA") + .setResourceValue("resourceValueA") + .build(); + final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom); + + final var expectedConfig = + new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.DELETE, configRuleType))); + + final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4); + + final var expectedTopologyIdA = new TopologyId("contextIdA", "idA"); + final var expectedDeviceIdA = "expectedDeviceIdA"; + final var expectedIdA = "expectedIdA"; + final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA); + + final var endPointTypeA = "endPointTypeA"; + final var kpiSampleTypesA = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionA = new LocationTypeRegion("ATH"); + final var locationA = new Location(locationTypeRegionA); + final var endPointA = + new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA) + .location(locationA) + .build(); + + final var expectedTopologyIdB = new TopologyId("contextIdB", "idB"); + final var expectedDeviceIdB = "expectedDeviceIdB"; + final var expectedIdB = "expectedIdB"; + final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB); + + final var endPointTypeB = "endPointTypeB"; + final var kpiSampleTypesB = + List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED); + final var locationTypeRegionB = new LocationTypeRegion("ATH"); + final var locationB = new Location(locationTypeRegionB); + final var endPointB = + new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB) + .location(locationB) + .build(); + + final var endPoints = List.of(endPointA, endPointB); + + final var expectedDevice = + new Device( + "deviceId", + "deviceType", + expectedConfig, + DeviceOperationalStatus.ENABLED, + deviceDrivers, + endPoints); + + final var configRule = + ContextOuterClass.ConfigRule.newBuilder() + .setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE) + .setCustom(expectedConfigRuleCustom) + .build(); + final var deviceConfig = + ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(configRule).build(); + + final var serializedDeviceId = serializer.serializeDeviceId("deviceId"); + final var serializedDeviceOperationalStatus = + serializer.serialize(DeviceOperationalStatus.ENABLED); + + final var serializedDrivers = + deviceDrivers.stream() + .map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum)) + .collect(Collectors.toList()); + + final var serializedEndPoints = + endPoints.stream() + .map(endPoint -> serializer.serialize(endPoint)) + .collect(Collectors.toList()); + + final var deviceBuilder = ContextOuterClass.Device.newBuilder(); + deviceBuilder.setDeviceId(serializedDeviceId); + deviceBuilder.setDeviceType("deviceType"); + deviceBuilder.setDeviceConfig(deviceConfig); + deviceBuilder.setDeviceOperationalStatus(serializedDeviceOperationalStatus); + deviceBuilder.addAllDeviceDrivers(serializedDrivers); + deviceBuilder.addAllDeviceEndpoints(serializedEndPoints); + + final var serializedDevice = deviceBuilder.build(); + final var device = serializer.deserialize(serializedDevice); + + assertThat(device).usingRecursiveComparison().isEqualTo(expectedDevice); + } + + @Test + void shouldSerializeEmpty() { + final var empty = new Empty(); + final var expectedEmpty = ContextOuterClass.Empty.newBuilder().build(); + + final var serializeEmpty = serializer.serializeEmpty(empty); + + assertThat(serializeEmpty).isEqualTo(expectedEmpty); + } + + @Test + void shouldDeserializeEmpty() { + final var expectedEmpty = new Empty(); + + final var serializedEmpty = serializer.serializeEmpty(expectedEmpty); + + final var empty = serializer.deserializeEmpty(serializedEmpty); + + assertThat(empty).usingRecursiveComparison().isEqualTo(expectedEmpty); + } + + @Test + void shouldSerializeUuid() { + final var expectedUuid = "uuid"; + + final var serializeUuid = serializer.serializeUuid(expectedUuid); + + assertThat(serializeUuid.getUuid()).isEqualTo(expectedUuid); + } + + @Test + void shouldDeserializeUuid() { + final var expectedUuid = "uuid"; + + final var uuid = serializer.deserialize(Uuid.newBuilder().setUuid(expectedUuid).build()); + + assertThat(uuid).isEqualTo(expectedUuid); + } +} diff --git a/src/policy/target/generated-sources/grpc/acl/Acl.java b/src/policy/target/generated-sources/grpc/acl/Acl.java new file mode 100644 index 0000000000000000000000000000000000000000..521294eefdec36b373b99aaca5281be28e01d2db --- /dev/null +++ b/src/policy/target/generated-sources/grpc/acl/Acl.java @@ -0,0 +1,4654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: acl.proto + +package acl; + +public final class Acl { + private Acl() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code acl.AclRuleTypeEnum} + */ + public enum AclRuleTypeEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLRULETYPE_UNDEFINED = 0; + */ + ACLRULETYPE_UNDEFINED(0), + /** + * ACLRULETYPE_IPV4 = 1; + */ + ACLRULETYPE_IPV4(1), + /** + * ACLRULETYPE_IPV6 = 2; + */ + ACLRULETYPE_IPV6(2), + /** + * ACLRULETYPE_L2 = 3; + */ + ACLRULETYPE_L2(3), + /** + * ACLRULETYPE_MPLS = 4; + */ + ACLRULETYPE_MPLS(4), + /** + * ACLRULETYPE_MIXED = 5; + */ + ACLRULETYPE_MIXED(5), + UNRECOGNIZED(-1), + ; + + /** + * ACLRULETYPE_UNDEFINED = 0; + */ + public static final int ACLRULETYPE_UNDEFINED_VALUE = 0; + /** + * ACLRULETYPE_IPV4 = 1; + */ + public static final int ACLRULETYPE_IPV4_VALUE = 1; + /** + * ACLRULETYPE_IPV6 = 2; + */ + public static final int ACLRULETYPE_IPV6_VALUE = 2; + /** + * ACLRULETYPE_L2 = 3; + */ + public static final int ACLRULETYPE_L2_VALUE = 3; + /** + * ACLRULETYPE_MPLS = 4; + */ + public static final int ACLRULETYPE_MPLS_VALUE = 4; + /** + * ACLRULETYPE_MIXED = 5; + */ + public static final int ACLRULETYPE_MIXED_VALUE = 5; + + + 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 AclRuleTypeEnum 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 AclRuleTypeEnum forNumber(int value) { + switch (value) { + case 0: return ACLRULETYPE_UNDEFINED; + case 1: return ACLRULETYPE_IPV4; + case 2: return ACLRULETYPE_IPV6; + case 3: return ACLRULETYPE_L2; + case 4: return ACLRULETYPE_MPLS; + case 5: return ACLRULETYPE_MIXED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclRuleTypeEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclRuleTypeEnum findValueByNumber(int number) { + return AclRuleTypeEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(0); + } + + private static final AclRuleTypeEnum[] VALUES = values(); + + public static AclRuleTypeEnum 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 AclRuleTypeEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclRuleTypeEnum) + } + + /** + * Protobuf enum {@code acl.AclForwardActionEnum} + */ + public enum AclForwardActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLFORWARDINGACTION_UNDEFINED = 0; + */ + ACLFORWARDINGACTION_UNDEFINED(0), + /** + * ACLFORWARDINGACTION_DROP = 1; + */ + ACLFORWARDINGACTION_DROP(1), + /** + * ACLFORWARDINGACTION_ACCEPT = 2; + */ + ACLFORWARDINGACTION_ACCEPT(2), + /** + * ACLFORWARDINGACTION_REJECT = 3; + */ + ACLFORWARDINGACTION_REJECT(3), + UNRECOGNIZED(-1), + ; + + /** + * ACLFORWARDINGACTION_UNDEFINED = 0; + */ + public static final int ACLFORWARDINGACTION_UNDEFINED_VALUE = 0; + /** + * ACLFORWARDINGACTION_DROP = 1; + */ + public static final int ACLFORWARDINGACTION_DROP_VALUE = 1; + /** + * ACLFORWARDINGACTION_ACCEPT = 2; + */ + public static final int ACLFORWARDINGACTION_ACCEPT_VALUE = 2; + /** + * ACLFORWARDINGACTION_REJECT = 3; + */ + public static final int ACLFORWARDINGACTION_REJECT_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 AclForwardActionEnum 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 AclForwardActionEnum forNumber(int value) { + switch (value) { + case 0: return ACLFORWARDINGACTION_UNDEFINED; + case 1: return ACLFORWARDINGACTION_DROP; + case 2: return ACLFORWARDINGACTION_ACCEPT; + case 3: return ACLFORWARDINGACTION_REJECT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclForwardActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclForwardActionEnum findValueByNumber(int number) { + return AclForwardActionEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(1); + } + + private static final AclForwardActionEnum[] VALUES = values(); + + public static AclForwardActionEnum 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 AclForwardActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclForwardActionEnum) + } + + /** + * Protobuf enum {@code acl.AclLogActionEnum} + */ + public enum AclLogActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ACLLOGACTION_UNDEFINED = 0; + */ + ACLLOGACTION_UNDEFINED(0), + /** + * ACLLOGACTION_NOLOG = 1; + */ + ACLLOGACTION_NOLOG(1), + /** + * ACLLOGACTION_SYSLOG = 2; + */ + ACLLOGACTION_SYSLOG(2), + UNRECOGNIZED(-1), + ; + + /** + * ACLLOGACTION_UNDEFINED = 0; + */ + public static final int ACLLOGACTION_UNDEFINED_VALUE = 0; + /** + * ACLLOGACTION_NOLOG = 1; + */ + public static final int ACLLOGACTION_NOLOG_VALUE = 1; + /** + * ACLLOGACTION_SYSLOG = 2; + */ + public static final int ACLLOGACTION_SYSLOG_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 AclLogActionEnum 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 AclLogActionEnum forNumber(int value) { + switch (value) { + case 0: return ACLLOGACTION_UNDEFINED; + case 1: return ACLLOGACTION_NOLOG; + case 2: return ACLLOGACTION_SYSLOG; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AclLogActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AclLogActionEnum findValueByNumber(int number) { + return AclLogActionEnum.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 acl.Acl.getDescriptor().getEnumTypes().get(2); + } + + private static final AclLogActionEnum[] VALUES = values(); + + public static AclLogActionEnum 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 AclLogActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:acl.AclLogActionEnum) + } + + public interface AclMatchOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclMatch) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 dscp = 1; + * @return The dscp. + */ + int getDscp(); + + /** + * uint32 protocol = 2; + * @return The protocol. + */ + int getProtocol(); + + /** + * string src_address = 3; + * @return The srcAddress. + */ + java.lang.String getSrcAddress(); + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + com.google.protobuf.ByteString + getSrcAddressBytes(); + + /** + * string dst_address = 4; + * @return The dstAddress. + */ + java.lang.String getDstAddress(); + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + com.google.protobuf.ByteString + getDstAddressBytes(); + + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + int getSrcPort(); + + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + int getDstPort(); + + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + int getStartMplsLabel(); + + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + int getEndMplsLabel(); + } + /** + * Protobuf type {@code acl.AclMatch} + */ + public static final class AclMatch extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclMatch) + AclMatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclMatch.newBuilder() to construct. + private AclMatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclMatch() { + srcAddress_ = ""; + dstAddress_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclMatch(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclMatch( + 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: { + + dscp_ = input.readUInt32(); + break; + } + case 16: { + + protocol_ = input.readUInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + srcAddress_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + dstAddress_ = s; + break; + } + case 40: { + + srcPort_ = input.readUInt32(); + break; + } + case 48: { + + dstPort_ = input.readUInt32(); + break; + } + case 56: { + + startMplsLabel_ = input.readUInt32(); + break; + } + case 64: { + + endMplsLabel_ = input.readUInt32(); + 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 acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class); + } + + public static final int DSCP_FIELD_NUMBER = 1; + private int dscp_; + /** + * uint32 dscp = 1; + * @return The dscp. + */ + @java.lang.Override + public int getDscp() { + return dscp_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 2; + private int protocol_; + /** + * uint32 protocol = 2; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + + public static final int SRC_ADDRESS_FIELD_NUMBER = 3; + private volatile java.lang.Object srcAddress_; + /** + * string src_address = 3; + * @return The srcAddress. + */ + @java.lang.Override + public java.lang.String getSrcAddress() { + java.lang.Object ref = srcAddress_; + 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(); + srcAddress_ = s; + return s; + } + } + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSrcAddressBytes() { + java.lang.Object ref = srcAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DST_ADDRESS_FIELD_NUMBER = 4; + private volatile java.lang.Object dstAddress_; + /** + * string dst_address = 4; + * @return The dstAddress. + */ + @java.lang.Override + public java.lang.String getDstAddress() { + java.lang.Object ref = dstAddress_; + 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(); + dstAddress_ = s; + return s; + } + } + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDstAddressBytes() { + java.lang.Object ref = dstAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SRC_PORT_FIELD_NUMBER = 5; + private int srcPort_; + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + @java.lang.Override + public int getSrcPort() { + return srcPort_; + } + + public static final int DST_PORT_FIELD_NUMBER = 6; + private int dstPort_; + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + @java.lang.Override + public int getDstPort() { + return dstPort_; + } + + public static final int START_MPLS_LABEL_FIELD_NUMBER = 7; + private int startMplsLabel_; + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + @java.lang.Override + public int getStartMplsLabel() { + return startMplsLabel_; + } + + public static final int END_MPLS_LABEL_FIELD_NUMBER = 8; + private int endMplsLabel_; + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + @java.lang.Override + public int getEndMplsLabel() { + return endMplsLabel_; + } + + 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 (dscp_ != 0) { + output.writeUInt32(1, dscp_); + } + if (protocol_ != 0) { + output.writeUInt32(2, protocol_); + } + if (!getSrcAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, srcAddress_); + } + if (!getDstAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dstAddress_); + } + if (srcPort_ != 0) { + output.writeUInt32(5, srcPort_); + } + if (dstPort_ != 0) { + output.writeUInt32(6, dstPort_); + } + if (startMplsLabel_ != 0) { + output.writeUInt32(7, startMplsLabel_); + } + if (endMplsLabel_ != 0) { + output.writeUInt32(8, endMplsLabel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dscp_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, dscp_); + } + if (protocol_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, protocol_); + } + if (!getSrcAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, srcAddress_); + } + if (!getDstAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dstAddress_); + } + if (srcPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, srcPort_); + } + if (dstPort_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, dstPort_); + } + if (startMplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(7, startMplsLabel_); + } + if (endMplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(8, endMplsLabel_); + } + 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 acl.Acl.AclMatch)) { + return super.equals(obj); + } + acl.Acl.AclMatch other = (acl.Acl.AclMatch) obj; + + if (getDscp() + != other.getDscp()) return false; + if (getProtocol() + != other.getProtocol()) return false; + if (!getSrcAddress() + .equals(other.getSrcAddress())) return false; + if (!getDstAddress() + .equals(other.getDstAddress())) return false; + if (getSrcPort() + != other.getSrcPort()) return false; + if (getDstPort() + != other.getDstPort()) return false; + if (getStartMplsLabel() + != other.getStartMplsLabel()) return false; + if (getEndMplsLabel() + != other.getEndMplsLabel()) 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) + DSCP_FIELD_NUMBER; + hash = (53 * hash) + getDscp(); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol(); + hash = (37 * hash) + SRC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcAddress().hashCode(); + hash = (37 * hash) + DST_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstAddress().hashCode(); + hash = (37 * hash) + SRC_PORT_FIELD_NUMBER; + hash = (53 * hash) + getSrcPort(); + hash = (37 * hash) + DST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getDstPort(); + hash = (37 * hash) + START_MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getStartMplsLabel(); + hash = (37 * hash) + END_MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getEndMplsLabel(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclMatch parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclMatch parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclMatch parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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 acl.Acl.AclMatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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 acl.Acl.AclMatch parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclMatch 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(acl.Acl.AclMatch 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 acl.AclMatch} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclMatch) + acl.Acl.AclMatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class); + } + + // Construct using acl.Acl.AclMatch.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(); + dscp_ = 0; + + protocol_ = 0; + + srcAddress_ = ""; + + dstAddress_ = ""; + + srcPort_ = 0; + + dstPort_ = 0; + + startMplsLabel_ = 0; + + endMplsLabel_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclMatch_descriptor; + } + + @java.lang.Override + public acl.Acl.AclMatch getDefaultInstanceForType() { + return acl.Acl.AclMatch.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclMatch build() { + acl.Acl.AclMatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclMatch buildPartial() { + acl.Acl.AclMatch result = new acl.Acl.AclMatch(this); + result.dscp_ = dscp_; + result.protocol_ = protocol_; + result.srcAddress_ = srcAddress_; + result.dstAddress_ = dstAddress_; + result.srcPort_ = srcPort_; + result.dstPort_ = dstPort_; + result.startMplsLabel_ = startMplsLabel_; + result.endMplsLabel_ = endMplsLabel_; + 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 acl.Acl.AclMatch) { + return mergeFrom((acl.Acl.AclMatch)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclMatch other) { + if (other == acl.Acl.AclMatch.getDefaultInstance()) return this; + if (other.getDscp() != 0) { + setDscp(other.getDscp()); + } + if (other.getProtocol() != 0) { + setProtocol(other.getProtocol()); + } + if (!other.getSrcAddress().isEmpty()) { + srcAddress_ = other.srcAddress_; + onChanged(); + } + if (!other.getDstAddress().isEmpty()) { + dstAddress_ = other.dstAddress_; + onChanged(); + } + if (other.getSrcPort() != 0) { + setSrcPort(other.getSrcPort()); + } + if (other.getDstPort() != 0) { + setDstPort(other.getDstPort()); + } + if (other.getStartMplsLabel() != 0) { + setStartMplsLabel(other.getStartMplsLabel()); + } + if (other.getEndMplsLabel() != 0) { + setEndMplsLabel(other.getEndMplsLabel()); + } + 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 { + acl.Acl.AclMatch parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclMatch) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int dscp_ ; + /** + * uint32 dscp = 1; + * @return The dscp. + */ + @java.lang.Override + public int getDscp() { + return dscp_; + } + /** + * uint32 dscp = 1; + * @param value The dscp to set. + * @return This builder for chaining. + */ + public Builder setDscp(int value) { + + dscp_ = value; + onChanged(); + return this; + } + /** + * uint32 dscp = 1; + * @return This builder for chaining. + */ + public Builder clearDscp() { + + dscp_ = 0; + onChanged(); + return this; + } + + private int protocol_ ; + /** + * uint32 protocol = 2; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + /** + * uint32 protocol = 2; + * @param value The protocol to set. + * @return This builder for chaining. + */ + public Builder setProtocol(int value) { + + protocol_ = value; + onChanged(); + return this; + } + /** + * uint32 protocol = 2; + * @return This builder for chaining. + */ + public Builder clearProtocol() { + + protocol_ = 0; + onChanged(); + return this; + } + + private java.lang.Object srcAddress_ = ""; + /** + * string src_address = 3; + * @return The srcAddress. + */ + public java.lang.String getSrcAddress() { + java.lang.Object ref = srcAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string src_address = 3; + * @return The bytes for srcAddress. + */ + public com.google.protobuf.ByteString + getSrcAddressBytes() { + java.lang.Object ref = srcAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string src_address = 3; + * @param value The srcAddress to set. + * @return This builder for chaining. + */ + public Builder setSrcAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcAddress_ = value; + onChanged(); + return this; + } + /** + * string src_address = 3; + * @return This builder for chaining. + */ + public Builder clearSrcAddress() { + + srcAddress_ = getDefaultInstance().getSrcAddress(); + onChanged(); + return this; + } + /** + * string src_address = 3; + * @param value The bytes for srcAddress to set. + * @return This builder for chaining. + */ + public Builder setSrcAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object dstAddress_ = ""; + /** + * string dst_address = 4; + * @return The dstAddress. + */ + public java.lang.String getDstAddress() { + java.lang.Object ref = dstAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string dst_address = 4; + * @return The bytes for dstAddress. + */ + public com.google.protobuf.ByteString + getDstAddressBytes() { + java.lang.Object ref = dstAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string dst_address = 4; + * @param value The dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstAddress_ = value; + onChanged(); + return this; + } + /** + * string dst_address = 4; + * @return This builder for chaining. + */ + public Builder clearDstAddress() { + + dstAddress_ = getDefaultInstance().getDstAddress(); + onChanged(); + return this; + } + /** + * string dst_address = 4; + * @param value The bytes for dstAddress to set. + * @return This builder for chaining. + */ + public Builder setDstAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstAddress_ = value; + onChanged(); + return this; + } + + private int srcPort_ ; + /** + * uint32 src_port = 5; + * @return The srcPort. + */ + @java.lang.Override + public int getSrcPort() { + return srcPort_; + } + /** + * uint32 src_port = 5; + * @param value The srcPort to set. + * @return This builder for chaining. + */ + public Builder setSrcPort(int value) { + + srcPort_ = value; + onChanged(); + return this; + } + /** + * uint32 src_port = 5; + * @return This builder for chaining. + */ + public Builder clearSrcPort() { + + srcPort_ = 0; + onChanged(); + return this; + } + + private int dstPort_ ; + /** + * uint32 dst_port = 6; + * @return The dstPort. + */ + @java.lang.Override + public int getDstPort() { + return dstPort_; + } + /** + * uint32 dst_port = 6; + * @param value The dstPort to set. + * @return This builder for chaining. + */ + public Builder setDstPort(int value) { + + dstPort_ = value; + onChanged(); + return this; + } + /** + * uint32 dst_port = 6; + * @return This builder for chaining. + */ + public Builder clearDstPort() { + + dstPort_ = 0; + onChanged(); + return this; + } + + private int startMplsLabel_ ; + /** + * uint32 start_mpls_label = 7; + * @return The startMplsLabel. + */ + @java.lang.Override + public int getStartMplsLabel() { + return startMplsLabel_; + } + /** + * uint32 start_mpls_label = 7; + * @param value The startMplsLabel to set. + * @return This builder for chaining. + */ + public Builder setStartMplsLabel(int value) { + + startMplsLabel_ = value; + onChanged(); + return this; + } + /** + * uint32 start_mpls_label = 7; + * @return This builder for chaining. + */ + public Builder clearStartMplsLabel() { + + startMplsLabel_ = 0; + onChanged(); + return this; + } + + private int endMplsLabel_ ; + /** + * uint32 end_mpls_label = 8; + * @return The endMplsLabel. + */ + @java.lang.Override + public int getEndMplsLabel() { + return endMplsLabel_; + } + /** + * uint32 end_mpls_label = 8; + * @param value The endMplsLabel to set. + * @return This builder for chaining. + */ + public Builder setEndMplsLabel(int value) { + + endMplsLabel_ = value; + onChanged(); + return this; + } + /** + * uint32 end_mpls_label = 8; + * @return This builder for chaining. + */ + public Builder clearEndMplsLabel() { + + endMplsLabel_ = 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:acl.AclMatch) + } + + // @@protoc_insertion_point(class_scope:acl.AclMatch) + private static final acl.Acl.AclMatch DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclMatch(); + } + + public static acl.Acl.AclMatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclMatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclMatch(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 acl.Acl.AclMatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclAction) + com.google.protobuf.MessageOrBuilder { + + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + int getForwardActionValue(); + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + acl.Acl.AclForwardActionEnum getForwardAction(); + + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + int getLogActionValue(); + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + acl.Acl.AclLogActionEnum getLogAction(); + } + /** + * Protobuf type {@code acl.AclAction} + */ + public static final class AclAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclAction) + AclActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclAction.newBuilder() to construct. + private AclAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclAction() { + forwardAction_ = 0; + logAction_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclAction( + 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(); + + forwardAction_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + logAction_ = 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 acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class); + } + + public static final int FORWARD_ACTION_FIELD_NUMBER = 1; + private int forwardAction_; + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + @java.lang.Override public int getForwardActionValue() { + return forwardAction_; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + @java.lang.Override public acl.Acl.AclForwardActionEnum getForwardAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_); + return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result; + } + + public static final int LOG_ACTION_FIELD_NUMBER = 2; + private int logAction_; + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + @java.lang.Override public int getLogActionValue() { + return logAction_; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + @java.lang.Override public acl.Acl.AclLogActionEnum getLogAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_); + return result == null ? acl.Acl.AclLogActionEnum.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 (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) { + output.writeEnum(1, forwardAction_); + } + if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) { + output.writeEnum(2, logAction_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, forwardAction_); + } + if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, logAction_); + } + 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 acl.Acl.AclAction)) { + return super.equals(obj); + } + acl.Acl.AclAction other = (acl.Acl.AclAction) obj; + + if (forwardAction_ != other.forwardAction_) return false; + if (logAction_ != other.logAction_) 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) + FORWARD_ACTION_FIELD_NUMBER; + hash = (53 * hash) + forwardAction_; + hash = (37 * hash) + LOG_ACTION_FIELD_NUMBER; + hash = (53 * hash) + logAction_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclAction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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 acl.Acl.AclAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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 acl.Acl.AclAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclAction 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(acl.Acl.AclAction 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 acl.AclAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclAction) + acl.Acl.AclActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class); + } + + // Construct using acl.Acl.AclAction.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(); + forwardAction_ = 0; + + logAction_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclAction_descriptor; + } + + @java.lang.Override + public acl.Acl.AclAction getDefaultInstanceForType() { + return acl.Acl.AclAction.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclAction build() { + acl.Acl.AclAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclAction buildPartial() { + acl.Acl.AclAction result = new acl.Acl.AclAction(this); + result.forwardAction_ = forwardAction_; + result.logAction_ = logAction_; + 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 acl.Acl.AclAction) { + return mergeFrom((acl.Acl.AclAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclAction other) { + if (other == acl.Acl.AclAction.getDefaultInstance()) return this; + if (other.forwardAction_ != 0) { + setForwardActionValue(other.getForwardActionValue()); + } + if (other.logAction_ != 0) { + setLogActionValue(other.getLogActionValue()); + } + 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 { + acl.Acl.AclAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int forwardAction_ = 0; + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The enum numeric value on the wire for forwardAction. + */ + @java.lang.Override public int getForwardActionValue() { + return forwardAction_; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @param value The enum numeric value on the wire for forwardAction to set. + * @return This builder for chaining. + */ + public Builder setForwardActionValue(int value) { + + forwardAction_ = value; + onChanged(); + return this; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return The forwardAction. + */ + @java.lang.Override + public acl.Acl.AclForwardActionEnum getForwardAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_); + return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @param value The forwardAction to set. + * @return This builder for chaining. + */ + public Builder setForwardAction(acl.Acl.AclForwardActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + forwardAction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclForwardActionEnum forward_action = 1; + * @return This builder for chaining. + */ + public Builder clearForwardAction() { + + forwardAction_ = 0; + onChanged(); + return this; + } + + private int logAction_ = 0; + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The enum numeric value on the wire for logAction. + */ + @java.lang.Override public int getLogActionValue() { + return logAction_; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @param value The enum numeric value on the wire for logAction to set. + * @return This builder for chaining. + */ + public Builder setLogActionValue(int value) { + + logAction_ = value; + onChanged(); + return this; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return The logAction. + */ + @java.lang.Override + public acl.Acl.AclLogActionEnum getLogAction() { + @SuppressWarnings("deprecation") + acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_); + return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @param value The logAction to set. + * @return This builder for chaining. + */ + public Builder setLogAction(acl.Acl.AclLogActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + logAction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclLogActionEnum log_action = 2; + * @return This builder for chaining. + */ + public Builder clearLogAction() { + + logAction_ = 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:acl.AclAction) + } + + // @@protoc_insertion_point(class_scope:acl.AclAction) + private static final acl.Acl.AclAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclAction(); + } + + public static acl.Acl.AclAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclAction(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 acl.Acl.AclAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclEntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + int getSequenceId(); + + /** + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + boolean hasMatch(); + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + acl.Acl.AclMatch getMatch(); + /** + * .acl.AclMatch match = 3; + */ + acl.Acl.AclMatchOrBuilder getMatchOrBuilder(); + + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + boolean hasAction(); + /** + * .acl.AclAction action = 4; + * @return The action. + */ + acl.Acl.AclAction getAction(); + /** + * .acl.AclAction action = 4; + */ + acl.Acl.AclActionOrBuilder getActionOrBuilder(); + } + /** + * Protobuf type {@code acl.AclEntry} + */ + public static final class AclEntry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclEntry) + AclEntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclEntry.newBuilder() to construct. + private AclEntry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclEntry() { + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclEntry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclEntry( + 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: { + + sequenceId_ = input.readUInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + acl.Acl.AclMatch.Builder subBuilder = null; + if (match_ != null) { + subBuilder = match_.toBuilder(); + } + match_ = input.readMessage(acl.Acl.AclMatch.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(match_); + match_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + acl.Acl.AclAction.Builder subBuilder = null; + if (action_ != null) { + subBuilder = action_.toBuilder(); + } + action_ = input.readMessage(acl.Acl.AclAction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(action_); + action_ = 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 acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class); + } + + public static final int SEQUENCE_ID_FIELD_NUMBER = 1; + private int sequenceId_; + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + @java.lang.Override + public int getSequenceId() { + return sequenceId_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATCH_FIELD_NUMBER = 3; + private acl.Acl.AclMatch match_; + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + @java.lang.Override + public boolean hasMatch() { + return match_ != null; + } + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + @java.lang.Override + public acl.Acl.AclMatch getMatch() { + return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_; + } + /** + * .acl.AclMatch match = 3; + */ + @java.lang.Override + public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() { + return getMatch(); + } + + public static final int ACTION_FIELD_NUMBER = 4; + private acl.Acl.AclAction action_; + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + @java.lang.Override + public boolean hasAction() { + return action_ != null; + } + /** + * .acl.AclAction action = 4; + * @return The action. + */ + @java.lang.Override + public acl.Acl.AclAction getAction() { + return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_; + } + /** + * .acl.AclAction action = 4; + */ + @java.lang.Override + public acl.Acl.AclActionOrBuilder getActionOrBuilder() { + return getAction(); + } + + 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 (sequenceId_ != 0) { + output.writeUInt32(1, sequenceId_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (match_ != null) { + output.writeMessage(3, getMatch()); + } + if (action_ != null) { + output.writeMessage(4, getAction()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sequenceId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(1, sequenceId_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (match_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMatch()); + } + if (action_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAction()); + } + 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 acl.Acl.AclEntry)) { + return super.equals(obj); + } + acl.Acl.AclEntry other = (acl.Acl.AclEntry) obj; + + if (getSequenceId() + != other.getSequenceId()) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (hasMatch() != other.hasMatch()) return false; + if (hasMatch()) { + if (!getMatch() + .equals(other.getMatch())) return false; + } + if (hasAction() != other.hasAction()) return false; + if (hasAction()) { + if (!getAction() + .equals(other.getAction())) 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) + SEQUENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSequenceId(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasMatch()) { + hash = (37 * hash) + MATCH_FIELD_NUMBER; + hash = (53 * hash) + getMatch().hashCode(); + } + if (hasAction()) { + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclEntry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclEntry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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 acl.Acl.AclEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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 acl.Acl.AclEntry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclEntry 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(acl.Acl.AclEntry 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 acl.AclEntry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclEntry) + acl.Acl.AclEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class); + } + + // Construct using acl.Acl.AclEntry.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(); + sequenceId_ = 0; + + description_ = ""; + + if (matchBuilder_ == null) { + match_ = null; + } else { + match_ = null; + matchBuilder_ = null; + } + if (actionBuilder_ == null) { + action_ = null; + } else { + action_ = null; + actionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclEntry_descriptor; + } + + @java.lang.Override + public acl.Acl.AclEntry getDefaultInstanceForType() { + return acl.Acl.AclEntry.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclEntry build() { + acl.Acl.AclEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclEntry buildPartial() { + acl.Acl.AclEntry result = new acl.Acl.AclEntry(this); + result.sequenceId_ = sequenceId_; + result.description_ = description_; + if (matchBuilder_ == null) { + result.match_ = match_; + } else { + result.match_ = matchBuilder_.build(); + } + if (actionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = actionBuilder_.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 acl.Acl.AclEntry) { + return mergeFrom((acl.Acl.AclEntry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclEntry other) { + if (other == acl.Acl.AclEntry.getDefaultInstance()) return this; + if (other.getSequenceId() != 0) { + setSequenceId(other.getSequenceId()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasMatch()) { + mergeMatch(other.getMatch()); + } + if (other.hasAction()) { + mergeAction(other.getAction()); + } + 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 { + acl.Acl.AclEntry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclEntry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sequenceId_ ; + /** + * uint32 sequence_id = 1; + * @return The sequenceId. + */ + @java.lang.Override + public int getSequenceId() { + return sequenceId_; + } + /** + * uint32 sequence_id = 1; + * @param value The sequenceId to set. + * @return This builder for chaining. + */ + public Builder setSequenceId(int value) { + + sequenceId_ = value; + onChanged(); + return this; + } + /** + * uint32 sequence_id = 1; + * @return This builder for chaining. + */ + public Builder clearSequenceId() { + + sequenceId_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private acl.Acl.AclMatch match_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> matchBuilder_; + /** + * .acl.AclMatch match = 3; + * @return Whether the match field is set. + */ + public boolean hasMatch() { + return matchBuilder_ != null || match_ != null; + } + /** + * .acl.AclMatch match = 3; + * @return The match. + */ + public acl.Acl.AclMatch getMatch() { + if (matchBuilder_ == null) { + return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_; + } else { + return matchBuilder_.getMessage(); + } + } + /** + * .acl.AclMatch match = 3; + */ + public Builder setMatch(acl.Acl.AclMatch value) { + if (matchBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + match_ = value; + onChanged(); + } else { + matchBuilder_.setMessage(value); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder setMatch( + acl.Acl.AclMatch.Builder builderForValue) { + if (matchBuilder_ == null) { + match_ = builderForValue.build(); + onChanged(); + } else { + matchBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder mergeMatch(acl.Acl.AclMatch value) { + if (matchBuilder_ == null) { + if (match_ != null) { + match_ = + acl.Acl.AclMatch.newBuilder(match_).mergeFrom(value).buildPartial(); + } else { + match_ = value; + } + onChanged(); + } else { + matchBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public Builder clearMatch() { + if (matchBuilder_ == null) { + match_ = null; + onChanged(); + } else { + match_ = null; + matchBuilder_ = null; + } + + return this; + } + /** + * .acl.AclMatch match = 3; + */ + public acl.Acl.AclMatch.Builder getMatchBuilder() { + + onChanged(); + return getMatchFieldBuilder().getBuilder(); + } + /** + * .acl.AclMatch match = 3; + */ + public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() { + if (matchBuilder_ != null) { + return matchBuilder_.getMessageOrBuilder(); + } else { + return match_ == null ? + acl.Acl.AclMatch.getDefaultInstance() : match_; + } + } + /** + * .acl.AclMatch match = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> + getMatchFieldBuilder() { + if (matchBuilder_ == null) { + matchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>( + getMatch(), + getParentForChildren(), + isClean()); + match_ = null; + } + return matchBuilder_; + } + + private acl.Acl.AclAction action_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> actionBuilder_; + /** + * .acl.AclAction action = 4; + * @return Whether the action field is set. + */ + public boolean hasAction() { + return actionBuilder_ != null || action_ != null; + } + /** + * .acl.AclAction action = 4; + * @return The action. + */ + public acl.Acl.AclAction getAction() { + if (actionBuilder_ == null) { + return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_; + } else { + return actionBuilder_.getMessage(); + } + } + /** + * .acl.AclAction action = 4; + */ + public Builder setAction(acl.Acl.AclAction value) { + if (actionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + actionBuilder_.setMessage(value); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder setAction( + acl.Acl.AclAction.Builder builderForValue) { + if (actionBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + actionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder mergeAction(acl.Acl.AclAction value) { + if (actionBuilder_ == null) { + if (action_ != null) { + action_ = + acl.Acl.AclAction.newBuilder(action_).mergeFrom(value).buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + actionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public Builder clearAction() { + if (actionBuilder_ == null) { + action_ = null; + onChanged(); + } else { + action_ = null; + actionBuilder_ = null; + } + + return this; + } + /** + * .acl.AclAction action = 4; + */ + public acl.Acl.AclAction.Builder getActionBuilder() { + + onChanged(); + return getActionFieldBuilder().getBuilder(); + } + /** + * .acl.AclAction action = 4; + */ + public acl.Acl.AclActionOrBuilder getActionOrBuilder() { + if (actionBuilder_ != null) { + return actionBuilder_.getMessageOrBuilder(); + } else { + return action_ == null ? + acl.Acl.AclAction.getDefaultInstance() : action_; + } + } + /** + * .acl.AclAction action = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> + getActionFieldBuilder() { + if (actionBuilder_ == null) { + actionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>( + getAction(), + getParentForChildren(), + isClean()); + action_ = null; + } + return actionBuilder_; + } + @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:acl.AclEntry) + } + + // @@protoc_insertion_point(class_scope:acl.AclEntry) + private static final acl.Acl.AclEntry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclEntry(); + } + + public static acl.Acl.AclEntry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclEntry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclEntry(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 acl.Acl.AclEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AclRuleSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:acl.AclRuleSet) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + acl.Acl.AclRuleTypeEnum getType(); + + /** + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + * string user_id = 4; + * @return The userId. + */ + java.lang.String getUserId(); + /** + * string user_id = 4; + * @return The bytes for userId. + */ + com.google.protobuf.ByteString + getUserIdBytes(); + + /** + * repeated .acl.AclEntry entries = 5; + */ + java.util.List + getEntriesList(); + /** + * repeated .acl.AclEntry entries = 5; + */ + acl.Acl.AclEntry getEntries(int index); + /** + * repeated .acl.AclEntry entries = 5; + */ + int getEntriesCount(); + /** + * repeated .acl.AclEntry entries = 5; + */ + java.util.List + getEntriesOrBuilderList(); + /** + * repeated .acl.AclEntry entries = 5; + */ + acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index); + } + /** + * Protobuf type {@code acl.AclRuleSet} + */ + public static final class AclRuleSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:acl.AclRuleSet) + AclRuleSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use AclRuleSet.newBuilder() to construct. + private AclRuleSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AclRuleSet() { + name_ = ""; + type_ = 0; + description_ = ""; + userId_ = ""; + entries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AclRuleSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AclRuleSet( + 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 16: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + userId_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + entries_.add( + input.readMessage(acl.Acl.AclEntry.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)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * 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; + } + } + /** + * 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 TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + @java.lang.Override public acl.Acl.AclRuleTypeEnum getType() { + @SuppressWarnings("deprecation") + acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_); + return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object userId_; + /** + * string user_id = 4; + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + 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(); + userId_ = s; + return s; + } + } + /** + * string user_id = 4; + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 5; + private java.util.List entries_; + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public acl.Acl.AclEntry getEntries(int index) { + return entries_.get(index); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + @java.lang.Override + public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) { + output.writeEnum(2, type_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (!getUserIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userId_); + } + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(5, entries_.get(i)); + } + 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 (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, type_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (!getUserIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userId_); + } + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, entries_.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 acl.Acl.AclRuleSet)) { + return super.equals(obj); + } + acl.Acl.AclRuleSet other = (acl.Acl.AclRuleSet) obj; + + if (!getName() + .equals(other.getName())) return false; + if (type_ != other.type_) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUserId() + .equals(other.getUserId())) return false; + if (!getEntriesList() + .equals(other.getEntriesList())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static acl.Acl.AclRuleSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static acl.Acl.AclRuleSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static acl.Acl.AclRuleSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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 acl.Acl.AclRuleSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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 acl.Acl.AclRuleSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static acl.Acl.AclRuleSet 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(acl.Acl.AclRuleSet 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 acl.AclRuleSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:acl.AclRuleSet) + acl.Acl.AclRuleSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class); + } + + // Construct using acl.Acl.AclRuleSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = 0; + + description_ = ""; + + userId_ = ""; + + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entriesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return acl.Acl.internal_static_acl_AclRuleSet_descriptor; + } + + @java.lang.Override + public acl.Acl.AclRuleSet getDefaultInstanceForType() { + return acl.Acl.AclRuleSet.getDefaultInstance(); + } + + @java.lang.Override + public acl.Acl.AclRuleSet build() { + acl.Acl.AclRuleSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public acl.Acl.AclRuleSet buildPartial() { + acl.Acl.AclRuleSet result = new acl.Acl.AclRuleSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.type_ = type_; + result.description_ = description_; + result.userId_ = userId_; + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.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 acl.Acl.AclRuleSet) { + return mergeFrom((acl.Acl.AclRuleSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(acl.Acl.AclRuleSet other) { + if (other == acl.Acl.AclRuleSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + onChanged(); + } + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEntriesFieldBuilder() : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + 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 { + acl.Acl.AclRuleSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (acl.Acl.AclRuleSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * 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 int type_ = 0; + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return The type. + */ + @java.lang.Override + public acl.Acl.AclRuleTypeEnum getType() { + @SuppressWarnings("deprecation") + acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_); + return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(acl.Acl.AclRuleTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .acl.AclRuleTypeEnum type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object userId_ = ""; + /** + * string user_id = 4; + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string user_id = 4; + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString + getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string user_id = 4; + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userId_ = value; + onChanged(); + return this; + } + /** + * string user_id = 4; + * @return This builder for chaining. + */ + public Builder clearUserId() { + + userId_ = getDefaultInstance().getUserId(); + onChanged(); + return this; + } + /** + * string user_id = 4; + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userId_ = value; + onChanged(); + return this; + } + + private java.util.List entries_ = + java.util.Collections.emptyList(); + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> entriesBuilder_; + + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder setEntries( + int index, acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder setEntries( + int index, acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries(acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + int index, acl.Acl.AclEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addEntries( + int index, acl.Acl.AclEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder().addBuilder( + acl.Acl.AclEntry.getDefaultInstance()); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public acl.Acl.AclEntry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder().addBuilder( + index, acl.Acl.AclEntry.getDefaultInstance()); + } + /** + * repeated .acl.AclEntry entries = 5; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>( + entries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + @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:acl.AclRuleSet) + } + + // @@protoc_insertion_point(class_scope:acl.AclRuleSet) + private static final acl.Acl.AclRuleSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new acl.Acl.AclRuleSet(); + } + + public static acl.Acl.AclRuleSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AclRuleSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AclRuleSet(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 acl.Acl.AclRuleSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclMatch_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclMatch_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclAction_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_acl_AclRuleSet_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_acl_AclRuleSet_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\tacl.proto\022\003acl\"\252\001\n\010AclMatch\022\014\n\004dscp\030\001 " + + "\001(\r\022\020\n\010protocol\030\002 \001(\r\022\023\n\013src_address\030\003 \001" + + "(\t\022\023\n\013dst_address\030\004 \001(\t\022\020\n\010src_port\030\005 \001(" + + "\r\022\020\n\010dst_port\030\006 \001(\r\022\030\n\020start_mpls_label\030" + + "\007 \001(\r\022\026\n\016end_mpls_label\030\010 \001(\r\"i\n\tAclActi" + + "on\0221\n\016forward_action\030\001 \001(\0162\031.acl.AclForw" + + "ardActionEnum\022)\n\nlog_action\030\002 \001(\0162\025.acl." + + "AclLogActionEnum\"r\n\010AclEntry\022\023\n\013sequence" + + "_id\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\034\n\005match\030" + + "\003 \001(\0132\r.acl.AclMatch\022\036\n\006action\030\004 \001(\0132\016.a" + + "cl.AclAction\"\204\001\n\nAclRuleSet\022\014\n\004name\030\001 \001(" + + "\t\022\"\n\004type\030\002 \001(\0162\024.acl.AclRuleTypeEnum\022\023\n" + + "\013description\030\003 \001(\t\022\017\n\007user_id\030\004 \001(\t\022\036\n\007e" + + "ntries\030\005 \003(\0132\r.acl.AclEntry*\231\001\n\017AclRuleT" + + "ypeEnum\022\031\n\025ACLRULETYPE_UNDEFINED\020\000\022\024\n\020AC" + + "LRULETYPE_IPV4\020\001\022\024\n\020ACLRULETYPE_IPV6\020\002\022\022" + + "\n\016ACLRULETYPE_L2\020\003\022\024\n\020ACLRULETYPE_MPLS\020\004" + + "\022\025\n\021ACLRULETYPE_MIXED\020\005*\227\001\n\024AclForwardAc" + + "tionEnum\022!\n\035ACLFORWARDINGACTION_UNDEFINE" + + "D\020\000\022\034\n\030ACLFORWARDINGACTION_DROP\020\001\022\036\n\032ACL" + + "FORWARDINGACTION_ACCEPT\020\002\022\036\n\032ACLFORWARDI" + + "NGACTION_REJECT\020\003*_\n\020AclLogActionEnum\022\032\n" + + "\026ACLLOGACTION_UNDEFINED\020\000\022\026\n\022ACLLOGACTIO" + + "N_NOLOG\020\001\022\027\n\023ACLLOGACTION_SYSLOG\020\002b\006prot" + + "o3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_acl_AclMatch_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_acl_AclMatch_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclMatch_descriptor, + new java.lang.String[] { "Dscp", "Protocol", "SrcAddress", "DstAddress", "SrcPort", "DstPort", "StartMplsLabel", "EndMplsLabel", }); + internal_static_acl_AclAction_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_acl_AclAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclAction_descriptor, + new java.lang.String[] { "ForwardAction", "LogAction", }); + internal_static_acl_AclEntry_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_acl_AclEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclEntry_descriptor, + new java.lang.String[] { "SequenceId", "Description", "Match", "Action", }); + internal_static_acl_AclRuleSet_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_acl_AclRuleSet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_acl_AclRuleSet_descriptor, + new java.lang.String[] { "Name", "Type", "Description", "UserId", "Entries", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java index 473bfa689e1a6df4d08ed8ddb76c746969f317dd..45a64fabb43bab645e97e9d80bc1825242006dce 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java @@ -556,6 +556,10 @@ public final class ContextOuterClass { * SERVICESTATUS_PENDING_REMOVAL = 3; */ SERVICESTATUS_PENDING_REMOVAL(3), + /** + * SERVICESTATUS_SLA_VIOLATED = 4; + */ + SERVICESTATUS_SLA_VIOLATED(4), UNRECOGNIZED(-1), ; @@ -575,6 +579,10 @@ public final class ContextOuterClass { * SERVICESTATUS_PENDING_REMOVAL = 3; */ public static final int SERVICESTATUS_PENDING_REMOVAL_VALUE = 3; + /** + * SERVICESTATUS_SLA_VIOLATED = 4; + */ + public static final int SERVICESTATUS_SLA_VIOLATED_VALUE = 4; public final int getNumber() { @@ -605,6 +613,7 @@ public final class ContextOuterClass { case 1: return SERVICESTATUS_PLANNED; case 2: return SERVICESTATUS_ACTIVE; case 3: return SERVICESTATUS_PENDING_REMOVAL; + case 4: return SERVICESTATUS_SLA_VIOLATED; default: return null; } } @@ -661,6 +670,150 @@ public final class ContextOuterClass { // @@protoc_insertion_point(enum_scope:context.ServiceStatusEnum) } + /** + * Protobuf enum {@code context.SliceStatusEnum} + */ + public enum SliceStatusEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SLICESTATUS_UNDEFINED = 0; + */ + SLICESTATUS_UNDEFINED(0), + /** + * SLICESTATUS_PLANNED = 1; + */ + SLICESTATUS_PLANNED(1), + /** + * SLICESTATUS_INIT = 2; + */ + SLICESTATUS_INIT(2), + /** + * SLICESTATUS_ACTIVE = 3; + */ + SLICESTATUS_ACTIVE(3), + /** + * SLICESTATUS_DEINIT = 4; + */ + SLICESTATUS_DEINIT(4), + /** + * SLICESTATUS_SLA_VIOLATED = 5; + */ + SLICESTATUS_SLA_VIOLATED(5), + UNRECOGNIZED(-1), + ; + + /** + * SLICESTATUS_UNDEFINED = 0; + */ + public static final int SLICESTATUS_UNDEFINED_VALUE = 0; + /** + * SLICESTATUS_PLANNED = 1; + */ + public static final int SLICESTATUS_PLANNED_VALUE = 1; + /** + * SLICESTATUS_INIT = 2; + */ + public static final int SLICESTATUS_INIT_VALUE = 2; + /** + * SLICESTATUS_ACTIVE = 3; + */ + public static final int SLICESTATUS_ACTIVE_VALUE = 3; + /** + * SLICESTATUS_DEINIT = 4; + */ + public static final int SLICESTATUS_DEINIT_VALUE = 4; + /** + * SLICESTATUS_SLA_VIOLATED = 5; + */ + public static final int SLICESTATUS_SLA_VIOLATED_VALUE = 5; + + + 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 SliceStatusEnum 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 SliceStatusEnum forNumber(int value) { + switch (value) { + case 0: return SLICESTATUS_UNDEFINED; + case 1: return SLICESTATUS_PLANNED; + case 2: return SLICESTATUS_INIT; + case 3: return SLICESTATUS_ACTIVE; + case 4: return SLICESTATUS_DEINIT; + case 5: return SLICESTATUS_SLA_VIOLATED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SliceStatusEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SliceStatusEnum findValueByNumber(int number) { + return SliceStatusEnum.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 context.ContextOuterClass.getDescriptor().getEnumTypes().get(5); + } + + private static final SliceStatusEnum[] VALUES = values(); + + public static SliceStatusEnum 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 SliceStatusEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:context.SliceStatusEnum) + } + /** *
    * ----- Configuration -------------------------------------------------------------------------------------------------
@@ -756,7 +909,7 @@ public final class ContextOuterClass {
     }
     public static final com.google.protobuf.Descriptors.EnumDescriptor
         getDescriptor() {
-      return context.ContextOuterClass.getDescriptor().getEnumTypes().get(5);
+      return context.ContextOuterClass.getDescriptor().getEnumTypes().get(6);
     }
 
     private static final ConfigActionEnum[] VALUES = values();
@@ -782,6 +935,177 @@ public final class ContextOuterClass {
     // @@protoc_insertion_point(enum_scope:context.ConfigActionEnum)
   }
 
+  /**
+   * Protobuf enum {@code context.IsolationLevelEnum}
+   */
+  public enum IsolationLevelEnum
+      implements com.google.protobuf.ProtocolMessageEnum {
+    /**
+     * NO_ISOLATION = 0;
+     */
+    NO_ISOLATION(0),
+    /**
+     * PHYSICAL_ISOLATION = 1;
+     */
+    PHYSICAL_ISOLATION(1),
+    /**
+     * LOGICAL_ISOLATION = 2;
+     */
+    LOGICAL_ISOLATION(2),
+    /**
+     * PROCESS_ISOLATION = 3;
+     */
+    PROCESS_ISOLATION(3),
+    /**
+     * PHYSICAL_MEMORY_ISOLATION = 4;
+     */
+    PHYSICAL_MEMORY_ISOLATION(4),
+    /**
+     * PHYSICAL_NETWORK_ISOLATION = 5;
+     */
+    PHYSICAL_NETWORK_ISOLATION(5),
+    /**
+     * VIRTUAL_RESOURCE_ISOLATION = 6;
+     */
+    VIRTUAL_RESOURCE_ISOLATION(6),
+    /**
+     * NETWORK_FUNCTIONS_ISOLATION = 7;
+     */
+    NETWORK_FUNCTIONS_ISOLATION(7),
+    /**
+     * SERVICE_ISOLATION = 8;
+     */
+    SERVICE_ISOLATION(8),
+    UNRECOGNIZED(-1),
+    ;
+
+    /**
+     * NO_ISOLATION = 0;
+     */
+    public static final int NO_ISOLATION_VALUE = 0;
+    /**
+     * PHYSICAL_ISOLATION = 1;
+     */
+    public static final int PHYSICAL_ISOLATION_VALUE = 1;
+    /**
+     * LOGICAL_ISOLATION = 2;
+     */
+    public static final int LOGICAL_ISOLATION_VALUE = 2;
+    /**
+     * PROCESS_ISOLATION = 3;
+     */
+    public static final int PROCESS_ISOLATION_VALUE = 3;
+    /**
+     * PHYSICAL_MEMORY_ISOLATION = 4;
+     */
+    public static final int PHYSICAL_MEMORY_ISOLATION_VALUE = 4;
+    /**
+     * PHYSICAL_NETWORK_ISOLATION = 5;
+     */
+    public static final int PHYSICAL_NETWORK_ISOLATION_VALUE = 5;
+    /**
+     * VIRTUAL_RESOURCE_ISOLATION = 6;
+     */
+    public static final int VIRTUAL_RESOURCE_ISOLATION_VALUE = 6;
+    /**
+     * NETWORK_FUNCTIONS_ISOLATION = 7;
+     */
+    public static final int NETWORK_FUNCTIONS_ISOLATION_VALUE = 7;
+    /**
+     * SERVICE_ISOLATION = 8;
+     */
+    public static final int SERVICE_ISOLATION_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 IsolationLevelEnum 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 IsolationLevelEnum forNumber(int value) {
+      switch (value) {
+        case 0: return NO_ISOLATION;
+        case 1: return PHYSICAL_ISOLATION;
+        case 2: return LOGICAL_ISOLATION;
+        case 3: return PROCESS_ISOLATION;
+        case 4: return PHYSICAL_MEMORY_ISOLATION;
+        case 5: return PHYSICAL_NETWORK_ISOLATION;
+        case 6: return VIRTUAL_RESOURCE_ISOLATION;
+        case 7: return NETWORK_FUNCTIONS_ISOLATION;
+        case 8: return SERVICE_ISOLATION;
+        default: return null;
+      }
+    }
+
+    public static com.google.protobuf.Internal.EnumLiteMap
+        internalGetValueMap() {
+      return internalValueMap;
+    }
+    private static final com.google.protobuf.Internal.EnumLiteMap<
+        IsolationLevelEnum> internalValueMap =
+          new com.google.protobuf.Internal.EnumLiteMap() {
+            public IsolationLevelEnum findValueByNumber(int number) {
+              return IsolationLevelEnum.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 context.ContextOuterClass.getDescriptor().getEnumTypes().get(7);
+    }
+
+    private static final IsolationLevelEnum[] VALUES = values();
+
+    public static IsolationLevelEnum 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 IsolationLevelEnum(int value) {
+      this.value = value;
+    }
+
+    // @@protoc_insertion_point(enum_scope:context.IsolationLevelEnum)
+  }
+
   public interface EmptyOrBuilder extends
       // @@protoc_insertion_point(interface_extends:context.Empty)
       com.google.protobuf.MessageOrBuilder {
@@ -1776,8 +2100,8 @@ public final class ContextOuterClass {
 
   }
 
-  public interface EventOrBuilder extends
-      // @@protoc_insertion_point(interface_extends:context.Event)
+  public interface TimestampOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:context.Timestamp)
       com.google.protobuf.MessageOrBuilder {
 
     /**
@@ -1785,39 +2109,27 @@ public final class ContextOuterClass {
      * @return The timestamp.
      */
     double getTimestamp();
-
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The enum numeric value on the wire for eventType.
-     */
-    int getEventTypeValue();
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The eventType.
-     */
-    context.ContextOuterClass.EventTypeEnum getEventType();
   }
   /**
-   * Protobuf type {@code context.Event}
+   * Protobuf type {@code context.Timestamp}
    */
-  public static final class Event extends
+  public static final class Timestamp extends
       com.google.protobuf.GeneratedMessageV3 implements
-      // @@protoc_insertion_point(message_implements:context.Event)
-      EventOrBuilder {
+      // @@protoc_insertion_point(message_implements:context.Timestamp)
+      TimestampOrBuilder {
   private static final long serialVersionUID = 0L;
-    // Use Event.newBuilder() to construct.
-    private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) {
+    // Use Timestamp.newBuilder() to construct.
+    private Timestamp(com.google.protobuf.GeneratedMessageV3.Builder builder) {
       super(builder);
     }
-    private Event() {
-      eventType_ = 0;
+    private Timestamp() {
     }
 
     @java.lang.Override
     @SuppressWarnings({"unused"})
     protected java.lang.Object newInstance(
         UnusedPrivateParameter unused) {
-      return new Event();
+      return new Timestamp();
     }
 
     @java.lang.Override
@@ -1825,7 +2137,7 @@ public final class ContextOuterClass {
     getUnknownFields() {
       return this.unknownFields;
     }
-    private Event(
+    private Timestamp(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1848,12 +2160,6 @@ public final class ContextOuterClass {
               timestamp_ = input.readDouble();
               break;
             }
-            case 16: {
-              int rawValue = input.readEnum();
-
-              eventType_ = rawValue;
-              break;
-            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -1875,15 +2181,15 @@ public final class ContextOuterClass {
     }
     public static final com.google.protobuf.Descriptors.Descriptor
         getDescriptor() {
-      return context.ContextOuterClass.internal_static_context_Event_descriptor;
+      return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
     }
 
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
-      return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable
+      return context.ContextOuterClass.internal_static_context_Timestamp_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class);
+              context.ContextOuterClass.Timestamp.class, context.ContextOuterClass.Timestamp.Builder.class);
     }
 
     public static final int TIMESTAMP_FIELD_NUMBER = 1;
@@ -1897,25 +2203,6 @@ public final class ContextOuterClass {
       return timestamp_;
     }
 
-    public static final int EVENT_TYPE_FIELD_NUMBER = 2;
-    private int eventType_;
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The enum numeric value on the wire for eventType.
-     */
-    @java.lang.Override public int getEventTypeValue() {
-      return eventType_;
-    }
-    /**
-     * .context.EventTypeEnum event_type = 2;
-     * @return The eventType.
-     */
-    @java.lang.Override public context.ContextOuterClass.EventTypeEnum getEventType() {
-      @SuppressWarnings("deprecation")
-      context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_);
-      return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result;
-    }
-
     private byte memoizedIsInitialized = -1;
     @java.lang.Override
     public final boolean isInitialized() {
@@ -1933,9 +2220,6 @@ public final class ContextOuterClass {
       if (timestamp_ != 0D) {
         output.writeDouble(1, timestamp_);
       }
-      if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) {
-        output.writeEnum(2, eventType_);
-      }
       unknownFields.writeTo(output);
     }
 
@@ -1949,10 +2233,6 @@ public final class ContextOuterClass {
         size += com.google.protobuf.CodedOutputStream
           .computeDoubleSize(1, timestamp_);
       }
-      if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeEnumSize(2, eventType_);
-      }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
       return size;
@@ -1963,15 +2243,14 @@ public final class ContextOuterClass {
       if (obj == this) {
        return true;
       }
-      if (!(obj instanceof context.ContextOuterClass.Event)) {
+      if (!(obj instanceof context.ContextOuterClass.Timestamp)) {
         return super.equals(obj);
       }
-      context.ContextOuterClass.Event other = (context.ContextOuterClass.Event) obj;
+      context.ContextOuterClass.Timestamp other = (context.ContextOuterClass.Timestamp) obj;
 
       if (java.lang.Double.doubleToLongBits(getTimestamp())
           != java.lang.Double.doubleToLongBits(
               other.getTimestamp())) return false;
-      if (eventType_ != other.eventType_) return false;
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
     }
@@ -1986,76 +2265,74 @@ public final class ContextOuterClass {
       hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER;
       hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
           java.lang.Double.doubleToLongBits(getTimestamp()));
-      hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER;
-      hash = (53 * hash) + eventType_;
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
     }
 
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         java.nio.ByteBuffer data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         java.nio.ByteBuffer data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.ByteString data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.ByteString data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(byte[] data)
+    public static context.ContextOuterClass.Timestamp parseFrom(byte[] data)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         byte[] data,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws com.google.protobuf.InvalidProtocolBufferException {
       return PARSER.parseFrom(data, extensionRegistry);
     }
-    public static context.ContextOuterClass.Event parseFrom(java.io.InputStream input)
+    public static context.ContextOuterClass.Timestamp parseFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp 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 context.ContextOuterClass.Event parseDelimitedFrom(java.io.InputStream input)
+    public static context.ContextOuterClass.Timestamp parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseDelimitedWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseDelimitedFrom(
+    public static context.ContextOuterClass.Timestamp 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 context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.CodedInputStream input)
         throws java.io.IOException {
       return com.google.protobuf.GeneratedMessageV3
           .parseWithIOException(PARSER, input);
     }
-    public static context.ContextOuterClass.Event parseFrom(
+    public static context.ContextOuterClass.Timestamp parseFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
@@ -2068,7 +2345,7 @@ public final class ContextOuterClass {
     public static Builder newBuilder() {
       return DEFAULT_INSTANCE.toBuilder();
     }
-    public static Builder newBuilder(context.ContextOuterClass.Event prototype) {
+    public static Builder newBuilder(context.ContextOuterClass.Timestamp prototype) {
       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
     }
     @java.lang.Override
@@ -2084,26 +2361,26 @@ public final class ContextOuterClass {
       return builder;
     }
     /**
-     * Protobuf type {@code context.Event}
+     * Protobuf type {@code context.Timestamp}
      */
     public static final class Builder extends
         com.google.protobuf.GeneratedMessageV3.Builder implements
-        // @@protoc_insertion_point(builder_implements:context.Event)
-        context.ContextOuterClass.EventOrBuilder {
+        // @@protoc_insertion_point(builder_implements:context.Timestamp)
+        context.ContextOuterClass.TimestampOrBuilder {
       public static final com.google.protobuf.Descriptors.Descriptor
           getDescriptor() {
-        return context.ContextOuterClass.internal_static_context_Event_descriptor;
+        return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
       }
 
       @java.lang.Override
       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
           internalGetFieldAccessorTable() {
-        return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable
+        return context.ContextOuterClass.internal_static_context_Timestamp_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
-                context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class);
+                context.ContextOuterClass.Timestamp.class, context.ContextOuterClass.Timestamp.Builder.class);
       }
 
-      // Construct using context.ContextOuterClass.Event.newBuilder()
+      // Construct using context.ContextOuterClass.Timestamp.newBuilder()
       private Builder() {
         maybeForceBuilderInitialization();
       }
@@ -2123,25 +2400,23 @@ public final class ContextOuterClass {
         super.clear();
         timestamp_ = 0D;
 
-        eventType_ = 0;
-
         return this;
       }
 
       @java.lang.Override
       public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
-        return context.ContextOuterClass.internal_static_context_Event_descriptor;
+        return context.ContextOuterClass.internal_static_context_Timestamp_descriptor;
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event getDefaultInstanceForType() {
-        return context.ContextOuterClass.Event.getDefaultInstance();
+      public context.ContextOuterClass.Timestamp getDefaultInstanceForType() {
+        return context.ContextOuterClass.Timestamp.getDefaultInstance();
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event build() {
-        context.ContextOuterClass.Event result = buildPartial();
+      public context.ContextOuterClass.Timestamp build() {
+        context.ContextOuterClass.Timestamp result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
         }
@@ -2149,10 +2424,9 @@ public final class ContextOuterClass {
       }
 
       @java.lang.Override
-      public context.ContextOuterClass.Event buildPartial() {
-        context.ContextOuterClass.Event result = new context.ContextOuterClass.Event(this);
+      public context.ContextOuterClass.Timestamp buildPartial() {
+        context.ContextOuterClass.Timestamp result = new context.ContextOuterClass.Timestamp(this);
         result.timestamp_ = timestamp_;
-        result.eventType_ = eventType_;
         onBuilt();
         return result;
       }
@@ -2191,22 +2465,19 @@ public final class ContextOuterClass {
       }
       @java.lang.Override
       public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof context.ContextOuterClass.Event) {
-          return mergeFrom((context.ContextOuterClass.Event)other);
+        if (other instanceof context.ContextOuterClass.Timestamp) {
+          return mergeFrom((context.ContextOuterClass.Timestamp)other);
         } else {
           super.mergeFrom(other);
           return this;
         }
       }
 
-      public Builder mergeFrom(context.ContextOuterClass.Event other) {
-        if (other == context.ContextOuterClass.Event.getDefaultInstance()) return this;
+      public Builder mergeFrom(context.ContextOuterClass.Timestamp other) {
+        if (other == context.ContextOuterClass.Timestamp.getDefaultInstance()) return this;
         if (other.getTimestamp() != 0D) {
           setTimestamp(other.getTimestamp());
         }
-        if (other.eventType_ != 0) {
-          setEventTypeValue(other.getEventTypeValue());
-        }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
         return this;
@@ -2222,11 +2493,11 @@ public final class ContextOuterClass {
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        context.ContextOuterClass.Event parsedMessage = null;
+        context.ContextOuterClass.Timestamp parsedMessage = null;
         try {
           parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (context.ContextOuterClass.Event) e.getUnfinishedMessage();
+          parsedMessage = (context.ContextOuterClass.Timestamp) e.getUnfinishedMessage();
           throw e.unwrapIOException();
         } finally {
           if (parsedMessage != null) {
@@ -2266,60 +2537,6 @@ public final class ContextOuterClass {
         onChanged();
         return this;
       }
-
-      private int eventType_ = 0;
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return The enum numeric value on the wire for eventType.
-       */
-      @java.lang.Override public int getEventTypeValue() {
-        return eventType_;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @param value The enum numeric value on the wire for eventType to set.
-       * @return This builder for chaining.
-       */
-      public Builder setEventTypeValue(int value) {
-        
-        eventType_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return The eventType.
-       */
-      @java.lang.Override
-      public context.ContextOuterClass.EventTypeEnum getEventType() {
-        @SuppressWarnings("deprecation")
-        context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_);
-        return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @param value The eventType to set.
-       * @return This builder for chaining.
-       */
-      public Builder setEventType(context.ContextOuterClass.EventTypeEnum value) {
-        if (value == null) {
-          throw new NullPointerException();
-        }
-        
-        eventType_ = value.getNumber();
-        onChanged();
-        return this;
-      }
-      /**
-       * .context.EventTypeEnum event_type = 2;
-       * @return This builder for chaining.
-       */
-      public Builder clearEventType() {
-        
-        eventType_ = 0;
-        onChanged();
-        return this;
-      }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -2333,89 +2550,97 @@ public final class ContextOuterClass {
       }
 
 
-      // @@protoc_insertion_point(builder_scope:context.Event)
+      // @@protoc_insertion_point(builder_scope:context.Timestamp)
     }
 
-    // @@protoc_insertion_point(class_scope:context.Event)
-    private static final context.ContextOuterClass.Event DEFAULT_INSTANCE;
+    // @@protoc_insertion_point(class_scope:context.Timestamp)
+    private static final context.ContextOuterClass.Timestamp DEFAULT_INSTANCE;
     static {
-      DEFAULT_INSTANCE = new context.ContextOuterClass.Event();
+      DEFAULT_INSTANCE = new context.ContextOuterClass.Timestamp();
     }
 
-    public static context.ContextOuterClass.Event getDefaultInstance() {
+    public static context.ContextOuterClass.Timestamp getDefaultInstance() {
       return DEFAULT_INSTANCE;
     }
 
-    private static final com.google.protobuf.Parser
-        PARSER = new com.google.protobuf.AbstractParser() {
+    private static final com.google.protobuf.Parser
+        PARSER = new com.google.protobuf.AbstractParser() {
       @java.lang.Override
-      public Event parsePartialFrom(
+      public Timestamp parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
-        return new Event(input, extensionRegistry);
+        return new Timestamp(input, extensionRegistry);
       }
     };
 
-    public static com.google.protobuf.Parser parser() {
+    public static com.google.protobuf.Parser parser() {
       return PARSER;
     }
 
     @java.lang.Override
-    public com.google.protobuf.Parser getParserForType() {
+    public com.google.protobuf.Parser getParserForType() {
       return PARSER;
     }
 
     @java.lang.Override
-    public context.ContextOuterClass.Event getDefaultInstanceForType() {
+    public context.ContextOuterClass.Timestamp getDefaultInstanceForType() {
       return DEFAULT_INSTANCE;
     }
 
   }
 
-  public interface ContextIdOrBuilder extends
-      // @@protoc_insertion_point(interface_extends:context.ContextId)
+  public interface EventOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:context.Event)
       com.google.protobuf.MessageOrBuilder {
 
     /**
-     * .context.Uuid context_uuid = 1;
-     * @return Whether the contextUuid field is set.
+     * .context.Timestamp timestamp = 1;
+     * @return Whether the timestamp field is set.
      */
-    boolean hasContextUuid();
+    boolean hasTimestamp();
     /**
-     * .context.Uuid context_uuid = 1;
-     * @return The contextUuid.
+     * .context.Timestamp timestamp = 1;
+     * @return The timestamp.
      */
-    context.ContextOuterClass.Uuid getContextUuid();
+    context.ContextOuterClass.Timestamp getTimestamp();
     /**
-     * .context.Uuid context_uuid = 1;
+     * .context.Timestamp timestamp = 1;
      */
-    context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder();
+    context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder();
+
+    /**
+     * .context.EventTypeEnum event_type = 2;
+     * @return The enum numeric value on the wire for eventType.
+     */
+    int getEventTypeValue();
+    /**
+     * .context.EventTypeEnum event_type = 2;
+     * @return The eventType.
+     */
+    context.ContextOuterClass.EventTypeEnum getEventType();
   }
   /**
-   * 
-   * ----- Context -------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.ContextId} + * Protobuf type {@code context.Event} */ - public static final class ContextId extends + public static final class Event extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextId) - ContextIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Event) + EventOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextId.newBuilder() to construct. - private ContextId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextId() { + private Event() { + eventType_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextId(); + return new Event(); } @java.lang.Override @@ -2423,7 +2648,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextId( + private Event( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2442,18 +2667,24 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (contextUuid_ != null) { - subBuilder = contextUuid_.toBuilder(); + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); } - contextUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextUuid_); - contextUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); } break; } + case 16: { + int rawValue = input.readEnum(); + + eventType_ = rawValue; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -2475,41 +2706,60 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); + context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class); } - public static final int CONTEXT_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid contextUuid_; + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private context.ContextOuterClass.Timestamp timestamp_; /** - * .context.Uuid context_uuid = 1; - * @return Whether the contextUuid field is set. + * .context.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. */ @java.lang.Override - public boolean hasContextUuid() { - return contextUuid_ != null; + public boolean hasTimestamp() { + return timestamp_ != null; } /** - * .context.Uuid context_uuid = 1; - * @return The contextUuid. + * .context.Timestamp timestamp = 1; + * @return The timestamp. */ @java.lang.Override - public context.ContextOuterClass.Uuid getContextUuid() { - return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { - return getContextUuid(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 2; + private int eventType_; + /** + * .context.EventTypeEnum event_type = 2; + * @return The enum numeric value on the wire for eventType. + */ + @java.lang.Override public int getEventTypeValue() { + return eventType_; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return The eventType. + */ + @java.lang.Override public context.ContextOuterClass.EventTypeEnum getEventType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_); + return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -2526,8 +2776,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextUuid_ != null) { - output.writeMessage(1, getContextUuid()); + if (timestamp_ != null) { + output.writeMessage(1, getTimestamp()); + } + if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) { + output.writeEnum(2, eventType_); } unknownFields.writeTo(output); } @@ -2538,9 +2791,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextUuid_ != null) { + if (timestamp_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextUuid()); + .computeMessageSize(1, getTimestamp()); + } + if (eventType_ != context.ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, eventType_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -2552,16 +2809,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextId)) { + if (!(obj instanceof context.ContextOuterClass.Event)) { return super.equals(obj); } - context.ContextOuterClass.ContextId other = (context.ContextOuterClass.ContextId) obj; + context.ContextOuterClass.Event other = (context.ContextOuterClass.Event) obj; - if (hasContextUuid() != other.hasContextUuid()) return false; - if (hasContextUuid()) { - if (!getContextUuid() - .equals(other.getContextUuid())) return false; + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; } + if (eventType_ != other.eventType_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2573,78 +2831,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextUuid()) { - hash = (37 * hash) + CONTEXT_UUID_FIELD_NUMBER; - hash = (53 * hash) + getContextUuid().hashCode(); + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); } + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + eventType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom(byte[] data) + public static context.ContextOuterClass.Event parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Event parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event 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 context.ContextOuterClass.ContextId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Event parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseDelimitedFrom( + public static context.ContextOuterClass.Event 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 context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextId parseFrom( + public static context.ContextOuterClass.Event parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2657,7 +2917,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Event prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2673,30 +2933,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Context -------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.ContextId} + * Protobuf type {@code context.Event} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextId) - context.ContextOuterClass.ContextIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Event) + context.ContextOuterClass.EventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Event_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); + context.ContextOuterClass.Event.class, context.ContextOuterClass.Event.Builder.class); } - // Construct using context.ContextOuterClass.ContextId.newBuilder() + // Construct using context.ContextOuterClass.Event.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2714,29 +2970,31 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (contextUuidBuilder_ == null) { - contextUuid_ = null; + if (timestampBuilder_ == null) { + timestamp_ = null; } else { - contextUuid_ = null; - contextUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } + eventType_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextId_descriptor; + return context.ContextOuterClass.internal_static_context_Event_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextId getDefaultInstanceForType() { - return context.ContextOuterClass.ContextId.getDefaultInstance(); + public context.ContextOuterClass.Event getDefaultInstanceForType() { + return context.ContextOuterClass.Event.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextId build() { - context.ContextOuterClass.ContextId result = buildPartial(); + public context.ContextOuterClass.Event build() { + context.ContextOuterClass.Event result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2744,13 +3002,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextId buildPartial() { - context.ContextOuterClass.ContextId result = new context.ContextOuterClass.ContextId(this); - if (contextUuidBuilder_ == null) { - result.contextUuid_ = contextUuid_; + public context.ContextOuterClass.Event buildPartial() { + context.ContextOuterClass.Event result = new context.ContextOuterClass.Event(this); + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; } else { - result.contextUuid_ = contextUuidBuilder_.build(); + result.timestamp_ = timestampBuilder_.build(); } + result.eventType_ = eventType_; onBuilt(); return result; } @@ -2789,18 +3048,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextId) { - return mergeFrom((context.ContextOuterClass.ContextId)other); + if (other instanceof context.ContextOuterClass.Event) { + return mergeFrom((context.ContextOuterClass.Event)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextId other) { - if (other == context.ContextOuterClass.ContextId.getDefaultInstance()) return this; - if (other.hasContextUuid()) { - mergeContextUuid(other.getContextUuid()); + public Builder mergeFrom(context.ContextOuterClass.Event other) { + if (other == context.ContextOuterClass.Event.getDefaultInstance()) return this; + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.eventType_ != 0) { + setEventTypeValue(other.getEventTypeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -2817,11 +3079,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextId parsedMessage = null; + context.ContextOuterClass.Event parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Event) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2831,123 +3093,177 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid contextUuid_; + private context.ContextOuterClass.Timestamp timestamp_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> contextUuidBuilder_; + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; /** - * .context.Uuid context_uuid = 1; - * @return Whether the contextUuid field is set. + * .context.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. */ - public boolean hasContextUuid() { - return contextUuidBuilder_ != null || contextUuid_ != null; + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; } /** - * .context.Uuid context_uuid = 1; - * @return The contextUuid. + * .context.Timestamp timestamp = 1; + * @return The timestamp. */ - public context.ContextOuterClass.Uuid getContextUuid() { - if (contextUuidBuilder_ == null) { - return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } else { - return contextUuidBuilder_.getMessage(); + return timestampBuilder_.getMessage(); } } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder setContextUuid(context.ContextOuterClass.Uuid value) { - if (contextUuidBuilder_ == null) { + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextUuid_ = value; + timestamp_ = value; onChanged(); } else { - contextUuidBuilder_.setMessage(value); + timestampBuilder_.setMessage(value); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder setContextUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (contextUuidBuilder_ == null) { - contextUuid_ = builderForValue.build(); + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); onChanged(); } else { - contextUuidBuilder_.setMessage(builderForValue.build()); + timestampBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder mergeContextUuid(context.ContextOuterClass.Uuid value) { - if (contextUuidBuilder_ == null) { - if (contextUuid_ != null) { - contextUuid_ = - context.ContextOuterClass.Uuid.newBuilder(contextUuid_).mergeFrom(value).buildPartial(); + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); } else { - contextUuid_ = value; + timestamp_ = value; } onChanged(); } else { - contextUuidBuilder_.mergeFrom(value); + timestampBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public Builder clearContextUuid() { - if (contextUuidBuilder_ == null) { - contextUuid_ = null; + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; onChanged(); } else { - contextUuid_ = null; - contextUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } return this; } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public context.ContextOuterClass.Uuid.Builder getContextUuidBuilder() { + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { onChanged(); - return getContextUuidFieldBuilder().getBuilder(); + return getTimestampFieldBuilder().getBuilder(); } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ - public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { - if (contextUuidBuilder_ != null) { - return contextUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); } else { - return contextUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } } /** - * .context.Uuid context_uuid = 1; + * .context.Timestamp timestamp = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getContextUuidFieldBuilder() { - if (contextUuidBuilder_ == null) { - contextUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getContextUuid(), + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); - contextUuid_ = null; + timestamp_ = null; } - return contextUuidBuilder_; + return timestampBuilder_; + } + + private int eventType_ = 0; + /** + * .context.EventTypeEnum event_type = 2; + * @return The enum numeric value on the wire for eventType. + */ + @java.lang.Override public int getEventTypeValue() { + return eventType_; + } + /** + * .context.EventTypeEnum event_type = 2; + * @param value The enum numeric value on the wire for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeValue(int value) { + + eventType_ = value; + onChanged(); + return this; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return The eventType. + */ + @java.lang.Override + public context.ContextOuterClass.EventTypeEnum getEventType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.EventTypeEnum result = context.ContextOuterClass.EventTypeEnum.valueOf(eventType_); + return result == null ? context.ContextOuterClass.EventTypeEnum.UNRECOGNIZED : result; + } + /** + * .context.EventTypeEnum event_type = 2; + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(context.ContextOuterClass.EventTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.EventTypeEnum event_type = 2; + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -2962,150 +3278,89 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextId) + // @@protoc_insertion_point(builder_scope:context.Event) } - // @@protoc_insertion_point(class_scope:context.ContextId) - private static final context.ContextOuterClass.ContextId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Event) + private static final context.ContextOuterClass.Event DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Event(); } - public static context.ContextOuterClass.ContextId getDefaultInstance() { + public static context.ContextOuterClass.Event getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextId parsePartialFrom( + public Event parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextId(input, extensionRegistry); + return new Event(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + public context.ContextOuterClass.Event getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Context) + public interface ContextIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextId) com.google.protobuf.MessageOrBuilder { /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - boolean hasContextId(); - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - context.ContextOuterClass.ContextId getContextId(); - /** - * .context.ContextId context_id = 1; - */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); - - /** - * repeated .context.TopologyId topology_ids = 2; - */ - java.util.List - getTopologyIdsList(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - context.ContextOuterClass.TopologyId getTopologyIds(int index); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - int getTopologyIdsCount(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - java.util.List - getTopologyIdsOrBuilderList(); - /** - * repeated .context.TopologyId topology_ids = 2; - */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index); - - /** - * repeated .context.ServiceId service_ids = 3; - */ - java.util.List - getServiceIdsList(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - context.ContextOuterClass.ServiceId getServiceIds(int index); - /** - * repeated .context.ServiceId service_ids = 3; - */ - int getServiceIdsCount(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - java.util.List - getServiceIdsOrBuilderList(); - /** - * repeated .context.ServiceId service_ids = 3; - */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index); - - /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ - boolean hasController(); + boolean hasContextUuid(); /** - * .context.TeraFlowController controller = 4; - * @return The controller. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ - context.ContextOuterClass.TeraFlowController getController(); + context.ContextOuterClass.Uuid getContextUuid(); /** - * .context.TeraFlowController controller = 4; + * .context.Uuid context_uuid = 1; */ - context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder(); + context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder(); } /** - * Protobuf type {@code context.Context} + *
+   * ----- Context -------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ContextId} */ - public static final class Context extends + public static final class ContextId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Context) - ContextOrBuilder { + // @@protoc_insertion_point(message_implements:context.ContextId) + ContextIdOrBuilder { private static final long serialVersionUID = 0L; - // Use Context.newBuilder() to construct. - private Context(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ContextId.newBuilder() to construct. + private ContextId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Context() { - topologyIds_ = java.util.Collections.emptyList(); - serviceIds_ = java.util.Collections.emptyList(); + private ContextId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Context(); + return new ContextId(); } @java.lang.Override @@ -3113,7 +3368,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Context( + private ContextId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3121,7 +3376,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -3133,45 +3387,14 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); - } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - topologyIds_.add( - input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - serviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - serviceIds_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); - break; - } - case 34: { - context.ContextOuterClass.TeraFlowController.Builder subBuilder = null; - if (controller_ != null) { - subBuilder = controller_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (contextUuid_ != null) { + subBuilder = contextUuid_.toBuilder(); } - controller_ = input.readMessage(context.ContextOuterClass.TeraFlowController.parser(), extensionRegistry); + contextUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(controller_); - controller_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(contextUuid_); + contextUuid_ = subBuilder.buildPartial(); } break; @@ -3191,159 +3414,47 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); - } - - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; - } - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; - } - /** - * .context.ContextId context_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); - } - - public static final int TOPOLOGY_IDS_FIELD_NUMBER = 2; - private java.util.List topologyIds_; - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public java.util.List getTopologyIdsList() { - return topologyIds_; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public java.util.List - getTopologyIdsOrBuilderList() { - return topologyIds_; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public int getTopologyIdsCount() { - return topologyIds_.size(); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - return topologyIds_.get(index); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index) { - return topologyIds_.get(index); - } - - public static final int SERVICE_IDS_FIELD_NUMBER = 3; - private java.util.List serviceIds_; - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public java.util.List getServiceIdsList() { - return serviceIds_; - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public java.util.List - getServiceIdsOrBuilderList() { - return serviceIds_; - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public int getServiceIdsCount() { - return serviceIds_.size(); - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - return serviceIds_.get(index); - } - /** - * repeated .context.ServiceId service_ids = 3; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - return serviceIds_.get(index); + context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); } - public static final int CONTROLLER_FIELD_NUMBER = 4; - private context.ContextOuterClass.TeraFlowController controller_; + public static final int CONTEXT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid contextUuid_; /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ @java.lang.Override - public boolean hasController() { - return controller_ != null; + public boolean hasContextUuid() { + return contextUuid_ != null; } /** - * .context.TeraFlowController controller = 4; - * @return The controller. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ @java.lang.Override - public context.ContextOuterClass.TeraFlowController getController() { - return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + public context.ContextOuterClass.Uuid getContextUuid() { + return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } /** - * .context.TeraFlowController controller = 4; + * .context.Uuid context_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { - return getController(); + public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { + return getContextUuid(); } private byte memoizedIsInitialized = -1; @@ -3360,17 +3471,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); - } - for (int i = 0; i < topologyIds_.size(); i++) { - output.writeMessage(2, topologyIds_.get(i)); - } - for (int i = 0; i < serviceIds_.size(); i++) { - output.writeMessage(3, serviceIds_.get(i)); - } - if (controller_ != null) { - output.writeMessage(4, getController()); + if (contextUuid_ != null) { + output.writeMessage(1, getContextUuid()); } unknownFields.writeTo(output); } @@ -3381,21 +3483,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); - } - for (int i = 0; i < topologyIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, topologyIds_.get(i)); - } - for (int i = 0; i < serviceIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, serviceIds_.get(i)); - } - if (controller_ != null) { + if (contextUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getController()); + .computeMessageSize(1, getContextUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -3407,24 +3497,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Context)) { + if (!(obj instanceof context.ContextOuterClass.ContextId)) { return super.equals(obj); } - context.ContextOuterClass.Context other = (context.ContextOuterClass.Context) obj; + context.ContextOuterClass.ContextId other = (context.ContextOuterClass.ContextId) obj; - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; - } - if (!getTopologyIdsList() - .equals(other.getTopologyIdsList())) return false; - if (!getServiceIdsList() - .equals(other.getServiceIdsList())) return false; - if (hasController() != other.hasController()) return false; - if (hasController()) { - if (!getController() - .equals(other.getController())) return false; + if (hasContextUuid() != other.hasContextUuid()) return false; + if (hasContextUuid()) { + if (!getContextUuid() + .equals(other.getContextUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -3437,90 +3518,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); - } - if (getTopologyIdsCount() > 0) { - hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTopologyIdsList().hashCode(); - } - if (getServiceIdsCount() > 0) { - hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceIdsList().hashCode(); - } - if (hasController()) { - hash = (37 * hash) + CONTROLLER_FIELD_NUMBER; - hash = (53 * hash) + getController().hashCode(); + if (hasContextUuid()) { + hash = (37 * hash) + CONTEXT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getContextUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom(byte[] data) + public static context.ContextOuterClass.ContextId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Context parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ContextId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId 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 context.ContextOuterClass.Context parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ContextId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseDelimitedFrom( + public static context.ContextOuterClass.ContextId 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 context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Context parseFrom( + public static context.ContextOuterClass.ContextId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3533,7 +3602,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Context prototype) { + public static Builder newBuilder(context.ContextOuterClass.ContextId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3549,26 +3618,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Context} + *
+     * ----- Context -------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ContextId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Context) - context.ContextOuterClass.ContextOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ContextId) + context.ContextOuterClass.ContextIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ContextId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + context.ContextOuterClass.ContextId.class, context.ContextOuterClass.ContextId.Builder.class); } - // Construct using context.ContextOuterClass.Context.newBuilder() + // Construct using context.ContextOuterClass.ContextId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3581,36 +3654,16 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologyIdsFieldBuilder(); - getServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; - } else { - contextId_ = null; - contextIdBuilder_ = null; - } - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - topologyIdsBuilder_.clear(); - } - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - serviceIdsBuilder_.clear(); - } - if (controllerBuilder_ == null) { - controller_ = null; + if (contextUuidBuilder_ == null) { + contextUuid_ = null; } else { - controller_ = null; - controllerBuilder_ = null; + contextUuid_ = null; + contextUuidBuilder_ = null; } return this; } @@ -3618,17 +3671,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Context_descriptor; + return context.ContextOuterClass.internal_static_context_ContextId_descriptor; } @java.lang.Override - public context.ContextOuterClass.Context getDefaultInstanceForType() { - return context.ContextOuterClass.Context.getDefaultInstance(); + public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + return context.ContextOuterClass.ContextId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Context build() { - context.ContextOuterClass.Context result = buildPartial(); + public context.ContextOuterClass.ContextId build() { + context.ContextOuterClass.ContextId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3636,36 +3689,12 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Context buildPartial() { - context.ContextOuterClass.Context result = new context.ContextOuterClass.Context(this); - int from_bitField0_ = bitField0_; - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; - } else { - result.contextId_ = contextIdBuilder_.build(); - } - if (topologyIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.topologyIds_ = topologyIds_; - } else { - result.topologyIds_ = topologyIdsBuilder_.build(); - } - if (serviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.serviceIds_ = serviceIds_; - } else { - result.serviceIds_ = serviceIdsBuilder_.build(); - } - if (controllerBuilder_ == null) { - result.controller_ = controller_; + public context.ContextOuterClass.ContextId buildPartial() { + context.ContextOuterClass.ContextId result = new context.ContextOuterClass.ContextId(this); + if (contextUuidBuilder_ == null) { + result.contextUuid_ = contextUuid_; } else { - result.controller_ = controllerBuilder_.build(); + result.contextUuid_ = contextUuidBuilder_.build(); } onBuilt(); return result; @@ -3705,73 +3734,18 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Context) { - return mergeFrom((context.ContextOuterClass.Context)other); + if (other instanceof context.ContextOuterClass.ContextId) { + return mergeFrom((context.ContextOuterClass.ContextId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Context other) { - if (other == context.ContextOuterClass.Context.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); - } - if (topologyIdsBuilder_ == null) { - if (!other.topologyIds_.isEmpty()) { - if (topologyIds_.isEmpty()) { - topologyIds_ = other.topologyIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTopologyIdsIsMutable(); - topologyIds_.addAll(other.topologyIds_); - } - onChanged(); - } - } else { - if (!other.topologyIds_.isEmpty()) { - if (topologyIdsBuilder_.isEmpty()) { - topologyIdsBuilder_.dispose(); - topologyIdsBuilder_ = null; - topologyIds_ = other.topologyIds_; - bitField0_ = (bitField0_ & ~0x00000001); - topologyIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologyIdsFieldBuilder() : null; - } else { - topologyIdsBuilder_.addAllMessages(other.topologyIds_); - } - } - } - if (serviceIdsBuilder_ == null) { - if (!other.serviceIds_.isEmpty()) { - if (serviceIds_.isEmpty()) { - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureServiceIdsIsMutable(); - serviceIds_.addAll(other.serviceIds_); - } - onChanged(); - } - } else { - if (!other.serviceIds_.isEmpty()) { - if (serviceIdsBuilder_.isEmpty()) { - serviceIdsBuilder_.dispose(); - serviceIdsBuilder_ = null; - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000002); - serviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceIdsFieldBuilder() : null; - } else { - serviceIdsBuilder_.addAllMessages(other.serviceIds_); - } - } - } - if (other.hasController()) { - mergeController(other.getController()); + public Builder mergeFrom(context.ContextOuterClass.ContextId other) { + if (other == context.ContextOuterClass.ContextId.getDefaultInstance()) return this; + if (other.hasContextUuid()) { + mergeContextUuid(other.getContextUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -3788,11 +3762,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Context parsedMessage = null; + context.ContextOuterClass.ContextId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Context) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ContextId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3801,724 +3775,24154 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.Uuid contextUuid_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> contextUuidBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.Uuid context_uuid = 1; + * @return Whether the contextUuid field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasContextUuid() { + return contextUuidBuilder_ != null || contextUuid_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.Uuid context_uuid = 1; + * @return The contextUuid. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.Uuid getContextUuid() { + if (contextUuidBuilder_ == null) { + return contextUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } else { - return contextIdBuilder_.getMessage(); + return contextUuidBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setContextUuid(context.ContextOuterClass.Uuid value) { + if (contextUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + contextUuid_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + contextUuidBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setContextUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (contextUuidBuilder_ == null) { + contextUuid_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + contextUuidBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); - } else { - contextId_ = value; + public Builder mergeContextUuid(context.ContextOuterClass.Uuid value) { + if (contextUuidBuilder_ == null) { + if (contextUuid_ != null) { + contextUuid_ = + context.ContextOuterClass.Uuid.newBuilder(contextUuid_).mergeFrom(value).buildPartial(); + } else { + contextUuid_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + contextUuidBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearContextUuid() { + if (contextUuidBuilder_ == null) { + contextUuid_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + contextUuid_ = null; + contextUuidBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.Uuid.Builder getContextUuidBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getContextUuidFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.UuidOrBuilder getContextUuidOrBuilder() { + if (contextUuidBuilder_ != null) { + return contextUuidBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return contextUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : contextUuid_; } } /** - * .context.ContextId context_id = 1; + * .context.Uuid context_uuid = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getContextUuidFieldBuilder() { + if (contextUuidBuilder_ == null) { + contextUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getContextUuid(), getParentForChildren(), isClean()); - contextId_ = null; + contextUuid_ = null; } - return contextIdBuilder_; + return contextUuidBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - private java.util.List topologyIds_ = - java.util.Collections.emptyList(); - private void ensureTopologyIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(topologyIds_); - bitField0_ |= 0x00000001; - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List getTopologyIdsList() { - if (topologyIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologyIds_); - } else { - return topologyIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public int getTopologyIdsCount() { - if (topologyIdsBuilder_ == null) { - return topologyIds_.size(); - } else { - return topologyIdsBuilder_.getCount(); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); - } else { - return topologyIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, value); - onChanged(); - } else { - topologyIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + // @@protoc_insertion_point(builder_scope:context.ContextId) + } + + // @@protoc_insertion_point(class_scope:context.ContextId) + private static final context.ContextOuterClass.ContextId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextId(); + } + + public static context.ContextOuterClass.ContextId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextId(input, extensionRegistry); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTopologyIdsIsMutable(); - topologyIds_.add(value); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(value); - } - return this; + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public context.ContextOuterClass.ContextId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Context) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * repeated .context.TopologyId topology_ids = 2; + */ + java.util.List + getTopologyIdsList(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + context.ContextOuterClass.TopologyId getTopologyIds(int index); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + int getTopologyIdsCount(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + java.util.List + getTopologyIdsOrBuilderList(); + /** + * repeated .context.TopologyId topology_ids = 2; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index); + + /** + * repeated .context.ServiceId service_ids = 3; + */ + java.util.List + getServiceIdsList(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + context.ContextOuterClass.ServiceId getServiceIds(int index); + /** + * repeated .context.ServiceId service_ids = 3; + */ + int getServiceIdsCount(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + java.util.List + getServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId service_ids = 3; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index); + + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + boolean hasController(); + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + context.ContextOuterClass.TeraFlowController getController(); + /** + * .context.TeraFlowController controller = 4; + */ + context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder(); + } + /** + * Protobuf type {@code context.Context} + */ + public static final class Context extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Context) + ContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use Context.newBuilder() to construct. + private Context(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Context() { + topologyIds_ = java.util.Collections.emptyList(); + serviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Context(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Context( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { - if (value == null) { - throw new 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologyIds_.add( + input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + serviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + serviceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 34: { + context.ContextOuterClass.TeraFlowController.Builder subBuilder = null; + if (controller_ != null) { + subBuilder = controller_.toBuilder(); + } + controller_ = input.readMessage(context.ContextOuterClass.TeraFlowController.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(controller_); + controller_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, value); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, builderForValue.build()); - onChanged(); - } else { - topologyIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder addAllTopologyIds( - java.lang.Iterable values) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologyIds_); - onChanged(); - } else { - topologyIdsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder clearTopologyIds() { - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - topologyIdsBuilder_.clear(); - } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public Builder removeTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.remove(index); - onChanged(); - } else { - topologyIdsBuilder_.remove(index); } - return this; - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( - int index) { - return getTopologyIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( - int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); } else { - return topologyIdsBuilder_.getMessageOrBuilder(index); + } 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)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); } - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List - getTopologyIdsOrBuilderList() { - if (topologyIdsBuilder_ != null) { - return topologyIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(topologyIds_); + if (((mutable_bitField0_ & 0x00000002) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { - return getTopologyIdsFieldBuilder().addBuilder( - context.ContextOuterClass.TopologyId.getDefaultInstance()); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( - int index) { - return getTopologyIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.TopologyId.getDefaultInstance()); - } - /** - * repeated .context.TopologyId topology_ids = 2; - */ - public java.util.List - getTopologyIdsBuilderList() { - return getTopologyIdsFieldBuilder().getBuilderList(); + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int TOPOLOGY_IDS_FIELD_NUMBER = 2; + private java.util.List topologyIds_; + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public java.util.List getTopologyIdsList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public java.util.List + getTopologyIdsOrBuilderList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public int getTopologyIdsCount() { + return topologyIds_.size(); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + return topologyIds_.get(index); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + return topologyIds_.get(index); + } + + public static final int SERVICE_IDS_FIELD_NUMBER = 3; + private java.util.List serviceIds_; + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public java.util.List getServiceIdsList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public java.util.List + getServiceIdsOrBuilderList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public int getServiceIdsCount() { + return serviceIds_.size(); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + return serviceIds_.get(index); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + return serviceIds_.get(index); + } + + public static final int CONTROLLER_FIELD_NUMBER = 4; + private context.ContextOuterClass.TeraFlowController controller_; + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + @java.lang.Override + public boolean hasController() { + return controller_ != null; + } + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + @java.lang.Override + public context.ContextOuterClass.TeraFlowController getController() { + return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } + /** + * .context.TeraFlowController controller = 4; + */ + @java.lang.Override + public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { + return getController(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + for (int i = 0; i < topologyIds_.size(); i++) { + output.writeMessage(2, topologyIds_.get(i)); + } + for (int i = 0; i < serviceIds_.size(); i++) { + output.writeMessage(3, serviceIds_.get(i)); + } + if (controller_ != null) { + output.writeMessage(4, getController()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + for (int i = 0; i < topologyIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, topologyIds_.get(i)); + } + for (int i = 0; i < serviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, serviceIds_.get(i)); + } + if (controller_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getController()); + } + 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 context.ContextOuterClass.Context)) { + return super.equals(obj); + } + context.ContextOuterClass.Context other = (context.ContextOuterClass.Context) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (!getTopologyIdsList() + .equals(other.getTopologyIdsList())) return false; + if (!getServiceIdsList() + .equals(other.getServiceIdsList())) return false; + if (hasController() != other.hasController()) return false; + if (hasController()) { + if (!getController() + .equals(other.getController())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (getTopologyIdsCount() > 0) { + hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTopologyIdsList().hashCode(); + } + if (getServiceIdsCount() > 0) { + hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceIdsList().hashCode(); + } + if (hasController()) { + hash = (37 * hash) + CONTROLLER_FIELD_NUMBER; + hash = (53 * hash) + getController().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Context parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Context parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Context parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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 context.ContextOuterClass.Context parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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 context.ContextOuterClass.Context parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Context 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(context.ContextOuterClass.Context 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 context.Context} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Context) + context.ContextOuterClass.ContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Context_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Context.class, context.ContextOuterClass.Context.Builder.class); + } + + // Construct using context.ContextOuterClass.Context.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologyIdsFieldBuilder(); + getServiceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologyIdsBuilder_.clear(); + } + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + serviceIdsBuilder_.clear(); + } + if (controllerBuilder_ == null) { + controller_ = null; + } else { + controller_ = null; + controllerBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Context_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Context getDefaultInstanceForType() { + return context.ContextOuterClass.Context.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Context build() { + context.ContextOuterClass.Context result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Context buildPartial() { + context.ContextOuterClass.Context result = new context.ContextOuterClass.Context(this); + int from_bitField0_ = bitField0_; + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (topologyIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologyIds_ = topologyIds_; + } else { + result.topologyIds_ = topologyIdsBuilder_.build(); + } + if (serviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serviceIds_ = serviceIds_; + } else { + result.serviceIds_ = serviceIdsBuilder_.build(); + } + if (controllerBuilder_ == null) { + result.controller_ = controller_; + } else { + result.controller_ = controllerBuilder_.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 context.ContextOuterClass.Context) { + return mergeFrom((context.ContextOuterClass.Context)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Context other) { + if (other == context.ContextOuterClass.Context.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (topologyIdsBuilder_ == null) { + if (!other.topologyIds_.isEmpty()) { + if (topologyIds_.isEmpty()) { + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologyIdsIsMutable(); + topologyIds_.addAll(other.topologyIds_); + } + onChanged(); + } + } else { + if (!other.topologyIds_.isEmpty()) { + if (topologyIdsBuilder_.isEmpty()) { + topologyIdsBuilder_.dispose(); + topologyIdsBuilder_ = null; + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + topologyIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologyIdsFieldBuilder() : null; + } else { + topologyIdsBuilder_.addAllMessages(other.topologyIds_); + } + } + } + if (serviceIdsBuilder_ == null) { + if (!other.serviceIds_.isEmpty()) { + if (serviceIds_.isEmpty()) { + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServiceIdsIsMutable(); + serviceIds_.addAll(other.serviceIds_); + } + onChanged(); + } + } else { + if (!other.serviceIds_.isEmpty()) { + if (serviceIdsBuilder_.isEmpty()) { + serviceIdsBuilder_.dispose(); + serviceIdsBuilder_ = null; + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + serviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceIdsFieldBuilder() : null; + } else { + serviceIdsBuilder_.addAllMessages(other.serviceIds_); + } + } + } + if (other.hasController()) { + mergeController(other.getController()); + } + 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 { + context.ContextOuterClass.Context parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Context) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private java.util.List topologyIds_ = + java.util.Collections.emptyList(); + private void ensureTopologyIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(topologyIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List getTopologyIdsList() { + if (topologyIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologyIds_); + } else { + return topologyIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public int getTopologyIdsCount() { + if (topologyIdsBuilder_ == null) { + return topologyIds_.size(); + } else { + return topologyIdsBuilder_.getCount(); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); + } else { + return topologyIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, value); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder addAllTopologyIds( + java.lang.Iterable values) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologyIds_); + onChanged(); + } else { + topologyIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder clearTopologyIds() { + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public Builder removeTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.remove(index); + onChanged(); + } else { + topologyIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); } else { + return topologyIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List + getTopologyIdsOrBuilderList() { + if (topologyIdsBuilder_ != null) { + return topologyIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologyIds_); + } + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { + return getTopologyIdsFieldBuilder().addBuilder( + context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 2; + */ + public java.util.List + getTopologyIdsBuilderList() { + return getTopologyIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdsFieldBuilder() { + if (topologyIdsBuilder_ == null) { + topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + topologyIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologyIds_ = null; + } + return topologyIdsBuilder_; + } + + private java.util.List serviceIds_ = + java.util.Collections.emptyList(); + private void ensureServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serviceIds_ = new java.util.ArrayList(serviceIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List getServiceIdsList() { + if (serviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceIds_); + } else { + return serviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public int getServiceIdsCount() { + if (serviceIdsBuilder_ == null) { + return serviceIds_.size(); + } else { + return serviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); + } else { + return serviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.set(index, value); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(index, value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder addAllServiceIds( + java.lang.Iterable values) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceIds_); + onChanged(); + } else { + serviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder clearServiceIds() { + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public Builder removeServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.remove(index); + onChanged(); + } else { + serviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); } else { + return serviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List + getServiceIdsOrBuilderList() { + if (serviceIdsBuilder_ != null) { + return serviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceIds_); + } + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { + return getServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 3; + */ + public java.util.List + getServiceIdsBuilderList() { + return getServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdsFieldBuilder() { + if (serviceIdsBuilder_ == null) { + serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + serviceIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + serviceIds_ = null; + } + return serviceIdsBuilder_; + } + + private context.ContextOuterClass.TeraFlowController controller_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> controllerBuilder_; + /** + * .context.TeraFlowController controller = 4; + * @return Whether the controller field is set. + */ + public boolean hasController() { + return controllerBuilder_ != null || controller_ != null; + } + /** + * .context.TeraFlowController controller = 4; + * @return The controller. + */ + public context.ContextOuterClass.TeraFlowController getController() { + if (controllerBuilder_ == null) { + return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } else { + return controllerBuilder_.getMessage(); + } + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder setController(context.ContextOuterClass.TeraFlowController value) { + if (controllerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + controller_ = value; + onChanged(); + } else { + controllerBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder setController( + context.ContextOuterClass.TeraFlowController.Builder builderForValue) { + if (controllerBuilder_ == null) { + controller_ = builderForValue.build(); + onChanged(); + } else { + controllerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder mergeController(context.ContextOuterClass.TeraFlowController value) { + if (controllerBuilder_ == null) { + if (controller_ != null) { + controller_ = + context.ContextOuterClass.TeraFlowController.newBuilder(controller_).mergeFrom(value).buildPartial(); + } else { + controller_ = value; + } + onChanged(); + } else { + controllerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public Builder clearController() { + if (controllerBuilder_ == null) { + controller_ = null; + onChanged(); + } else { + controller_ = null; + controllerBuilder_ = null; + } + + return this; + } + /** + * .context.TeraFlowController controller = 4; + */ + public context.ContextOuterClass.TeraFlowController.Builder getControllerBuilder() { + + onChanged(); + return getControllerFieldBuilder().getBuilder(); + } + /** + * .context.TeraFlowController controller = 4; + */ + public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { + if (controllerBuilder_ != null) { + return controllerBuilder_.getMessageOrBuilder(); + } else { + return controller_ == null ? + context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; + } + } + /** + * .context.TeraFlowController controller = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> + getControllerFieldBuilder() { + if (controllerBuilder_ == null) { + controllerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder>( + getController(), + getParentForChildren(), + isClean()); + controller_ = null; + } + return controllerBuilder_; + } + @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:context.Context) + } + + // @@protoc_insertion_point(class_scope:context.Context) + private static final context.ContextOuterClass.Context DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Context(); + } + + public static context.ContextOuterClass.Context getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Context parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Context(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 context.ContextOuterClass.Context getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ContextId context_ids = 1; + */ + java.util.List + getContextIdsList(); + /** + * repeated .context.ContextId context_ids = 1; + */ + context.ContextOuterClass.ContextId getContextIds(int index); + /** + * repeated .context.ContextId context_ids = 1; + */ + int getContextIdsCount(); + /** + * repeated .context.ContextId context_ids = 1; + */ + java.util.List + getContextIdsOrBuilderList(); + /** + * repeated .context.ContextId context_ids = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ContextIdList} + */ + public static final class ContextIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextIdList) + ContextIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextIdList.newBuilder() to construct. + private ContextIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextIdList() { + contextIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextIdList( + 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)) { + contextIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + contextIds_.add( + input.readMessage(context.ContextOuterClass.ContextId.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)) { + contextIds_ = java.util.Collections.unmodifiableList(contextIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + } + + public static final int CONTEXT_IDS_FIELD_NUMBER = 1; + private java.util.List contextIds_; + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public java.util.List getContextIdsList() { + return contextIds_; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public java.util.List + getContextIdsOrBuilderList() { + return contextIds_; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public int getContextIdsCount() { + return contextIds_.size(); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextIds(int index) { + return contextIds_.get(index); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index) { + return contextIds_.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 < contextIds_.size(); i++) { + output.writeMessage(1, contextIds_.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 < contextIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, contextIds_.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 context.ContextOuterClass.ContextIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextIdList other = (context.ContextOuterClass.ContextIdList) obj; + + if (!getContextIdsList() + .equals(other.getContextIdsList())) 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 (getContextIdsCount() > 0) { + hash = (37 * hash) + CONTEXT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getContextIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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 context.ContextOuterClass.ContextIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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 context.ContextOuterClass.ContextIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextIdList 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(context.ContextOuterClass.ContextIdList 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 context.ContextIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextIdList) + context.ContextOuterClass.ContextIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getContextIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextIdsBuilder_ == null) { + contextIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + contextIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ContextIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList build() { + context.ContextOuterClass.ContextIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextIdList buildPartial() { + context.ContextOuterClass.ContextIdList result = new context.ContextOuterClass.ContextIdList(this); + int from_bitField0_ = bitField0_; + if (contextIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + contextIds_ = java.util.Collections.unmodifiableList(contextIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.contextIds_ = contextIds_; + } else { + result.contextIds_ = contextIdsBuilder_.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 context.ContextOuterClass.ContextIdList) { + return mergeFrom((context.ContextOuterClass.ContextIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextIdList other) { + if (other == context.ContextOuterClass.ContextIdList.getDefaultInstance()) return this; + if (contextIdsBuilder_ == null) { + if (!other.contextIds_.isEmpty()) { + if (contextIds_.isEmpty()) { + contextIds_ = other.contextIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureContextIdsIsMutable(); + contextIds_.addAll(other.contextIds_); + } + onChanged(); + } + } else { + if (!other.contextIds_.isEmpty()) { + if (contextIdsBuilder_.isEmpty()) { + contextIdsBuilder_.dispose(); + contextIdsBuilder_ = null; + contextIds_ = other.contextIds_; + bitField0_ = (bitField0_ & ~0x00000001); + contextIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getContextIdsFieldBuilder() : null; + } else { + contextIdsBuilder_.addAllMessages(other.contextIds_); + } + } + } + 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 { + context.ContextOuterClass.ContextIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List contextIds_ = + java.util.Collections.emptyList(); + private void ensureContextIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + contextIds_ = new java.util.ArrayList(contextIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdsBuilder_; + + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List getContextIdsList() { + if (contextIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contextIds_); + } else { + return contextIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public int getContextIdsCount() { + if (contextIdsBuilder_ == null) { + return contextIds_.size(); + } else { + return contextIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId getContextIds(int index) { + if (contextIdsBuilder_ == null) { + return contextIds_.get(index); + } else { + return contextIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder setContextIds( + int index, context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.set(index, value); + onChanged(); + } else { + contextIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder setContextIds( + int index, context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.set(index, builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds(context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.add(value); + onChanged(); + } else { + contextIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + int index, context.ContextOuterClass.ContextId value) { + if (contextIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextIdsIsMutable(); + contextIds_.add(index, value); + onChanged(); + } else { + contextIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.add(builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addContextIds( + int index, context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.add(index, builderForValue.build()); + onChanged(); + } else { + contextIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder addAllContextIds( + java.lang.Iterable values) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, contextIds_); + onChanged(); + } else { + contextIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder clearContextIds() { + if (contextIdsBuilder_ == null) { + contextIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + contextIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public Builder removeContextIds(int index) { + if (contextIdsBuilder_ == null) { + ensureContextIdsIsMutable(); + contextIds_.remove(index); + onChanged(); + } else { + contextIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdsBuilder( + int index) { + return getContextIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( + int index) { + if (contextIdsBuilder_ == null) { + return contextIds_.get(index); } else { + return contextIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List + getContextIdsOrBuilderList() { + if (contextIdsBuilder_ != null) { + return contextIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contextIds_); + } + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder() { + return getContextIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ContextId.getDefaultInstance()); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder( + int index) { + return getContextIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ContextId.getDefaultInstance()); + } + /** + * repeated .context.ContextId context_ids = 1; + */ + public java.util.List + getContextIdsBuilderList() { + return getContextIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdsFieldBuilder() { + if (contextIdsBuilder_ == null) { + contextIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + contextIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + contextIds_ = null; + } + return contextIdsBuilder_; + } + @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:context.ContextIdList) + } + + // @@protoc_insertion_point(class_scope:context.ContextIdList) + private static final context.ContextOuterClass.ContextIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextIdList(); + } + + public static context.ContextOuterClass.ContextIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextIdList(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 context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Context contexts = 1; + */ + java.util.List + getContextsList(); + /** + * repeated .context.Context contexts = 1; + */ + context.ContextOuterClass.Context getContexts(int index); + /** + * repeated .context.Context contexts = 1; + */ + int getContextsCount(); + /** + * repeated .context.Context contexts = 1; + */ + java.util.List + getContextsOrBuilderList(); + /** + * repeated .context.Context contexts = 1; + */ + context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ContextList} + */ + public static final class ContextList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextList) + ContextListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextList.newBuilder() to construct. + private ContextList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextList() { + contexts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextList( + 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)) { + contexts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + contexts_.add( + input.readMessage(context.ContextOuterClass.Context.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)) { + contexts_ = java.util.Collections.unmodifiableList(contexts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + } + + public static final int CONTEXTS_FIELD_NUMBER = 1; + private java.util.List contexts_; + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public java.util.List getContextsList() { + return contexts_; + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public java.util.List + getContextsOrBuilderList() { + return contexts_; + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public int getContextsCount() { + return contexts_.size(); + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Context getContexts(int index) { + return contexts_.get(index); + } + /** + * repeated .context.Context contexts = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index) { + return contexts_.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 < contexts_.size(); i++) { + output.writeMessage(1, contexts_.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 < contexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, contexts_.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 context.ContextOuterClass.ContextList)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextList other = (context.ContextOuterClass.ContextList) obj; + + if (!getContextsList() + .equals(other.getContextsList())) 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 (getContextsCount() > 0) { + hash = (37 * hash) + CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getContextsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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 context.ContextOuterClass.ContextList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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 context.ContextOuterClass.ContextList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextList 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(context.ContextOuterClass.ContextList 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 context.ContextList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextList) + context.ContextOuterClass.ContextListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextsBuilder_ == null) { + contexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + contextsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextList getDefaultInstanceForType() { + return context.ContextOuterClass.ContextList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextList build() { + context.ContextOuterClass.ContextList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextList buildPartial() { + context.ContextOuterClass.ContextList result = new context.ContextOuterClass.ContextList(this); + int from_bitField0_ = bitField0_; + if (contextsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + contexts_ = java.util.Collections.unmodifiableList(contexts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.contexts_ = contexts_; + } else { + result.contexts_ = contextsBuilder_.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 context.ContextOuterClass.ContextList) { + return mergeFrom((context.ContextOuterClass.ContextList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextList other) { + if (other == context.ContextOuterClass.ContextList.getDefaultInstance()) return this; + if (contextsBuilder_ == null) { + if (!other.contexts_.isEmpty()) { + if (contexts_.isEmpty()) { + contexts_ = other.contexts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureContextsIsMutable(); + contexts_.addAll(other.contexts_); + } + onChanged(); + } + } else { + if (!other.contexts_.isEmpty()) { + if (contextsBuilder_.isEmpty()) { + contextsBuilder_.dispose(); + contextsBuilder_ = null; + contexts_ = other.contexts_; + bitField0_ = (bitField0_ & ~0x00000001); + contextsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getContextsFieldBuilder() : null; + } else { + contextsBuilder_.addAllMessages(other.contexts_); + } + } + } + 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 { + context.ContextOuterClass.ContextList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List contexts_ = + java.util.Collections.emptyList(); + private void ensureContextsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + contexts_ = new java.util.ArrayList(contexts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> contextsBuilder_; + + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List getContextsList() { + if (contextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(contexts_); + } else { + return contextsBuilder_.getMessageList(); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public int getContextsCount() { + if (contextsBuilder_ == null) { + return contexts_.size(); + } else { + return contextsBuilder_.getCount(); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context getContexts(int index) { + if (contextsBuilder_ == null) { + return contexts_.get(index); + } else { + return contextsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder setContexts( + int index, context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.set(index, value); + onChanged(); + } else { + contextsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder setContexts( + int index, context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.set(index, builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts(context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.add(value); + onChanged(); + } else { + contextsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + int index, context.ContextOuterClass.Context value) { + if (contextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContextsIsMutable(); + contexts_.add(index, value); + onChanged(); + } else { + contextsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.add(builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addContexts( + int index, context.ContextOuterClass.Context.Builder builderForValue) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.add(index, builderForValue.build()); + onChanged(); + } else { + contextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder addAllContexts( + java.lang.Iterable values) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, contexts_); + onChanged(); + } else { + contextsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder clearContexts() { + if (contextsBuilder_ == null) { + contexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + contextsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public Builder removeContexts(int index) { + if (contextsBuilder_ == null) { + ensureContextsIsMutable(); + contexts_.remove(index); + onChanged(); + } else { + contextsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder getContextsBuilder( + int index) { + return getContextsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( + int index) { + if (contextsBuilder_ == null) { + return contexts_.get(index); } else { + return contextsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List + getContextsOrBuilderList() { + if (contextsBuilder_ != null) { + return contextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(contexts_); + } + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder addContextsBuilder() { + return getContextsFieldBuilder().addBuilder( + context.ContextOuterClass.Context.getDefaultInstance()); + } + /** + * repeated .context.Context contexts = 1; + */ + public context.ContextOuterClass.Context.Builder addContextsBuilder( + int index) { + return getContextsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Context.getDefaultInstance()); + } + /** + * repeated .context.Context contexts = 1; + */ + public java.util.List + getContextsBuilderList() { + return getContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> + getContextsFieldBuilder() { + if (contextsBuilder_ == null) { + contextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder>( + contexts_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + contexts_ = null; + } + return contextsBuilder_; + } + @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:context.ContextList) + } + + // @@protoc_insertion_point(class_scope:context.ContextList) + private static final context.ContextOuterClass.ContextList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextList(); + } + + public static context.ContextOuterClass.ContextList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextList(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 context.ContextOuterClass.ContextList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ContextEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ContextEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 2; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + } + /** + * Protobuf type {@code context.ContextEvent} + */ + public static final class ContextEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ContextEvent) + ContextEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContextEvent.newBuilder() to construct. + private ContextEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ContextEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ContextEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ContextEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = 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 context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (contextId_ != null) { + output.writeMessage(2, getContextId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getContextId()); + } + 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 context.ContextOuterClass.ContextEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.ContextEvent other = (context.ContextOuterClass.ContextEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ContextEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ContextEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ContextEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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 context.ContextOuterClass.ContextEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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 context.ContextOuterClass.ContextEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ContextEvent 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(context.ContextOuterClass.ContextEvent 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 context.ContextEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ContextEvent) + context.ContextOuterClass.ContextEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.ContextEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ContextEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent build() { + context.ContextOuterClass.ContextEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ContextEvent buildPartial() { + context.ContextOuterClass.ContextEvent result = new context.ContextOuterClass.ContextEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.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 context.ContextOuterClass.ContextEvent) { + return mergeFrom((context.ContextOuterClass.ContextEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ContextEvent other) { + if (other == context.ContextOuterClass.ContextEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + 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 { + context.ContextOuterClass.ContextEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ContextEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 2; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 2; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 2; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 2; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 2; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + @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:context.ContextEvent) + } + + // @@protoc_insertion_point(class_scope:context.ContextEvent) + private static final context.ContextOuterClass.ContextEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ContextEvent(); + } + + public static context.ContextOuterClass.ContextEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContextEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContextEvent(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 context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + boolean hasTopologyUuid(); + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + context.ContextOuterClass.Uuid getTopologyUuid(); + /** + * .context.Uuid topology_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder(); + } + /** + *
+   * ----- Topology ------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.TopologyId} + */ + public static final class TopologyId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyId) + TopologyIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyId.newBuilder() to construct. + private TopologyId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyId( + 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (topologyUuid_ != null) { + subBuilder = topologyUuid_.toBuilder(); + } + topologyUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyUuid_); + topologyUuid_ = 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 context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int TOPOLOGY_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid topologyUuid_; + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + @java.lang.Override + public boolean hasTopologyUuid() { + return topologyUuid_ != null; + } + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getTopologyUuid() { + return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } + /** + * .context.Uuid topology_uuid = 2; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { + return getTopologyUuid(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (topologyUuid_ != null) { + output.writeMessage(2, getTopologyUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + if (topologyUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTopologyUuid()); + } + 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 context.ContextOuterClass.TopologyId)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyId other = (context.ContextOuterClass.TopologyId) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasTopologyUuid() != other.hasTopologyUuid()) return false; + if (hasTopologyUuid()) { + if (!getTopologyUuid() + .equals(other.getTopologyUuid())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasTopologyUuid()) { + hash = (37 * hash) + TOPOLOGY_UUID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyId 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(context.ContextOuterClass.TopologyId 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; + } + /** + *
+     * ----- Topology ------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.TopologyId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyId) + context.ContextOuterClass.TopologyIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyId.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 (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (topologyUuidBuilder_ == null) { + topologyUuid_ = null; + } else { + topologyUuid_ = null; + topologyUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId build() { + context.ContextOuterClass.TopologyId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyId buildPartial() { + context.ContextOuterClass.TopologyId result = new context.ContextOuterClass.TopologyId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (topologyUuidBuilder_ == null) { + result.topologyUuid_ = topologyUuid_; + } else { + result.topologyUuid_ = topologyUuidBuilder_.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 context.ContextOuterClass.TopologyId) { + return mergeFrom((context.ContextOuterClass.TopologyId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyId other) { + if (other == context.ContextOuterClass.TopologyId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasTopologyUuid()) { + mergeTopologyUuid(other.getTopologyUuid()); + } + 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 { + context.ContextOuterClass.TopologyId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid topologyUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> topologyUuidBuilder_; + /** + * .context.Uuid topology_uuid = 2; + * @return Whether the topologyUuid field is set. + */ + public boolean hasTopologyUuid() { + return topologyUuidBuilder_ != null || topologyUuid_ != null; + } + /** + * .context.Uuid topology_uuid = 2; + * @return The topologyUuid. + */ + public context.ContextOuterClass.Uuid getTopologyUuid() { + if (topologyUuidBuilder_ == null) { + return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } else { + return topologyUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder setTopologyUuid(context.ContextOuterClass.Uuid value) { + if (topologyUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyUuid_ = value; + onChanged(); + } else { + topologyUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder setTopologyUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (topologyUuidBuilder_ == null) { + topologyUuid_ = builderForValue.build(); + onChanged(); + } else { + topologyUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder mergeTopologyUuid(context.ContextOuterClass.Uuid value) { + if (topologyUuidBuilder_ == null) { + if (topologyUuid_ != null) { + topologyUuid_ = + context.ContextOuterClass.Uuid.newBuilder(topologyUuid_).mergeFrom(value).buildPartial(); + } else { + topologyUuid_ = value; + } + onChanged(); + } else { + topologyUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public Builder clearTopologyUuid() { + if (topologyUuidBuilder_ == null) { + topologyUuid_ = null; + onChanged(); + } else { + topologyUuid_ = null; + topologyUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid topology_uuid = 2; + */ + public context.ContextOuterClass.Uuid.Builder getTopologyUuidBuilder() { + + onChanged(); + return getTopologyUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid topology_uuid = 2; + */ + public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { + if (topologyUuidBuilder_ != null) { + return topologyUuidBuilder_.getMessageOrBuilder(); + } else { + return topologyUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + } + } + /** + * .context.Uuid topology_uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getTopologyUuidFieldBuilder() { + if (topologyUuidBuilder_ == null) { + topologyUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getTopologyUuid(), + getParentForChildren(), + isClean()); + topologyUuid_ = null; + } + return topologyUuidBuilder_; + } + @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:context.TopologyId) + } + + // @@protoc_insertion_point(class_scope:context.TopologyId) + private static final context.ContextOuterClass.TopologyId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyId(); + } + + public static context.ContextOuterClass.TopologyId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyId(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 context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Topology) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + boolean hasTopologyId(); + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + context.ContextOuterClass.TopologyId getTopologyId(); + /** + * .context.TopologyId topology_id = 1; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + + /** + * repeated .context.DeviceId device_ids = 2; + */ + java.util.List + getDeviceIdsList(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + context.ContextOuterClass.DeviceId getDeviceIds(int index); + /** + * repeated .context.DeviceId device_ids = 2; + */ + int getDeviceIdsCount(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + java.util.List + getDeviceIdsOrBuilderList(); + /** + * repeated .context.DeviceId device_ids = 2; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index); + + /** + * repeated .context.LinkId link_ids = 3; + */ + java.util.List + getLinkIdsList(); + /** + * repeated .context.LinkId link_ids = 3; + */ + context.ContextOuterClass.LinkId getLinkIds(int index); + /** + * repeated .context.LinkId link_ids = 3; + */ + int getLinkIdsCount(); + /** + * repeated .context.LinkId link_ids = 3; + */ + java.util.List + getLinkIdsOrBuilderList(); + /** + * repeated .context.LinkId link_ids = 3; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Topology} + */ + public static final class Topology extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Topology) + TopologyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Topology.newBuilder() to construct. + private Topology(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Topology() { + deviceIds_ = java.util.Collections.emptyList(); + linkIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Topology(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Topology( + 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: { + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); + } + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyId_); + topologyId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceIds_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + linkIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + linkIds_.add( + input.readMessage(context.ContextOuterClass.LinkId.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)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + } + + public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.TopologyId topologyId_; + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + @java.lang.Override + public boolean hasTopologyId() { + return topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + /** + * .context.TopologyId topology_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); + } + + public static final int DEVICE_IDS_FIELD_NUMBER = 2; + private java.util.List deviceIds_; + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public java.util.List getDeviceIdsList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public java.util.List + getDeviceIdsOrBuilderList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public int getDeviceIdsCount() { + return deviceIds_.size(); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + return deviceIds_.get(index); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + return deviceIds_.get(index); + } + + public static final int LINK_IDS_FIELD_NUMBER = 3; + private java.util.List linkIds_; + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public java.util.List getLinkIdsList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public java.util.List + getLinkIdsOrBuilderList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public int getLinkIdsCount() { + return linkIds_.size(); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkIds(int index) { + return linkIds_.get(index); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + return linkIds_.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 (topologyId_ != null) { + output.writeMessage(1, getTopologyId()); + } + for (int i = 0; i < deviceIds_.size(); i++) { + output.writeMessage(2, deviceIds_.get(i)); + } + for (int i = 0; i < linkIds_.size(); i++) { + output.writeMessage(3, linkIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (topologyId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTopologyId()); + } + for (int i = 0; i < deviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, deviceIds_.get(i)); + } + for (int i = 0; i < linkIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, linkIds_.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 context.ContextOuterClass.Topology)) { + return super.equals(obj); + } + context.ContextOuterClass.Topology other = (context.ContextOuterClass.Topology) obj; + + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) return false; + } + if (!getDeviceIdsList() + .equals(other.getDeviceIdsList())) return false; + if (!getLinkIdsList() + .equals(other.getLinkIdsList())) 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 (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); + } + if (getDeviceIdsCount() > 0) { + hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceIdsList().hashCode(); + } + if (getLinkIdsCount() > 0) { + hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Topology parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Topology parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Topology parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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 context.ContextOuterClass.Topology parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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 context.ContextOuterClass.Topology parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Topology 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(context.ContextOuterClass.Topology 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 context.Topology} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Topology) + context.ContextOuterClass.TopologyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + } + + // Construct using context.ContextOuterClass.Topology.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceIdsFieldBuilder(); + getLinkIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologyIdBuilder_ == null) { + topologyId_ = null; + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + deviceIdsBuilder_.clear(); + } + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Topology_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Topology getDefaultInstanceForType() { + return context.ContextOuterClass.Topology.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Topology build() { + context.ContextOuterClass.Topology result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Topology buildPartial() { + context.ContextOuterClass.Topology result = new context.ContextOuterClass.Topology(this); + int from_bitField0_ = bitField0_; + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; + } else { + result.topologyId_ = topologyIdBuilder_.build(); + } + if (deviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceIds_ = deviceIds_; + } else { + result.deviceIds_ = deviceIdsBuilder_.build(); + } + if (linkIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.linkIds_ = linkIds_; + } else { + result.linkIds_ = linkIdsBuilder_.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 context.ContextOuterClass.Topology) { + return mergeFrom((context.ContextOuterClass.Topology)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Topology other) { + if (other == context.ContextOuterClass.Topology.getDefaultInstance()) return this; + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); + } + if (deviceIdsBuilder_ == null) { + if (!other.deviceIds_.isEmpty()) { + if (deviceIds_.isEmpty()) { + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceIdsIsMutable(); + deviceIds_.addAll(other.deviceIds_); + } + onChanged(); + } + } else { + if (!other.deviceIds_.isEmpty()) { + if (deviceIdsBuilder_.isEmpty()) { + deviceIdsBuilder_.dispose(); + deviceIdsBuilder_ = null; + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceIdsFieldBuilder() : null; + } else { + deviceIdsBuilder_.addAllMessages(other.deviceIds_); + } + } + } + if (linkIdsBuilder_ == null) { + if (!other.linkIds_.isEmpty()) { + if (linkIds_.isEmpty()) { + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLinkIdsIsMutable(); + linkIds_.addAll(other.linkIds_); + } + onChanged(); + } + } else { + if (!other.linkIds_.isEmpty()) { + if (linkIdsBuilder_.isEmpty()) { + linkIdsBuilder_.dispose(); + linkIdsBuilder_ = null; + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000002); + linkIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkIdsFieldBuilder() : null; + } else { + linkIdsBuilder_.addAllMessages(other.linkIds_); + } + } + } + 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 { + context.ContextOuterClass.Topology parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Topology) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.TopologyId topologyId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; + /** + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. + */ + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 1; + * @return The topologyId. + */ + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } else { + return topologyIdBuilder_.getMessage(); + } + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyId_ = value; + onChanged(); + } else { + topologyIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); + onChanged(); + } else { + topologyIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); + } else { + topologyId_ = value; + } + onChanged(); + } else { + topologyIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; + onChanged(); + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + + return this; + } + /** + * .context.TopologyId topology_id = 1; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { + + onChanged(); + return getTopologyIdFieldBuilder().getBuilder(); + } + /** + * .context.TopologyId topology_id = 1; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); + } else { + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + } + /** + * .context.TopologyId topology_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), + getParentForChildren(), + isClean()); + topologyId_ = null; + } + return topologyIdBuilder_; + } + + private java.util.List deviceIds_ = + java.util.Collections.emptyList(); + private void ensureDeviceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(deviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List getDeviceIdsList() { + if (deviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceIds_); + } else { + return deviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public int getDeviceIdsCount() { + if (deviceIdsBuilder_ == null) { + return deviceIds_.size(); + } else { + return deviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); + } else { + return deviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, value); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder addAllDeviceIds( + java.lang.Iterable values) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceIds_); + onChanged(); + } else { + deviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder clearDeviceIds() { + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public Builder removeDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.remove(index); + onChanged(); + } else { + deviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); } else { + return deviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List + getDeviceIdsOrBuilderList() { + if (deviceIdsBuilder_ != null) { + return deviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceIds_); + } + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { + return getDeviceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 2; + */ + public java.util.List + getDeviceIdsBuilderList() { + return getDeviceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdsFieldBuilder() { + if (deviceIdsBuilder_ == null) { + deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceIds_ = null; + } + return deviceIdsBuilder_; + } + + private java.util.List linkIds_ = + java.util.Collections.emptyList(); + private void ensureLinkIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + linkIds_ = new java.util.ArrayList(linkIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List getLinkIdsList() { + if (linkIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkIds_); + } else { + return linkIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public int getLinkIdsCount() { + if (linkIdsBuilder_ == null) { + return linkIds_.size(); + } else { + return linkIdsBuilder_.getCount(); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId getLinkIds(int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); + } else { + return linkIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.set(index, value); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds(context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(index, value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder addAllLinkIds( + java.lang.Iterable values) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkIds_); + onChanged(); + } else { + linkIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder clearLinkIds() { + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public Builder removeLinkIds(int index) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.remove(index); + onChanged(); + } else { + linkIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); } else { + return linkIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List + getLinkIdsOrBuilderList() { + if (linkIdsBuilder_ != null) { + return linkIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkIds_); + } + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { + return getLinkIdsFieldBuilder().addBuilder( + context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 3; + */ + public java.util.List + getLinkIdsBuilderList() { + return getLinkIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdsFieldBuilder() { + if (linkIdsBuilder_ == null) { + linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + linkIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + linkIds_ = null; + } + return linkIdsBuilder_; + } + @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:context.Topology) + } + + // @@protoc_insertion_point(class_scope:context.Topology) + private static final context.ContextOuterClass.Topology DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Topology(); + } + + public static context.ContextOuterClass.Topology getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Topology parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Topology(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 context.ContextOuterClass.Topology getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.TopologyId topology_ids = 1; + */ + java.util.List + getTopologyIdsList(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + context.ContextOuterClass.TopologyId getTopologyIds(int index); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + int getTopologyIdsCount(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + java.util.List + getTopologyIdsOrBuilderList(); + /** + * repeated .context.TopologyId topology_ids = 1; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.TopologyIdList} + */ + public static final class TopologyIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyIdList) + TopologyIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyIdList.newBuilder() to construct. + private TopologyIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyIdList() { + topologyIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyIdList( + 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)) { + topologyIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologyIds_.add( + input.readMessage(context.ContextOuterClass.TopologyId.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)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + } + + public static final int TOPOLOGY_IDS_FIELD_NUMBER = 1; + private java.util.List topologyIds_; + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public java.util.List getTopologyIdsList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public java.util.List + getTopologyIdsOrBuilderList() { + return topologyIds_; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public int getTopologyIdsCount() { + return topologyIds_.size(); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + return topologyIds_.get(index); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + return topologyIds_.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 < topologyIds_.size(); i++) { + output.writeMessage(1, topologyIds_.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 < topologyIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, topologyIds_.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 context.ContextOuterClass.TopologyIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyIdList other = (context.ContextOuterClass.TopologyIdList) obj; + + if (!getTopologyIdsList() + .equals(other.getTopologyIdsList())) 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 (getTopologyIdsCount() > 0) { + hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; + hash = (53 * hash) + getTopologyIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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 context.ContextOuterClass.TopologyIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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 context.ContextOuterClass.TopologyIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyIdList 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(context.ContextOuterClass.TopologyIdList 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 context.TopologyIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyIdList) + context.ContextOuterClass.TopologyIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologyIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList build() { + context.ContextOuterClass.TopologyIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyIdList buildPartial() { + context.ContextOuterClass.TopologyIdList result = new context.ContextOuterClass.TopologyIdList(this); + int from_bitField0_ = bitField0_; + if (topologyIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologyIds_ = topologyIds_; + } else { + result.topologyIds_ = topologyIdsBuilder_.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 context.ContextOuterClass.TopologyIdList) { + return mergeFrom((context.ContextOuterClass.TopologyIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyIdList other) { + if (other == context.ContextOuterClass.TopologyIdList.getDefaultInstance()) return this; + if (topologyIdsBuilder_ == null) { + if (!other.topologyIds_.isEmpty()) { + if (topologyIds_.isEmpty()) { + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologyIdsIsMutable(); + topologyIds_.addAll(other.topologyIds_); + } + onChanged(); + } + } else { + if (!other.topologyIds_.isEmpty()) { + if (topologyIdsBuilder_.isEmpty()) { + topologyIdsBuilder_.dispose(); + topologyIdsBuilder_ = null; + topologyIds_ = other.topologyIds_; + bitField0_ = (bitField0_ & ~0x00000001); + topologyIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologyIdsFieldBuilder() : null; + } else { + topologyIdsBuilder_.addAllMessages(other.topologyIds_); + } + } + } + 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 { + context.ContextOuterClass.TopologyIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List topologyIds_ = + java.util.Collections.emptyList(); + private void ensureTopologyIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologyIds_ = new java.util.ArrayList(topologyIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List getTopologyIdsList() { + if (topologyIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologyIds_); + } else { + return topologyIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public int getTopologyIdsCount() { + if (topologyIdsBuilder_ == null) { + return topologyIds_.size(); + } else { + return topologyIdsBuilder_.getCount(); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId getTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); + } else { + return topologyIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, value); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder setTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.set(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId value) { + if (topologyIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, value); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addTopologyIds( + int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.add(index, builderForValue.build()); + onChanged(); + } else { + topologyIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder addAllTopologyIds( + java.lang.Iterable values) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologyIds_); + onChanged(); + } else { + topologyIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder clearTopologyIds() { + if (topologyIdsBuilder_ == null) { + topologyIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologyIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public Builder removeTopologyIds(int index) { + if (topologyIdsBuilder_ == null) { + ensureTopologyIdsIsMutable(); + topologyIds_.remove(index); + onChanged(); + } else { + topologyIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + int index) { + if (topologyIdsBuilder_ == null) { + return topologyIds_.get(index); } else { + return topologyIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List + getTopologyIdsOrBuilderList() { + if (topologyIdsBuilder_ != null) { + return topologyIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologyIds_); + } + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { + return getTopologyIdsFieldBuilder().addBuilder( + context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + int index) { + return getTopologyIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + } + /** + * repeated .context.TopologyId topology_ids = 1; + */ + public java.util.List + getTopologyIdsBuilderList() { + return getTopologyIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdsFieldBuilder() { + if (topologyIdsBuilder_ == null) { + topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + topologyIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologyIds_ = null; + } + return topologyIdsBuilder_; + } + @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:context.TopologyIdList) + } + + // @@protoc_insertion_point(class_scope:context.TopologyIdList) + private static final context.ContextOuterClass.TopologyIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyIdList(); + } + + public static context.ContextOuterClass.TopologyIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyIdList(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 context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Topology topologies = 1; + */ + java.util.List + getTopologiesList(); + /** + * repeated .context.Topology topologies = 1; + */ + context.ContextOuterClass.Topology getTopologies(int index); + /** + * repeated .context.Topology topologies = 1; + */ + int getTopologiesCount(); + /** + * repeated .context.Topology topologies = 1; + */ + java.util.List + getTopologiesOrBuilderList(); + /** + * repeated .context.Topology topologies = 1; + */ + context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.TopologyList} + */ + public static final class TopologyList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyList) + TopologyListOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyList.newBuilder() to construct. + private TopologyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyList() { + topologies_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyList( + 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)) { + topologies_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + topologies_.add( + input.readMessage(context.ContextOuterClass.Topology.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)) { + topologies_ = java.util.Collections.unmodifiableList(topologies_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + } + + public static final int TOPOLOGIES_FIELD_NUMBER = 1; + private java.util.List topologies_; + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public java.util.List getTopologiesList() { + return topologies_; + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public java.util.List + getTopologiesOrBuilderList() { + return topologies_; + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public int getTopologiesCount() { + return topologies_.size(); + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Topology getTopologies(int index) { + return topologies_.get(index); + } + /** + * repeated .context.Topology topologies = 1; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index) { + return topologies_.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 < topologies_.size(); i++) { + output.writeMessage(1, topologies_.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 < topologies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, topologies_.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 context.ContextOuterClass.TopologyList)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyList other = (context.ContextOuterClass.TopologyList) obj; + + if (!getTopologiesList() + .equals(other.getTopologiesList())) 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 (getTopologiesCount() > 0) { + hash = (37 * hash) + TOPOLOGIES_FIELD_NUMBER; + hash = (53 * hash) + getTopologiesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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 context.ContextOuterClass.TopologyList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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 context.ContextOuterClass.TopologyList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyList 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(context.ContextOuterClass.TopologyList 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 context.TopologyList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyList) + context.ContextOuterClass.TopologyListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTopologiesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (topologiesBuilder_ == null) { + topologies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + topologiesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList build() { + context.ContextOuterClass.TopologyList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyList buildPartial() { + context.ContextOuterClass.TopologyList result = new context.ContextOuterClass.TopologyList(this); + int from_bitField0_ = bitField0_; + if (topologiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + topologies_ = java.util.Collections.unmodifiableList(topologies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.topologies_ = topologies_; + } else { + result.topologies_ = topologiesBuilder_.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 context.ContextOuterClass.TopologyList) { + return mergeFrom((context.ContextOuterClass.TopologyList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyList other) { + if (other == context.ContextOuterClass.TopologyList.getDefaultInstance()) return this; + if (topologiesBuilder_ == null) { + if (!other.topologies_.isEmpty()) { + if (topologies_.isEmpty()) { + topologies_ = other.topologies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTopologiesIsMutable(); + topologies_.addAll(other.topologies_); + } + onChanged(); + } + } else { + if (!other.topologies_.isEmpty()) { + if (topologiesBuilder_.isEmpty()) { + topologiesBuilder_.dispose(); + topologiesBuilder_ = null; + topologies_ = other.topologies_; + bitField0_ = (bitField0_ & ~0x00000001); + topologiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTopologiesFieldBuilder() : null; + } else { + topologiesBuilder_.addAllMessages(other.topologies_); + } + } + } + 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 { + context.ContextOuterClass.TopologyList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List topologies_ = + java.util.Collections.emptyList(); + private void ensureTopologiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + topologies_ = new java.util.ArrayList(topologies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> topologiesBuilder_; + + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List getTopologiesList() { + if (topologiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(topologies_); + } else { + return topologiesBuilder_.getMessageList(); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public int getTopologiesCount() { + if (topologiesBuilder_ == null) { + return topologies_.size(); + } else { + return topologiesBuilder_.getCount(); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology getTopologies(int index) { + if (topologiesBuilder_ == null) { + return topologies_.get(index); + } else { + return topologiesBuilder_.getMessage(index); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder setTopologies( + int index, context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.set(index, value); + onChanged(); + } else { + topologiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder setTopologies( + int index, context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.set(index, builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies(context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.add(value); + onChanged(); + } else { + topologiesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + int index, context.ContextOuterClass.Topology value) { + if (topologiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTopologiesIsMutable(); + topologies_.add(index, value); + onChanged(); + } else { + topologiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.add(builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addTopologies( + int index, context.ContextOuterClass.Topology.Builder builderForValue) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.add(index, builderForValue.build()); + onChanged(); + } else { + topologiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder addAllTopologies( + java.lang.Iterable values) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, topologies_); + onChanged(); + } else { + topologiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder clearTopologies() { + if (topologiesBuilder_ == null) { + topologies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + topologiesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public Builder removeTopologies(int index) { + if (topologiesBuilder_ == null) { + ensureTopologiesIsMutable(); + topologies_.remove(index); + onChanged(); + } else { + topologiesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder getTopologiesBuilder( + int index) { + return getTopologiesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + int index) { + if (topologiesBuilder_ == null) { + return topologies_.get(index); } else { + return topologiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List + getTopologiesOrBuilderList() { + if (topologiesBuilder_ != null) { + return topologiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(topologies_); + } + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder addTopologiesBuilder() { + return getTopologiesFieldBuilder().addBuilder( + context.ContextOuterClass.Topology.getDefaultInstance()); + } + /** + * repeated .context.Topology topologies = 1; + */ + public context.ContextOuterClass.Topology.Builder addTopologiesBuilder( + int index) { + return getTopologiesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Topology.getDefaultInstance()); + } + /** + * repeated .context.Topology topologies = 1; + */ + public java.util.List + getTopologiesBuilderList() { + return getTopologiesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> + getTopologiesFieldBuilder() { + if (topologiesBuilder_ == null) { + topologiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder>( + topologies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + topologies_ = null; + } + return topologiesBuilder_; + } + @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:context.TopologyList) + } + + // @@protoc_insertion_point(class_scope:context.TopologyList) + private static final context.ContextOuterClass.TopologyList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyList(); + } + + public static context.ContextOuterClass.TopologyList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyList(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 context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopologyEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.TopologyEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + boolean hasTopologyId(); + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + context.ContextOuterClass.TopologyId getTopologyId(); + /** + * .context.TopologyId topology_id = 2; + */ + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + } + /** + * Protobuf type {@code context.TopologyEvent} + */ + public static final class TopologyEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.TopologyEvent) + TopologyEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopologyEvent.newBuilder() to construct. + private TopologyEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopologyEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopologyEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopologyEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); + } + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(topologyId_); + topologyId_ = 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 context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int TOPOLOGY_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.TopologyId topologyId_; + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + @java.lang.Override + public boolean hasTopologyId() { + return topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + @java.lang.Override + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + /** + * .context.TopologyId topology_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (topologyId_ != null) { + output.writeMessage(2, getTopologyId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (topologyId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTopologyId()); + } + 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 context.ContextOuterClass.TopologyEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.TopologyEvent other = (context.ContextOuterClass.TopologyEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.TopologyEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.TopologyEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.TopologyEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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 context.ContextOuterClass.TopologyEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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 context.ContextOuterClass.TopologyEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.TopologyEvent 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(context.ContextOuterClass.TopologyEvent 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 context.TopologyEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.TopologyEvent) + context.ContextOuterClass.TopologyEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.TopologyEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (topologyIdBuilder_ == null) { + topologyId_ = null; + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + return context.ContextOuterClass.TopologyEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent build() { + context.ContextOuterClass.TopologyEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.TopologyEvent buildPartial() { + context.ContextOuterClass.TopologyEvent result = new context.ContextOuterClass.TopologyEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; + } else { + result.topologyId_ = topologyIdBuilder_.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 context.ContextOuterClass.TopologyEvent) { + return mergeFrom((context.ContextOuterClass.TopologyEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.TopologyEvent other) { + if (other == context.ContextOuterClass.TopologyEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); + } + 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 { + context.ContextOuterClass.TopologyEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.TopologyEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.TopologyId topologyId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; + /** + * .context.TopologyId topology_id = 2; + * @return Whether the topologyId field is set. + */ + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; + } + /** + * .context.TopologyId topology_id = 2; + * @return The topologyId. + */ + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } else { + return topologyIdBuilder_.getMessage(); + } + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + topologyId_ = value; + onChanged(); + } else { + topologyIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); + onChanged(); + } else { + topologyIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); + } else { + topologyId_ = value; + } + onChanged(); + } else { + topologyIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; + onChanged(); + } else { + topologyId_ = null; + topologyIdBuilder_ = null; + } + + return this; + } + /** + * .context.TopologyId topology_id = 2; + */ + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { + + onChanged(); + return getTopologyIdFieldBuilder().getBuilder(); + } + /** + * .context.TopologyId topology_id = 2; + */ + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); + } else { + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + } + } + /** + * .context.TopologyId topology_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), + getParentForChildren(), + isClean()); + topologyId_ = null; + } + return topologyIdBuilder_; + } + @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:context.TopologyEvent) + } + + // @@protoc_insertion_point(class_scope:context.TopologyEvent) + private static final context.ContextOuterClass.TopologyEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyEvent(); + } + + public static context.ContextOuterClass.TopologyEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopologyEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopologyEvent(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 context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + boolean hasDeviceUuid(); + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + context.ContextOuterClass.Uuid getDeviceUuid(); + /** + * .context.Uuid device_uuid = 1; + */ + context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder(); + } + /** + *
+   * ----- Device --------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.DeviceId} + */ + public static final class DeviceId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceId) + DeviceIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceId.newBuilder() to construct. + private DeviceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (deviceUuid_ != null) { + subBuilder = deviceUuid_.toBuilder(); + } + deviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceUuid_); + deviceUuid_ = 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 context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + } + + public static final int DEVICE_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid deviceUuid_; + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + @java.lang.Override + public boolean hasDeviceUuid() { + return deviceUuid_ != null; + } + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getDeviceUuid() { + return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } + /** + * .context.Uuid device_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { + return getDeviceUuid(); + } + + 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 (deviceUuid_ != null) { + output.writeMessage(1, getDeviceUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deviceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDeviceUuid()); + } + 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 context.ContextOuterClass.DeviceId)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceId other = (context.ContextOuterClass.DeviceId) obj; + + if (hasDeviceUuid() != other.hasDeviceUuid()) return false; + if (hasDeviceUuid()) { + if (!getDeviceUuid() + .equals(other.getDeviceUuid())) 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 (hasDeviceUuid()) { + hash = (37 * hash) + DEVICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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 context.ContextOuterClass.DeviceId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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 context.ContextOuterClass.DeviceId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceId 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(context.ContextOuterClass.DeviceId 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; + } + /** + *
+     * ----- Device --------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.DeviceId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceId) + context.ContextOuterClass.DeviceIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceId.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 (deviceUuidBuilder_ == null) { + deviceUuid_ = null; + } else { + deviceUuid_ = null; + deviceUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId build() { + context.ContextOuterClass.DeviceId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceId buildPartial() { + context.ContextOuterClass.DeviceId result = new context.ContextOuterClass.DeviceId(this); + if (deviceUuidBuilder_ == null) { + result.deviceUuid_ = deviceUuid_; + } else { + result.deviceUuid_ = deviceUuidBuilder_.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 context.ContextOuterClass.DeviceId) { + return mergeFrom((context.ContextOuterClass.DeviceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceId other) { + if (other == context.ContextOuterClass.DeviceId.getDefaultInstance()) return this; + if (other.hasDeviceUuid()) { + mergeDeviceUuid(other.getDeviceUuid()); + } + 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 { + context.ContextOuterClass.DeviceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid deviceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> deviceUuidBuilder_; + /** + * .context.Uuid device_uuid = 1; + * @return Whether the deviceUuid field is set. + */ + public boolean hasDeviceUuid() { + return deviceUuidBuilder_ != null || deviceUuid_ != null; + } + /** + * .context.Uuid device_uuid = 1; + * @return The deviceUuid. + */ + public context.ContextOuterClass.Uuid getDeviceUuid() { + if (deviceUuidBuilder_ == null) { + return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } else { + return deviceUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder setDeviceUuid(context.ContextOuterClass.Uuid value) { + if (deviceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceUuid_ = value; + onChanged(); + } else { + deviceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder setDeviceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (deviceUuidBuilder_ == null) { + deviceUuid_ = builderForValue.build(); + onChanged(); + } else { + deviceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder mergeDeviceUuid(context.ContextOuterClass.Uuid value) { + if (deviceUuidBuilder_ == null) { + if (deviceUuid_ != null) { + deviceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(deviceUuid_).mergeFrom(value).buildPartial(); + } else { + deviceUuid_ = value; + } + onChanged(); + } else { + deviceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public Builder clearDeviceUuid() { + if (deviceUuidBuilder_ == null) { + deviceUuid_ = null; + onChanged(); + } else { + deviceUuid_ = null; + deviceUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid device_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getDeviceUuidBuilder() { + + onChanged(); + return getDeviceUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid device_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { + if (deviceUuidBuilder_ != null) { + return deviceUuidBuilder_.getMessageOrBuilder(); + } else { + return deviceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + } + } + /** + * .context.Uuid device_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getDeviceUuidFieldBuilder() { + if (deviceUuidBuilder_ == null) { + deviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getDeviceUuid(), + getParentForChildren(), + isClean()); + deviceUuid_ = null; + } + return deviceUuidBuilder_; + } + @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:context.DeviceId) + } + + // @@protoc_insertion_point(class_scope:context.DeviceId) + private static final context.ContextOuterClass.DeviceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceId(); + } + + public static context.ContextOuterClass.DeviceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceId(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 context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Device) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 1; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * string device_type = 2; + * @return The deviceType. + */ + java.lang.String getDeviceType(); + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + com.google.protobuf.ByteString + getDeviceTypeBytes(); + + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + boolean hasDeviceConfig(); + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + context.ContextOuterClass.DeviceConfig getDeviceConfig(); + /** + * .context.DeviceConfig device_config = 3; + */ + context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder(); + + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + int getDeviceOperationalStatusValue(); + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus(); + + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + java.util.List getDeviceDriversList(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + int getDeviceDriversCount(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + java.util.List + getDeviceDriversValueList(); + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + int getDeviceDriversValue(int index); + + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + java.util.List + getDeviceEndpointsList(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + context.ContextOuterClass.EndPoint getDeviceEndpoints(int index); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + int getDeviceEndpointsCount(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + java.util.List + getDeviceEndpointsOrBuilderList(); + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Device} + */ + public static final class Device extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Device) + DeviceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Device.newBuilder() to construct. + private Device(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Device() { + deviceType_ = ""; + deviceOperationalStatus_ = 0; + deviceDrivers_ = java.util.Collections.emptyList(); + deviceEndpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Device(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Device( + 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: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + deviceType_ = s; + break; + } + case 26: { + context.ContextOuterClass.DeviceConfig.Builder subBuilder = null; + if (deviceConfig_ != null) { + subBuilder = deviceConfig_.toBuilder(); + } + deviceConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceConfig_); + deviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 32: { + int rawValue = input.readEnum(); + + deviceOperationalStatus_ = rawValue; + break; + } + case 40: { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceDrivers_.add(rawValue); + break; + } + case 42: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceDrivers_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + deviceEndpoints_.add( + input.readMessage(context.ContextOuterClass.EndPoint.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)) { + deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); + } + + public static final int DEVICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int DEVICE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object deviceType_; + /** + * string device_type = 2; + * @return The deviceType. + */ + @java.lang.Override + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + 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(); + deviceType_ = s; + return s; + } + } + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEVICE_CONFIG_FIELD_NUMBER = 3; + private context.ContextOuterClass.DeviceConfig deviceConfig_; + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + @java.lang.Override + public boolean hasDeviceConfig() { + return deviceConfig_ != null; + } + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceConfig getDeviceConfig() { + return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } + /** + * .context.DeviceConfig device_config = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { + return getDeviceConfig(); + } + + public static final int DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER = 4; + private int deviceOperationalStatus_; + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + @java.lang.Override public int getDeviceOperationalStatusValue() { + return deviceOperationalStatus_; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + @java.lang.Override public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); + return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; + } + + public static final int DEVICE_DRIVERS_FIELD_NUMBER = 5; + private java.util.List deviceDrivers_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum> deviceDrivers_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>() { + public context.ContextOuterClass.DeviceDriverEnum convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceDriverEnum result = context.ContextOuterClass.DeviceDriverEnum.valueOf(from); + return result == null ? context.ContextOuterClass.DeviceDriverEnum.UNRECOGNIZED : result; + } + }; + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + @java.lang.Override + public java.util.List getDeviceDriversList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + @java.lang.Override + public int getDeviceDriversCount() { + return deviceDrivers_.size(); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { + return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + @java.lang.Override + public java.util.List + getDeviceDriversValueList() { + return deviceDrivers_; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + @java.lang.Override + public int getDeviceDriversValue(int index) { + return deviceDrivers_.get(index); + } + private int deviceDriversMemoizedSerializedSize; + + public static final int DEVICE_ENDPOINTS_FIELD_NUMBER = 6; + private java.util.List deviceEndpoints_; + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public java.util.List getDeviceEndpointsList() { + return deviceEndpoints_; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public java.util.List + getDeviceEndpointsOrBuilderList() { + return deviceEndpoints_; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public int getDeviceEndpointsCount() { + return deviceEndpoints_.size(); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { + return deviceEndpoints_.get(index); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index) { + return deviceEndpoints_.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 { + getSerializedSize(); + if (deviceId_ != null) { + output.writeMessage(1, getDeviceId()); + } + if (!getDeviceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); + } + if (deviceConfig_ != null) { + output.writeMessage(3, getDeviceConfig()); + } + if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { + output.writeEnum(4, deviceOperationalStatus_); + } + if (getDeviceDriversList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(deviceDriversMemoizedSerializedSize); + } + for (int i = 0; i < deviceDrivers_.size(); i++) { + output.writeEnumNoTag(deviceDrivers_.get(i)); + } + for (int i = 0; i < deviceEndpoints_.size(); i++) { + output.writeMessage(6, deviceEndpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDeviceId()); + } + if (!getDeviceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); + } + if (deviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDeviceConfig()); + } + if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, deviceOperationalStatus_); + } + { + int dataSize = 0; + for (int i = 0; i < deviceDrivers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(deviceDrivers_.get(i)); + } + size += dataSize; + if (!getDeviceDriversList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }deviceDriversMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < deviceEndpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, deviceEndpoints_.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 context.ContextOuterClass.Device)) { + return super.equals(obj); + } + context.ContextOuterClass.Device other = (context.ContextOuterClass.Device) obj; + + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (!getDeviceType() + .equals(other.getDeviceType())) return false; + if (hasDeviceConfig() != other.hasDeviceConfig()) return false; + if (hasDeviceConfig()) { + if (!getDeviceConfig() + .equals(other.getDeviceConfig())) return false; + } + if (deviceOperationalStatus_ != other.deviceOperationalStatus_) return false; + if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; + if (!getDeviceEndpointsList() + .equals(other.getDeviceEndpointsList())) 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 (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDeviceType().hashCode(); + if (hasDeviceConfig()) { + hash = (37 * hash) + DEVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDeviceConfig().hashCode(); + } + hash = (37 * hash) + DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER; + hash = (53 * hash) + deviceOperationalStatus_; + if (getDeviceDriversCount() > 0) { + hash = (37 * hash) + DEVICE_DRIVERS_FIELD_NUMBER; + hash = (53 * hash) + deviceDrivers_.hashCode(); + } + if (getDeviceEndpointsCount() > 0) { + hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceEndpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Device parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Device parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Device parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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 context.ContextOuterClass.Device parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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 context.ContextOuterClass.Device parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Device 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(context.ContextOuterClass.Device 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 context.Device} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Device) + context.ContextOuterClass.DeviceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); + } + + // Construct using context.ContextOuterClass.Device.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceEndpointsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + deviceType_ = ""; + + if (deviceConfigBuilder_ == null) { + deviceConfig_ = null; + } else { + deviceConfig_ = null; + deviceConfigBuilder_ = null; + } + deviceOperationalStatus_ = 0; + + deviceDrivers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (deviceEndpointsBuilder_ == null) { + deviceEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + deviceEndpointsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Device_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Device getDefaultInstanceForType() { + return context.ContextOuterClass.Device.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Device build() { + context.ContextOuterClass.Device result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Device buildPartial() { + context.ContextOuterClass.Device result = new context.ContextOuterClass.Device(this); + int from_bitField0_ = bitField0_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + result.deviceType_ = deviceType_; + if (deviceConfigBuilder_ == null) { + result.deviceConfig_ = deviceConfig_; + } else { + result.deviceConfig_ = deviceConfigBuilder_.build(); + } + result.deviceOperationalStatus_ = deviceOperationalStatus_; + if (((bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceDrivers_ = deviceDrivers_; + if (deviceEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.deviceEndpoints_ = deviceEndpoints_; + } else { + result.deviceEndpoints_ = deviceEndpointsBuilder_.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 context.ContextOuterClass.Device) { + return mergeFrom((context.ContextOuterClass.Device)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Device other) { + if (other == context.ContextOuterClass.Device.getDefaultInstance()) return this; + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (!other.getDeviceType().isEmpty()) { + deviceType_ = other.deviceType_; + onChanged(); + } + if (other.hasDeviceConfig()) { + mergeDeviceConfig(other.getDeviceConfig()); + } + if (other.deviceOperationalStatus_ != 0) { + setDeviceOperationalStatusValue(other.getDeviceOperationalStatusValue()); + } + if (!other.deviceDrivers_.isEmpty()) { + if (deviceDrivers_.isEmpty()) { + deviceDrivers_ = other.deviceDrivers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceDriversIsMutable(); + deviceDrivers_.addAll(other.deviceDrivers_); + } + onChanged(); + } + if (deviceEndpointsBuilder_ == null) { + if (!other.deviceEndpoints_.isEmpty()) { + if (deviceEndpoints_.isEmpty()) { + deviceEndpoints_ = other.deviceEndpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.addAll(other.deviceEndpoints_); + } + onChanged(); + } + } else { + if (!other.deviceEndpoints_.isEmpty()) { + if (deviceEndpointsBuilder_.isEmpty()) { + deviceEndpointsBuilder_.dispose(); + deviceEndpointsBuilder_ = null; + deviceEndpoints_ = other.deviceEndpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + deviceEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceEndpointsFieldBuilder() : null; + } else { + deviceEndpointsBuilder_.addAllMessages(other.deviceEndpoints_); + } + } + } + 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 { + context.ContextOuterClass.Device parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Device) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 1; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 1; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 1; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 1; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private java.lang.Object deviceType_ = ""; + /** + * string device_type = 2; + * @return The deviceType. + */ + public java.lang.String getDeviceType() { + java.lang.Object ref = deviceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deviceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string device_type = 2; + * @return The bytes for deviceType. + */ + public com.google.protobuf.ByteString + getDeviceTypeBytes() { + java.lang.Object ref = deviceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + deviceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string device_type = 2; + * @param value The deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceType_ = value; + onChanged(); + return this; + } + /** + * string device_type = 2; + * @return This builder for chaining. + */ + public Builder clearDeviceType() { + + deviceType_ = getDefaultInstance().getDeviceType(); + onChanged(); + return this; + } + /** + * string device_type = 2; + * @param value The bytes for deviceType to set. + * @return This builder for chaining. + */ + public Builder setDeviceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deviceType_ = value; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceConfig deviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> deviceConfigBuilder_; + /** + * .context.DeviceConfig device_config = 3; + * @return Whether the deviceConfig field is set. + */ + public boolean hasDeviceConfig() { + return deviceConfigBuilder_ != null || deviceConfig_ != null; + } + /** + * .context.DeviceConfig device_config = 3; + * @return The deviceConfig. + */ + public context.ContextOuterClass.DeviceConfig getDeviceConfig() { + if (deviceConfigBuilder_ == null) { + return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } else { + return deviceConfigBuilder_.getMessage(); + } + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder setDeviceConfig(context.ContextOuterClass.DeviceConfig value) { + if (deviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceConfig_ = value; + onChanged(); + } else { + deviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder setDeviceConfig( + context.ContextOuterClass.DeviceConfig.Builder builderForValue) { + if (deviceConfigBuilder_ == null) { + deviceConfig_ = builderForValue.build(); + onChanged(); + } else { + deviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder mergeDeviceConfig(context.ContextOuterClass.DeviceConfig value) { + if (deviceConfigBuilder_ == null) { + if (deviceConfig_ != null) { + deviceConfig_ = + context.ContextOuterClass.DeviceConfig.newBuilder(deviceConfig_).mergeFrom(value).buildPartial(); + } else { + deviceConfig_ = value; + } + onChanged(); + } else { + deviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public Builder clearDeviceConfig() { + if (deviceConfigBuilder_ == null) { + deviceConfig_ = null; + onChanged(); + } else { + deviceConfig_ = null; + deviceConfigBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceConfig device_config = 3; + */ + public context.ContextOuterClass.DeviceConfig.Builder getDeviceConfigBuilder() { + + onChanged(); + return getDeviceConfigFieldBuilder().getBuilder(); + } + /** + * .context.DeviceConfig device_config = 3; + */ + public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { + if (deviceConfigBuilder_ != null) { + return deviceConfigBuilder_.getMessageOrBuilder(); + } else { + return deviceConfig_ == null ? + context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; + } + } + /** + * .context.DeviceConfig device_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> + getDeviceConfigFieldBuilder() { + if (deviceConfigBuilder_ == null) { + deviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>( + getDeviceConfig(), + getParentForChildren(), + isClean()); + deviceConfig_ = null; + } + return deviceConfigBuilder_; + } + + private int deviceOperationalStatus_ = 0; + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The enum numeric value on the wire for deviceOperationalStatus. + */ + @java.lang.Override public int getDeviceOperationalStatusValue() { + return deviceOperationalStatus_; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @param value The enum numeric value on the wire for deviceOperationalStatus to set. + * @return This builder for chaining. + */ + public Builder setDeviceOperationalStatusValue(int value) { + + deviceOperationalStatus_ = value; + onChanged(); + return this; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return The deviceOperationalStatus. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); + return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @param value The deviceOperationalStatus to set. + * @return This builder for chaining. + */ + public Builder setDeviceOperationalStatus(context.ContextOuterClass.DeviceOperationalStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + deviceOperationalStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.DeviceOperationalStatusEnum device_operational_status = 4; + * @return This builder for chaining. + */ + public Builder clearDeviceOperationalStatus() { + + deviceOperationalStatus_ = 0; + onChanged(); + return this; + } + + private java.util.List deviceDrivers_ = + java.util.Collections.emptyList(); + private void ensureDeviceDriversIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceDrivers_ = new java.util.ArrayList(deviceDrivers_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the deviceDrivers. + */ + public java.util.List getDeviceDriversList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return The count of deviceDrivers. + */ + public int getDeviceDriversCount() { + return deviceDrivers_.size(); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the element to return. + * @return The deviceDrivers at the given index. + */ + public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { + return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index to set the value at. + * @param value The deviceDrivers to set. + * @return This builder for chaining. + */ + public Builder setDeviceDrivers( + int index, context.ContextOuterClass.DeviceDriverEnum value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceDriversIsMutable(); + deviceDrivers_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param value The deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addDeviceDrivers(context.ContextOuterClass.DeviceDriverEnum value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceDriversIsMutable(); + deviceDrivers_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param values The deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceDrivers( + java.lang.Iterable values) { + ensureDeviceDriversIsMutable(); + for (context.ContextOuterClass.DeviceDriverEnum value : values) { + deviceDrivers_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return This builder for chaining. + */ + public Builder clearDeviceDrivers() { + deviceDrivers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @return A list containing the enum numeric values on the wire for deviceDrivers. + */ + public java.util.List + getDeviceDriversValueList() { + return java.util.Collections.unmodifiableList(deviceDrivers_); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + */ + public int getDeviceDriversValue(int index) { + return deviceDrivers_.get(index); + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of deviceDrivers at the given index. + * @return This builder for chaining. + */ + public Builder setDeviceDriversValue( + int index, int value) { + ensureDeviceDriversIsMutable(); + deviceDrivers_.set(index, value); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param value The enum numeric value on the wire for deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addDeviceDriversValue(int value) { + ensureDeviceDriversIsMutable(); + deviceDrivers_.add(value); + onChanged(); + return this; + } + /** + * repeated .context.DeviceDriverEnum device_drivers = 5; + * @param values The enum numeric values on the wire for deviceDrivers to add. + * @return This builder for chaining. + */ + public Builder addAllDeviceDriversValue( + java.lang.Iterable values) { + ensureDeviceDriversIsMutable(); + for (int value : values) { + deviceDrivers_.add(value); + } + onChanged(); + return this; + } + + private java.util.List deviceEndpoints_ = + java.util.Collections.emptyList(); + private void ensureDeviceEndpointsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + deviceEndpoints_ = new java.util.ArrayList(deviceEndpoints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> deviceEndpointsBuilder_; + + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List getDeviceEndpointsList() { + if (deviceEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceEndpoints_); + } else { + return deviceEndpointsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public int getDeviceEndpointsCount() { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.size(); + } else { + return deviceEndpointsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.get(index); + } else { + return deviceEndpointsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder setDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.set(index, value); + onChanged(); + } else { + deviceEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder setDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints(context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(value); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint value) { + if (deviceEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(index, value); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addDeviceEndpoints( + int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder addAllDeviceEndpoints( + java.lang.Iterable values) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceEndpoints_); + onChanged(); + } else { + deviceEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder clearDeviceEndpoints() { + if (deviceEndpointsBuilder_ == null) { + deviceEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + deviceEndpointsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public Builder removeDeviceEndpoints(int index) { + if (deviceEndpointsBuilder_ == null) { + ensureDeviceEndpointsIsMutable(); + deviceEndpoints_.remove(index); + onChanged(); + } else { + deviceEndpointsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder getDeviceEndpointsBuilder( + int index) { + return getDeviceEndpointsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( + int index) { + if (deviceEndpointsBuilder_ == null) { + return deviceEndpoints_.get(index); } else { + return deviceEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List + getDeviceEndpointsOrBuilderList() { + if (deviceEndpointsBuilder_ != null) { + return deviceEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceEndpoints_); + } + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder() { + return getDeviceEndpointsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPoint.getDefaultInstance()); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder( + int index) { + return getDeviceEndpointsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPoint.getDefaultInstance()); + } + /** + * repeated .context.EndPoint device_endpoints = 6; + */ + public java.util.List + getDeviceEndpointsBuilderList() { + return getDeviceEndpointsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> + getDeviceEndpointsFieldBuilder() { + if (deviceEndpointsBuilder_ == null) { + deviceEndpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder>( + deviceEndpoints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + deviceEndpoints_ = null; + } + return deviceEndpointsBuilder_; + } + @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:context.Device) + } + + // @@protoc_insertion_point(class_scope:context.Device) + private static final context.ContextOuterClass.Device DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Device(); + } + + public static context.ContextOuterClass.Device getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Device parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Device(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 context.ContextOuterClass.Device getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRule getConfigRules(int index); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + int getConfigRulesCount(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesOrBuilderList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceConfig} + */ + public static final class DeviceConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceConfig) + DeviceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceConfig.newBuilder() to construct. + private DeviceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceConfig() { + configRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceConfig( + 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)) { + configRules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.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)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + } + + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List getConfigRulesList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public int getConfigRulesCount() { + return configRules_.size(); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + return configRules_.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 < configRules_.size(); i++) { + output.writeMessage(1, configRules_.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 < configRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configRules_.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 context.ContextOuterClass.DeviceConfig)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceConfig other = (context.ContextOuterClass.DeviceConfig) obj; + + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) 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 (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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 context.ContextOuterClass.DeviceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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 context.ContextOuterClass.DeviceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceConfig 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(context.ContextOuterClass.DeviceConfig 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 context.DeviceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceConfig) + context.ContextOuterClass.DeviceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getConfigRulesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + configRulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceConfig.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig build() { + context.ContextOuterClass.DeviceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceConfig buildPartial() { + context.ContextOuterClass.DeviceConfig result = new context.ContextOuterClass.DeviceConfig(this); + int from_bitField0_ = bitField0_; + if (configRulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configRules_ = configRules_; + } else { + result.configRules_ = configRulesBuilder_.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 context.ContextOuterClass.DeviceConfig) { + return mergeFrom((context.ContextOuterClass.DeviceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceConfig other) { + if (other == context.ContextOuterClass.DeviceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); + } + onChanged(); + } + } else { + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + configRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfigRulesFieldBuilder() : null; + } else { + configRulesBuilder_.addAllMessages(other.configRules_); + } + } + } + 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 { + context.ContextOuterClass.DeviceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List configRules_ = + java.util.Collections.emptyList(); + private void ensureConfigRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configRules_ = new java.util.ArrayList(configRules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); + } else { + return configRulesBuilder_.getMessageList(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); + } else { + return configRulesBuilder_.getCount(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); + } else { + return configRulesBuilder_.getMessage(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.set(index, value); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(value); + onChanged(); + } else { + configRulesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(index, value); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configRules_); + onChanged(); + } else { + configRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configRulesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); + onChanged(); + } else { + configRulesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configRules_); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configRules_ = null; + } + return configRulesBuilder_; + } + @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:context.DeviceConfig) + } + + // @@protoc_insertion_point(class_scope:context.DeviceConfig) + private static final context.ContextOuterClass.DeviceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceConfig(); + } + + public static context.ContextOuterClass.DeviceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceConfig(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 context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.DeviceId device_ids = 1; + */ + java.util.List + getDeviceIdsList(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + context.ContextOuterClass.DeviceId getDeviceIds(int index); + /** + * repeated .context.DeviceId device_ids = 1; + */ + int getDeviceIdsCount(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + java.util.List + getDeviceIdsOrBuilderList(); + /** + * repeated .context.DeviceId device_ids = 1; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceIdList} + */ + public static final class DeviceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceIdList) + DeviceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceIdList.newBuilder() to construct. + private DeviceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceIdList() { + deviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceIdList( + 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)) { + deviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceIds_.add( + input.readMessage(context.ContextOuterClass.DeviceId.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)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + } + + public static final int DEVICE_IDS_FIELD_NUMBER = 1; + private java.util.List deviceIds_; + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public java.util.List getDeviceIdsList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public java.util.List + getDeviceIdsOrBuilderList() { + return deviceIds_; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public int getDeviceIdsCount() { + return deviceIds_.size(); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + return deviceIds_.get(index); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + return deviceIds_.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 < deviceIds_.size(); i++) { + output.writeMessage(1, deviceIds_.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 < deviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, deviceIds_.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 context.ContextOuterClass.DeviceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceIdList other = (context.ContextOuterClass.DeviceIdList) obj; + + if (!getDeviceIdsList() + .equals(other.getDeviceIdsList())) 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 (getDeviceIdsCount() > 0) { + hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getDeviceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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 context.ContextOuterClass.DeviceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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 context.ContextOuterClass.DeviceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceIdList 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(context.ContextOuterClass.DeviceIdList 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 context.DeviceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceIdList) + context.ContextOuterClass.DeviceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDeviceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList build() { + context.ContextOuterClass.DeviceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceIdList buildPartial() { + context.ContextOuterClass.DeviceIdList result = new context.ContextOuterClass.DeviceIdList(this); + int from_bitField0_ = bitField0_; + if (deviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceIds_ = deviceIds_; + } else { + result.deviceIds_ = deviceIdsBuilder_.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 context.ContextOuterClass.DeviceIdList) { + return mergeFrom((context.ContextOuterClass.DeviceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceIdList other) { + if (other == context.ContextOuterClass.DeviceIdList.getDefaultInstance()) return this; + if (deviceIdsBuilder_ == null) { + if (!other.deviceIds_.isEmpty()) { + if (deviceIds_.isEmpty()) { + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceIdsIsMutable(); + deviceIds_.addAll(other.deviceIds_); + } + onChanged(); + } + } else { + if (!other.deviceIds_.isEmpty()) { + if (deviceIdsBuilder_.isEmpty()) { + deviceIdsBuilder_.dispose(); + deviceIdsBuilder_ = null; + deviceIds_ = other.deviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceIdsFieldBuilder() : null; + } else { + deviceIdsBuilder_.addAllMessages(other.deviceIds_); + } + } + } + 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 { + context.ContextOuterClass.DeviceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List deviceIds_ = + java.util.Collections.emptyList(); + private void ensureDeviceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceIds_ = new java.util.ArrayList(deviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List getDeviceIdsList() { + if (deviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceIds_); + } else { + return deviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public int getDeviceIdsCount() { + if (deviceIdsBuilder_ == null) { + return deviceIds_.size(); + } else { + return deviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId getDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); + } else { + return deviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, value); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder setDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, value); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addDeviceIds( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + deviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder addAllDeviceIds( + java.lang.Iterable values) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceIds_); + onChanged(); + } else { + deviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder clearDeviceIds() { + if (deviceIdsBuilder_ == null) { + deviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public Builder removeDeviceIds(int index) { + if (deviceIdsBuilder_ == null) { + ensureDeviceIdsIsMutable(); + deviceIds_.remove(index); + onChanged(); + } else { + deviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( + int index) { + if (deviceIdsBuilder_ == null) { + return deviceIds_.get(index); } else { + return deviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List + getDeviceIdsOrBuilderList() { + if (deviceIdsBuilder_ != null) { + return deviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceIds_); + } + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { + return getDeviceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( + int index) { + return getDeviceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + * repeated .context.DeviceId device_ids = 1; + */ + public java.util.List + getDeviceIdsBuilderList() { + return getDeviceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdsFieldBuilder() { + if (deviceIdsBuilder_ == null) { + deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceIds_ = null; + } + return deviceIdsBuilder_; + } + @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:context.DeviceIdList) + } + + // @@protoc_insertion_point(class_scope:context.DeviceIdList) + private static final context.ContextOuterClass.DeviceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceIdList(); + } + + public static context.ContextOuterClass.DeviceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceIdList(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 context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Device devices = 1; + */ + java.util.List + getDevicesList(); + /** + * repeated .context.Device devices = 1; + */ + context.ContextOuterClass.Device getDevices(int index); + /** + * repeated .context.Device devices = 1; + */ + int getDevicesCount(); + /** + * repeated .context.Device devices = 1; + */ + java.util.List + getDevicesOrBuilderList(); + /** + * repeated .context.Device devices = 1; + */ + context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.DeviceList} + */ + public static final class DeviceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceList) + DeviceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceList.newBuilder() to construct. + private DeviceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceList() { + devices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceList( + 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)) { + devices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + devices_.add( + input.readMessage(context.ContextOuterClass.Device.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)) { + devices_ = java.util.Collections.unmodifiableList(devices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + } + + public static final int DEVICES_FIELD_NUMBER = 1; + private java.util.List devices_; + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public java.util.List getDevicesList() { + return devices_; + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public java.util.List + getDevicesOrBuilderList() { + return devices_; + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public int getDevicesCount() { + return devices_.size(); + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Device getDevices(int index) { + return devices_.get(index); + } + /** + * repeated .context.Device devices = 1; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index) { + return devices_.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 < devices_.size(); i++) { + output.writeMessage(1, devices_.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 < devices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, devices_.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 context.ContextOuterClass.DeviceList)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceList other = (context.ContextOuterClass.DeviceList) obj; + + if (!getDevicesList() + .equals(other.getDevicesList())) 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 (getDevicesCount() > 0) { + hash = (37 * hash) + DEVICES_FIELD_NUMBER; + hash = (53 * hash) + getDevicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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 context.ContextOuterClass.DeviceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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 context.ContextOuterClass.DeviceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceList 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(context.ContextOuterClass.DeviceList 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 context.DeviceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceList) + context.ContextOuterClass.DeviceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDevicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (devicesBuilder_ == null) { + devices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + devicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList build() { + context.ContextOuterClass.DeviceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceList buildPartial() { + context.ContextOuterClass.DeviceList result = new context.ContextOuterClass.DeviceList(this); + int from_bitField0_ = bitField0_; + if (devicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + devices_ = java.util.Collections.unmodifiableList(devices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.devices_ = devices_; + } else { + result.devices_ = devicesBuilder_.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 context.ContextOuterClass.DeviceList) { + return mergeFrom((context.ContextOuterClass.DeviceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceList other) { + if (other == context.ContextOuterClass.DeviceList.getDefaultInstance()) return this; + if (devicesBuilder_ == null) { + if (!other.devices_.isEmpty()) { + if (devices_.isEmpty()) { + devices_ = other.devices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDevicesIsMutable(); + devices_.addAll(other.devices_); + } + onChanged(); + } + } else { + if (!other.devices_.isEmpty()) { + if (devicesBuilder_.isEmpty()) { + devicesBuilder_.dispose(); + devicesBuilder_ = null; + devices_ = other.devices_; + bitField0_ = (bitField0_ & ~0x00000001); + devicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDevicesFieldBuilder() : null; + } else { + devicesBuilder_.addAllMessages(other.devices_); + } + } + } + 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 { + context.ContextOuterClass.DeviceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List devices_ = + java.util.Collections.emptyList(); + private void ensureDevicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + devices_ = new java.util.ArrayList(devices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> devicesBuilder_; + + /** + * repeated .context.Device devices = 1; + */ + public java.util.List getDevicesList() { + if (devicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(devices_); + } else { + return devicesBuilder_.getMessageList(); + } + } + /** + * repeated .context.Device devices = 1; + */ + public int getDevicesCount() { + if (devicesBuilder_ == null) { + return devices_.size(); + } else { + return devicesBuilder_.getCount(); + } + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device getDevices(int index) { + if (devicesBuilder_ == null) { + return devices_.get(index); + } else { + return devicesBuilder_.getMessage(index); + } + } + /** + * repeated .context.Device devices = 1; + */ + public Builder setDevices( + int index, context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.set(index, value); + onChanged(); + } else { + devicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder setDevices( + int index, context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.set(index, builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices(context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.add(value); + onChanged(); + } else { + devicesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + int index, context.ContextOuterClass.Device value) { + if (devicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDevicesIsMutable(); + devices_.add(index, value); + onChanged(); + } else { + devicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.add(builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addDevices( + int index, context.ContextOuterClass.Device.Builder builderForValue) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.add(index, builderForValue.build()); + onChanged(); + } else { + devicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder addAllDevices( + java.lang.Iterable values) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, devices_); + onChanged(); + } else { + devicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder clearDevices() { + if (devicesBuilder_ == null) { + devices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + devicesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public Builder removeDevices(int index) { + if (devicesBuilder_ == null) { + ensureDevicesIsMutable(); + devices_.remove(index); + onChanged(); + } else { + devicesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder getDevicesBuilder( + int index) { + return getDevicesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( + int index) { + if (devicesBuilder_ == null) { + return devices_.get(index); } else { + return devicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Device devices = 1; + */ + public java.util.List + getDevicesOrBuilderList() { + if (devicesBuilder_ != null) { + return devicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(devices_); + } + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder addDevicesBuilder() { + return getDevicesFieldBuilder().addBuilder( + context.ContextOuterClass.Device.getDefaultInstance()); + } + /** + * repeated .context.Device devices = 1; + */ + public context.ContextOuterClass.Device.Builder addDevicesBuilder( + int index) { + return getDevicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Device.getDefaultInstance()); + } + /** + * repeated .context.Device devices = 1; + */ + public java.util.List + getDevicesBuilderList() { + return getDevicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> + getDevicesFieldBuilder() { + if (devicesBuilder_ == null) { + devicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder>( + devices_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + devices_ = null; + } + return devicesBuilder_; + } + @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:context.DeviceList) + } + + // @@protoc_insertion_point(class_scope:context.DeviceList) + private static final context.ContextOuterClass.DeviceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceList(); + } + + public static context.ContextOuterClass.DeviceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceList(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 context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeviceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.DeviceEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 2; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + } + /** + * Protobuf type {@code context.DeviceEvent} + */ + public static final class DeviceEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.DeviceEvent) + DeviceEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeviceEvent.newBuilder() to construct. + private DeviceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeviceEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeviceEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeviceEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = 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 context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int DEVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (deviceId_ != null) { + output.writeMessage(2, getDeviceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDeviceId()); + } + 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 context.ContextOuterClass.DeviceEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.DeviceEvent other = (context.ContextOuterClass.DeviceEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.DeviceEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.DeviceEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.DeviceEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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 context.ContextOuterClass.DeviceEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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 context.ContextOuterClass.DeviceEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.DeviceEvent 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(context.ContextOuterClass.DeviceEvent 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 context.DeviceEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.DeviceEvent) + context.ContextOuterClass.DeviceEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.DeviceEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.DeviceEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent build() { + context.ContextOuterClass.DeviceEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.DeviceEvent buildPartial() { + context.ContextOuterClass.DeviceEvent result = new context.ContextOuterClass.DeviceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.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 context.ContextOuterClass.DeviceEvent) { + return mergeFrom((context.ContextOuterClass.DeviceEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.DeviceEvent other) { + if (other == context.ContextOuterClass.DeviceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + 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 { + context.ContextOuterClass.DeviceEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.DeviceEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 2; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + @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:context.DeviceEvent) + } + + // @@protoc_insertion_point(class_scope:context.DeviceEvent) + private static final context.ContextOuterClass.DeviceEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceEvent(); + } + + public static context.ContextOuterClass.DeviceEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeviceEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeviceEvent(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 context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + boolean hasLinkUuid(); + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + context.ContextOuterClass.Uuid getLinkUuid(); + /** + * .context.Uuid link_uuid = 1; + */ + context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder(); + } + /** + *
+   * ----- Link ----------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.LinkId} + */ + public static final class LinkId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkId) + LinkIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkId.newBuilder() to construct. + private LinkId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (linkUuid_ != null) { + subBuilder = linkUuid_.toBuilder(); + } + linkUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkUuid_); + linkUuid_ = 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 context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + } + + public static final int LINK_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid linkUuid_; + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + @java.lang.Override + public boolean hasLinkUuid() { + return linkUuid_ != null; + } + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getLinkUuid() { + return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } + /** + * .context.Uuid link_uuid = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { + return getLinkUuid(); + } + + 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 (linkUuid_ != null) { + output.writeMessage(1, getLinkUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (linkUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLinkUuid()); + } + 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 context.ContextOuterClass.LinkId)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkId other = (context.ContextOuterClass.LinkId) obj; + + if (hasLinkUuid() != other.hasLinkUuid()) return false; + if (hasLinkUuid()) { + if (!getLinkUuid() + .equals(other.getLinkUuid())) 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 (hasLinkUuid()) { + hash = (37 * hash) + LINK_UUID_FIELD_NUMBER; + hash = (53 * hash) + getLinkUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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 context.ContextOuterClass.LinkId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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 context.ContextOuterClass.LinkId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkId 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(context.ContextOuterClass.LinkId 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; + } + /** + *
+     * ----- Link ----------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.LinkId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkId) + context.ContextOuterClass.LinkIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkId.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 (linkUuidBuilder_ == null) { + linkUuid_ = null; + } else { + linkUuid_ = null; + linkUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkId getDefaultInstanceForType() { + return context.ContextOuterClass.LinkId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkId build() { + context.ContextOuterClass.LinkId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkId buildPartial() { + context.ContextOuterClass.LinkId result = new context.ContextOuterClass.LinkId(this); + if (linkUuidBuilder_ == null) { + result.linkUuid_ = linkUuid_; + } else { + result.linkUuid_ = linkUuidBuilder_.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 context.ContextOuterClass.LinkId) { + return mergeFrom((context.ContextOuterClass.LinkId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkId other) { + if (other == context.ContextOuterClass.LinkId.getDefaultInstance()) return this; + if (other.hasLinkUuid()) { + mergeLinkUuid(other.getLinkUuid()); + } + 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 { + context.ContextOuterClass.LinkId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid linkUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> linkUuidBuilder_; + /** + * .context.Uuid link_uuid = 1; + * @return Whether the linkUuid field is set. + */ + public boolean hasLinkUuid() { + return linkUuidBuilder_ != null || linkUuid_ != null; + } + /** + * .context.Uuid link_uuid = 1; + * @return The linkUuid. + */ + public context.ContextOuterClass.Uuid getLinkUuid() { + if (linkUuidBuilder_ == null) { + return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } else { + return linkUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder setLinkUuid(context.ContextOuterClass.Uuid value) { + if (linkUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkUuid_ = value; + onChanged(); + } else { + linkUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder setLinkUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (linkUuidBuilder_ == null) { + linkUuid_ = builderForValue.build(); + onChanged(); + } else { + linkUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder mergeLinkUuid(context.ContextOuterClass.Uuid value) { + if (linkUuidBuilder_ == null) { + if (linkUuid_ != null) { + linkUuid_ = + context.ContextOuterClass.Uuid.newBuilder(linkUuid_).mergeFrom(value).buildPartial(); + } else { + linkUuid_ = value; + } + onChanged(); + } else { + linkUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public Builder clearLinkUuid() { + if (linkUuidBuilder_ == null) { + linkUuid_ = null; + onChanged(); + } else { + linkUuid_ = null; + linkUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid link_uuid = 1; + */ + public context.ContextOuterClass.Uuid.Builder getLinkUuidBuilder() { + + onChanged(); + return getLinkUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid link_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { + if (linkUuidBuilder_ != null) { + return linkUuidBuilder_.getMessageOrBuilder(); + } else { + return linkUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + } + } + /** + * .context.Uuid link_uuid = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getLinkUuidFieldBuilder() { + if (linkUuidBuilder_ == null) { + linkUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getLinkUuid(), + getParentForChildren(), + isClean()); + linkUuid_ = null; + } + return linkUuidBuilder_; + } + @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:context.LinkId) + } + + // @@protoc_insertion_point(class_scope:context.LinkId) + private static final context.ContextOuterClass.LinkId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkId(); + } + + public static context.ContextOuterClass.LinkId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkId(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 context.ContextOuterClass.LinkId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Link) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + boolean hasLinkId(); + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + context.ContextOuterClass.LinkId getLinkId(); + /** + * .context.LinkId link_id = 1; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + java.util.List + getLinkEndpointIdsList(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointId getLinkEndpointIds(int index); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + int getLinkEndpointIdsCount(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + java.util.List + getLinkEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.Link} + */ + public static final class Link extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Link) + LinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use Link.newBuilder() to construct. + private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Link() { + linkEndpointIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Link(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Link( + 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: { + context.ContextOuterClass.LinkId.Builder subBuilder = null; + if (linkId_ != null) { + subBuilder = linkId_.toBuilder(); + } + linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkId_); + linkId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + linkEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.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)) { + linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + } + + public static final int LINK_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.LinkId linkId_; + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + @java.lang.Override + public boolean hasLinkId() { + return linkId_ != null; + } + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkId() { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + /** + * .context.LinkId link_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + return getLinkId(); + } + + public static final int LINK_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List linkEndpointIds_; + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public java.util.List getLinkEndpointIdsList() { + return linkEndpointIds_; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public java.util.List + getLinkEndpointIdsOrBuilderList() { + return linkEndpointIds_; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public int getLinkEndpointIdsCount() { + return linkEndpointIds_.size(); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { + return linkEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index) { + return linkEndpointIds_.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 (linkId_ != null) { + output.writeMessage(1, getLinkId()); + } + for (int i = 0; i < linkEndpointIds_.size(); i++) { + output.writeMessage(2, linkEndpointIds_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (linkId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getLinkId()); + } + for (int i = 0; i < linkEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, linkEndpointIds_.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 context.ContextOuterClass.Link)) { + return super.equals(obj); + } + context.ContextOuterClass.Link other = (context.ContextOuterClass.Link) obj; + + if (hasLinkId() != other.hasLinkId()) return false; + if (hasLinkId()) { + if (!getLinkId() + .equals(other.getLinkId())) return false; + } + if (!getLinkEndpointIdsList() + .equals(other.getLinkEndpointIdsList())) 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 (hasLinkId()) { + hash = (37 * hash) + LINK_ID_FIELD_NUMBER; + hash = (53 * hash) + getLinkId().hashCode(); + } + if (getLinkEndpointIdsCount() > 0) { + hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Link parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Link parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Link parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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 context.ContextOuterClass.Link parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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 context.ContextOuterClass.Link parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Link 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(context.ContextOuterClass.Link 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 context.Link} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Link) + context.ContextOuterClass.LinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + } + + // Construct using context.ContextOuterClass.Link.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinkEndpointIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linkIdBuilder_ == null) { + linkId_ = null; + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linkEndpointIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Link_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Link getDefaultInstanceForType() { + return context.ContextOuterClass.Link.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Link build() { + context.ContextOuterClass.Link result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Link buildPartial() { + context.ContextOuterClass.Link result = new context.ContextOuterClass.Link(this); + int from_bitField0_ = bitField0_; + if (linkIdBuilder_ == null) { + result.linkId_ = linkId_; + } else { + result.linkId_ = linkIdBuilder_.build(); + } + if (linkEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.linkEndpointIds_ = linkEndpointIds_; + } else { + result.linkEndpointIds_ = linkEndpointIdsBuilder_.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 context.ContextOuterClass.Link) { + return mergeFrom((context.ContextOuterClass.Link)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Link other) { + if (other == context.ContextOuterClass.Link.getDefaultInstance()) return this; + if (other.hasLinkId()) { + mergeLinkId(other.getLinkId()); + } + if (linkEndpointIdsBuilder_ == null) { + if (!other.linkEndpointIds_.isEmpty()) { + if (linkEndpointIds_.isEmpty()) { + linkEndpointIds_ = other.linkEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.addAll(other.linkEndpointIds_); + } + onChanged(); + } + } else { + if (!other.linkEndpointIds_.isEmpty()) { + if (linkEndpointIdsBuilder_.isEmpty()) { + linkEndpointIdsBuilder_.dispose(); + linkEndpointIdsBuilder_ = null; + linkEndpointIds_ = other.linkEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + linkEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkEndpointIdsFieldBuilder() : null; + } else { + linkEndpointIdsBuilder_.addAllMessages(other.linkEndpointIds_); + } + } + } + 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 { + context.ContextOuterClass.Link parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Link) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.LinkId linkId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + /** + * .context.LinkId link_id = 1; + * @return Whether the linkId field is set. + */ + public boolean hasLinkId() { + return linkIdBuilder_ != null || linkId_ != null; + } + /** + * .context.LinkId link_id = 1; + * @return The linkId. + */ + public context.ContextOuterClass.LinkId getLinkId() { + if (linkIdBuilder_ == null) { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } else { + return linkIdBuilder_.getMessage(); + } + } + /** + * .context.LinkId link_id = 1; + */ + public Builder setLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkId_ = value; + onChanged(); + } else { + linkIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder setLinkId( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdBuilder_ == null) { + linkId_ = builderForValue.build(); + onChanged(); + } else { + linkIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (linkId_ != null) { + linkId_ = + context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + } else { + linkId_ = value; + } + onChanged(); + } else { + linkIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public Builder clearLinkId() { + if (linkIdBuilder_ == null) { + linkId_ = null; + onChanged(); + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + + return this; + } + /** + * .context.LinkId link_id = 1; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + + onChanged(); + return getLinkIdFieldBuilder().getBuilder(); + } + /** + * .context.LinkId link_id = 1; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + if (linkIdBuilder_ != null) { + return linkIdBuilder_.getMessageOrBuilder(); + } else { + return linkId_ == null ? + context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + } + /** + * .context.LinkId link_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdFieldBuilder() { + if (linkIdBuilder_ == null) { + linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + getLinkId(), + getParentForChildren(), + isClean()); + linkId_ = null; + } + return linkIdBuilder_; + } + + private java.util.List linkEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureLinkEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + linkEndpointIds_ = new java.util.ArrayList(linkEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> linkEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List getLinkEndpointIdsList() { + if (linkEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkEndpointIds_); + } else { + return linkEndpointIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public int getLinkEndpointIdsCount() { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.size(); + } else { + return linkEndpointIdsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.get(index); + } else { + return linkEndpointIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder setLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.set(index, value); + onChanged(); + } else { + linkEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder setLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds(context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(value); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (linkEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(index, value); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addLinkEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder addAllLinkEndpointIds( + java.lang.Iterable values) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkEndpointIds_); + onChanged(); + } else { + linkEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder clearLinkEndpointIds() { + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linkEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public Builder removeLinkEndpointIds(int index) { + if (linkEndpointIdsBuilder_ == null) { + ensureLinkEndpointIdsIsMutable(); + linkEndpointIds_.remove(index); + onChanged(); + } else { + linkEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder getLinkEndpointIdsBuilder( + int index) { + return getLinkEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + int index) { + if (linkEndpointIdsBuilder_ == null) { + return linkEndpointIds_.get(index); } else { + return linkEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List + getLinkEndpointIdsOrBuilderList() { + if (linkEndpointIdsBuilder_ != null) { + return linkEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkEndpointIds_); + } + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder() { + return getLinkEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder( + int index) { + return getLinkEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId link_endpoint_ids = 2; + */ + public java.util.List + getLinkEndpointIdsBuilderList() { + return getLinkEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getLinkEndpointIdsFieldBuilder() { + if (linkEndpointIdsBuilder_ == null) { + linkEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + linkEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + linkEndpointIds_ = null; + } + return linkEndpointIdsBuilder_; + } + @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:context.Link) + } + + // @@protoc_insertion_point(class_scope:context.Link) + private static final context.ContextOuterClass.Link DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Link(); + } + + public static context.ContextOuterClass.Link getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Link parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Link(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 context.ContextOuterClass.Link getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.LinkId link_ids = 1; + */ + java.util.List + getLinkIdsList(); + /** + * repeated .context.LinkId link_ids = 1; + */ + context.ContextOuterClass.LinkId getLinkIds(int index); + /** + * repeated .context.LinkId link_ids = 1; + */ + int getLinkIdsCount(); + /** + * repeated .context.LinkId link_ids = 1; + */ + java.util.List + getLinkIdsOrBuilderList(); + /** + * repeated .context.LinkId link_ids = 1; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.LinkIdList} + */ + public static final class LinkIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkIdList) + LinkIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkIdList.newBuilder() to construct. + private LinkIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkIdList() { + linkIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkIdList( + 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)) { + linkIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + linkIds_.add( + input.readMessage(context.ContextOuterClass.LinkId.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)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + } + + public static final int LINK_IDS_FIELD_NUMBER = 1; + private java.util.List linkIds_; + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public java.util.List getLinkIdsList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public java.util.List + getLinkIdsOrBuilderList() { + return linkIds_; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public int getLinkIdsCount() { + return linkIds_.size(); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkIds(int index) { + return linkIds_.get(index); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + return linkIds_.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 < linkIds_.size(); i++) { + output.writeMessage(1, linkIds_.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 < linkIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, linkIds_.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 context.ContextOuterClass.LinkIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkIdList other = (context.ContextOuterClass.LinkIdList) obj; + + if (!getLinkIdsList() + .equals(other.getLinkIdsList())) 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 (getLinkIdsCount() > 0) { + hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLinkIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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 context.ContextOuterClass.LinkIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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 context.ContextOuterClass.LinkIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkIdList 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(context.ContextOuterClass.LinkIdList 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 context.LinkIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkIdList) + context.ContextOuterClass.LinkIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinkIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + return context.ContextOuterClass.LinkIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList build() { + context.ContextOuterClass.LinkIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkIdList buildPartial() { + context.ContextOuterClass.LinkIdList result = new context.ContextOuterClass.LinkIdList(this); + int from_bitField0_ = bitField0_; + if (linkIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.linkIds_ = linkIds_; + } else { + result.linkIds_ = linkIdsBuilder_.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 context.ContextOuterClass.LinkIdList) { + return mergeFrom((context.ContextOuterClass.LinkIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkIdList other) { + if (other == context.ContextOuterClass.LinkIdList.getDefaultInstance()) return this; + if (linkIdsBuilder_ == null) { + if (!other.linkIds_.isEmpty()) { + if (linkIds_.isEmpty()) { + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinkIdsIsMutable(); + linkIds_.addAll(other.linkIds_); + } + onChanged(); + } + } else { + if (!other.linkIds_.isEmpty()) { + if (linkIdsBuilder_.isEmpty()) { + linkIdsBuilder_.dispose(); + linkIdsBuilder_ = null; + linkIds_ = other.linkIds_; + bitField0_ = (bitField0_ & ~0x00000001); + linkIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinkIdsFieldBuilder() : null; + } else { + linkIdsBuilder_.addAllMessages(other.linkIds_); + } + } + } + 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 { + context.ContextOuterClass.LinkIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List linkIds_ = + java.util.Collections.emptyList(); + private void ensureLinkIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + linkIds_ = new java.util.ArrayList(linkIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List getLinkIdsList() { + if (linkIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(linkIds_); + } else { + return linkIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public int getLinkIdsCount() { + if (linkIdsBuilder_ == null) { + return linkIds_.size(); + } else { + return linkIdsBuilder_.getCount(); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId getLinkIds(int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); + } else { + return linkIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.set(index, value); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder setLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.set(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds(context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId value) { + if (linkIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinkIdsIsMutable(); + linkIds_.add(index, value); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addLinkIds( + int index, context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.add(index, builderForValue.build()); + onChanged(); + } else { + linkIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder addAllLinkIds( + java.lang.Iterable values) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, linkIds_); + onChanged(); + } else { + linkIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder clearLinkIds() { + if (linkIdsBuilder_ == null) { + linkIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linkIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public Builder removeLinkIds(int index) { + if (linkIdsBuilder_ == null) { + ensureLinkIdsIsMutable(); + linkIds_.remove(index); + onChanged(); + } else { + linkIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + int index) { + if (linkIdsBuilder_ == null) { + return linkIds_.get(index); } else { + return linkIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List + getLinkIdsOrBuilderList() { + if (linkIdsBuilder_ != null) { + return linkIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(linkIds_); + } + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { + return getLinkIdsFieldBuilder().addBuilder( + context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + int index) { + return getLinkIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.LinkId.getDefaultInstance()); + } + /** + * repeated .context.LinkId link_ids = 1; + */ + public java.util.List + getLinkIdsBuilderList() { + return getLinkIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdsFieldBuilder() { + if (linkIdsBuilder_ == null) { + linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + linkIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + linkIds_ = null; + } + return linkIdsBuilder_; + } + @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:context.LinkIdList) + } + + // @@protoc_insertion_point(class_scope:context.LinkIdList) + private static final context.ContextOuterClass.LinkIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkIdList(); + } + + public static context.ContextOuterClass.LinkIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkIdList(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 context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Link links = 1; + */ + java.util.List + getLinksList(); + /** + * repeated .context.Link links = 1; + */ + context.ContextOuterClass.Link getLinks(int index); + /** + * repeated .context.Link links = 1; + */ + int getLinksCount(); + /** + * repeated .context.Link links = 1; + */ + java.util.List + getLinksOrBuilderList(); + /** + * repeated .context.Link links = 1; + */ + context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index); + } + /** + * Protobuf type {@code context.LinkList} + */ + public static final class LinkList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkList) + LinkListOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkList.newBuilder() to construct. + private LinkList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkList() { + links_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkList( + 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)) { + links_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + links_.add( + input.readMessage(context.ContextOuterClass.Link.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)) { + links_ = java.util.Collections.unmodifiableList(links_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + } + + public static final int LINKS_FIELD_NUMBER = 1; + private java.util.List links_; + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public java.util.List + getLinksOrBuilderList() { + return links_; + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Link getLinks(int index) { + return links_.get(index); + } + /** + * repeated .context.Link links = 1; + */ + @java.lang.Override + public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index) { + return links_.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 < links_.size(); i++) { + output.writeMessage(1, links_.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 < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, links_.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 context.ContextOuterClass.LinkList)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkList other = (context.ContextOuterClass.LinkList) obj; + + if (!getLinksList() + .equals(other.getLinksList())) 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 (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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 context.ContextOuterClass.LinkList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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 context.ContextOuterClass.LinkList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkList 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(context.ContextOuterClass.LinkList 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 context.LinkList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkList) + context.ContextOuterClass.LinkListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linksBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkList getDefaultInstanceForType() { + return context.ContextOuterClass.LinkList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkList build() { + context.ContextOuterClass.LinkList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkList buildPartial() { + context.ContextOuterClass.LinkList result = new context.ContextOuterClass.LinkList(this); + int from_bitField0_ = bitField0_; + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.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 context.ContextOuterClass.LinkList) { + return mergeFrom((context.ContextOuterClass.LinkList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkList other) { + if (other == context.ContextOuterClass.LinkList.getDefaultInstance()) return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinksFieldBuilder() : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + 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 { + context.ContextOuterClass.LinkList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List links_ = + java.util.Collections.emptyList(); + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> linksBuilder_; + + /** + * repeated .context.Link links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + /** + * repeated .context.Link links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + /** + * repeated .context.Link links = 1; + */ + public Builder setLinks( + int index, context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder setLinks( + int index, context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks(context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + int index, context.ContextOuterClass.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addLinks( + int index, context.ContextOuterClass.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder addAllLinks( + java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder getLinksBuilder( + int index) { + return getLinksFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + int index) { + if (linksBuilder_ == null) { + return links_.get(index); } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Link links = 1; + */ + public java.util.List + getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder addLinksBuilder() { + return getLinksFieldBuilder().addBuilder( + context.ContextOuterClass.Link.getDefaultInstance()); + } + /** + * repeated .context.Link links = 1; + */ + public context.ContextOuterClass.Link.Builder addLinksBuilder( + int index) { + return getLinksFieldBuilder().addBuilder( + index, context.ContextOuterClass.Link.getDefaultInstance()); + } + /** + * repeated .context.Link links = 1; + */ + public java.util.List + getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder>( + links_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + links_ = null; + } + return linksBuilder_; + } + @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:context.LinkList) + } + + // @@protoc_insertion_point(class_scope:context.LinkList) + private static final context.ContextOuterClass.LinkList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkList(); + } + + public static context.ContextOuterClass.LinkList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkList(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 context.ContextOuterClass.LinkList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LinkEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.LinkEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + boolean hasEvent(); + /** + * .context.Event event = 1; + * @return The event. + */ + context.ContextOuterClass.Event getEvent(); + /** + * .context.Event event = 1; + */ + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + boolean hasLinkId(); + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + context.ContextOuterClass.LinkId getLinkId(); + /** + * .context.LinkId link_id = 2; + */ + context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + } + /** + * Protobuf type {@code context.LinkEvent} + */ + public static final class LinkEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.LinkEvent) + LinkEventOrBuilder { + private static final long serialVersionUID = 0L; + // Use LinkEvent.newBuilder() to construct. + private LinkEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LinkEvent() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LinkEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LinkEvent( + 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: { + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.LinkId.Builder subBuilder = null; + if (linkId_ != null) { + subBuilder = linkId_.toBuilder(); + } + linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(linkId_); + linkId_ = 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 context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + @java.lang.Override + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + /** + * .context.Event event = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int LINK_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.LinkId linkId_; + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + @java.lang.Override + public boolean hasLinkId() { + return linkId_ != null; + } + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + @java.lang.Override + public context.ContextOuterClass.LinkId getLinkId() { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + /** + * .context.LinkId link_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + return getLinkId(); + } + + 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 (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (linkId_ != null) { + output.writeMessage(2, getLinkId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEvent()); + } + if (linkId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLinkId()); + } + 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 context.ContextOuterClass.LinkEvent)) { + return super.equals(obj); + } + context.ContextOuterClass.LinkEvent other = (context.ContextOuterClass.LinkEvent) obj; + + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasLinkId() != other.hasLinkId()) return false; + if (hasLinkId()) { + if (!getLinkId() + .equals(other.getLinkId())) 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 (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasLinkId()) { + hash = (37 * hash) + LINK_ID_FIELD_NUMBER; + hash = (53 * hash) + getLinkId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.LinkEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.LinkEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.LinkEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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 context.ContextOuterClass.LinkEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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 context.ContextOuterClass.LinkEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.LinkEvent 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(context.ContextOuterClass.LinkEvent 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 context.LinkEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.LinkEvent) + context.ContextOuterClass.LinkEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + } + + // Construct using context.ContextOuterClass.LinkEvent.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 (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + if (linkIdBuilder_ == null) { + linkId_ = null; + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + return context.ContextOuterClass.LinkEvent.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent build() { + context.ContextOuterClass.LinkEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.LinkEvent buildPartial() { + context.ContextOuterClass.LinkEvent result = new context.ContextOuterClass.LinkEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + if (linkIdBuilder_ == null) { + result.linkId_ = linkId_; + } else { + result.linkId_ = linkIdBuilder_.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 context.ContextOuterClass.LinkEvent) { + return mergeFrom((context.ContextOuterClass.LinkEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.LinkEvent other) { + if (other == context.ContextOuterClass.LinkEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasLinkId()) { + mergeLinkId(other.getLinkId()); + } + 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 { + context.ContextOuterClass.LinkEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.LinkEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + /** + * .context.Event event = 1; + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * .context.Event event = 1; + * @return The event. + */ + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * .context.Event event = 1; + */ + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Event event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; + } + } + /** + * .context.Event event = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + + private context.ContextOuterClass.LinkId linkId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + /** + * .context.LinkId link_id = 2; + * @return Whether the linkId field is set. + */ + public boolean hasLinkId() { + return linkIdBuilder_ != null || linkId_ != null; + } + /** + * .context.LinkId link_id = 2; + * @return The linkId. + */ + public context.ContextOuterClass.LinkId getLinkId() { + if (linkIdBuilder_ == null) { + return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } else { + return linkIdBuilder_.getMessage(); + } + } + /** + * .context.LinkId link_id = 2; + */ + public Builder setLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + linkId_ = value; + onChanged(); + } else { + linkIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder setLinkId( + context.ContextOuterClass.LinkId.Builder builderForValue) { + if (linkIdBuilder_ == null) { + linkId_ = builderForValue.build(); + onChanged(); + } else { + linkIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { + if (linkIdBuilder_ == null) { + if (linkId_ != null) { + linkId_ = + context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + } else { + linkId_ = value; + } + onChanged(); + } else { + linkIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public Builder clearLinkId() { + if (linkIdBuilder_ == null) { + linkId_ = null; + onChanged(); + } else { + linkId_ = null; + linkIdBuilder_ = null; + } + + return this; + } + /** + * .context.LinkId link_id = 2; + */ + public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + + onChanged(); + return getLinkIdFieldBuilder().getBuilder(); + } + /** + * .context.LinkId link_id = 2; + */ + public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { + if (linkIdBuilder_ != null) { + return linkIdBuilder_.getMessageOrBuilder(); + } else { + return linkId_ == null ? + context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + } + } + /** + * .context.LinkId link_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> + getLinkIdFieldBuilder() { + if (linkIdBuilder_ == null) { + linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( + getLinkId(), + getParentForChildren(), + isClean()); + linkId_ = null; + } + return linkIdBuilder_; + } + @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:context.LinkEvent) + } + + // @@protoc_insertion_point(class_scope:context.LinkEvent) + private static final context.ContextOuterClass.LinkEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.LinkEvent(); + } + + public static context.ContextOuterClass.LinkEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LinkEvent(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 context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + boolean hasContextId(); + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + context.ContextOuterClass.ContextId getContextId(); + /** + * .context.ContextId context_id = 1; + */ + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + boolean hasServiceUuid(); + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + context.ContextOuterClass.Uuid getServiceUuid(); + /** + * .context.Uuid service_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder(); + } + /** + *
+   * ----- Service -------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ServiceId} + */ + public static final class ServiceId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceId) + ServiceIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceId.newBuilder() to construct. + private ServiceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceId( + 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: { + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); + } + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (serviceUuid_ != null) { + subBuilder = serviceUuid_.toBuilder(); + } + serviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceUuid_); + serviceUuid_ = 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 context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + } + + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + @java.lang.Override + public boolean hasContextId() { + return contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + @java.lang.Override + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + /** + * .context.ContextId context_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); + } + + public static final int SERVICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid serviceUuid_; + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + @java.lang.Override + public boolean hasServiceUuid() { + return serviceUuid_ != null; + } + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getServiceUuid() { + return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } + /** + * .context.Uuid service_uuid = 2; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { + return getServiceUuid(); + } + + 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 (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (serviceUuid_ != null) { + output.writeMessage(2, getServiceUuid()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getContextId()); + } + if (serviceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getServiceUuid()); + } + 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 context.ContextOuterClass.ServiceId)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceId other = (context.ContextOuterClass.ServiceId) obj; + + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasServiceUuid() != other.hasServiceUuid()) return false; + if (hasServiceUuid()) { + if (!getServiceUuid() + .equals(other.getServiceUuid())) 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 (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasServiceUuid()) { + hash = (37 * hash) + SERVICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getServiceUuid().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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 context.ContextOuterClass.ServiceId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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 context.ContextOuterClass.ServiceId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceId 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(context.ContextOuterClass.ServiceId 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; + } + /** + *
+     * ----- Service -------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ServiceId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceId) + context.ContextOuterClass.ServiceIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceId.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 (contextIdBuilder_ == null) { + contextId_ = null; + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + if (serviceUuidBuilder_ == null) { + serviceUuid_ = null; + } else { + serviceUuid_ = null; + serviceUuidBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceId.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId build() { + context.ContextOuterClass.ServiceId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceId buildPartial() { + context.ContextOuterClass.ServiceId result = new context.ContextOuterClass.ServiceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; + } else { + result.contextId_ = contextIdBuilder_.build(); + } + if (serviceUuidBuilder_ == null) { + result.serviceUuid_ = serviceUuid_; + } else { + result.serviceUuid_ = serviceUuidBuilder_.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 context.ContextOuterClass.ServiceId) { + return mergeFrom((context.ContextOuterClass.ServiceId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceId other) { + if (other == context.ContextOuterClass.ServiceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasServiceUuid()) { + mergeServiceUuid(other.getServiceUuid()); + } + 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 { + context.ContextOuterClass.ServiceId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; + } + /** + * .context.ContextId context_id = 1; + * @return The contextId. + */ + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } else { + return contextIdBuilder_.getMessage(); + } + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contextId_ = value; + onChanged(); + } else { + contextIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); + onChanged(); + } else { + contextIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; + } + onChanged(); + } else { + contextIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; + onChanged(); + } else { + contextId_ = null; + contextIdBuilder_ = null; + } + + return this; + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); + } else { + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + } + } + /** + * .context.ContextId context_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; + } + return contextIdBuilder_; + } + + private context.ContextOuterClass.Uuid serviceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> serviceUuidBuilder_; + /** + * .context.Uuid service_uuid = 2; + * @return Whether the serviceUuid field is set. + */ + public boolean hasServiceUuid() { + return serviceUuidBuilder_ != null || serviceUuid_ != null; + } + /** + * .context.Uuid service_uuid = 2; + * @return The serviceUuid. + */ + public context.ContextOuterClass.Uuid getServiceUuid() { + if (serviceUuidBuilder_ == null) { + return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } else { + return serviceUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder setServiceUuid(context.ContextOuterClass.Uuid value) { + if (serviceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceUuid_ = value; + onChanged(); + } else { + serviceUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder setServiceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (serviceUuidBuilder_ == null) { + serviceUuid_ = builderForValue.build(); + onChanged(); + } else { + serviceUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder mergeServiceUuid(context.ContextOuterClass.Uuid value) { + if (serviceUuidBuilder_ == null) { + if (serviceUuid_ != null) { + serviceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(serviceUuid_).mergeFrom(value).buildPartial(); + } else { + serviceUuid_ = value; + } + onChanged(); + } else { + serviceUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public Builder clearServiceUuid() { + if (serviceUuidBuilder_ == null) { + serviceUuid_ = null; + onChanged(); + } else { + serviceUuid_ = null; + serviceUuidBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid service_uuid = 2; + */ + public context.ContextOuterClass.Uuid.Builder getServiceUuidBuilder() { + + onChanged(); + return getServiceUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid service_uuid = 2; + */ + public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { + if (serviceUuidBuilder_ != null) { + return serviceUuidBuilder_.getMessageOrBuilder(); + } else { + return serviceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + } + } + /** + * .context.Uuid service_uuid = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getServiceUuidFieldBuilder() { + if (serviceUuidBuilder_ == null) { + serviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getServiceUuid(), + getParentForChildren(), + isClean()); + serviceUuid_ = null; + } + return serviceUuidBuilder_; + } + @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:context.ServiceId) + } + + // @@protoc_insertion_point(class_scope:context.ServiceId) + private static final context.ContextOuterClass.ServiceId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceId(); + } + + public static context.ContextOuterClass.ServiceId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceId(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 context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Service) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 1; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + int getServiceTypeValue(); + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + context.ContextOuterClass.ServiceTypeEnum getServiceType(); + + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + java.util.List + getServiceEndpointIdsList(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + context.ContextOuterClass.EndPointId getServiceEndpointIds(int index); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + int getServiceEndpointIdsCount(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + java.util.List + getServiceEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.Constraint service_constraints = 4; + */ + java.util.List + getServiceConstraintsList(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + context.ContextOuterClass.Constraint getServiceConstraints(int index); + /** + * repeated .context.Constraint service_constraints = 4; + */ + int getServiceConstraintsCount(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + java.util.List + getServiceConstraintsOrBuilderList(); + /** + * repeated .context.Constraint service_constraints = 4; + */ + context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index); + + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + boolean hasServiceStatus(); + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + context.ContextOuterClass.ServiceStatus getServiceStatus(); + /** + * .context.ServiceStatus service_status = 5; + */ + context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder(); + + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + boolean hasServiceConfig(); + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + context.ContextOuterClass.ServiceConfig getServiceConfig(); + /** + * .context.ServiceConfig service_config = 6; + */ + context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + context.ContextOuterClass.Timestamp getTimestamp(); + /** + * .context.Timestamp timestamp = 7; + */ + context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder(); + } + /** + * Protobuf type {@code context.Service} + */ + public static final class Service extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.Service) + ServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Service.newBuilder() to construct. + private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Service() { + serviceType_ = 0; + serviceEndpointIds_ = java.util.Collections.emptyList(); + serviceConstraints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Service(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Service( + 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: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + serviceType_ = rawValue; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + serviceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 42: { + context.ContextOuterClass.ServiceStatus.Builder subBuilder = null; + if (serviceStatus_ != null) { + subBuilder = serviceStatus_.toBuilder(); + } + serviceStatus_ = input.readMessage(context.ContextOuterClass.ServiceStatus.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceStatus_); + serviceStatus_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.ServiceConfig.Builder subBuilder = null; + if (serviceConfig_ != null) { + subBuilder = serviceConfig_.toBuilder(); + } + serviceConfig_ = input.readMessage(context.ContextOuterClass.ServiceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceConfig_); + serviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SERVICE_TYPE_FIELD_NUMBER = 2; + private int serviceType_; + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + @java.lang.Override public int getServiceTypeValue() { + return serviceType_; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + @java.lang.Override public context.ContextOuterClass.ServiceTypeEnum getServiceType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); + return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + } + + public static final int SERVICE_ENDPOINT_IDS_FIELD_NUMBER = 3; + private java.util.List serviceEndpointIds_; + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List getServiceEndpointIdsList() { + return serviceEndpointIds_; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List + getServiceEndpointIdsOrBuilderList() { + return serviceEndpointIds_; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public int getServiceEndpointIdsCount() { + return serviceEndpointIds_.size(); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { + return serviceEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index) { + return serviceEndpointIds_.get(index); + } + + public static final int SERVICE_CONSTRAINTS_FIELD_NUMBER = 4; + private java.util.List serviceConstraints_; + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public java.util.List getServiceConstraintsList() { + return serviceConstraints_; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public java.util.List + getServiceConstraintsOrBuilderList() { + return serviceConstraints_; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public int getServiceConstraintsCount() { + return serviceConstraints_.size(); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getServiceConstraints(int index) { + return serviceConstraints_.get(index); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index) { + return serviceConstraints_.get(index); + } + + public static final int SERVICE_STATUS_FIELD_NUMBER = 5; + private context.ContextOuterClass.ServiceStatus serviceStatus_; + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + @java.lang.Override + public boolean hasServiceStatus() { + return serviceStatus_ != null; + } + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatus getServiceStatus() { + return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } + /** + * .context.ServiceStatus service_status = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { + return getServiceStatus(); + } + + public static final int SERVICE_CONFIG_FIELD_NUMBER = 6; + private context.ContextOuterClass.ServiceConfig serviceConfig_; + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + @java.lang.Override + public boolean hasServiceConfig() { + return serviceConfig_ != null; + } + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceConfig getServiceConfig() { + return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } + /** + * .context.ServiceConfig service_config = 6; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + return getServiceConfig(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 7; + private context.ContextOuterClass.Timestamp timestamp_; + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + @java.lang.Override + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .context.Timestamp timestamp = 7; + */ + @java.lang.Override + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); + } + + 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 (serviceId_ != null) { + output.writeMessage(1, getServiceId()); + } + if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { + output.writeEnum(2, serviceType_); + } + for (int i = 0; i < serviceEndpointIds_.size(); i++) { + output.writeMessage(3, serviceEndpointIds_.get(i)); + } + for (int i = 0; i < serviceConstraints_.size(); i++) { + output.writeMessage(4, serviceConstraints_.get(i)); + } + if (serviceStatus_ != null) { + output.writeMessage(5, getServiceStatus()); + } + if (serviceConfig_ != null) { + output.writeMessage(6, getServiceConfig()); + } + if (timestamp_ != null) { + output.writeMessage(7, getTimestamp()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getServiceId()); + } + if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, serviceType_); + } + for (int i = 0; i < serviceEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, serviceEndpointIds_.get(i)); + } + for (int i = 0; i < serviceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, serviceConstraints_.get(i)); + } + if (serviceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getServiceStatus()); + } + if (serviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getServiceConfig()); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getTimestamp()); + } + 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 context.ContextOuterClass.Service)) { + return super.equals(obj); + } + context.ContextOuterClass.Service other = (context.ContextOuterClass.Service) obj; + + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (serviceType_ != other.serviceType_) return false; + if (!getServiceEndpointIdsList() + .equals(other.getServiceEndpointIdsList())) return false; + if (!getServiceConstraintsList() + .equals(other.getServiceConstraintsList())) return false; + if (hasServiceStatus() != other.hasServiceStatus()) return false; + if (hasServiceStatus()) { + if (!getServiceStatus() + .equals(other.getServiceStatus())) return false; + } + if (hasServiceConfig() != other.hasServiceConfig()) return false; + if (hasServiceConfig()) { + if (!getServiceConfig() + .equals(other.getServiceConfig())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) 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 (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + hash = (37 * hash) + SERVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + serviceType_; + if (getServiceEndpointIdsCount() > 0) { + hash = (37 * hash) + SERVICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceEndpointIdsList().hashCode(); + } + if (getServiceConstraintsCount() > 0) { + hash = (37 * hash) + SERVICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getServiceConstraintsList().hashCode(); + } + if (hasServiceStatus()) { + hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getServiceStatus().hashCode(); + } + if (hasServiceConfig()) { + hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfig().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.Service parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.Service parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.Service parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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 context.ContextOuterClass.Service parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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 context.ContextOuterClass.Service parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.Service 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(context.ContextOuterClass.Service 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 context.Service} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.Service) + context.ContextOuterClass.ServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + } + + // Construct using context.ContextOuterClass.Service.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServiceEndpointIdsFieldBuilder(); + getServiceConstraintsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + serviceType_ = 0; + + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serviceEndpointIdsBuilder_.clear(); + } + if (serviceConstraintsBuilder_ == null) { + serviceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + serviceConstraintsBuilder_.clear(); + } + if (serviceStatusBuilder_ == null) { + serviceStatus_ = null; + } else { + serviceStatus_ = null; + serviceStatusBuilder_ = null; + } + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_Service_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.Service getDefaultInstanceForType() { + return context.ContextOuterClass.Service.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.Service build() { + context.ContextOuterClass.Service result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.Service buildPartial() { + context.ContextOuterClass.Service result = new context.ContextOuterClass.Service(this); + int from_bitField0_ = bitField0_; + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + result.serviceType_ = serviceType_; + if (serviceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceEndpointIds_ = serviceEndpointIds_; + } else { + result.serviceEndpointIds_ = serviceEndpointIdsBuilder_.build(); + } + if (serviceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.serviceConstraints_ = serviceConstraints_; + } else { + result.serviceConstraints_ = serviceConstraintsBuilder_.build(); + } + if (serviceStatusBuilder_ == null) { + result.serviceStatus_ = serviceStatus_; + } else { + result.serviceStatus_ = serviceStatusBuilder_.build(); + } + if (serviceConfigBuilder_ == null) { + result.serviceConfig_ = serviceConfig_; + } else { + result.serviceConfig_ = serviceConfigBuilder_.build(); + } + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.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 context.ContextOuterClass.Service) { + return mergeFrom((context.ContextOuterClass.Service)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.Service other) { + if (other == context.ContextOuterClass.Service.getDefaultInstance()) return this; + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.serviceType_ != 0) { + setServiceTypeValue(other.getServiceTypeValue()); + } + if (serviceEndpointIdsBuilder_ == null) { + if (!other.serviceEndpointIds_.isEmpty()) { + if (serviceEndpointIds_.isEmpty()) { + serviceEndpointIds_ = other.serviceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.addAll(other.serviceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.serviceEndpointIds_.isEmpty()) { + if (serviceEndpointIdsBuilder_.isEmpty()) { + serviceEndpointIdsBuilder_.dispose(); + serviceEndpointIdsBuilder_ = null; + serviceEndpointIds_ = other.serviceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + serviceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceEndpointIdsFieldBuilder() : null; + } else { + serviceEndpointIdsBuilder_.addAllMessages(other.serviceEndpointIds_); + } + } + } + if (serviceConstraintsBuilder_ == null) { + if (!other.serviceConstraints_.isEmpty()) { + if (serviceConstraints_.isEmpty()) { + serviceConstraints_ = other.serviceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.addAll(other.serviceConstraints_); + } + onChanged(); + } + } else { + if (!other.serviceConstraints_.isEmpty()) { + if (serviceConstraintsBuilder_.isEmpty()) { + serviceConstraintsBuilder_.dispose(); + serviceConstraintsBuilder_ = null; + serviceConstraints_ = other.serviceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + serviceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceConstraintsFieldBuilder() : null; + } else { + serviceConstraintsBuilder_.addAllMessages(other.serviceConstraints_); + } + } + } + if (other.hasServiceStatus()) { + mergeServiceStatus(other.getServiceStatus()); + } + if (other.hasServiceConfig()) { + mergeServiceConfig(other.getServiceConfig()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 { + context.ContextOuterClass.Service parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Service) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 1; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 1; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 1; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 1; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private int serviceType_ = 0; + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The enum numeric value on the wire for serviceType. + */ + @java.lang.Override public int getServiceTypeValue() { + return serviceType_; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @param value The enum numeric value on the wire for serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceTypeValue(int value) { + + serviceType_ = value; + onChanged(); + return this; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return The serviceType. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceTypeEnum getServiceType() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); + return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @param value The serviceType to set. + * @return This builder for chaining. + */ + public Builder setServiceType(context.ContextOuterClass.ServiceTypeEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.ServiceTypeEnum service_type = 2; + * @return This builder for chaining. + */ + public Builder clearServiceType() { + + serviceType_ = 0; + onChanged(); + return this; + } + + private java.util.List serviceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureServiceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceEndpointIds_ = new java.util.ArrayList(serviceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> serviceEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List getServiceEndpointIdsList() { + if (serviceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceEndpointIds_); + } else { + return serviceEndpointIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public int getServiceEndpointIdsCount() { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.size(); + } else { + return serviceEndpointIdsBuilder_.getCount(); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.get(index); + } else { + return serviceEndpointIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder setServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.set(index, value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder setServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (serviceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(index, value); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addServiceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder addAllServiceEndpointIds( + java.lang.Iterable values) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceEndpointIds_); + onChanged(); + } else { + serviceEndpointIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder clearServiceEndpointIds() { + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serviceEndpointIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public Builder removeServiceEndpointIds(int index) { + if (serviceEndpointIdsBuilder_ == null) { + ensureServiceEndpointIdsIsMutable(); + serviceEndpointIds_.remove(index); + onChanged(); + } else { + serviceEndpointIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder getServiceEndpointIdsBuilder( + int index) { + return getServiceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( + int index) { + if (serviceEndpointIdsBuilder_ == null) { + return serviceEndpointIds_.get(index); } else { + return serviceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List + getServiceEndpointIdsOrBuilderList() { + if (serviceEndpointIdsBuilder_ != null) { + return serviceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceEndpointIds_); + } + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder() { + return getServiceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder( + int index) { + return getServiceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId service_endpoint_ids = 3; + */ + public java.util.List + getServiceEndpointIdsBuilderList() { + return getServiceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getServiceEndpointIdsFieldBuilder() { + if (serviceEndpointIdsBuilder_ == null) { + serviceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + serviceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serviceEndpointIds_ = null; + } + return serviceEndpointIdsBuilder_; + } + + private java.util.List serviceConstraints_ = + java.util.Collections.emptyList(); + private void ensureServiceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + serviceConstraints_ = new java.util.ArrayList(serviceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> serviceConstraintsBuilder_; + + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List getServiceConstraintsList() { + if (serviceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceConstraints_); + } else { + return serviceConstraintsBuilder_.getMessageList(); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public int getServiceConstraintsCount() { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.size(); + } else { + return serviceConstraintsBuilder_.getCount(); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint getServiceConstraints(int index) { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.get(index); + } else { + return serviceConstraintsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder setServiceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.set(index, value); + onChanged(); + } else { + serviceConstraintsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder setServiceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints(context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(value); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (serviceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(index, value); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addServiceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceConstraintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder addAllServiceConstraints( + java.lang.Iterable values) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceConstraints_); + onChanged(); + } else { + serviceConstraintsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder clearServiceConstraints() { + if (serviceConstraintsBuilder_ == null) { + serviceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + serviceConstraintsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public Builder removeServiceConstraints(int index) { + if (serviceConstraintsBuilder_ == null) { + ensureServiceConstraintsIsMutable(); + serviceConstraints_.remove(index); + onChanged(); + } else { + serviceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder getServiceConstraintsBuilder( + int index) { + return getServiceConstraintsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( + int index) { + if (serviceConstraintsBuilder_ == null) { + return serviceConstraints_.get(index); } else { + return serviceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List + getServiceConstraintsOrBuilderList() { + if (serviceConstraintsBuilder_ != null) { + return serviceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceConstraints_); + } + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder() { + return getServiceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder( + int index) { + return getServiceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint service_constraints = 4; + */ + public java.util.List + getServiceConstraintsBuilderList() { + return getServiceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getServiceConstraintsFieldBuilder() { + if (serviceConstraintsBuilder_ == null) { + serviceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + serviceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + serviceConstraints_ = null; + } + return serviceConstraintsBuilder_; + } + + private context.ContextOuterClass.ServiceStatus serviceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> serviceStatusBuilder_; + /** + * .context.ServiceStatus service_status = 5; + * @return Whether the serviceStatus field is set. + */ + public boolean hasServiceStatus() { + return serviceStatusBuilder_ != null || serviceStatus_ != null; + } + /** + * .context.ServiceStatus service_status = 5; + * @return The serviceStatus. + */ + public context.ContextOuterClass.ServiceStatus getServiceStatus() { + if (serviceStatusBuilder_ == null) { + return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } else { + return serviceStatusBuilder_.getMessage(); + } + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder setServiceStatus(context.ContextOuterClass.ServiceStatus value) { + if (serviceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceStatus_ = value; + onChanged(); + } else { + serviceStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder setServiceStatus( + context.ContextOuterClass.ServiceStatus.Builder builderForValue) { + if (serviceStatusBuilder_ == null) { + serviceStatus_ = builderForValue.build(); + onChanged(); + } else { + serviceStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder mergeServiceStatus(context.ContextOuterClass.ServiceStatus value) { + if (serviceStatusBuilder_ == null) { + if (serviceStatus_ != null) { + serviceStatus_ = + context.ContextOuterClass.ServiceStatus.newBuilder(serviceStatus_).mergeFrom(value).buildPartial(); + } else { + serviceStatus_ = value; + } + onChanged(); + } else { + serviceStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public Builder clearServiceStatus() { + if (serviceStatusBuilder_ == null) { + serviceStatus_ = null; + onChanged(); + } else { + serviceStatus_ = null; + serviceStatusBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceStatus service_status = 5; + */ + public context.ContextOuterClass.ServiceStatus.Builder getServiceStatusBuilder() { + + onChanged(); + return getServiceStatusFieldBuilder().getBuilder(); + } + /** + * .context.ServiceStatus service_status = 5; + */ + public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { + if (serviceStatusBuilder_ != null) { + return serviceStatusBuilder_.getMessageOrBuilder(); + } else { + return serviceStatus_ == null ? + context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + } + } + /** + * .context.ServiceStatus service_status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> + getServiceStatusFieldBuilder() { + if (serviceStatusBuilder_ == null) { + serviceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder>( + getServiceStatus(), + getParentForChildren(), + isClean()); + serviceStatus_ = null; + } + return serviceStatusBuilder_; + } + + private context.ContextOuterClass.ServiceConfig serviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> serviceConfigBuilder_; + /** + * .context.ServiceConfig service_config = 6; + * @return Whether the serviceConfig field is set. + */ + public boolean hasServiceConfig() { + return serviceConfigBuilder_ != null || serviceConfig_ != null; + } + /** + * .context.ServiceConfig service_config = 6; + * @return The serviceConfig. + */ + public context.ContextOuterClass.ServiceConfig getServiceConfig() { + if (serviceConfigBuilder_ == null) { + return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } else { + return serviceConfigBuilder_.getMessage(); + } + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder setServiceConfig(context.ContextOuterClass.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceConfig_ = value; + onChanged(); + } else { + serviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder setServiceConfig( + context.ContextOuterClass.ServiceConfig.Builder builderForValue) { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = builderForValue.build(); + onChanged(); + } else { + serviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder mergeServiceConfig(context.ContextOuterClass.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (serviceConfig_ != null) { + serviceConfig_ = + context.ContextOuterClass.ServiceConfig.newBuilder(serviceConfig_).mergeFrom(value).buildPartial(); + } else { + serviceConfig_ = value; + } + onChanged(); + } else { + serviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public Builder clearServiceConfig() { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + onChanged(); + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceConfig service_config = 6; + */ + public context.ContextOuterClass.ServiceConfig.Builder getServiceConfigBuilder() { + + onChanged(); + return getServiceConfigFieldBuilder().getBuilder(); + } + /** + * .context.ServiceConfig service_config = 6; + */ + public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + if (serviceConfigBuilder_ != null) { + return serviceConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceConfig_ == null ? + context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + } + } + /** + * .context.ServiceConfig service_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> + getServiceConfigFieldBuilder() { + if (serviceConfigBuilder_ == null) { + serviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder>( + getServiceConfig(), + getParentForChildren(), + isClean()); + serviceConfig_ = null; + } + return serviceConfigBuilder_; + } + + private context.ContextOuterClass.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; + /** + * .context.Timestamp timestamp = 7; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 7; + * @return The timestamp. + */ + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestamp_ = null; + timestampBuilder_ = null; + } + + return this; + } + /** + * .context.Timestamp timestamp = 7; + */ + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { + + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + * .context.Timestamp timestamp = 7; + */ + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + * .context.Timestamp timestamp = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + @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:context.Service) + } + + // @@protoc_insertion_point(class_scope:context.Service) + private static final context.ContextOuterClass.Service DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.Service(); + } + + public static context.ContextOuterClass.Service getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Service parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Service(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 context.ContextOuterClass.Service getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + int getServiceStatusValue(); + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + context.ContextOuterClass.ServiceStatusEnum getServiceStatus(); + } + /** + * Protobuf type {@code context.ServiceStatus} + */ + public static final class ServiceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceStatus) + ServiceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceStatus.newBuilder() to construct. + private ServiceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceStatus() { + serviceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceStatus( + 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(); + + serviceStatus_ = 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 context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + } + + public static final int SERVICE_STATUS_FIELD_NUMBER = 1; + private int serviceStatus_; + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + @java.lang.Override public int getServiceStatusValue() { + return serviceStatus_; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + @java.lang.Override public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); + return result == null ? context.ContextOuterClass.ServiceStatusEnum.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 (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, serviceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, serviceStatus_); + } + 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 context.ContextOuterClass.ServiceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceStatus other = (context.ContextOuterClass.ServiceStatus) obj; + + if (serviceStatus_ != other.serviceStatus_) 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_STATUS_FIELD_NUMBER; + hash = (53 * hash) + serviceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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 context.ContextOuterClass.ServiceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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 context.ContextOuterClass.ServiceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceStatus 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(context.ContextOuterClass.ServiceStatus 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 context.ServiceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceStatus) + context.ContextOuterClass.ServiceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceStatus.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(); + serviceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus build() { + context.ContextOuterClass.ServiceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceStatus buildPartial() { + context.ContextOuterClass.ServiceStatus result = new context.ContextOuterClass.ServiceStatus(this); + result.serviceStatus_ = serviceStatus_; + 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 context.ContextOuterClass.ServiceStatus) { + return mergeFrom((context.ContextOuterClass.ServiceStatus)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceStatus other) { + if (other == context.ContextOuterClass.ServiceStatus.getDefaultInstance()) return this; + if (other.serviceStatus_ != 0) { + setServiceStatusValue(other.getServiceStatusValue()); + } + 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 { + context.ContextOuterClass.ServiceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int serviceStatus_ = 0; + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The enum numeric value on the wire for serviceStatus. + */ + @java.lang.Override public int getServiceStatusValue() { + return serviceStatus_; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @param value The enum numeric value on the wire for serviceStatus to set. + * @return This builder for chaining. + */ + public Builder setServiceStatusValue(int value) { + + serviceStatus_ = value; + onChanged(); + return this; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return The serviceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); + return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @param value The serviceStatus to set. + * @return This builder for chaining. + */ + public Builder setServiceStatus(context.ContextOuterClass.ServiceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.ServiceStatusEnum service_status = 1; + * @return This builder for chaining. + */ + public Builder clearServiceStatus() { + + serviceStatus_ = 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:context.ServiceStatus) + } + + // @@protoc_insertion_point(class_scope:context.ServiceStatus) + private static final context.ContextOuterClass.ServiceStatus DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceStatus(); + } + + public static context.ContextOuterClass.ServiceStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceStatus(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 context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRule getConfigRules(int index); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + int getConfigRulesCount(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + java.util.List + getConfigRulesOrBuilderList(); + /** + * repeated .context.ConfigRule config_rules = 1; + */ + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceConfig} + */ + public static final class ServiceConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceConfig) + ServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConfig.newBuilder() to construct. + private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceConfig() { + configRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceConfig( + 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)) { + configRules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.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)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + } + + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List getConfigRulesList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public int getConfigRulesCount() { + return configRules_.size(); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + return configRules_.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 < configRules_.size(); i++) { + output.writeMessage(1, configRules_.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 < configRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, configRules_.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 context.ContextOuterClass.ServiceConfig)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceConfig other = (context.ContextOuterClass.ServiceConfig) obj; + + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) 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 (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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 context.ContextOuterClass.ServiceConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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 context.ContextOuterClass.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceConfig 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(context.ContextOuterClass.ServiceConfig 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 context.ServiceConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceConfig) + context.ContextOuterClass.ServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getConfigRulesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + configRulesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig build() { + context.ContextOuterClass.ServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceConfig buildPartial() { + context.ContextOuterClass.ServiceConfig result = new context.ContextOuterClass.ServiceConfig(this); + int from_bitField0_ = bitField0_; + if (configRulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + configRules_ = java.util.Collections.unmodifiableList(configRules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.configRules_ = configRules_; + } else { + result.configRules_ = configRulesBuilder_.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 context.ContextOuterClass.ServiceConfig) { + return mergeFrom((context.ContextOuterClass.ServiceConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceConfig other) { + if (other == context.ContextOuterClass.ServiceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); + } + onChanged(); + } + } else { + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; + bitField0_ = (bitField0_ & ~0x00000001); + configRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConfigRulesFieldBuilder() : null; + } else { + configRulesBuilder_.addAllMessages(other.configRules_); + } + } + } + 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 { + context.ContextOuterClass.ServiceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List configRules_ = + java.util.Collections.emptyList(); + private void ensureConfigRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + configRules_ = new java.util.ArrayList(configRules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); + } else { + return configRulesBuilder_.getMessageList(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); + } else { + return configRulesBuilder_.getCount(); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); + } else { + return configRulesBuilder_.getMessage(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.set(index, value); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(value); + onChanged(); + } else { + configRulesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConfigRulesIsMutable(); + configRules_.add(index, value); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); + onChanged(); + } else { + configRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, configRules_); + onChanged(); + } else { + configRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + configRulesBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); + onChanged(); + } else { + configRulesBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( + int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(configRules_); + } + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( + int index) { + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + } + /** + * repeated .context.ConfigRule config_rules = 1; + */ + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + configRules_ = null; + } + return configRulesBuilder_; + } + @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:context.ServiceConfig) + } + + // @@protoc_insertion_point(class_scope:context.ServiceConfig) + private static final context.ContextOuterClass.ServiceConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceConfig(); + } + + public static context.ContextOuterClass.ServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConfig(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 context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceIdList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.ServiceId service_ids = 1; + */ + java.util.List + getServiceIdsList(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + context.ContextOuterClass.ServiceId getServiceIds(int index); + /** + * repeated .context.ServiceId service_ids = 1; + */ + int getServiceIdsCount(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + java.util.List + getServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId service_ids = 1; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceIdList} + */ + public static final class ServiceIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceIdList) + ServiceIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceIdList.newBuilder() to construct. + private ServiceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceIdList() { + serviceIds_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceIdList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceIdList( + 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)) { + serviceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + serviceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.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)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + } + + public static final int SERVICE_IDS_FIELD_NUMBER = 1; + private java.util.List serviceIds_; + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public java.util.List getServiceIdsList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public java.util.List + getServiceIdsOrBuilderList() { + return serviceIds_; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public int getServiceIdsCount() { + return serviceIds_.size(); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + return serviceIds_.get(index); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + return serviceIds_.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 < serviceIds_.size(); i++) { + output.writeMessage(1, serviceIds_.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 < serviceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, serviceIds_.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 context.ContextOuterClass.ServiceIdList)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceIdList other = (context.ContextOuterClass.ServiceIdList) obj; + + if (!getServiceIdsList() + .equals(other.getServiceIdsList())) 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 (getServiceIdsCount() > 0) { + hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServiceIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceIdList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceIdList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceIdList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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 context.ContextOuterClass.ServiceIdList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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 context.ContextOuterClass.ServiceIdList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceIdList 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(context.ContextOuterClass.ServiceIdList 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 context.ServiceIdList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceIdList) + context.ContextOuterClass.ServiceIdListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceIdList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServiceIdsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceIdList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList build() { + context.ContextOuterClass.ServiceIdList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceIdList buildPartial() { + context.ContextOuterClass.ServiceIdList result = new context.ContextOuterClass.ServiceIdList(this); + int from_bitField0_ = bitField0_; + if (serviceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.serviceIds_ = serviceIds_; + } else { + result.serviceIds_ = serviceIdsBuilder_.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 context.ContextOuterClass.ServiceIdList) { + return mergeFrom((context.ContextOuterClass.ServiceIdList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceIdList other) { + if (other == context.ContextOuterClass.ServiceIdList.getDefaultInstance()) return this; + if (serviceIdsBuilder_ == null) { + if (!other.serviceIds_.isEmpty()) { + if (serviceIds_.isEmpty()) { + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServiceIdsIsMutable(); + serviceIds_.addAll(other.serviceIds_); + } + onChanged(); + } + } else { + if (!other.serviceIds_.isEmpty()) { + if (serviceIdsBuilder_.isEmpty()) { + serviceIdsBuilder_.dispose(); + serviceIdsBuilder_ = null; + serviceIds_ = other.serviceIds_; + bitField0_ = (bitField0_ & ~0x00000001); + serviceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServiceIdsFieldBuilder() : null; + } else { + serviceIdsBuilder_.addAllMessages(other.serviceIds_); + } + } + } + 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 { + context.ContextOuterClass.ServiceIdList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceIdList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List serviceIds_ = + java.util.Collections.emptyList(); + private void ensureServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + serviceIds_ = new java.util.ArrayList(serviceIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List getServiceIdsList() { + if (serviceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(serviceIds_); + } else { + return serviceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public int getServiceIdsCount() { + if (serviceIdsBuilder_ == null) { + return serviceIds_.size(); + } else { + return serviceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId getServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); + } else { + return serviceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.set(index, value); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder setServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (serviceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServiceIdsIsMutable(); + serviceIds_.add(index, value); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + serviceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder addAllServiceIds( + java.lang.Iterable values) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, serviceIds_); + onChanged(); + } else { + serviceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder clearServiceIds() { + if (serviceIdsBuilder_ == null) { + serviceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + serviceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public Builder removeServiceIds(int index) { + if (serviceIdsBuilder_ == null) { + ensureServiceIdsIsMutable(); + serviceIds_.remove(index); + onChanged(); + } else { + serviceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + int index) { + if (serviceIdsBuilder_ == null) { + return serviceIds_.get(index); } else { + return serviceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List + getServiceIdsOrBuilderList() { + if (serviceIdsBuilder_ != null) { + return serviceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(serviceIds_); + } + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { + return getServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + int index) { + return getServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId service_ids = 1; + */ + public java.util.List + getServiceIdsBuilderList() { + return getServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdsFieldBuilder() { + if (serviceIdsBuilder_ == null) { + serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + serviceIds_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + serviceIds_ = null; + } + return serviceIdsBuilder_; + } + @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:context.ServiceIdList) + } + + // @@protoc_insertion_point(class_scope:context.ServiceIdList) + private static final context.ContextOuterClass.ServiceIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceIdList(); + } + + public static context.ContextOuterClass.ServiceIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceIdList(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 context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ServiceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .context.Service services = 1; + */ + java.util.List + getServicesList(); + /** + * repeated .context.Service services = 1; + */ + context.ContextOuterClass.Service getServices(int index); + /** + * repeated .context.Service services = 1; + */ + int getServicesCount(); + /** + * repeated .context.Service services = 1; + */ + java.util.List + getServicesOrBuilderList(); + /** + * repeated .context.Service services = 1; + */ + context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( + int index); + } + /** + * Protobuf type {@code context.ServiceList} + */ + public static final class ServiceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ServiceList) + ServiceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceList.newBuilder() to construct. + private ServiceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ServiceList() { + services_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ServiceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServiceList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdsFieldBuilder() { - if (topologyIdsBuilder_ == null) { - topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - topologyIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - topologyIds_ = null; + 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)) { + services_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + services_.add( + input.readMessage(context.ContextOuterClass.Service.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } } - return topologyIdsBuilder_; + } 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)) { + services_ = java.util.Collections.unmodifiableList(services_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } - private java.util.List serviceIds_ = + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + } + + public static final int SERVICES_FIELD_NUMBER = 1; + private java.util.List services_; + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public java.util.List getServicesList() { + return services_; + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public java.util.List + getServicesOrBuilderList() { + return services_; + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public int getServicesCount() { + return services_.size(); + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Service getServices(int index) { + return services_.get(index); + } + /** + * repeated .context.Service services = 1; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( + int index) { + return services_.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 < services_.size(); i++) { + output.writeMessage(1, services_.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 < services_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, services_.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 context.ContextOuterClass.ServiceList)) { + return super.equals(obj); + } + context.ContextOuterClass.ServiceList other = (context.ContextOuterClass.ServiceList) obj; + + if (!getServicesList() + .equals(other.getServicesList())) 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 (getServicesCount() > 0) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getServicesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ServiceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ServiceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ServiceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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 context.ContextOuterClass.ServiceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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 context.ContextOuterClass.ServiceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ServiceList 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(context.ContextOuterClass.ServiceList 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 context.ServiceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ServiceList) + context.ContextOuterClass.ServiceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + } + + // Construct using context.ContextOuterClass.ServiceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getServicesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servicesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceList.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList build() { + context.ContextOuterClass.ServiceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.ServiceList buildPartial() { + context.ContextOuterClass.ServiceList result = new context.ContextOuterClass.ServiceList(this); + int from_bitField0_ = bitField0_; + if (servicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.services_ = services_; + } else { + result.services_ = servicesBuilder_.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 context.ContextOuterClass.ServiceList) { + return mergeFrom((context.ContextOuterClass.ServiceList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(context.ContextOuterClass.ServiceList other) { + if (other == context.ContextOuterClass.ServiceList.getDefaultInstance()) return this; + if (servicesBuilder_ == null) { + if (!other.services_.isEmpty()) { + if (services_.isEmpty()) { + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServicesIsMutable(); + services_.addAll(other.services_); + } + onChanged(); + } + } else { + if (!other.services_.isEmpty()) { + if (servicesBuilder_.isEmpty()) { + servicesBuilder_.dispose(); + servicesBuilder_ = null; + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + servicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getServicesFieldBuilder() : null; + } else { + servicesBuilder_.addAllMessages(other.services_); + } + } + } + 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 { + context.ContextOuterClass.ServiceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ServiceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List services_ = java.util.Collections.emptyList(); - private void ensureServiceIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - serviceIds_ = new java.util.ArrayList(serviceIds_); - bitField0_ |= 0x00000002; + private void ensureServicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + services_ = new java.util.ArrayList(services_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> servicesBuilder_; /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List getServiceIdsList() { - if (serviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceIds_); + public java.util.List getServicesList() { + if (servicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(services_); } else { - return serviceIdsBuilder_.getMessageList(); + return servicesBuilder_.getMessageList(); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public int getServiceIdsCount() { - if (serviceIdsBuilder_ == null) { - return serviceIds_.size(); + public int getServicesCount() { + if (servicesBuilder_ == null) { + return services_.size(); } else { - return serviceIdsBuilder_.getCount(); + return servicesBuilder_.getCount(); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); + public context.ContextOuterClass.Service getServices(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); } else { - return serviceIdsBuilder_.getMessage(index); + return servicesBuilder_.getMessage(index); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder setServices( + int index, context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.set(index, value); + ensureServicesIsMutable(); + services_.set(index, value); onChanged(); } else { - serviceIdsBuilder_.setMessage(index, value); + servicesBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; - */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.set(index, builderForValue.build()); + * repeated .context.Service services = 1; + */ + public Builder setServices( + int index, context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.set(index, builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.setMessage(index, builderForValue.build()); + servicesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder addServices(context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.add(value); + ensureServicesIsMutable(); + services_.add(value); onChanged(); } else { - serviceIdsBuilder_.addMessage(value); + servicesBuilder_.addMessage(value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { + public Builder addServices( + int index, context.ContextOuterClass.Service value) { + if (servicesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureServiceIdsIsMutable(); - serviceIds_.add(index, value); + ensureServicesIsMutable(); + services_.add(index, value); onChanged(); } else { - serviceIdsBuilder_.addMessage(index, value); + servicesBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(builderForValue.build()); + public Builder addServices( + context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.addMessage(builderForValue.build()); + servicesBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(index, builderForValue.build()); + public Builder addServices( + int index, context.ContextOuterClass.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(index, builderForValue.build()); onChanged(); } else { - serviceIdsBuilder_.addMessage(index, builderForValue.build()); + servicesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder addAllServiceIds( - java.lang.Iterable values) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); + public Builder addAllServices( + java.lang.Iterable values) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceIds_); + values, services_); onChanged(); } else { - serviceIdsBuilder_.addAllMessages(values); + servicesBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder clearServiceIds() { - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder clearServices() { + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - serviceIdsBuilder_.clear(); + servicesBuilder_.clear(); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public Builder removeServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.remove(index); + public Builder removeServices(int index) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.remove(index); onChanged(); } else { - serviceIdsBuilder_.remove(index); + servicesBuilder_.remove(index); } return this; } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( + public context.ContextOuterClass.Service.Builder getServicesBuilder( int index) { - return getServiceIdsFieldBuilder().getBuilder(index); + return getServicesFieldBuilder().getBuilder(index); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( + public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); } else { - return serviceIdsBuilder_.getMessageOrBuilder(index); + if (servicesBuilder_ == null) { + return services_.get(index); } else { + return servicesBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List - getServiceIdsOrBuilderList() { - if (serviceIdsBuilder_ != null) { - return serviceIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getServicesOrBuilderList() { + if (servicesBuilder_ != null) { + return servicesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(serviceIds_); + return java.util.Collections.unmodifiableList(services_); } } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { - return getServiceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); + public context.ContextOuterClass.Service.Builder addServicesBuilder() { + return getServicesFieldBuilder().addBuilder( + context.ContextOuterClass.Service.getDefaultInstance()); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( + public context.ContextOuterClass.Service.Builder addServicesBuilder( int index) { - return getServiceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + return getServicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Service.getDefaultInstance()); } /** - * repeated .context.ServiceId service_ids = 3; + * repeated .context.Service services = 1; */ - public java.util.List - getServiceIdsBuilderList() { - return getServiceIdsFieldBuilder().getBuilderList(); + public java.util.List + getServicesBuilderList() { + return getServicesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdsFieldBuilder() { - if (serviceIdsBuilder_ == null) { - serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceIds_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - serviceIds_ = null; - } - return serviceIdsBuilder_; - } - - private context.ContextOuterClass.TeraFlowController controller_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> controllerBuilder_; - /** - * .context.TeraFlowController controller = 4; - * @return Whether the controller field is set. - */ - public boolean hasController() { - return controllerBuilder_ != null || controller_ != null; - } - /** - * .context.TeraFlowController controller = 4; - * @return The controller. - */ - public context.ContextOuterClass.TeraFlowController getController() { - if (controllerBuilder_ == null) { - return controller_ == null ? context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; - } else { - return controllerBuilder_.getMessage(); - } - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder setController(context.ContextOuterClass.TeraFlowController value) { - if (controllerBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - controller_ = value; - onChanged(); - } else { - controllerBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder setController( - context.ContextOuterClass.TeraFlowController.Builder builderForValue) { - if (controllerBuilder_ == null) { - controller_ = builderForValue.build(); - onChanged(); - } else { - controllerBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder mergeController(context.ContextOuterClass.TeraFlowController value) { - if (controllerBuilder_ == null) { - if (controller_ != null) { - controller_ = - context.ContextOuterClass.TeraFlowController.newBuilder(controller_).mergeFrom(value).buildPartial(); - } else { - controller_ = value; - } - onChanged(); - } else { - controllerBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public Builder clearController() { - if (controllerBuilder_ == null) { - controller_ = null; - onChanged(); - } else { - controller_ = null; - controllerBuilder_ = null; - } - - return this; - } - /** - * .context.TeraFlowController controller = 4; - */ - public context.ContextOuterClass.TeraFlowController.Builder getControllerBuilder() { - - onChanged(); - return getControllerFieldBuilder().getBuilder(); - } - /** - * .context.TeraFlowController controller = 4; - */ - public context.ContextOuterClass.TeraFlowControllerOrBuilder getControllerOrBuilder() { - if (controllerBuilder_ != null) { - return controllerBuilder_.getMessageOrBuilder(); - } else { - return controller_ == null ? - context.ContextOuterClass.TeraFlowController.getDefaultInstance() : controller_; - } - } - /** - * .context.TeraFlowController controller = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder> - getControllerFieldBuilder() { - if (controllerBuilder_ == null) { - controllerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TeraFlowController, context.ContextOuterClass.TeraFlowController.Builder, context.ContextOuterClass.TeraFlowControllerOrBuilder>( - getController(), + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> + getServicesFieldBuilder() { + if (servicesBuilder_ == null) { + servicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder>( + services_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - controller_ = null; + services_ = null; } - return controllerBuilder_; + return servicesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -4533,95 +27937,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Context) + // @@protoc_insertion_point(builder_scope:context.ServiceList) } - // @@protoc_insertion_point(class_scope:context.Context) - private static final context.ContextOuterClass.Context DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ServiceList) + private static final context.ContextOuterClass.ServiceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Context(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceList(); } - public static context.ContextOuterClass.Context getDefaultInstance() { + public static context.ContextOuterClass.ServiceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Context parsePartialFrom( + public ServiceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Context(input, extensionRegistry); + return new ServiceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Context getDefaultInstanceForType() { + public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextIdList) + public interface ServiceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ServiceEvent) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ - java.util.List - getContextIdsList(); + boolean hasEvent(); /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ - context.ContextOuterClass.ContextId getContextIds(int index); + context.ContextOuterClass.Event getEvent(); /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - int getContextIdsCount(); + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - java.util.List - getContextIdsOrBuilderList(); + boolean hasServiceId(); /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return The serviceId. */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index); + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 2; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); } /** - * Protobuf type {@code context.ContextIdList} + * Protobuf type {@code context.ServiceEvent} */ - public static final class ContextIdList extends + public static final class ServiceEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextIdList) - ContextIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ServiceEvent) + ServiceEventOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextIdList.newBuilder() to construct. - private ContextIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ServiceEvent.newBuilder() to construct. + private ServiceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextIdList() { - contextIds_ = java.util.Collections.emptyList(); + private ServiceEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextIdList(); + return new ServiceEvent(); } @java.lang.Override @@ -4629,7 +28038,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextIdList( + private ServiceEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4637,7 +28046,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4649,12 +28057,29 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - contextIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); } - contextIds_.add( - input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry)); + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + break; } default: { @@ -4672,64 +28097,73 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - contextIds_ = java.util.Collections.unmodifiableList(contextIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); } - public static final int CONTEXT_IDS_FIELD_NUMBER = 1; - private java.util.List contextIds_; + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ @java.lang.Override - public java.util.List getContextIdsList() { - return contextIds_; + public boolean hasEvent() { + return event_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ @java.lang.Override - public java.util.List - getContextIdsOrBuilderList() { - return contextIds_; + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ @java.lang.Override - public int getContextIdsCount() { - return contextIds_.size(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); } + + public static final int SERVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextIds(int index) { - return contextIds_.get(index); + public boolean hasServiceId() { + return serviceId_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return The serviceId. */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index) { - return contextIds_.get(index); + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); } private byte memoizedIsInitialized = -1; @@ -4746,8 +28180,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < contextIds_.size(); i++) { - output.writeMessage(1, contextIds_.get(i)); + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); } unknownFields.writeTo(output); } @@ -4758,9 +28195,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < contextIds_.size(); i++) { + if (event_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, contextIds_.get(i)); + .computeMessageSize(1, getEvent()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getServiceId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -4772,13 +28213,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextIdList)) { + if (!(obj instanceof context.ContextOuterClass.ServiceEvent)) { return super.equals(obj); } - context.ContextOuterClass.ContextIdList other = (context.ContextOuterClass.ContextIdList) obj; + context.ContextOuterClass.ServiceEvent other = (context.ContextOuterClass.ServiceEvent) obj; - if (!getContextIdsList() - .equals(other.getContextIdsList())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -4790,78 +28239,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getContextIdsCount() > 0) { - hash = (37 * hash) + CONTEXT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getContextIdsList().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ServiceEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ServiceEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent 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 context.ContextOuterClass.ContextIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ServiceEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseDelimitedFrom( + public static context.ContextOuterClass.ServiceEvent 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 context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextIdList parseFrom( + public static context.ContextOuterClass.ServiceEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4874,7 +28327,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ServiceEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4890,26 +28343,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextIdList} + * Protobuf type {@code context.ServiceEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextIdList) - context.ContextOuterClass.ContextIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ServiceEvent) + context.ContextOuterClass.ServiceEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextIdList.class, context.ContextOuterClass.ContextIdList.Builder.class); + context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); } - // Construct using context.ContextOuterClass.ContextIdList.newBuilder() + // Construct using context.ContextOuterClass.ServiceEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4922,17 +28375,22 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getContextIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextIdsBuilder_ == null) { - contextIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + if (eventBuilder_ == null) { + event_ = null; } else { - contextIdsBuilder_.clear(); + event_ = null; + eventBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; } return this; } @@ -4940,17 +28398,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ContextIdList.getDefaultInstance(); + public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ServiceEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextIdList build() { - context.ContextOuterClass.ContextIdList result = buildPartial(); + public context.ContextOuterClass.ServiceEvent build() { + context.ContextOuterClass.ServiceEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4958,17 +28416,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextIdList buildPartial() { - context.ContextOuterClass.ContextIdList result = new context.ContextOuterClass.ContextIdList(this); - int from_bitField0_ = bitField0_; - if (contextIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - contextIds_ = java.util.Collections.unmodifiableList(contextIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.contextIds_ = contextIds_; + public context.ContextOuterClass.ServiceEvent buildPartial() { + context.ContextOuterClass.ServiceEvent result = new context.ContextOuterClass.ServiceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; } else { - result.contextIds_ = contextIdsBuilder_.build(); + result.event_ = eventBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); } onBuilt(); return result; @@ -5008,41 +28466,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextIdList) { - return mergeFrom((context.ContextOuterClass.ContextIdList)other); + if (other instanceof context.ContextOuterClass.ServiceEvent) { + return mergeFrom((context.ContextOuterClass.ServiceEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextIdList other) { - if (other == context.ContextOuterClass.ContextIdList.getDefaultInstance()) return this; - if (contextIdsBuilder_ == null) { - if (!other.contextIds_.isEmpty()) { - if (contextIds_.isEmpty()) { - contextIds_ = other.contextIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureContextIdsIsMutable(); - contextIds_.addAll(other.contextIds_); - } - onChanged(); - } - } else { - if (!other.contextIds_.isEmpty()) { - if (contextIdsBuilder_.isEmpty()) { - contextIdsBuilder_.dispose(); - contextIdsBuilder_ = null; - contextIds_ = other.contextIds_; - bitField0_ = (bitField0_ & ~0x00000001); - contextIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getContextIdsFieldBuilder() : null; - } else { - contextIdsBuilder_.addAllMessages(other.contextIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ServiceEvent other) { + if (other == context.ContextOuterClass.ServiceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -5059,11 +28497,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextIdList parsedMessage = null; + context.ContextOuterClass.ServiceEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ServiceEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -5072,246 +28510,243 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List contextIds_ = - java.util.Collections.emptyList(); - private void ensureContextIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - contextIds_ = new java.util.ArrayList(contextIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdsBuilder_; + private context.ContextOuterClass.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * repeated .context.ContextId context_ids = 1; - */ - public java.util.List getContextIdsList() { - if (contextIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(contextIds_); - } else { - return contextIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return Whether the event field is set. */ - public int getContextIdsCount() { - if (contextIdsBuilder_ == null) { - return contextIds_.size(); - } else { - return contextIdsBuilder_.getCount(); - } + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; + * @return The event. */ - public context.ContextOuterClass.ContextId getContextIds(int index) { - if (contextIdsBuilder_ == null) { - return contextIds_.get(index); + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } else { - return contextIdsBuilder_.getMessage(index); + return eventBuilder_.getMessage(); } } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder setContextIds( - int index, context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureContextIdsIsMutable(); - contextIds_.set(index, value); + event_ = value; onChanged(); } else { - contextIdsBuilder_.setMessage(index, value); + eventBuilder_.setMessage(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder setContextIds( - int index, context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.set(index, builderForValue.build()); + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); onChanged(); } else { - contextIdsBuilder_.setMessage(index, builderForValue.build()); + eventBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds(context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + } else { + event_ = value; } - ensureContextIdsIsMutable(); - contextIds_.add(value); onChanged(); } else { - contextIdsBuilder_.addMessage(value); + eventBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - int index, context.ContextOuterClass.ContextId value) { - if (contextIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContextIdsIsMutable(); - contextIds_.add(index, value); + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; onChanged(); } else { - contextIdsBuilder_.addMessage(index, value); + event_ = null; + eventBuilder_ = null; } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * .context.Event event = 1; + */ + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); } else { - contextIdsBuilder_.addMessage(builderForValue.build()); + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; } - return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.Event event = 1; */ - public Builder addContextIds( - int index, context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.add(index, builderForValue.build()); - onChanged(); - } else { - contextIdsBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), + getParentForChildren(), + isClean()); + event_ = null; } - return this; + return eventBuilder_; } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - public Builder addAllContextIds( - java.lang.Iterable values) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, contextIds_); - onChanged(); + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } else { - contextIdsBuilder_.addAllMessages(values); + return serviceIdBuilder_.getMessage(); } - return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public Builder clearContextIds() { - if (contextIdsBuilder_ == null) { - contextIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; onChanged(); } else { - contextIdsBuilder_.clear(); + serviceIdBuilder_.setMessage(value); } + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public Builder removeContextIds(int index) { - if (contextIdsBuilder_ == null) { - ensureContextIdsIsMutable(); - contextIds_.remove(index); + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); onChanged(); } else { - contextIdsBuilder_.remove(index); + serviceIdBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.ContextId context_ids = 1; - */ - public context.ContextOuterClass.ContextId.Builder getContextIdsBuilder( - int index) { - return getContextIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdsOrBuilder( - int index) { - if (contextIdsBuilder_ == null) { - return contextIds_.get(index); } else { - return contextIdsBuilder_.getMessageOrBuilder(index); + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); } + + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public java.util.List - getContextIdsOrBuilderList() { - if (contextIdsBuilder_ != null) { - return contextIdsBuilder_.getMessageOrBuilderList(); + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(contextIds_); + serviceId_ = null; + serviceIdBuilder_ = null; } + + return this; } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder() { - return getContextIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ContextId.getDefaultInstance()); + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.ContextId.Builder addContextIdsBuilder( - int index) { - return getContextIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ContextId.getDefaultInstance()); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } } /** - * repeated .context.ContextId context_ids = 1; + * .context.ServiceId service_id = 2; */ - public java.util.List - getContextIdsBuilderList() { - return getContextIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdsFieldBuilder() { - if (contextIdsBuilder_ == null) { - contextIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - contextIds_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), getParentForChildren(), isClean()); - contextIds_ = null; + serviceId_ = null; } - return contextIdsBuilder_; + return serviceIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -5326,95 +28761,104 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextIdList) + // @@protoc_insertion_point(builder_scope:context.ServiceEvent) } - // @@protoc_insertion_point(class_scope:context.ContextIdList) - private static final context.ContextOuterClass.ContextIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ServiceEvent) + private static final context.ContextOuterClass.ServiceEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceEvent(); } - public static context.ContextOuterClass.ContextIdList getDefaultInstance() { + public static context.ContextOuterClass.ServiceEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextIdList parsePartialFrom( + public ServiceEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextIdList(input, extensionRegistry); + return new ServiceEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextList) + public interface SliceIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceId) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. */ - java.util.List - getContextsList(); + boolean hasContextId(); /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ - context.ContextOuterClass.Context getContexts(int index); + context.ContextOuterClass.ContextId getContextId(); /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - int getContextsCount(); + context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ - java.util.List - getContextsOrBuilderList(); + boolean hasSliceUuid(); /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. */ - context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index); + context.ContextOuterClass.Uuid getSliceUuid(); + /** + * .context.Uuid slice_uuid = 2; + */ + context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder(); } /** - * Protobuf type {@code context.ContextList} + *
+   * ----- Slice ---------------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.SliceId} */ - public static final class ContextList extends + public static final class SliceId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextList) - ContextListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceId) + SliceIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextList.newBuilder() to construct. - private ContextList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceId.newBuilder() to construct. + private SliceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextList() { - contexts_ = java.util.Collections.emptyList(); + private SliceId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextList(); + return new SliceId(); } @java.lang.Override @@ -5422,7 +28866,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextList( + private SliceId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5430,7 +28874,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -5442,12 +28885,29 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - contexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.ContextId.Builder subBuilder = null; + if (contextId_ != null) { + subBuilder = contextId_.toBuilder(); } - contexts_.add( - input.readMessage(context.ContextOuterClass.Context.parser(), extensionRegistry)); + contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contextId_); + contextId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (sliceUuid_ != null) { + subBuilder = sliceUuid_.toBuilder(); + } + sliceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceUuid_); + sliceUuid_ = subBuilder.buildPartial(); + } + break; } default: { @@ -5465,64 +28925,73 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - contexts_ = java.util.Collections.unmodifiableList(contexts_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } + public static final int CONTEXT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ContextId contextId_; + /** + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + public boolean hasContextId() { + return contextId_ != null; } - - public static final int CONTEXTS_FIELD_NUMBER = 1; - private java.util.List contexts_; /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ @java.lang.Override - public java.util.List getContextsList() { - return contexts_; + public context.ContextOuterClass.ContextId getContextId() { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ @java.lang.Override - public java.util.List - getContextsOrBuilderList() { - return contexts_; + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + return getContextId(); } + + public static final int SLICE_UUID_FIELD_NUMBER = 2; + private context.ContextOuterClass.Uuid sliceUuid_; /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ @java.lang.Override - public int getContextsCount() { - return contexts_.size(); + public boolean hasSliceUuid() { + return sliceUuid_ != null; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. */ @java.lang.Override - public context.ContextOuterClass.Context getContexts(int index) { - return contexts_.get(index); + public context.ContextOuterClass.Uuid getSliceUuid() { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index) { - return contexts_.get(index); + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + return getSliceUuid(); } private byte memoizedIsInitialized = -1; @@ -5539,8 +29008,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < contexts_.size(); i++) { - output.writeMessage(1, contexts_.get(i)); + if (contextId_ != null) { + output.writeMessage(1, getContextId()); + } + if (sliceUuid_ != null) { + output.writeMessage(2, getSliceUuid()); } unknownFields.writeTo(output); } @@ -5551,9 +29023,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < contexts_.size(); i++) { + if (contextId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, contexts_.get(i)); + .computeMessageSize(1, getContextId()); + } + if (sliceUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5565,13 +29041,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextList)) { + if (!(obj instanceof context.ContextOuterClass.SliceId)) { return super.equals(obj); } - context.ContextOuterClass.ContextList other = (context.ContextOuterClass.ContextList) obj; + context.ContextOuterClass.SliceId other = (context.ContextOuterClass.SliceId) obj; - if (!getContextsList() - .equals(other.getContextsList())) return false; + if (hasContextId() != other.hasContextId()) return false; + if (hasContextId()) { + if (!getContextId() + .equals(other.getContextId())) return false; + } + if (hasSliceUuid() != other.hasSliceUuid()) return false; + if (hasSliceUuid()) { + if (!getSliceUuid() + .equals(other.getSliceUuid())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -5583,78 +29067,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getContextsCount() > 0) { - hash = (37 * hash) + CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getContextsList().hashCode(); + if (hasContextId()) { + hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + getContextId().hashCode(); + } + if (hasSliceUuid()) { + hash = (37 * hash) + SLICE_UUID_FIELD_NUMBER; + hash = (53 * hash) + getSliceUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId 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 context.ContextOuterClass.ContextList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseDelimitedFrom( + public static context.ContextOuterClass.SliceId 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 context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextList parseFrom( + public static context.ContextOuterClass.SliceId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5667,7 +29155,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -5683,26 +29171,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextList} + *
+     * ----- Slice ---------------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.SliceId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextList) - context.ContextOuterClass.ContextListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceId) + context.ContextOuterClass.SliceIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextList.class, context.ContextOuterClass.ContextList.Builder.class); + context.ContextOuterClass.SliceId.class, context.ContextOuterClass.SliceId.Builder.class); } - // Construct using context.ContextOuterClass.ContextList.newBuilder() + // Construct using context.ContextOuterClass.SliceId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -5715,17 +29207,22 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getContextsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (contextsBuilder_ == null) { - contexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + if (contextIdBuilder_ == null) { + contextId_ = null; } else { - contextsBuilder_.clear(); + contextId_ = null; + contextIdBuilder_ = null; + } + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + } else { + sliceUuid_ = null; + sliceUuidBuilder_ = null; } return this; } @@ -5733,17 +29230,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextList getDefaultInstanceForType() { - return context.ContextOuterClass.ContextList.getDefaultInstance(); + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { + return context.ContextOuterClass.SliceId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextList build() { - context.ContextOuterClass.ContextList result = buildPartial(); + public context.ContextOuterClass.SliceId build() { + context.ContextOuterClass.SliceId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -5751,17 +29248,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextList buildPartial() { - context.ContextOuterClass.ContextList result = new context.ContextOuterClass.ContextList(this); - int from_bitField0_ = bitField0_; - if (contextsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - contexts_ = java.util.Collections.unmodifiableList(contexts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.contexts_ = contexts_; + public context.ContextOuterClass.SliceId buildPartial() { + context.ContextOuterClass.SliceId result = new context.ContextOuterClass.SliceId(this); + if (contextIdBuilder_ == null) { + result.contextId_ = contextId_; } else { - result.contexts_ = contextsBuilder_.build(); + result.contextId_ = contextIdBuilder_.build(); + } + if (sliceUuidBuilder_ == null) { + result.sliceUuid_ = sliceUuid_; + } else { + result.sliceUuid_ = sliceUuidBuilder_.build(); } onBuilt(); return result; @@ -5801,41 +29298,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextList) { - return mergeFrom((context.ContextOuterClass.ContextList)other); + if (other instanceof context.ContextOuterClass.SliceId) { + return mergeFrom((context.ContextOuterClass.SliceId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextList other) { - if (other == context.ContextOuterClass.ContextList.getDefaultInstance()) return this; - if (contextsBuilder_ == null) { - if (!other.contexts_.isEmpty()) { - if (contexts_.isEmpty()) { - contexts_ = other.contexts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureContextsIsMutable(); - contexts_.addAll(other.contexts_); - } - onChanged(); - } - } else { - if (!other.contexts_.isEmpty()) { - if (contextsBuilder_.isEmpty()) { - contextsBuilder_.dispose(); - contextsBuilder_ = null; - contexts_ = other.contexts_; - bitField0_ = (bitField0_ & ~0x00000001); - contextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getContextsFieldBuilder() : null; - } else { - contextsBuilder_.addAllMessages(other.contexts_); - } - } + public Builder mergeFrom(context.ContextOuterClass.SliceId other) { + if (other == context.ContextOuterClass.SliceId.getDefaultInstance()) return this; + if (other.hasContextId()) { + mergeContextId(other.getContextId()); + } + if (other.hasSliceUuid()) { + mergeSliceUuid(other.getSliceUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -5852,11 +29329,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ContextList parsedMessage = null; + context.ContextOuterClass.SliceId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -5865,246 +29342,243 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List contexts_ = - java.util.Collections.emptyList(); - private void ensureContextsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - contexts_ = new java.util.ArrayList(contexts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> contextsBuilder_; + private context.ContextOuterClass.ContextId contextId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; /** - * repeated .context.Context contexts = 1; - */ - public java.util.List getContextsList() { - if (contextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(contexts_); - } else { - return contextsBuilder_.getMessageList(); - } - } - /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return Whether the contextId field is set. */ - public int getContextsCount() { - if (contextsBuilder_ == null) { - return contexts_.size(); - } else { - return contextsBuilder_.getCount(); - } + public boolean hasContextId() { + return contextIdBuilder_ != null || contextId_ != null; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; + * @return The contextId. */ - public context.ContextOuterClass.Context getContexts(int index) { - if (contextsBuilder_ == null) { - return contexts_.get(index); + public context.ContextOuterClass.ContextId getContextId() { + if (contextIdBuilder_ == null) { + return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } else { - return contextsBuilder_.getMessage(index); + return contextIdBuilder_.getMessage(); } } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder setContexts( - int index, context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { + public Builder setContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureContextsIsMutable(); - contexts_.set(index, value); + contextId_ = value; onChanged(); } else { - contextsBuilder_.setMessage(index, value); + contextIdBuilder_.setMessage(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder setContexts( - int index, context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.set(index, builderForValue.build()); + public Builder setContextId( + context.ContextOuterClass.ContextId.Builder builderForValue) { + if (contextIdBuilder_ == null) { + contextId_ = builderForValue.build(); onChanged(); } else { - contextsBuilder_.setMessage(index, builderForValue.build()); + contextIdBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts(context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeContextId(context.ContextOuterClass.ContextId value) { + if (contextIdBuilder_ == null) { + if (contextId_ != null) { + contextId_ = + context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + } else { + contextId_ = value; } - ensureContextsIsMutable(); - contexts_.add(value); onChanged(); } else { - contextsBuilder_.addMessage(value); + contextIdBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - int index, context.ContextOuterClass.Context value) { - if (contextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureContextsIsMutable(); - contexts_.add(index, value); + public Builder clearContextId() { + if (contextIdBuilder_ == null) { + contextId_ = null; onChanged(); } else { - contextsBuilder_.addMessage(index, value); + contextId_ = null; + contextIdBuilder_ = null; } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + + onChanged(); + return getContextIdFieldBuilder().getBuilder(); + } + /** + * .context.ContextId context_id = 1; + */ + public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { + if (contextIdBuilder_ != null) { + return contextIdBuilder_.getMessageOrBuilder(); } else { - contextsBuilder_.addMessage(builderForValue.build()); + return contextId_ == null ? + context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; } - return this; } /** - * repeated .context.Context contexts = 1; + * .context.ContextId context_id = 1; */ - public Builder addContexts( - int index, context.ContextOuterClass.Context.Builder builderForValue) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.add(index, builderForValue.build()); - onChanged(); - } else { - contextsBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> + getContextIdFieldBuilder() { + if (contextIdBuilder_ == null) { + contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( + getContextId(), + getParentForChildren(), + isClean()); + contextId_ = null; } - return this; + return contextIdBuilder_; } + + private context.ContextOuterClass.Uuid sliceUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> sliceUuidBuilder_; /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; + * @return Whether the sliceUuid field is set. */ - public Builder addAllContexts( - java.lang.Iterable values) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, contexts_); - onChanged(); + public boolean hasSliceUuid() { + return sliceUuidBuilder_ != null || sliceUuid_ != null; + } + /** + * .context.Uuid slice_uuid = 2; + * @return The sliceUuid. + */ + public context.ContextOuterClass.Uuid getSliceUuid() { + if (sliceUuidBuilder_ == null) { + return sliceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; } else { - contextsBuilder_.addAllMessages(values); + return sliceUuidBuilder_.getMessage(); } - return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public Builder clearContexts() { - if (contextsBuilder_ == null) { - contexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceUuid_ = value; onChanged(); } else { - contextsBuilder_.clear(); + sliceUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public Builder removeContexts(int index) { - if (contextsBuilder_ == null) { - ensureContextsIsMutable(); - contexts_.remove(index); + public Builder setSliceUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = builderForValue.build(); onChanged(); } else { - contextsBuilder_.remove(index); + sliceUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.Context contexts = 1; - */ - public context.ContextOuterClass.Context.Builder getContextsBuilder( - int index) { - return getContextsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.ContextOrBuilder getContextsOrBuilder( - int index) { - if (contextsBuilder_ == null) { - return contexts_.get(index); } else { - return contextsBuilder_.getMessageOrBuilder(index); + public Builder mergeSliceUuid(context.ContextOuterClass.Uuid value) { + if (sliceUuidBuilder_ == null) { + if (sliceUuid_ != null) { + sliceUuid_ = + context.ContextOuterClass.Uuid.newBuilder(sliceUuid_).mergeFrom(value).buildPartial(); + } else { + sliceUuid_ = value; + } + onChanged(); + } else { + sliceUuidBuilder_.mergeFrom(value); } + + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public java.util.List - getContextsOrBuilderList() { - if (contextsBuilder_ != null) { - return contextsBuilder_.getMessageOrBuilderList(); + public Builder clearSliceUuid() { + if (sliceUuidBuilder_ == null) { + sliceUuid_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(contexts_); + sliceUuid_ = null; + sliceUuidBuilder_ = null; } + + return this; } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.Context.Builder addContextsBuilder() { - return getContextsFieldBuilder().addBuilder( - context.ContextOuterClass.Context.getDefaultInstance()); + public context.ContextOuterClass.Uuid.Builder getSliceUuidBuilder() { + + onChanged(); + return getSliceUuidFieldBuilder().getBuilder(); } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public context.ContextOuterClass.Context.Builder addContextsBuilder( - int index) { - return getContextsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Context.getDefaultInstance()); + public context.ContextOuterClass.UuidOrBuilder getSliceUuidOrBuilder() { + if (sliceUuidBuilder_ != null) { + return sliceUuidBuilder_.getMessageOrBuilder(); + } else { + return sliceUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : sliceUuid_; + } } /** - * repeated .context.Context contexts = 1; + * .context.Uuid slice_uuid = 2; */ - public java.util.List - getContextsBuilderList() { - return getContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder> - getContextsFieldBuilder() { - if (contextsBuilder_ == null) { - contextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Context, context.ContextOuterClass.Context.Builder, context.ContextOuterClass.ContextOrBuilder>( - contexts_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSliceUuidFieldBuilder() { + if (sliceUuidBuilder_ == null) { + sliceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSliceUuid(), getParentForChildren(), isClean()); - contexts_ = null; + sliceUuid_ = null; } - return contextsBuilder_; + return sliceUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -6119,100 +29593,245 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ContextList) + // @@protoc_insertion_point(builder_scope:context.SliceId) } - // @@protoc_insertion_point(class_scope:context.ContextList) - private static final context.ContextOuterClass.ContextList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceId) + private static final context.ContextOuterClass.SliceId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceId(); } - public static context.ContextOuterClass.ContextList getDefaultInstance() { + public static context.ContextOuterClass.SliceId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ContextList parsePartialFrom( + public SliceId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextList(input, extensionRegistry); + return new SliceId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ContextList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ContextEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ContextEvent) + public interface SliceOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Slice) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. */ - boolean hasEvent(); + boolean hasSliceId(); /** - * .context.Event event = 1; - * @return The event. + * .context.SliceId slice_id = 1; + * @return The sliceId. */ - context.ContextOuterClass.Event getEvent(); + context.ContextOuterClass.SliceId getSliceId(); /** - * .context.Event event = 1; + * .context.SliceId slice_id = 1; */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - boolean hasContextId(); + java.util.List + getSliceEndpointIdsList(); /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - context.ContextOuterClass.ContextId getContextId(); + context.ContextOuterClass.EndPointId getSliceEndpointIds(int index); /** - * .context.ContextId context_id = 2; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + int getSliceEndpointIdsCount(); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + java.util.List + getSliceEndpointIdsOrBuilderList(); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.Constraint slice_constraints = 3; + */ + java.util.List + getSliceConstraintsList(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + context.ContextOuterClass.Constraint getSliceConstraints(int index); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + int getSliceConstraintsCount(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + java.util.List + getSliceConstraintsOrBuilderList(); + /** + * repeated .context.Constraint slice_constraints = 3; + */ + context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index); + + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + java.util.List + getSliceServiceIdsList(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + context.ContextOuterClass.ServiceId getSliceServiceIds(int index); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + int getSliceServiceIdsCount(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + java.util.List + getSliceServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index); + + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + java.util.List + getSliceSubsliceIdsList(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + context.ContextOuterClass.SliceId getSliceSubsliceIds(int index); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + int getSliceSubsliceIdsCount(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + java.util.List + getSliceSubsliceIdsOrBuilderList(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index); + + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + boolean hasSliceStatus(); + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatus getSliceStatus(); + /** + * .context.SliceStatus slice_status = 6; + */ + context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder(); + + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + boolean hasSliceConfig(); + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + context.ContextOuterClass.SliceConfig getSliceConfig(); + /** + * .context.SliceConfig slice_config = 7; + */ + context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder(); + + /** + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. + */ + boolean hasSliceOwner(); + /** + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. + */ + context.ContextOuterClass.SliceOwner getSliceOwner(); + /** + * .context.SliceOwner slice_owner = 8; + */ + context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder(); + + /** + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * .context.Timestamp timestamp = 9; + * @return The timestamp. + */ + context.ContextOuterClass.Timestamp getTimestamp(); + /** + * .context.Timestamp timestamp = 9; + */ + context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder(); } /** - * Protobuf type {@code context.ContextEvent} + * Protobuf type {@code context.Slice} */ - public static final class ContextEvent extends + public static final class Slice extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ContextEvent) - ContextEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.Slice) + SliceOrBuilder { private static final long serialVersionUID = 0L; - // Use ContextEvent.newBuilder() to construct. - private ContextEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Slice.newBuilder() to construct. + private Slice(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ContextEvent() { + private Slice() { + sliceEndpointIds_ = java.util.Collections.emptyList(); + sliceConstraints_ = java.util.Collections.emptyList(); + sliceServiceIds_ = java.util.Collections.emptyList(); + sliceSubsliceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ContextEvent(); + return new Slice(); } @java.lang.Override @@ -6220,7 +29839,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ContextEvent( + private Slice( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6228,6 +29847,7 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -6239,27 +29859,102 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); } break; } case 18: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + sliceEndpointIds_.add( + input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + sliceConstraints_.add( + input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + sliceServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + sliceSubsliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); + break; + } + case 50: { + context.ContextOuterClass.SliceStatus.Builder subBuilder = null; + if (sliceStatus_ != null) { + subBuilder = sliceStatus_.toBuilder(); + } + sliceStatus_ = input.readMessage(context.ContextOuterClass.SliceStatus.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(sliceStatus_); + sliceStatus_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.SliceConfig.Builder subBuilder = null; + if (sliceConfig_ != null) { + subBuilder = sliceConfig_.toBuilder(); + } + sliceConfig_ = input.readMessage(context.ContextOuterClass.SliceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceConfig_); + sliceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + context.ContextOuterClass.SliceOwner.Builder subBuilder = null; + if (sliceOwner_ != null) { + subBuilder = sliceOwner_.toBuilder(); + } + sliceOwner_ = input.readMessage(context.ContextOuterClass.SliceOwner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceOwner_); + sliceOwner_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + context.ContextOuterClass.Timestamp.Builder subBuilder = null; + if (timestamp_ != null) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(context.ContextOuterClass.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); } break; @@ -6279,73 +29974,323 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; + public static final int SLICE_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.SliceId sliceId_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. */ @java.lang.Override - public boolean hasEvent() { - return event_ != null; + public boolean hasSliceId() { + return sliceId_ != null; } /** - * .context.Event event = 1; - * @return The event. + * .context.SliceId slice_id = 1; + * @return The sliceId. */ @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; } /** - * .context.Event event = 1; + * .context.SliceId slice_id = 1; */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); } - public static final int CONTEXT_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ContextId contextId_; + public static final int SLICE_ENDPOINT_IDS_FIELD_NUMBER = 2; + private java.util.List sliceEndpointIds_; /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; + public java.util.List getSliceEndpointIdsList() { + return sliceEndpointIds_; } /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public java.util.List + getSliceEndpointIdsOrBuilderList() { + return sliceEndpointIds_; } /** - * .context.ContextId context_id = 2; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); + public int getSliceEndpointIdsCount() { + return sliceEndpointIds_.size(); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + return sliceEndpointIds_.get(index); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + return sliceEndpointIds_.get(index); + } + + public static final int SLICE_CONSTRAINTS_FIELD_NUMBER = 3; + private java.util.List sliceConstraints_; + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public java.util.List getSliceConstraintsList() { + return sliceConstraints_; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public java.util.List + getSliceConstraintsOrBuilderList() { + return sliceConstraints_; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public int getSliceConstraintsCount() { + return sliceConstraints_.size(); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + return sliceConstraints_.get(index); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + return sliceConstraints_.get(index); + } + + public static final int SLICE_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List sliceServiceIds_; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public java.util.List getSliceServiceIdsList() { + return sliceServiceIds_; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public java.util.List + getSliceServiceIdsOrBuilderList() { + return sliceServiceIds_; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public int getSliceServiceIdsCount() { + return sliceServiceIds_.size(); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + return sliceServiceIds_.get(index); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + return sliceServiceIds_.get(index); + } + + public static final int SLICE_SUBSLICE_IDS_FIELD_NUMBER = 5; + private java.util.List sliceSubsliceIds_; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public java.util.List getSliceSubsliceIdsList() { + return sliceSubsliceIds_; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public java.util.List + getSliceSubsliceIdsOrBuilderList() { + return sliceSubsliceIds_; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public int getSliceSubsliceIdsCount() { + return sliceSubsliceIds_.size(); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + return sliceSubsliceIds_.get(index); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + return sliceSubsliceIds_.get(index); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceStatus sliceStatus_; + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + @java.lang.Override + public boolean hasSliceStatus() { + return sliceStatus_ != null; + } + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatus getSliceStatus() { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } + /** + * .context.SliceStatus slice_status = 6; + */ + @java.lang.Override + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + return getSliceStatus(); + } + + public static final int SLICE_CONFIG_FIELD_NUMBER = 7; + private context.ContextOuterClass.SliceConfig sliceConfig_; + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + @java.lang.Override + public boolean hasSliceConfig() { + return sliceConfig_ != null; + } + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + @java.lang.Override + public context.ContextOuterClass.SliceConfig getSliceConfig() { + return sliceConfig_ == null ? context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; + } + /** + * .context.SliceConfig slice_config = 7; + */ + @java.lang.Override + public context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder() { + return getSliceConfig(); + } + + public static final int SLICE_OWNER_FIELD_NUMBER = 8; + private context.ContextOuterClass.SliceOwner sliceOwner_; + /** + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. + */ + @java.lang.Override + public boolean hasSliceOwner() { + return sliceOwner_ != null; + } + /** + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. + */ + @java.lang.Override + public context.ContextOuterClass.SliceOwner getSliceOwner() { + return sliceOwner_ == null ? context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; + } + /** + * .context.SliceOwner slice_owner = 8; + */ + @java.lang.Override + public context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder() { + return getSliceOwner(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private context.ContextOuterClass.Timestamp timestamp_; + /** + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return timestamp_ != null; + } + /** + * .context.Timestamp timestamp = 9; + * @return The timestamp. + */ + @java.lang.Override + public context.ContextOuterClass.Timestamp getTimestamp() { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * .context.Timestamp timestamp = 9; + */ + @java.lang.Override + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + return getTimestamp(); } private byte memoizedIsInitialized = -1; @@ -6362,11 +30307,32 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (sliceId_ != null) { + output.writeMessage(1, getSliceId()); } - if (contextId_ != null) { - output.writeMessage(2, getContextId()); + for (int i = 0; i < sliceEndpointIds_.size(); i++) { + output.writeMessage(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + output.writeMessage(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + output.writeMessage(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + output.writeMessage(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + output.writeMessage(6, getSliceStatus()); + } + if (sliceConfig_ != null) { + output.writeMessage(7, getSliceConfig()); + } + if (sliceOwner_ != null) { + output.writeMessage(8, getSliceOwner()); + } + if (timestamp_ != null) { + output.writeMessage(9, getTimestamp()); } unknownFields.writeTo(output); } @@ -6377,13 +30343,41 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (sliceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeMessageSize(1, getSliceId()); } - if (contextId_ != null) { + for (int i = 0; i < sliceEndpointIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getContextId()); + .computeMessageSize(2, sliceEndpointIds_.get(i)); + } + for (int i = 0; i < sliceConstraints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, sliceConstraints_.get(i)); + } + for (int i = 0; i < sliceServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, sliceServiceIds_.get(i)); + } + for (int i = 0; i < sliceSubsliceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, sliceSubsliceIds_.get(i)); + } + if (sliceStatus_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceStatus()); + } + if (sliceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSliceConfig()); + } + if (sliceOwner_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSliceOwner()); + } + if (timestamp_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getTimestamp()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -6395,20 +30389,43 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ContextEvent)) { + if (!(obj instanceof context.ContextOuterClass.Slice)) { return super.equals(obj); } - context.ContextOuterClass.ContextEvent other = (context.ContextOuterClass.ContextEvent) obj; - - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + context.ContextOuterClass.Slice other = (context.ContextOuterClass.Slice) obj; + + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; + } + if (!getSliceEndpointIdsList() + .equals(other.getSliceEndpointIdsList())) return false; + if (!getSliceConstraintsList() + .equals(other.getSliceConstraintsList())) return false; + if (!getSliceServiceIdsList() + .equals(other.getSliceServiceIdsList())) return false; + if (!getSliceSubsliceIdsList() + .equals(other.getSliceSubsliceIdsList())) return false; + if (hasSliceStatus() != other.hasSliceStatus()) return false; + if (hasSliceStatus()) { + if (!getSliceStatus() + .equals(other.getSliceStatus())) return false; + } + if (hasSliceConfig() != other.hasSliceConfig()) return false; + if (hasSliceConfig()) { + if (!getSliceConfig() + .equals(other.getSliceConfig())) return false; + } + if (hasSliceOwner() != other.hasSliceOwner()) return false; + if (hasSliceOwner()) { + if (!getSliceOwner() + .equals(other.getSliceOwner())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -6421,82 +30438,110 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); } - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + if (getSliceEndpointIdsCount() > 0) { + hash = (37 * hash) + SLICE_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceEndpointIdsList().hashCode(); + } + if (getSliceConstraintsCount() > 0) { + hash = (37 * hash) + SLICE_CONSTRAINTS_FIELD_NUMBER; + hash = (53 * hash) + getSliceConstraintsList().hashCode(); + } + if (getSliceServiceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceServiceIdsList().hashCode(); + } + if (getSliceSubsliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_SUBSLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceSubsliceIdsList().hashCode(); + } + if (hasSliceStatus()) { + hash = (37 * hash) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getSliceStatus().hashCode(); + } + if (hasSliceConfig()) { + hash = (37 * hash) + SLICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getSliceConfig().hashCode(); + } + if (hasSliceOwner()) { + hash = (37 * hash) + SLICE_OWNER_FIELD_NUMBER; + hash = (53 * hash) + getSliceOwner().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom(byte[] data) + public static context.ContextOuterClass.Slice parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ContextEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Slice parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice 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 context.ContextOuterClass.ContextEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Slice parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseDelimitedFrom( + public static context.ContextOuterClass.Slice 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 context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ContextEvent parseFrom( + public static context.ContextOuterClass.Slice parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6509,7 +30554,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ContextEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.Slice prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -6525,26 +30570,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ContextEvent} + * Protobuf type {@code context.Slice} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ContextEvent) - context.ContextOuterClass.ContextEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Slice) + context.ContextOuterClass.SliceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ContextEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Slice_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ContextEvent.class, context.ContextOuterClass.ContextEvent.Builder.class); + context.ContextOuterClass.Slice.class, context.ContextOuterClass.Slice.Builder.class); } - // Construct using context.ContextOuterClass.ContextEvent.newBuilder() + // Construct using context.ContextOuterClass.Slice.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6557,22 +30602,68 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getSliceEndpointIdsFieldBuilder(); + getSliceConstraintsFieldBuilder(); + getSliceServiceIdsFieldBuilder(); + getSliceSubsliceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; + if (sliceIdBuilder_ == null) { + sliceId_ = null; } else { - event_ = null; - eventBuilder_ = null; + sliceId_ = null; + sliceIdBuilder_ = null; } - if (contextIdBuilder_ == null) { - contextId_ = null; + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceEndpointIdsBuilder_.clear(); + } + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + sliceConstraintsBuilder_.clear(); + } + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + sliceServiceIdsBuilder_.clear(); + } + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + if (sliceConfigBuilder_ == null) { + sliceConfig_ = null; + } else { + sliceConfig_ = null; + sliceConfigBuilder_ = null; + } + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = null; + } else { + sliceOwner_ = null; + sliceOwnerBuilder_ = null; + } + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestamp_ = null; + timestampBuilder_ = null; } return this; } @@ -6580,17 +30671,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ContextEvent_descriptor; + return context.ContextOuterClass.internal_static_context_Slice_descriptor; } @java.lang.Override - public context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { - return context.ContextOuterClass.ContextEvent.getDefaultInstance(); + public context.ContextOuterClass.Slice getDefaultInstanceForType() { + return context.ContextOuterClass.Slice.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ContextEvent build() { - context.ContextOuterClass.ContextEvent result = buildPartial(); + public context.ContextOuterClass.Slice build() { + context.ContextOuterClass.Slice result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6598,17 +30689,69 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ContextEvent buildPartial() { - context.ContextOuterClass.ContextEvent result = new context.ContextOuterClass.ContextEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; + public context.ContextOuterClass.Slice buildPartial() { + context.ContextOuterClass.Slice result = new context.ContextOuterClass.Slice(this); + int from_bitField0_ = bitField0_; + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; } else { - result.event_ = eventBuilder_.build(); + result.sliceId_ = sliceIdBuilder_.build(); } - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + if (sliceEndpointIdsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = java.util.Collections.unmodifiableList(sliceEndpointIds_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sliceEndpointIds_ = sliceEndpointIds_; } else { - result.contextId_ = contextIdBuilder_.build(); + result.sliceEndpointIds_ = sliceEndpointIdsBuilder_.build(); + } + if (sliceConstraintsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = java.util.Collections.unmodifiableList(sliceConstraints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.sliceConstraints_ = sliceConstraints_; + } else { + result.sliceConstraints_ = sliceConstraintsBuilder_.build(); + } + if (sliceServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = java.util.Collections.unmodifiableList(sliceServiceIds_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.sliceServiceIds_ = sliceServiceIds_; + } else { + result.sliceServiceIds_ = sliceServiceIdsBuilder_.build(); + } + if (sliceSubsliceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = java.util.Collections.unmodifiableList(sliceSubsliceIds_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.sliceSubsliceIds_ = sliceSubsliceIds_; + } else { + result.sliceSubsliceIds_ = sliceSubsliceIdsBuilder_.build(); + } + if (sliceStatusBuilder_ == null) { + result.sliceStatus_ = sliceStatus_; + } else { + result.sliceStatus_ = sliceStatusBuilder_.build(); + } + if (sliceConfigBuilder_ == null) { + result.sliceConfig_ = sliceConfig_; + } else { + result.sliceConfig_ = sliceConfigBuilder_.build(); + } + if (sliceOwnerBuilder_ == null) { + result.sliceOwner_ = sliceOwner_; + } else { + result.sliceOwner_ = sliceOwnerBuilder_.build(); + } + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); } onBuilt(); return result; @@ -6648,1119 +30791,1718 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ContextEvent) { - return mergeFrom((context.ContextOuterClass.ContextEvent)other); + if (other instanceof context.ContextOuterClass.Slice) { + return mergeFrom((context.ContextOuterClass.Slice)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ContextEvent other) { - if (other == context.ContextOuterClass.ContextEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.Slice other) { + if (other == context.ContextOuterClass.Slice.getDefaultInstance()) return this; + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + if (sliceEndpointIdsBuilder_ == null) { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIds_.isEmpty()) { + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.addAll(other.sliceEndpointIds_); + } + onChanged(); + } + } else { + if (!other.sliceEndpointIds_.isEmpty()) { + if (sliceEndpointIdsBuilder_.isEmpty()) { + sliceEndpointIdsBuilder_.dispose(); + sliceEndpointIdsBuilder_ = null; + sliceEndpointIds_ = other.sliceEndpointIds_; + bitField0_ = (bitField0_ & ~0x00000001); + sliceEndpointIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceEndpointIdsFieldBuilder() : null; + } else { + sliceEndpointIdsBuilder_.addAllMessages(other.sliceEndpointIds_); + } + } + } + if (sliceConstraintsBuilder_ == null) { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraints_.isEmpty()) { + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.addAll(other.sliceConstraints_); + } + onChanged(); + } + } else { + if (!other.sliceConstraints_.isEmpty()) { + if (sliceConstraintsBuilder_.isEmpty()) { + sliceConstraintsBuilder_.dispose(); + sliceConstraintsBuilder_ = null; + sliceConstraints_ = other.sliceConstraints_; + bitField0_ = (bitField0_ & ~0x00000002); + sliceConstraintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceConstraintsFieldBuilder() : null; + } else { + sliceConstraintsBuilder_.addAllMessages(other.sliceConstraints_); + } + } + } + if (sliceServiceIdsBuilder_ == null) { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIds_.isEmpty()) { + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.addAll(other.sliceServiceIds_); + } + onChanged(); + } + } else { + if (!other.sliceServiceIds_.isEmpty()) { + if (sliceServiceIdsBuilder_.isEmpty()) { + sliceServiceIdsBuilder_.dispose(); + sliceServiceIdsBuilder_ = null; + sliceServiceIds_ = other.sliceServiceIds_; + bitField0_ = (bitField0_ & ~0x00000004); + sliceServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceServiceIdsFieldBuilder() : null; + } else { + sliceServiceIdsBuilder_.addAllMessages(other.sliceServiceIds_); + } + } + } + if (sliceSubsliceIdsBuilder_ == null) { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIds_.isEmpty()) { + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.addAll(other.sliceSubsliceIds_); + } + onChanged(); + } + } else { + if (!other.sliceSubsliceIds_.isEmpty()) { + if (sliceSubsliceIdsBuilder_.isEmpty()) { + sliceSubsliceIdsBuilder_.dispose(); + sliceSubsliceIdsBuilder_ = null; + sliceSubsliceIds_ = other.sliceSubsliceIds_; + bitField0_ = (bitField0_ & ~0x00000008); + sliceSubsliceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSliceSubsliceIdsFieldBuilder() : null; + } else { + sliceSubsliceIdsBuilder_.addAllMessages(other.sliceSubsliceIds_); + } + } + } + if (other.hasSliceStatus()) { + mergeSliceStatus(other.getSliceStatus()); + } + if (other.hasSliceConfig()) { + mergeSliceConfig(other.getSliceConfig()); + } + if (other.hasSliceOwner()) { + mergeSliceOwner(other.getSliceOwner()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + 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 { + context.ContextOuterClass.Slice parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Slice) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 1; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 1; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 1; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 1; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + + private java.util.List sliceEndpointIds_ = + java.util.Collections.emptyList(); + private void ensureSliceEndpointIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sliceEndpointIds_ = new java.util.ArrayList(sliceEndpointIds_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> sliceEndpointIdsBuilder_; + + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List getSliceEndpointIdsList() { + if (sliceEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } else { + return sliceEndpointIdsBuilder_.getMessageList(); } - if (other.hasContextId()) { - mergeContextId(other.getContextId()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public int getSliceEndpointIdsCount() { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.size(); + } else { + return sliceEndpointIdsBuilder_.getCount(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId getSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); + } else { + return sliceEndpointIdsBuilder_.getMessage(index); + } } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.ContextEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ContextEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, value); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, value); } return this; } - - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + public Builder setSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; } /** - * .context.Event event = 1; - * @return The event. + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public Builder addSliceEndpointIds(context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(value); + onChanged(); } else { - return eventBuilder_.getMessage(); + sliceEndpointIdsBuilder_.addMessage(value); } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId value) { + if (sliceEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - event_ = value; + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, value); onChanged(); } else { - eventBuilder_.setMessage(value); + sliceEndpointIdsBuilder_.addMessage(index, value); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); + public Builder addSliceEndpointIds( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(builderForValue.build()); onChanged(); } else { - eventBuilder_.setMessage(builderForValue.build()); + sliceEndpointIdsBuilder_.addMessage(builderForValue.build()); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } + public Builder addSliceEndpointIds( + int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.add(index, builderForValue.build()); onChanged(); } else { - eventBuilder_.mergeFrom(value); + sliceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; + public Builder addAllSliceEndpointIds( + java.lang.Iterable values) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceEndpointIds_); onChanged(); } else { - event_ = null; - eventBuilder_ = null; + sliceEndpointIdsBuilder_.addAllMessages(values); } - return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); + public Builder clearSliceEndpointIds() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sliceEndpointIdsBuilder_.clear(); + } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); + public Builder removeSliceEndpointIds(int index) { + if (sliceEndpointIdsBuilder_ == null) { + ensureSliceEndpointIdsIsMutable(); + sliceEndpointIds_.remove(index); + onChanged(); } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; + sliceEndpointIdsBuilder_.remove(index); } + return this; } /** - * .context.Event event = 1; + * repeated .context.EndPointId slice_endpoint_ids = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), + public context.ContextOuterClass.EndPointId.Builder getSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getSliceEndpointIdsOrBuilder( + int index) { + if (sliceEndpointIdsBuilder_ == null) { + return sliceEndpointIds_.get(index); } else { + return sliceEndpointIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List + getSliceEndpointIdsOrBuilderList() { + if (sliceEndpointIdsBuilder_ != null) { + return sliceEndpointIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceEndpointIds_); + } + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder() { + return getSliceEndpointIdsFieldBuilder().addBuilder( + context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public context.ContextOuterClass.EndPointId.Builder addSliceEndpointIdsBuilder( + int index) { + return getSliceEndpointIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + } + /** + * repeated .context.EndPointId slice_endpoint_ids = 2; + */ + public java.util.List + getSliceEndpointIdsBuilderList() { + return getSliceEndpointIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getSliceEndpointIdsFieldBuilder() { + if (sliceEndpointIdsBuilder_ == null) { + sliceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + sliceEndpointIds_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - event_ = null; + sliceEndpointIds_ = null; } - return eventBuilder_; + return sliceEndpointIdsBuilder_; } - private context.ContextOuterClass.ContextId contextId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + private java.util.List sliceConstraints_ = + java.util.Collections.emptyList(); + private void ensureSliceConstraintsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + sliceConstraints_ = new java.util.ArrayList(sliceConstraints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> sliceConstraintsBuilder_; + /** - * .context.ContextId context_id = 2; - * @return Whether the contextId field is set. + * repeated .context.Constraint slice_constraints = 3; */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public java.util.List getSliceConstraintsList() { + if (sliceConstraintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } else { + return sliceConstraintsBuilder_.getMessageList(); + } } /** - * .context.ContextId context_id = 2; - * @return The contextId. + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public int getSliceConstraintsCount() { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.size(); } else { - return contextIdBuilder_.getMessage(); + return sliceConstraintsBuilder_.getCount(); } } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public context.ContextOuterClass.Constraint getSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); + } else { + return sliceConstraintsBuilder_.getMessage(index); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, value); onChanged(); } else { - contextIdBuilder_.setMessage(value); + sliceConstraintsBuilder_.setMessage(index, value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.set(index, builderForValue.build()); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + sliceConstraintsBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); - } else { - contextId_ = value; + public Builder addSliceConstraints(context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(value); onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + sliceConstraintsBuilder_.addMessage(value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint value) { + if (sliceConstraintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, value); onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceConstraintsBuilder_.addMessage(index, value); } - return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { - - onChanged(); - return getContextIdFieldBuilder().getBuilder(); + public Builder addSliceConstraints( + context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(builderForValue.build()); + onChanged(); + } else { + sliceConstraintsBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public Builder addSliceConstraints( + int index, context.ContextOuterClass.Constraint.Builder builderForValue) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.add(index, builderForValue.build()); + onChanged(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + sliceConstraintsBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** - * .context.ContextId context_id = 2; + * repeated .context.Constraint slice_constraints = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), - getParentForChildren(), - isClean()); - contextId_ = null; + public Builder addAllSliceConstraints( + java.lang.Iterable values) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceConstraints_); + onChanged(); + } else { + sliceConstraintsBuilder_.addAllMessages(values); } - return contextIdBuilder_; - } - @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:context.ContextEvent) - } - - // @@protoc_insertion_point(class_scope:context.ContextEvent) - private static final context.ContextOuterClass.ContextEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ContextEvent(); - } - - public static context.ContextOuterClass.ContextEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ContextEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ContextEvent(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 context.ContextOuterClass.ContextEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface TopologyIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyId) - com.google.protobuf.MessageOrBuilder { - - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - boolean hasContextId(); - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - context.ContextOuterClass.ContextId getContextId(); - /** - * .context.ContextId context_id = 1; - */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); - - /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. - */ - boolean hasTopologyUuid(); - /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. - */ - context.ContextOuterClass.Uuid getTopologyUuid(); - /** - * .context.Uuid topology_uuid = 2; - */ - context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder(); - } - /** - *
-   * ----- Topology ------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.TopologyId} - */ - public static final class TopologyId extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyId) - TopologyIdOrBuilder { - private static final long serialVersionUID = 0L; - // Use TopologyId.newBuilder() to construct. - private TopologyId(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TopologyId() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TopologyId(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TopologyId( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + return this; } - 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: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); - } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (topologyUuid_ != null) { - subBuilder = topologyUuid_.toBuilder(); - } - topologyUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyUuid_); - topologyUuid_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder clearSliceConstraints() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + sliceConstraintsBuilder_.clear(); } - } 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(); + return this; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public Builder removeSliceConstraints(int index) { + if (sliceConstraintsBuilder_ == null) { + ensureSliceConstraintsIsMutable(); + sliceConstraints_.remove(index); + onChanged(); + } else { + sliceConstraintsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder getSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.ConstraintOrBuilder getSliceConstraintsOrBuilder( + int index) { + if (sliceConstraintsBuilder_ == null) { + return sliceConstraints_.get(index); } else { + return sliceConstraintsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public java.util.List + getSliceConstraintsOrBuilderList() { + if (sliceConstraintsBuilder_ != null) { + return sliceConstraintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceConstraints_); + } + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder() { + return getSliceConstraintsFieldBuilder().addBuilder( + context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public context.ContextOuterClass.Constraint.Builder addSliceConstraintsBuilder( + int index) { + return getSliceConstraintsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Constraint.getDefaultInstance()); + } + /** + * repeated .context.Constraint slice_constraints = 3; + */ + public java.util.List + getSliceConstraintsBuilderList() { + return getSliceConstraintsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> + getSliceConstraintsFieldBuilder() { + if (sliceConstraintsBuilder_ == null) { + sliceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( + sliceConstraints_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + sliceConstraints_ = null; + } + return sliceConstraintsBuilder_; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); - } - - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; - /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. - */ - @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; - } - /** - * .context.ContextId context_id = 1; - * @return The contextId. - */ - @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; - } - /** - * .context.ContextId context_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); - } - - public static final int TOPOLOGY_UUID_FIELD_NUMBER = 2; - private context.ContextOuterClass.Uuid topologyUuid_; - /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. - */ - @java.lang.Override - public boolean hasTopologyUuid() { - return topologyUuid_ != null; - } - /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getTopologyUuid() { - return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; - } - /** - * .context.Uuid topology_uuid = 2; - */ - @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { - return getTopologyUuid(); - } - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private java.util.List sliceServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + sliceServiceIds_ = new java.util.ArrayList(sliceServiceIds_); + bitField0_ |= 0x00000004; + } + } - memoizedIsInitialized = 1; - return true; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> sliceServiceIdsBuilder_; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List getSliceServiceIdsList() { + if (sliceServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } else { + return sliceServiceIdsBuilder_.getMessageList(); + } } - if (topologyUuid_ != null) { - output.writeMessage(2, getTopologyUuid()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public int getSliceServiceIdsCount() { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.size(); + } else { + return sliceServiceIdsBuilder_.getCount(); + } } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (contextId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId getSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); + } else { + return sliceServiceIdsBuilder_.getMessage(index); + } } - if (topologyUuid_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTopologyUuid()); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, value); + } + return this; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder setSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; } - if (!(obj instanceof context.ContextOuterClass.TopologyId)) { - return super.equals(obj); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds(context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(value); + } + return this; } - context.ContextOuterClass.TopologyId other = (context.ContextOuterClass.TopologyId) obj; - - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (sliceServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, value); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, value); + } + return this; } - if (hasTopologyUuid() != other.hasTopologyUuid()) return false; - if (hasTopologyUuid()) { - if (!getTopologyUuid() - .equals(other.getTopologyUuid())) return false; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addSliceServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder addAllSliceServiceIds( + java.lang.Iterable values) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceServiceIds_); + onChanged(); + } else { + sliceServiceIdsBuilder_.addAllMessages(values); + } + return this; } - if (hasTopologyUuid()) { - hash = (37 * hash) + TOPOLOGY_UUID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyUuid().hashCode(); + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder clearSliceServiceIds() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + sliceServiceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public Builder removeSliceServiceIds(int index) { + if (sliceServiceIdsBuilder_ == null) { + ensureSliceServiceIdsIsMutable(); + sliceServiceIds_.remove(index); + onChanged(); + } else { + sliceServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder getSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSliceServiceIdsOrBuilder( + int index) { + if (sliceServiceIdsBuilder_ == null) { + return sliceServiceIds_.get(index); } else { + return sliceServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List + getSliceServiceIdsOrBuilderList() { + if (sliceServiceIdsBuilder_ != null) { + return sliceServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceServiceIds_); + } + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder() { + return getSliceServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSliceServiceIdsBuilder( + int index) { + return getSliceServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId slice_service_ids = 4; + */ + public java.util.List + getSliceServiceIdsBuilderList() { + return getSliceServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSliceServiceIdsFieldBuilder() { + if (sliceServiceIdsBuilder_ == null) { + sliceServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + sliceServiceIds_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + sliceServiceIds_ = null; + } + return sliceServiceIdsBuilder_; } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - public static context.ContextOuterClass.TopologyId parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static context.ContextOuterClass.TopologyId parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static context.ContextOuterClass.TopologyId parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId 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 context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static context.ContextOuterClass.TopologyId parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } + private java.util.List sliceSubsliceIds_ = + java.util.Collections.emptyList(); + private void ensureSliceSubsliceIdsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + sliceSubsliceIds_ = new java.util.ArrayList(sliceSubsliceIds_); + bitField0_ |= 0x00000008; + } + } - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(context.ContextOuterClass.TopologyId prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceSubsliceIdsBuilder_; - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * ----- Topology ------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.TopologyId} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyId) - context.ContextOuterClass.TopologyIdOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List getSliceSubsliceIdsList() { + if (sliceSubsliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } else { + return sliceSubsliceIdsBuilder_.getMessageList(); + } } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyId_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyId.class, context.ContextOuterClass.TopologyId.Builder.class); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public int getSliceSubsliceIdsCount() { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.size(); + } else { + return sliceSubsliceIdsBuilder_.getCount(); + } } - - // Construct using context.ContextOuterClass.TopologyId.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId getSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); + } else { + return sliceSubsliceIdsBuilder_.getMessage(index); + } } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, value); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, value); + } + return this; } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder setSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.setMessage(index, builderForValue.build()); } + return this; } - @java.lang.Override - public Builder clear() { - super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds(context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(value); + onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceSubsliceIdsBuilder_.addMessage(value); } - if (topologyUuidBuilder_ == null) { - topologyUuid_ = null; + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceSubsliceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, value); + onChanged(); } else { - topologyUuid_ = null; - topologyUuidBuilder_ = null; + sliceSubsliceIdsBuilder_.addMessage(index, value); } return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyId_descriptor; + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; } - - @java.lang.Override - public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyId.getDefaultInstance(); + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addSliceSubsliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder addAllSliceSubsliceIds( + java.lang.Iterable values) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sliceSubsliceIds_); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder clearSliceSubsliceIds() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public Builder removeSliceSubsliceIds(int index) { + if (sliceSubsliceIdsBuilder_ == null) { + ensureSliceSubsliceIdsIsMutable(); + sliceSubsliceIds_.remove(index); + onChanged(); + } else { + sliceSubsliceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder getSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceSubsliceIdsOrBuilder( + int index) { + if (sliceSubsliceIdsBuilder_ == null) { + return sliceSubsliceIds_.get(index); } else { + return sliceSubsliceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List + getSliceSubsliceIdsOrBuilderList() { + if (sliceSubsliceIdsBuilder_ != null) { + return sliceSubsliceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sliceSubsliceIds_); + } + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder() { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public context.ContextOuterClass.SliceId.Builder addSliceSubsliceIdsBuilder( + int index) { + return getSliceSubsliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); + } + /** + * repeated .context.SliceId slice_subslice_ids = 5; + */ + public java.util.List + getSliceSubsliceIdsBuilderList() { + return getSliceSubsliceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceSubsliceIdsFieldBuilder() { + if (sliceSubsliceIdsBuilder_ == null) { + sliceSubsliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceSubsliceIds_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + sliceSubsliceIds_ = null; + } + return sliceSubsliceIdsBuilder_; } - @java.lang.Override - public context.ContextOuterClass.TopologyId build() { - context.ContextOuterClass.TopologyId result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + private context.ContextOuterClass.SliceStatus sliceStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> sliceStatusBuilder_; + /** + * .context.SliceStatus slice_status = 6; + * @return Whether the sliceStatus field is set. + */ + public boolean hasSliceStatus() { + return sliceStatusBuilder_ != null || sliceStatus_ != null; + } + /** + * .context.SliceStatus slice_status = 6; + * @return The sliceStatus. + */ + public context.ContextOuterClass.SliceStatus getSliceStatus() { + if (sliceStatusBuilder_ == null) { + return sliceStatus_ == null ? context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } else { + return sliceStatusBuilder_.getMessage(); } - return result; } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder setSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceStatus_ = value; + onChanged(); + } else { + sliceStatusBuilder_.setMessage(value); + } - @java.lang.Override - public context.ContextOuterClass.TopologyId buildPartial() { - context.ContextOuterClass.TopologyId result = new context.ContextOuterClass.TopologyId(this); - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + return this; + } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder setSliceStatus( + context.ContextOuterClass.SliceStatus.Builder builderForValue) { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = builderForValue.build(); + onChanged(); } else { - result.contextId_ = contextIdBuilder_.build(); + sliceStatusBuilder_.setMessage(builderForValue.build()); } - if (topologyUuidBuilder_ == null) { - result.topologyUuid_ = topologyUuid_; + + return this; + } + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder mergeSliceStatus(context.ContextOuterClass.SliceStatus value) { + if (sliceStatusBuilder_ == null) { + if (sliceStatus_ != null) { + sliceStatus_ = + context.ContextOuterClass.SliceStatus.newBuilder(sliceStatus_).mergeFrom(value).buildPartial(); + } else { + sliceStatus_ = value; + } + onChanged(); } else { - result.topologyUuid_ = topologyUuidBuilder_.build(); + sliceStatusBuilder_.mergeFrom(value); } - onBuilt(); - return result; - } - @java.lang.Override - public Builder clone() { - return super.clone(); + return this; } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); + /** + * .context.SliceStatus slice_status = 6; + */ + public Builder clearSliceStatus() { + if (sliceStatusBuilder_ == null) { + sliceStatus_ = null; + onChanged(); + } else { + sliceStatus_ = null; + sliceStatusBuilder_ = null; + } + + return this; } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * .context.SliceStatus slice_status = 6; + */ + public context.ContextOuterClass.SliceStatus.Builder getSliceStatusBuilder() { + + onChanged(); + return getSliceStatusFieldBuilder().getBuilder(); } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * .context.SliceStatus slice_status = 6; + */ + public context.ContextOuterClass.SliceStatusOrBuilder getSliceStatusOrBuilder() { + if (sliceStatusBuilder_ != null) { + return sliceStatusBuilder_.getMessageOrBuilder(); + } else { + return sliceStatus_ == null ? + context.ContextOuterClass.SliceStatus.getDefaultInstance() : sliceStatus_; + } } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * .context.SliceStatus slice_status = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder> + getSliceStatusFieldBuilder() { + if (sliceStatusBuilder_ == null) { + sliceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceStatus, context.ContextOuterClass.SliceStatus.Builder, context.ContextOuterClass.SliceStatusOrBuilder>( + getSliceStatus(), + getParentForChildren(), + isClean()); + sliceStatus_ = null; + } + return sliceStatusBuilder_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + + private context.ContextOuterClass.SliceConfig sliceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder> sliceConfigBuilder_; + /** + * .context.SliceConfig slice_config = 7; + * @return Whether the sliceConfig field is set. + */ + public boolean hasSliceConfig() { + return sliceConfigBuilder_ != null || sliceConfig_ != null; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyId) { - return mergeFrom((context.ContextOuterClass.TopologyId)other); + /** + * .context.SliceConfig slice_config = 7; + * @return The sliceConfig. + */ + public context.ContextOuterClass.SliceConfig getSliceConfig() { + if (sliceConfigBuilder_ == null) { + return sliceConfig_ == null ? context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; } else { - super.mergeFrom(other); - return this; + return sliceConfigBuilder_.getMessage(); } } - - public Builder mergeFrom(context.ContextOuterClass.TopologyId other) { - if (other == context.ContextOuterClass.TopologyId.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); - } - if (other.hasTopologyUuid()) { - mergeTopologyUuid(other.getTopologyUuid()); + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder setSliceConfig(context.ContextOuterClass.SliceConfig value) { + if (sliceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceConfig_ = value; + onChanged(); + } else { + sliceConfigBuilder_.setMessage(value); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + return this; } + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder setSliceConfig( + context.ContextOuterClass.SliceConfig.Builder builderForValue) { + if (sliceConfigBuilder_ == null) { + sliceConfig_ = builderForValue.build(); + onChanged(); + } else { + sliceConfigBuilder_.setMessage(builderForValue.build()); + } - @java.lang.Override - public final boolean isInitialized() { - return true; + return this; } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.TopologyId parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyId) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder mergeSliceConfig(context.ContextOuterClass.SliceConfig value) { + if (sliceConfigBuilder_ == null) { + if (sliceConfig_ != null) { + sliceConfig_ = + context.ContextOuterClass.SliceConfig.newBuilder(sliceConfig_).mergeFrom(value).buildPartial(); + } else { + sliceConfig_ = value; } + onChanged(); + } else { + sliceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceConfig slice_config = 7; + */ + public Builder clearSliceConfig() { + if (sliceConfigBuilder_ == null) { + sliceConfig_ = null; + onChanged(); + } else { + sliceConfig_ = null; + sliceConfigBuilder_ = null; } + return this; } + /** + * .context.SliceConfig slice_config = 7; + */ + public context.ContextOuterClass.SliceConfig.Builder getSliceConfigBuilder() { + + onChanged(); + return getSliceConfigFieldBuilder().getBuilder(); + } + /** + * .context.SliceConfig slice_config = 7; + */ + public context.ContextOuterClass.SliceConfigOrBuilder getSliceConfigOrBuilder() { + if (sliceConfigBuilder_ != null) { + return sliceConfigBuilder_.getMessageOrBuilder(); + } else { + return sliceConfig_ == null ? + context.ContextOuterClass.SliceConfig.getDefaultInstance() : sliceConfig_; + } + } + /** + * .context.SliceConfig slice_config = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder> + getSliceConfigFieldBuilder() { + if (sliceConfigBuilder_ == null) { + sliceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceConfig, context.ContextOuterClass.SliceConfig.Builder, context.ContextOuterClass.SliceConfigOrBuilder>( + getSliceConfig(), + getParentForChildren(), + isClean()); + sliceConfig_ = null; + } + return sliceConfigBuilder_; + } - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.SliceOwner sliceOwner_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder> sliceOwnerBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.SliceOwner slice_owner = 8; + * @return Whether the sliceOwner field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasSliceOwner() { + return sliceOwnerBuilder_ != null || sliceOwner_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.SliceOwner slice_owner = 8; + * @return The sliceOwner. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.SliceOwner getSliceOwner() { + if (sliceOwnerBuilder_ == null) { + return sliceOwner_ == null ? context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; } else { - return contextIdBuilder_.getMessage(); + return sliceOwnerBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setSliceOwner(context.ContextOuterClass.SliceOwner value) { + if (sliceOwnerBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + sliceOwner_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + sliceOwnerBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setSliceOwner( + context.ContextOuterClass.SliceOwner.Builder builderForValue) { + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + sliceOwnerBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + public Builder mergeSliceOwner(context.ContextOuterClass.SliceOwner value) { + if (sliceOwnerBuilder_ == null) { + if (sliceOwner_ != null) { + sliceOwner_ = + context.ContextOuterClass.SliceOwner.newBuilder(sliceOwner_).mergeFrom(value).buildPartial(); } else { - contextId_ = value; + sliceOwner_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + sliceOwnerBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearSliceOwner() { + if (sliceOwnerBuilder_ == null) { + sliceOwner_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + sliceOwner_ = null; + sliceOwnerBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.SliceOwner.Builder getSliceOwnerBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getSliceOwnerFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.SliceOwnerOrBuilder getSliceOwnerOrBuilder() { + if (sliceOwnerBuilder_ != null) { + return sliceOwnerBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return sliceOwner_ == null ? + context.ContextOuterClass.SliceOwner.getDefaultInstance() : sliceOwner_; } } /** - * .context.ContextId context_id = 1; + * .context.SliceOwner slice_owner = 8; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder> + getSliceOwnerFieldBuilder() { + if (sliceOwnerBuilder_ == null) { + sliceOwnerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceOwner, context.ContextOuterClass.SliceOwner.Builder, context.ContextOuterClass.SliceOwnerOrBuilder>( + getSliceOwner(), getParentForChildren(), isClean()); - contextId_ = null; + sliceOwner_ = null; } - return contextIdBuilder_; + return sliceOwnerBuilder_; } - private context.ContextOuterClass.Uuid topologyUuid_; + private context.ContextOuterClass.Timestamp timestamp_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> topologyUuidBuilder_; + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> timestampBuilder_; /** - * .context.Uuid topology_uuid = 2; - * @return Whether the topologyUuid field is set. + * .context.Timestamp timestamp = 9; + * @return Whether the timestamp field is set. */ - public boolean hasTopologyUuid() { - return topologyUuidBuilder_ != null || topologyUuid_ != null; + public boolean hasTimestamp() { + return timestampBuilder_ != null || timestamp_ != null; } /** - * .context.Uuid topology_uuid = 2; - * @return The topologyUuid. + * .context.Timestamp timestamp = 9; + * @return The timestamp. */ - public context.ContextOuterClass.Uuid getTopologyUuid() { - if (topologyUuidBuilder_ == null) { - return topologyUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + public context.ContextOuterClass.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } else { - return topologyUuidBuilder_.getMessage(); + return timestampBuilder_.getMessage(); } } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder setTopologyUuid(context.ContextOuterClass.Uuid value) { - if (topologyUuidBuilder_ == null) { + public Builder setTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - topologyUuid_ = value; + timestamp_ = value; onChanged(); } else { - topologyUuidBuilder_.setMessage(value); + timestampBuilder_.setMessage(value); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder setTopologyUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (topologyUuidBuilder_ == null) { - topologyUuid_ = builderForValue.build(); + public Builder setTimestamp( + context.ContextOuterClass.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); onChanged(); } else { - topologyUuidBuilder_.setMessage(builderForValue.build()); + timestampBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder mergeTopologyUuid(context.ContextOuterClass.Uuid value) { - if (topologyUuidBuilder_ == null) { - if (topologyUuid_ != null) { - topologyUuid_ = - context.ContextOuterClass.Uuid.newBuilder(topologyUuid_).mergeFrom(value).buildPartial(); + public Builder mergeTimestamp(context.ContextOuterClass.Timestamp value) { + if (timestampBuilder_ == null) { + if (timestamp_ != null) { + timestamp_ = + context.ContextOuterClass.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); } else { - topologyUuid_ = value; + timestamp_ = value; } onChanged(); } else { - topologyUuidBuilder_.mergeFrom(value); + timestampBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public Builder clearTopologyUuid() { - if (topologyUuidBuilder_ == null) { - topologyUuid_ = null; + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; onChanged(); } else { - topologyUuid_ = null; - topologyUuidBuilder_ = null; + timestamp_ = null; + timestampBuilder_ = null; } return this; } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public context.ContextOuterClass.Uuid.Builder getTopologyUuidBuilder() { + public context.ContextOuterClass.Timestamp.Builder getTimestampBuilder() { onChanged(); - return getTopologyUuidFieldBuilder().getBuilder(); + return getTimestampFieldBuilder().getBuilder(); } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ - public context.ContextOuterClass.UuidOrBuilder getTopologyUuidOrBuilder() { - if (topologyUuidBuilder_ != null) { - return topologyUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); } else { - return topologyUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : topologyUuid_; + return timestamp_ == null ? + context.ContextOuterClass.Timestamp.getDefaultInstance() : timestamp_; } } /** - * .context.Uuid topology_uuid = 2; + * .context.Timestamp timestamp = 9; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getTopologyUuidFieldBuilder() { - if (topologyUuidBuilder_ == null) { - topologyUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getTopologyUuid(), + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Timestamp, context.ContextOuterClass.Timestamp.Builder, context.ContextOuterClass.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); - topologyUuid_ = null; + timestamp_ = null; } - return topologyUuidBuilder_; + return timestampBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -7775,135 +32517,98 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyId) + // @@protoc_insertion_point(builder_scope:context.Slice) } - // @@protoc_insertion_point(class_scope:context.TopologyId) - private static final context.ContextOuterClass.TopologyId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Slice) + private static final context.ContextOuterClass.Slice DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Slice(); } - public static context.ContextOuterClass.TopologyId getDefaultInstance() { + public static context.ContextOuterClass.Slice getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyId parsePartialFrom( + public Slice parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyId(input, extensionRegistry); + return new Slice(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyId getDefaultInstanceForType() { + public context.ContextOuterClass.Slice getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Topology) + public interface SliceOwnerOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceOwner) com.google.protobuf.MessageOrBuilder { /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - boolean hasTopologyId(); - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - context.ContextOuterClass.TopologyId getTopologyId(); - /** - * .context.TopologyId topology_id = 1; - */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); - - /** - * repeated .context.DeviceId device_ids = 2; - */ - java.util.List - getDeviceIdsList(); - /** - * repeated .context.DeviceId device_ids = 2; - */ - context.ContextOuterClass.DeviceId getDeviceIds(int index); - /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ - int getDeviceIdsCount(); + boolean hasOwnerUuid(); /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ - java.util.List - getDeviceIdsOrBuilderList(); + context.ContextOuterClass.Uuid getOwnerUuid(); /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index); + context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder(); /** - * repeated .context.LinkId link_ids = 3; - */ - java.util.List - getLinkIdsList(); - /** - * repeated .context.LinkId link_ids = 3; - */ - context.ContextOuterClass.LinkId getLinkIds(int index); - /** - * repeated .context.LinkId link_ids = 3; - */ - int getLinkIdsCount(); - /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The ownerString. */ - java.util.List - getLinkIdsOrBuilderList(); + java.lang.String getOwnerString(); /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index); + com.google.protobuf.ByteString + getOwnerStringBytes(); } /** - * Protobuf type {@code context.Topology} + * Protobuf type {@code context.SliceOwner} */ - public static final class Topology extends + public static final class SliceOwner extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Topology) - TopologyOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceOwner) + SliceOwnerOrBuilder { private static final long serialVersionUID = 0L; - // Use Topology.newBuilder() to construct. - private Topology(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceOwner.newBuilder() to construct. + private SliceOwner(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Topology() { - deviceIds_ = java.util.Collections.emptyList(); - linkIds_ = java.util.Collections.emptyList(); + private SliceOwner() { + ownerString_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Topology(); + return new SliceOwner(); } @java.lang.Override @@ -7911,7 +32616,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Topology( + private SliceOwner( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7919,7 +32624,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -7931,34 +32635,22 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (ownerUuid_ != null) { + subBuilder = ownerUuid_.toBuilder(); } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); + ownerUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(ownerUuid_); + ownerUuid_ = subBuilder.buildPartial(); } break; } case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceIds_.add( - input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - linkIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - linkIds_.add( - input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + ownerString_ = s; break; } default: { @@ -7976,133 +32668,85 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceOwner_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); - } - - public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.TopologyId topologyId_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - /** - * .context.TopologyId topology_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + context.ContextOuterClass.SliceOwner.class, context.ContextOuterClass.SliceOwner.Builder.class); } - public static final int DEVICE_IDS_FIELD_NUMBER = 2; - private java.util.List deviceIds_; + public static final int OWNER_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid ownerUuid_; /** - * repeated .context.DeviceId device_ids = 2; - */ - @java.lang.Override - public java.util.List getDeviceIdsList() { - return deviceIds_; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - @java.lang.Override - public java.util.List - getDeviceIdsOrBuilderList() { - return deviceIds_; - } - /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ @java.lang.Override - public int getDeviceIdsCount() { - return deviceIds_.size(); + public boolean hasOwnerUuid() { + return ownerUuid_ != null; } /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - return deviceIds_.get(index); + public context.ContextOuterClass.Uuid getOwnerUuid() { + return ownerUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } /** - * repeated .context.DeviceId device_ids = 2; + * .context.Uuid owner_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - return deviceIds_.get(index); + public context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder() { + return getOwnerUuid(); } - public static final int LINK_IDS_FIELD_NUMBER = 3; - private java.util.List linkIds_; - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public java.util.List getLinkIdsList() { - return linkIds_; - } - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public java.util.List - getLinkIdsOrBuilderList() { - return linkIds_; - } - /** - * repeated .context.LinkId link_ids = 3; - */ - @java.lang.Override - public int getLinkIdsCount() { - return linkIds_.size(); - } + public static final int OWNER_STRING_FIELD_NUMBER = 2; + private volatile java.lang.Object ownerString_; /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The ownerString. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkIds(int index) { - return linkIds_.get(index); + public java.lang.String getOwnerString() { + java.lang.Object ref = ownerString_; + 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(); + ownerString_ = s; + return s; + } } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index) { - return linkIds_.get(index); + public com.google.protobuf.ByteString + getOwnerStringBytes() { + java.lang.Object ref = ownerString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ownerString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -8119,14 +32763,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (topologyId_ != null) { - output.writeMessage(1, getTopologyId()); - } - for (int i = 0; i < deviceIds_.size(); i++) { - output.writeMessage(2, deviceIds_.get(i)); + if (ownerUuid_ != null) { + output.writeMessage(1, getOwnerUuid()); } - for (int i = 0; i < linkIds_.size(); i++) { - output.writeMessage(3, linkIds_.get(i)); + if (!getOwnerStringBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ownerString_); } unknownFields.writeTo(output); } @@ -8137,17 +32778,12 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (topologyId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTopologyId()); - } - for (int i = 0; i < deviceIds_.size(); i++) { + if (ownerUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, deviceIds_.get(i)); + .computeMessageSize(1, getOwnerUuid()); } - for (int i = 0; i < linkIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, linkIds_.get(i)); + if (!getOwnerStringBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ownerString_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -8159,20 +32795,18 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Topology)) { + if (!(obj instanceof context.ContextOuterClass.SliceOwner)) { return super.equals(obj); } - context.ContextOuterClass.Topology other = (context.ContextOuterClass.Topology) obj; + context.ContextOuterClass.SliceOwner other = (context.ContextOuterClass.SliceOwner) obj; - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; + if (hasOwnerUuid() != other.hasOwnerUuid()) return false; + if (hasOwnerUuid()) { + if (!getOwnerUuid() + .equals(other.getOwnerUuid())) return false; } - if (!getDeviceIdsList() - .equals(other.getDeviceIdsList())) return false; - if (!getLinkIdsList() - .equals(other.getLinkIdsList())) return false; + if (!getOwnerString() + .equals(other.getOwnerString())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -8184,86 +32818,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); - } - if (getDeviceIdsCount() > 0) { - hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceIdsList().hashCode(); - } - if (getLinkIdsCount() > 0) { - hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkIdsList().hashCode(); + if (hasOwnerUuid()) { + hash = (37 * hash) + OWNER_UUID_FIELD_NUMBER; + hash = (53 * hash) + getOwnerUuid().hashCode(); } + hash = (37 * hash) + OWNER_STRING_FIELD_NUMBER; + hash = (53 * hash) + getOwnerString().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom(byte[] data) + public static context.ContextOuterClass.SliceOwner parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Topology parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceOwner parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner 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 context.ContextOuterClass.Topology parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceOwner parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseDelimitedFrom( + public static context.ContextOuterClass.SliceOwner 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 context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Topology parseFrom( + public static context.ContextOuterClass.SliceOwner parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -8276,7 +32904,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Topology prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceOwner prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -8292,26 +32920,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Topology} + * Protobuf type {@code context.SliceOwner} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Topology) - context.ContextOuterClass.TopologyOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceOwner) + context.ContextOuterClass.SliceOwnerOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Topology_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceOwner_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Topology.class, context.ContextOuterClass.Topology.Builder.class); + context.ContextOuterClass.SliceOwner.class, context.ContextOuterClass.SliceOwner.Builder.class); } - // Construct using context.ContextOuterClass.Topology.newBuilder() + // Construct using context.ContextOuterClass.SliceOwner.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -8324,48 +32952,36 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDeviceIdsFieldBuilder(); - getLinkIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdBuilder_ == null) { - topologyId_ = null; - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - deviceIdsBuilder_.clear(); - } - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + if (ownerUuidBuilder_ == null) { + ownerUuid_ = null; } else { - linkIdsBuilder_.clear(); + ownerUuid_ = null; + ownerUuidBuilder_ = null; } + ownerString_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Topology_descriptor; + return context.ContextOuterClass.internal_static_context_SliceOwner_descriptor; } @java.lang.Override - public context.ContextOuterClass.Topology getDefaultInstanceForType() { - return context.ContextOuterClass.Topology.getDefaultInstance(); + public context.ContextOuterClass.SliceOwner getDefaultInstanceForType() { + return context.ContextOuterClass.SliceOwner.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Topology build() { - context.ContextOuterClass.Topology result = buildPartial(); + public context.ContextOuterClass.SliceOwner build() { + context.ContextOuterClass.SliceOwner result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -8373,32 +32989,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Topology buildPartial() { - context.ContextOuterClass.Topology result = new context.ContextOuterClass.Topology(this); - int from_bitField0_ = bitField0_; - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; - } else { - result.topologyId_ = topologyIdBuilder_.build(); - } - if (deviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceIds_ = deviceIds_; - } else { - result.deviceIds_ = deviceIdsBuilder_.build(); - } - if (linkIdsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.linkIds_ = linkIds_; + public context.ContextOuterClass.SliceOwner buildPartial() { + context.ContextOuterClass.SliceOwner result = new context.ContextOuterClass.SliceOwner(this); + if (ownerUuidBuilder_ == null) { + result.ownerUuid_ = ownerUuid_; } else { - result.linkIds_ = linkIdsBuilder_.build(); + result.ownerUuid_ = ownerUuidBuilder_.build(); } + result.ownerString_ = ownerString_; onBuilt(); return result; } @@ -8437,70 +33035,22 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Topology) { - return mergeFrom((context.ContextOuterClass.Topology)other); + if (other instanceof context.ContextOuterClass.SliceOwner) { + return mergeFrom((context.ContextOuterClass.SliceOwner)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Topology other) { - if (other == context.ContextOuterClass.Topology.getDefaultInstance()) return this; - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); - } - if (deviceIdsBuilder_ == null) { - if (!other.deviceIds_.isEmpty()) { - if (deviceIds_.isEmpty()) { - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceIdsIsMutable(); - deviceIds_.addAll(other.deviceIds_); - } - onChanged(); - } - } else { - if (!other.deviceIds_.isEmpty()) { - if (deviceIdsBuilder_.isEmpty()) { - deviceIdsBuilder_.dispose(); - deviceIdsBuilder_ = null; - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - deviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceIdsFieldBuilder() : null; - } else { - deviceIdsBuilder_.addAllMessages(other.deviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.SliceOwner other) { + if (other == context.ContextOuterClass.SliceOwner.getDefaultInstance()) return this; + if (other.hasOwnerUuid()) { + mergeOwnerUuid(other.getOwnerUuid()); } - if (linkIdsBuilder_ == null) { - if (!other.linkIds_.isEmpty()) { - if (linkIds_.isEmpty()) { - linkIds_ = other.linkIds_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureLinkIdsIsMutable(); - linkIds_.addAll(other.linkIds_); - } - onChanged(); - } - } else { - if (!other.linkIds_.isEmpty()) { - if (linkIdsBuilder_.isEmpty()) { - linkIdsBuilder_.dispose(); - linkIdsBuilder_ = null; - linkIds_ = other.linkIds_; - bitField0_ = (bitField0_ & ~0x00000002); - linkIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkIdsFieldBuilder() : null; - } else { - linkIdsBuilder_.addAllMessages(other.linkIds_); - } - } + if (!other.getOwnerString().isEmpty()) { + ownerString_ = other.ownerString_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -8512,623 +33062,743 @@ public final class ContextOuterClass { return true; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.Topology parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Topology) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } else { - return topologyIdBuilder_.getMessage(); - } - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; - onChanged(); - } else { - topologyIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); - onChanged(); - } else { - topologyIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } - onChanged(); - } else { - topologyIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; - onChanged(); - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); - } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - } - /** - * .context.TopologyId topology_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), - getParentForChildren(), - isClean()); - topologyId_ = null; - } - return topologyIdBuilder_; - } - - private java.util.List deviceIds_ = - java.util.Collections.emptyList(); - private void ensureDeviceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(deviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; - - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List getDeviceIdsList() { - if (deviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceIds_); - } else { - return deviceIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public int getDeviceIdsCount() { - if (deviceIdsBuilder_ == null) { - return deviceIds_.size(); - } else { - return deviceIdsBuilder_.getCount(); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); - } else { - return deviceIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, value); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(value); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, value); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder addAllDeviceIds( - java.lang.Iterable values) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceIds_); - onChanged(); - } else { - deviceIdsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder clearDeviceIds() { - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - deviceIdsBuilder_.clear(); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public Builder removeDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.remove(index); - onChanged(); - } else { - deviceIdsBuilder_.remove(index); - } - return this; - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); } else { - return deviceIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List - getDeviceIdsOrBuilderList() { - if (deviceIdsBuilder_ != null) { - return deviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(deviceIds_); - } - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { - return getDeviceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); - } - /** - * repeated .context.DeviceId device_ids = 2; - */ - public java.util.List - getDeviceIdsBuilderList() { - return getDeviceIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdsFieldBuilder() { - if (deviceIdsBuilder_ == null) { - deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - deviceIds_ = null; - } - return deviceIdsBuilder_; - } - - private java.util.List linkIds_ = - java.util.Collections.emptyList(); - private void ensureLinkIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - linkIds_ = new java.util.ArrayList(linkIds_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; - - /** - * repeated .context.LinkId link_ids = 3; - */ - public java.util.List getLinkIdsList() { - if (linkIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkIds_); - } else { - return linkIdsBuilder_.getMessageList(); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceOwner parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceOwner) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private context.ContextOuterClass.Uuid ownerUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> ownerUuidBuilder_; /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; + * @return Whether the ownerUuid field is set. */ - public int getLinkIdsCount() { - if (linkIdsBuilder_ == null) { - return linkIds_.size(); - } else { - return linkIdsBuilder_.getCount(); - } + public boolean hasOwnerUuid() { + return ownerUuidBuilder_ != null || ownerUuid_ != null; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; + * @return The ownerUuid. */ - public context.ContextOuterClass.LinkId getLinkIds(int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); + public context.ContextOuterClass.Uuid getOwnerUuid() { + if (ownerUuidBuilder_ == null) { + return ownerUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } else { - return linkIdsBuilder_.getMessage(index); + return ownerUuidBuilder_.getMessage(); } } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder setOwnerUuid(context.ContextOuterClass.Uuid value) { + if (ownerUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.set(index, value); + ownerUuid_ = value; onChanged(); } else { - linkIdsBuilder_.setMessage(index, value); + ownerUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.set(index, builderForValue.build()); + public Builder setOwnerUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (ownerUuidBuilder_ == null) { + ownerUuid_ = builderForValue.build(); onChanged(); } else { - linkIdsBuilder_.setMessage(index, builderForValue.build()); + ownerUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds(context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeOwnerUuid(context.ContextOuterClass.Uuid value) { + if (ownerUuidBuilder_ == null) { + if (ownerUuid_ != null) { + ownerUuid_ = + context.ContextOuterClass.Uuid.newBuilder(ownerUuid_).mergeFrom(value).buildPartial(); + } else { + ownerUuid_ = value; } - ensureLinkIdsIsMutable(); - linkIds_.add(value); onChanged(); } else { - linkIdsBuilder_.addMessage(value); + ownerUuidBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureLinkIdsIsMutable(); - linkIds_.add(index, value); + public Builder clearOwnerUuid() { + if (ownerUuidBuilder_ == null) { + ownerUuid_ = null; onChanged(); } else { - linkIdsBuilder_.addMessage(index, value); + ownerUuid_ = null; + ownerUuidBuilder_ = null; } + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.Uuid.Builder getOwnerUuidBuilder() { + + onChanged(); + return getOwnerUuidFieldBuilder().getBuilder(); + } + /** + * .context.Uuid owner_uuid = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getOwnerUuidOrBuilder() { + if (ownerUuidBuilder_ != null) { + return ownerUuidBuilder_.getMessageOrBuilder(); } else { - linkIdsBuilder_.addMessage(builderForValue.build()); + return ownerUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : ownerUuid_; } - return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.Uuid owner_uuid = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(index, builderForValue.build()); - onChanged(); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getOwnerUuidFieldBuilder() { + if (ownerUuidBuilder_ == null) { + ownerUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getOwnerUuid(), + getParentForChildren(), + isClean()); + ownerUuid_ = null; + } + return ownerUuidBuilder_; + } + + private java.lang.Object ownerString_ = ""; + /** + * string owner_string = 2; + * @return The ownerString. + */ + public java.lang.String getOwnerString() { + java.lang.Object ref = ownerString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ownerString_ = s; + return s; } else { - linkIdsBuilder_.addMessage(index, builderForValue.build()); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return The bytes for ownerString. */ - public Builder addAllLinkIds( - java.lang.Iterable values) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkIds_); - onChanged(); + public com.google.protobuf.ByteString + getOwnerStringBytes() { + java.lang.Object ref = ownerString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ownerString_ = b; + return b; } else { - linkIdsBuilder_.addAllMessages(values); + return (com.google.protobuf.ByteString) ref; } + } + /** + * string owner_string = 2; + * @param value The ownerString to set. + * @return This builder for chaining. + */ + public Builder setOwnerString( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ownerString_ = value; + onChanged(); return this; } /** - * repeated .context.LinkId link_ids = 3; + * string owner_string = 2; + * @return This builder for chaining. */ - public Builder clearLinkIds() { - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); + public Builder clearOwnerString() { + + ownerString_ = getDefaultInstance().getOwnerString(); + onChanged(); + return this; + } + /** + * string owner_string = 2; + * @param value The bytes for ownerString to set. + * @return This builder for chaining. + */ + public Builder setOwnerStringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ownerString_ = 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:context.SliceOwner) + } + + // @@protoc_insertion_point(class_scope:context.SliceOwner) + private static final context.ContextOuterClass.SliceOwner DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceOwner(); + } + + public static context.ContextOuterClass.SliceOwner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SliceOwner parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SliceOwner(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 context.ContextOuterClass.SliceOwner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SliceStatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. + */ + int getSliceStatusValue(); + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. + */ + context.ContextOuterClass.SliceStatusEnum getSliceStatus(); + } + /** + * Protobuf type {@code context.SliceStatus} + */ + public static final class SliceStatus extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.SliceStatus) + SliceStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use SliceStatus.newBuilder() to construct. + private SliceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SliceStatus() { + sliceStatus_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SliceStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SliceStatus( + 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(); + + sliceStatus_ = 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 context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + public static final int SLICE_STATUS_FIELD_NUMBER = 1; + private int sliceStatus_; + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. + */ + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; + } + /** + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. + */ + @java.lang.Override public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.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 (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + output.writeEnum(1, sliceStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sliceStatus_ != context.ContextOuterClass.SliceStatusEnum.SLICESTATUS_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, sliceStatus_); + } + 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 context.ContextOuterClass.SliceStatus)) { + return super.equals(obj); + } + context.ContextOuterClass.SliceStatus other = (context.ContextOuterClass.SliceStatus) obj; + + if (sliceStatus_ != other.sliceStatus_) 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) + SLICE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + sliceStatus_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.SliceStatus parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.SliceStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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 context.ContextOuterClass.SliceStatus parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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 context.ContextOuterClass.SliceStatus parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.SliceStatus 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(context.ContextOuterClass.SliceStatus 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 context.SliceStatus} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.SliceStatus) + context.ContextOuterClass.SliceStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_SliceStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.SliceStatus.class, context.ContextOuterClass.SliceStatus.Builder.class); + } + + // Construct using context.ContextOuterClass.SliceStatus.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(); + sliceStatus_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_SliceStatus_descriptor; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { + return context.ContextOuterClass.SliceStatus.getDefaultInstance(); + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus build() { + context.ContextOuterClass.SliceStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public context.ContextOuterClass.SliceStatus buildPartial() { + context.ContextOuterClass.SliceStatus result = new context.ContextOuterClass.SliceStatus(this); + result.sliceStatus_ = sliceStatus_; + 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 context.ContextOuterClass.SliceStatus) { + return mergeFrom((context.ContextOuterClass.SliceStatus)other); } else { - linkIdsBuilder_.clear(); + super.mergeFrom(other); + return this; } - return this; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public Builder removeLinkIds(int index) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.remove(index); - onChanged(); - } else { - linkIdsBuilder_.remove(index); + + public Builder mergeFrom(context.ContextOuterClass.SliceStatus other) { + if (other == context.ContextOuterClass.SliceStatus.getDefaultInstance()) return this; + if (other.sliceStatus_ != 0) { + setSliceStatusValue(other.getSliceStatusValue()); } + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( - int index) { - return getLinkIdsFieldBuilder().getBuilder(index); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * repeated .context.LinkId link_ids = 3; - */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( - int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); } else { - return linkIdsBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.SliceStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.SliceStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private int sliceStatus_ = 0; /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @return The enum numeric value on the wire for sliceStatus. */ - public java.util.List - getLinkIdsOrBuilderList() { - if (linkIdsBuilder_ != null) { - return linkIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(linkIds_); - } + @java.lang.Override public int getSliceStatusValue() { + return sliceStatus_; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @param value The enum numeric value on the wire for sliceStatus to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { - return getLinkIdsFieldBuilder().addBuilder( - context.ContextOuterClass.LinkId.getDefaultInstance()); + public Builder setSliceStatusValue(int value) { + + sliceStatus_ = value; + onChanged(); + return this; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @return The sliceStatus. */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( - int index) { - return getLinkIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.LinkId.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.SliceStatusEnum getSliceStatus() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.SliceStatusEnum result = context.ContextOuterClass.SliceStatusEnum.valueOf(sliceStatus_); + return result == null ? context.ContextOuterClass.SliceStatusEnum.UNRECOGNIZED : result; } /** - * repeated .context.LinkId link_ids = 3; + * .context.SliceStatusEnum slice_status = 1; + * @param value The sliceStatus to set. + * @return This builder for chaining. */ - public java.util.List - getLinkIdsBuilderList() { - return getLinkIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdsFieldBuilder() { - if (linkIdsBuilder_ == null) { - linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - linkIds_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - linkIds_ = null; + public Builder setSliceStatus(context.ContextOuterClass.SliceStatusEnum value) { + if (value == null) { + throw new NullPointerException(); } - return linkIdsBuilder_; + + sliceStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .context.SliceStatusEnum slice_status = 1; + * @return This builder for chaining. + */ + public Builder clearSliceStatus() { + + sliceStatus_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -9143,95 +33813,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Topology) + // @@protoc_insertion_point(builder_scope:context.SliceStatus) } - // @@protoc_insertion_point(class_scope:context.Topology) - private static final context.ContextOuterClass.Topology DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceStatus) + private static final context.ContextOuterClass.SliceStatus DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Topology(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceStatus(); } - public static context.ContextOuterClass.Topology getDefaultInstance() { + public static context.ContextOuterClass.SliceStatus getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Topology parsePartialFrom( + public SliceStatus parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Topology(input, extensionRegistry); + return new SliceStatus(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Topology getDefaultInstanceForType() { + public context.ContextOuterClass.SliceStatus getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyIdList) + public interface SliceConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceConfig) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - java.util.List - getTopologyIdsList(); + java.util.List + getConfigRulesList(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - context.ContextOuterClass.TopologyId getTopologyIds(int index); + context.ContextOuterClass.ConfigRule getConfigRules(int index); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - int getTopologyIdsCount(); + int getConfigRulesCount(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - java.util.List - getTopologyIdsOrBuilderList(); + java.util.List + getConfigRulesOrBuilderList(); /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index); } /** - * Protobuf type {@code context.TopologyIdList} + * Protobuf type {@code context.SliceConfig} */ - public static final class TopologyIdList extends + public static final class SliceConfig extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyIdList) - TopologyIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceConfig) + SliceConfigOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyIdList.newBuilder() to construct. - private TopologyIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceConfig.newBuilder() to construct. + private SliceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyIdList() { - topologyIds_ = java.util.Collections.emptyList(); + private SliceConfig() { + configRules_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyIdList(); + return new SliceConfig(); } @java.lang.Override @@ -9239,7 +33909,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyIdList( + private SliceConfig( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9260,11 +33930,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(); + configRules_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - topologyIds_.add( - input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry)); + configRules_.add( + input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); break; } default: { @@ -9283,7 +33953,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + configRules_ = java.util.Collections.unmodifiableList(configRules_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -9291,55 +33961,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + context.ContextOuterClass.SliceConfig.class, context.ContextOuterClass.SliceConfig.Builder.class); } - public static final int TOPOLOGY_IDS_FIELD_NUMBER = 1; - private java.util.List topologyIds_; + public static final int CONFIG_RULES_FIELD_NUMBER = 1; + private java.util.List configRules_; /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public java.util.List getTopologyIdsList() { - return topologyIds_; + public java.util.List getConfigRulesList() { + return configRules_; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public java.util.List - getTopologyIdsOrBuilderList() { - return topologyIds_; + public java.util.List + getConfigRulesOrBuilderList() { + return configRules_; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public int getTopologyIdsCount() { - return topologyIds_.size(); + public int getConfigRulesCount() { + return configRules_.size(); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - return topologyIds_.get(index); + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + return configRules_.get(index); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index) { - return topologyIds_.get(index); + return configRules_.get(index); } private byte memoizedIsInitialized = -1; @@ -9356,8 +34026,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < topologyIds_.size(); i++) { - output.writeMessage(1, topologyIds_.get(i)); + for (int i = 0; i < configRules_.size(); i++) { + output.writeMessage(1, configRules_.get(i)); } unknownFields.writeTo(output); } @@ -9368,9 +34038,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < topologyIds_.size(); i++) { + for (int i = 0; i < configRules_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, topologyIds_.get(i)); + .computeMessageSize(1, configRules_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -9382,13 +34052,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyIdList)) { + if (!(obj instanceof context.ContextOuterClass.SliceConfig)) { return super.equals(obj); } - context.ContextOuterClass.TopologyIdList other = (context.ContextOuterClass.TopologyIdList) obj; + context.ContextOuterClass.SliceConfig other = (context.ContextOuterClass.SliceConfig) obj; - if (!getTopologyIdsList() - .equals(other.getTopologyIdsList())) return false; + if (!getConfigRulesList() + .equals(other.getConfigRulesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -9400,78 +34070,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getTopologyIdsCount() > 0) { - hash = (37 * hash) + TOPOLOGY_IDS_FIELD_NUMBER; - hash = (53 * hash) + getTopologyIdsList().hashCode(); + if (getConfigRulesCount() > 0) { + hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; + hash = (53 * hash) + getConfigRulesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig 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 context.ContextOuterClass.TopologyIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseDelimitedFrom( + public static context.ContextOuterClass.SliceConfig 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 context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyIdList parseFrom( + public static context.ContextOuterClass.SliceConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -9484,7 +34154,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -9500,26 +34170,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyIdList} + * Protobuf type {@code context.SliceConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyIdList) - context.ContextOuterClass.TopologyIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceConfig) + context.ContextOuterClass.SliceConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyIdList.class, context.ContextOuterClass.TopologyIdList.Builder.class); + context.ContextOuterClass.SliceConfig.class, context.ContextOuterClass.SliceConfig.Builder.class); } - // Construct using context.ContextOuterClass.TopologyIdList.newBuilder() + // Construct using context.ContextOuterClass.SliceConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -9532,17 +34202,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologyIdsFieldBuilder(); + getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - topologyIdsBuilder_.clear(); + configRulesBuilder_.clear(); } return this; } @@ -9550,17 +34220,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyIdList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceConfig_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyIdList.getDefaultInstance(); + public context.ContextOuterClass.SliceConfig getDefaultInstanceForType() { + return context.ContextOuterClass.SliceConfig.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyIdList build() { - context.ContextOuterClass.TopologyIdList result = buildPartial(); + public context.ContextOuterClass.SliceConfig build() { + context.ContextOuterClass.SliceConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -9568,17 +34238,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyIdList buildPartial() { - context.ContextOuterClass.TopologyIdList result = new context.ContextOuterClass.TopologyIdList(this); + public context.ContextOuterClass.SliceConfig buildPartial() { + context.ContextOuterClass.SliceConfig result = new context.ContextOuterClass.SliceConfig(this); int from_bitField0_ = bitField0_; - if (topologyIdsBuilder_ == null) { + if (configRulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = java.util.Collections.unmodifiableList(topologyIds_); + configRules_ = java.util.Collections.unmodifiableList(configRules_); bitField0_ = (bitField0_ & ~0x00000001); } - result.topologyIds_ = topologyIds_; + result.configRules_ = configRules_; } else { - result.topologyIds_ = topologyIdsBuilder_.build(); + result.configRules_ = configRulesBuilder_.build(); } onBuilt(); return result; @@ -9618,39 +34288,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyIdList) { - return mergeFrom((context.ContextOuterClass.TopologyIdList)other); + if (other instanceof context.ContextOuterClass.SliceConfig) { + return mergeFrom((context.ContextOuterClass.SliceConfig)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyIdList other) { - if (other == context.ContextOuterClass.TopologyIdList.getDefaultInstance()) return this; - if (topologyIdsBuilder_ == null) { - if (!other.topologyIds_.isEmpty()) { - if (topologyIds_.isEmpty()) { - topologyIds_ = other.topologyIds_; + public Builder mergeFrom(context.ContextOuterClass.SliceConfig other) { + if (other == context.ContextOuterClass.SliceConfig.getDefaultInstance()) return this; + if (configRulesBuilder_ == null) { + if (!other.configRules_.isEmpty()) { + if (configRules_.isEmpty()) { + configRules_ = other.configRules_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureTopologyIdsIsMutable(); - topologyIds_.addAll(other.topologyIds_); + ensureConfigRulesIsMutable(); + configRules_.addAll(other.configRules_); } onChanged(); } } else { - if (!other.topologyIds_.isEmpty()) { - if (topologyIdsBuilder_.isEmpty()) { - topologyIdsBuilder_.dispose(); - topologyIdsBuilder_ = null; - topologyIds_ = other.topologyIds_; + if (!other.configRules_.isEmpty()) { + if (configRulesBuilder_.isEmpty()) { + configRulesBuilder_.dispose(); + configRulesBuilder_ = null; + configRules_ = other.configRules_; bitField0_ = (bitField0_ & ~0x00000001); - topologyIdsBuilder_ = + configRulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologyIdsFieldBuilder() : null; + getConfigRulesFieldBuilder() : null; } else { - topologyIdsBuilder_.addAllMessages(other.topologyIds_); + configRulesBuilder_.addAllMessages(other.configRules_); } } } @@ -9669,11 +34339,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyIdList parsedMessage = null; + context.ContextOuterClass.SliceConfig parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -9684,244 +34354,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List topologyIds_ = + private java.util.List configRules_ = java.util.Collections.emptyList(); - private void ensureTopologyIdsIsMutable() { + private void ensureConfigRulesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - topologyIds_ = new java.util.ArrayList(topologyIds_); + configRules_ = new java.util.ArrayList(configRules_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdsBuilder_; + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List getTopologyIdsList() { - if (topologyIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologyIds_); + public java.util.List getConfigRulesList() { + if (configRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(configRules_); } else { - return topologyIdsBuilder_.getMessageList(); + return configRulesBuilder_.getMessageList(); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public int getTopologyIdsCount() { - if (topologyIdsBuilder_ == null) { - return topologyIds_.size(); + public int getConfigRulesCount() { + if (configRulesBuilder_ == null) { + return configRules_.size(); } else { - return topologyIdsBuilder_.getCount(); + return configRulesBuilder_.getCount(); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId getTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); + public context.ContextOuterClass.ConfigRule getConfigRules(int index) { + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { - return topologyIdsBuilder_.getMessage(index); + return configRulesBuilder_.getMessage(index); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, value); + ensureConfigRulesIsMutable(); + configRules_.set(index, value); onChanged(); } else { - topologyIdsBuilder_.setMessage(index, value); + configRulesBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder setTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.set(index, builderForValue.build()); + public Builder setConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.set(index, builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.setMessage(index, builderForValue.build()); + configRulesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds(context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.add(value); + ensureConfigRulesIsMutable(); + configRules_.add(value); onChanged(); } else { - topologyIdsBuilder_.addMessage(value); + configRulesBuilder_.addMessage(value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId value) { - if (topologyIdsBuilder_ == null) { + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule value) { + if (configRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, value); + ensureConfigRulesIsMutable(); + configRules_.add(index, value); onChanged(); } else { - topologyIdsBuilder_.addMessage(index, value); + configRulesBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(builderForValue.build()); + public Builder addConfigRules( + context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.addMessage(builderForValue.build()); + configRulesBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addTopologyIds( - int index, context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.add(index, builderForValue.build()); + public Builder addConfigRules( + int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.add(index, builderForValue.build()); onChanged(); } else { - topologyIdsBuilder_.addMessage(index, builderForValue.build()); + configRulesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder addAllTopologyIds( - java.lang.Iterable values) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); + public Builder addAllConfigRules( + java.lang.Iterable values) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologyIds_); + values, configRules_); onChanged(); } else { - topologyIdsBuilder_.addAllMessages(values); + configRulesBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder clearTopologyIds() { - if (topologyIdsBuilder_ == null) { - topologyIds_ = java.util.Collections.emptyList(); + public Builder clearConfigRules() { + if (configRulesBuilder_ == null) { + configRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologyIdsBuilder_.clear(); + configRulesBuilder_.clear(); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public Builder removeTopologyIds(int index) { - if (topologyIdsBuilder_ == null) { - ensureTopologyIdsIsMutable(); - topologyIds_.remove(index); + public Builder removeConfigRules(int index) { + if (configRulesBuilder_ == null) { + ensureConfigRulesIsMutable(); + configRules_.remove(index); onChanged(); } else { - topologyIdsBuilder_.remove(index); + configRulesBuilder_.remove(index); } return this; } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdsBuilder( + public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( int index) { - return getTopologyIdsFieldBuilder().getBuilder(index); + return getConfigRulesFieldBuilder().getBuilder(index); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdsOrBuilder( + public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( int index) { - if (topologyIdsBuilder_ == null) { - return topologyIds_.get(index); } else { - return topologyIdsBuilder_.getMessageOrBuilder(index); + if (configRulesBuilder_ == null) { + return configRules_.get(index); } else { + return configRulesBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List - getTopologyIdsOrBuilderList() { - if (topologyIdsBuilder_ != null) { - return topologyIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getConfigRulesOrBuilderList() { + if (configRulesBuilder_ != null) { + return configRulesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(topologyIds_); + return java.util.Collections.unmodifiableList(configRules_); } } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder() { - return getTopologyIdsFieldBuilder().addBuilder( - context.ContextOuterClass.TopologyId.getDefaultInstance()); + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { + return getConfigRulesFieldBuilder().addBuilder( + context.ContextOuterClass.ConfigRule.getDefaultInstance()); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public context.ContextOuterClass.TopologyId.Builder addTopologyIdsBuilder( + public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( int index) { - return getTopologyIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.TopologyId.getDefaultInstance()); + return getConfigRulesFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); } /** - * repeated .context.TopologyId topology_ids = 1; + * repeated .context.ConfigRule config_rules = 1; */ - public java.util.List - getTopologyIdsBuilderList() { - return getTopologyIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdsFieldBuilder() { - if (topologyIdsBuilder_ == null) { - topologyIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - topologyIds_, + public java.util.List + getConfigRulesBuilderList() { + return getConfigRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> + getConfigRulesFieldBuilder() { + if (configRulesBuilder_ == null) { + configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( + configRules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologyIds_ = null; + configRules_ = null; } - return topologyIdsBuilder_; + return configRulesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -9936,95 +34606,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyIdList) + // @@protoc_insertion_point(builder_scope:context.SliceConfig) } - // @@protoc_insertion_point(class_scope:context.TopologyIdList) - private static final context.ContextOuterClass.TopologyIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceConfig) + private static final context.ContextOuterClass.SliceConfig DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceConfig(); } - public static context.ContextOuterClass.TopologyIdList getDefaultInstance() { + public static context.ContextOuterClass.SliceConfig getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyIdList parsePartialFrom( + public SliceConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyIdList(input, extensionRegistry); + return new SliceConfig(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyIdList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyList) + public interface SliceIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceIdList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - java.util.List - getTopologiesList(); + java.util.List + getSliceIdsList(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - context.ContextOuterClass.Topology getTopologies(int index); + context.ContextOuterClass.SliceId getSliceIds(int index); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - int getTopologiesCount(); + int getSliceIdsCount(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - java.util.List - getTopologiesOrBuilderList(); + java.util.List + getSliceIdsOrBuilderList(); /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index); } /** - * Protobuf type {@code context.TopologyList} + * Protobuf type {@code context.SliceIdList} */ - public static final class TopologyList extends + public static final class SliceIdList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyList) - TopologyListOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceIdList) + SliceIdListOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyList.newBuilder() to construct. - private TopologyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceIdList.newBuilder() to construct. + private SliceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyList() { - topologies_ = java.util.Collections.emptyList(); + private SliceIdList() { + sliceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyList(); + return new SliceIdList(); } @java.lang.Override @@ -10032,7 +34702,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyList( + private SliceIdList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10053,11 +34723,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - topologies_ = new java.util.ArrayList(); + sliceIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - topologies_.add( - input.readMessage(context.ContextOuterClass.Topology.parser(), extensionRegistry)); + sliceIds_.add( + input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry)); break; } default: { @@ -10076,7 +34746,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - topologies_ = java.util.Collections.unmodifiableList(topologies_); + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -10084,55 +34754,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); } - public static final int TOPOLOGIES_FIELD_NUMBER = 1; - private java.util.List topologies_; + public static final int SLICE_IDS_FIELD_NUMBER = 1; + private java.util.List sliceIds_; /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public java.util.List getTopologiesList() { - return topologies_; + public java.util.List getSliceIdsList() { + return sliceIds_; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public java.util.List - getTopologiesOrBuilderList() { - return topologies_; + public java.util.List + getSliceIdsOrBuilderList() { + return sliceIds_; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public int getTopologiesCount() { - return topologies_.size(); + public int getSliceIdsCount() { + return sliceIds_.size(); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.Topology getTopologies(int index) { - return topologies_.get(index); + public context.ContextOuterClass.SliceId getSliceIds(int index) { + return sliceIds_.get(index); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index) { - return topologies_.get(index); + return sliceIds_.get(index); } private byte memoizedIsInitialized = -1; @@ -10149,8 +34819,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < topologies_.size(); i++) { - output.writeMessage(1, topologies_.get(i)); + for (int i = 0; i < sliceIds_.size(); i++) { + output.writeMessage(1, sliceIds_.get(i)); } unknownFields.writeTo(output); } @@ -10161,9 +34831,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < topologies_.size(); i++) { + for (int i = 0; i < sliceIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, topologies_.get(i)); + .computeMessageSize(1, sliceIds_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -10175,13 +34845,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyList)) { + if (!(obj instanceof context.ContextOuterClass.SliceIdList)) { return super.equals(obj); } - context.ContextOuterClass.TopologyList other = (context.ContextOuterClass.TopologyList) obj; + context.ContextOuterClass.SliceIdList other = (context.ContextOuterClass.SliceIdList) obj; - if (!getTopologiesList() - .equals(other.getTopologiesList())) return false; + if (!getSliceIdsList() + .equals(other.getSliceIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -10193,78 +34863,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getTopologiesCount() > 0) { - hash = (37 * hash) + TOPOLOGIES_FIELD_NUMBER; - hash = (53 * hash) + getTopologiesList().hashCode(); + if (getSliceIdsCount() > 0) { + hash = (37 * hash) + SLICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSliceIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom(byte[] data) + public static context.ContextOuterClass.SliceIdList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceIdList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList 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 context.ContextOuterClass.TopologyList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceIdList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseDelimitedFrom( + public static context.ContextOuterClass.SliceIdList 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 context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyList parseFrom( + public static context.ContextOuterClass.SliceIdList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -10277,7 +34947,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyList prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceIdList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -10293,26 +34963,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyList} + * Protobuf type {@code context.SliceIdList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyList) - context.ContextOuterClass.TopologyListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceIdList) + context.ContextOuterClass.SliceIdListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyList.class, context.ContextOuterClass.TopologyList.Builder.class); + context.ContextOuterClass.SliceIdList.class, context.ContextOuterClass.SliceIdList.Builder.class); } - // Construct using context.ContextOuterClass.TopologyList.newBuilder() + // Construct using context.ContextOuterClass.SliceIdList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -10325,17 +34995,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getTopologiesFieldBuilder(); + getSliceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (topologiesBuilder_ == null) { - topologies_ = java.util.Collections.emptyList(); + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - topologiesBuilder_.clear(); + sliceIdsBuilder_.clear(); } return this; } @@ -10343,17 +35013,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyList_descriptor; + return context.ContextOuterClass.internal_static_context_SliceIdList_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyList.getDefaultInstance(); + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceIdList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyList build() { - context.ContextOuterClass.TopologyList result = buildPartial(); + public context.ContextOuterClass.SliceIdList build() { + context.ContextOuterClass.SliceIdList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -10361,17 +35031,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyList buildPartial() { - context.ContextOuterClass.TopologyList result = new context.ContextOuterClass.TopologyList(this); + public context.ContextOuterClass.SliceIdList buildPartial() { + context.ContextOuterClass.SliceIdList result = new context.ContextOuterClass.SliceIdList(this); int from_bitField0_ = bitField0_; - if (topologiesBuilder_ == null) { + if (sliceIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - topologies_ = java.util.Collections.unmodifiableList(topologies_); + sliceIds_ = java.util.Collections.unmodifiableList(sliceIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.topologies_ = topologies_; + result.sliceIds_ = sliceIds_; } else { - result.topologies_ = topologiesBuilder_.build(); + result.sliceIds_ = sliceIdsBuilder_.build(); } onBuilt(); return result; @@ -10411,39 +35081,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyList) { - return mergeFrom((context.ContextOuterClass.TopologyList)other); + if (other instanceof context.ContextOuterClass.SliceIdList) { + return mergeFrom((context.ContextOuterClass.SliceIdList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyList other) { - if (other == context.ContextOuterClass.TopologyList.getDefaultInstance()) return this; - if (topologiesBuilder_ == null) { - if (!other.topologies_.isEmpty()) { - if (topologies_.isEmpty()) { - topologies_ = other.topologies_; + public Builder mergeFrom(context.ContextOuterClass.SliceIdList other) { + if (other == context.ContextOuterClass.SliceIdList.getDefaultInstance()) return this; + if (sliceIdsBuilder_ == null) { + if (!other.sliceIds_.isEmpty()) { + if (sliceIds_.isEmpty()) { + sliceIds_ = other.sliceIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureTopologiesIsMutable(); - topologies_.addAll(other.topologies_); + ensureSliceIdsIsMutable(); + sliceIds_.addAll(other.sliceIds_); } onChanged(); } } else { - if (!other.topologies_.isEmpty()) { - if (topologiesBuilder_.isEmpty()) { - topologiesBuilder_.dispose(); - topologiesBuilder_ = null; - topologies_ = other.topologies_; + if (!other.sliceIds_.isEmpty()) { + if (sliceIdsBuilder_.isEmpty()) { + sliceIdsBuilder_.dispose(); + sliceIdsBuilder_ = null; + sliceIds_ = other.sliceIds_; bitField0_ = (bitField0_ & ~0x00000001); - topologiesBuilder_ = + sliceIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTopologiesFieldBuilder() : null; + getSliceIdsFieldBuilder() : null; } else { - topologiesBuilder_.addAllMessages(other.topologies_); + sliceIdsBuilder_.addAllMessages(other.sliceIds_); } } } @@ -10462,11 +35132,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyList parsedMessage = null; + context.ContextOuterClass.SliceIdList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceIdList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -10477,244 +35147,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List topologies_ = + private java.util.List sliceIds_ = java.util.Collections.emptyList(); - private void ensureTopologiesIsMutable() { + private void ensureSliceIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - topologies_ = new java.util.ArrayList(topologies_); + sliceIds_ = new java.util.ArrayList(sliceIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> topologiesBuilder_; + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdsBuilder_; /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List getTopologiesList() { - if (topologiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(topologies_); + public java.util.List getSliceIdsList() { + if (sliceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sliceIds_); } else { - return topologiesBuilder_.getMessageList(); + return sliceIdsBuilder_.getMessageList(); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public int getTopologiesCount() { - if (topologiesBuilder_ == null) { - return topologies_.size(); + public int getSliceIdsCount() { + if (sliceIdsBuilder_ == null) { + return sliceIds_.size(); } else { - return topologiesBuilder_.getCount(); + return sliceIdsBuilder_.getCount(); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology getTopologies(int index) { - if (topologiesBuilder_ == null) { - return topologies_.get(index); + public context.ContextOuterClass.SliceId getSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { - return topologiesBuilder_.getMessage(index); + return sliceIdsBuilder_.getMessage(index); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder setTopologies( - int index, context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.set(index, value); + ensureSliceIdsIsMutable(); + sliceIds_.set(index, value); onChanged(); } else { - topologiesBuilder_.setMessage(index, value); + sliceIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder setTopologies( - int index, context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.set(index, builderForValue.build()); + public Builder setSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.set(index, builderForValue.build()); onChanged(); } else { - topologiesBuilder_.setMessage(index, builderForValue.build()); + sliceIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies(context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder addSliceIds(context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.add(value); + ensureSliceIdsIsMutable(); + sliceIds_.add(value); onChanged(); } else { - topologiesBuilder_.addMessage(value); + sliceIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - int index, context.ContextOuterClass.Topology value) { - if (topologiesBuilder_ == null) { + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId value) { + if (sliceIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureTopologiesIsMutable(); - topologies_.add(index, value); + ensureSliceIdsIsMutable(); + sliceIds_.add(index, value); onChanged(); } else { - topologiesBuilder_.addMessage(index, value); + sliceIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.add(builderForValue.build()); + public Builder addSliceIds( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(builderForValue.build()); onChanged(); } else { - topologiesBuilder_.addMessage(builderForValue.build()); + sliceIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addTopologies( - int index, context.ContextOuterClass.Topology.Builder builderForValue) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.add(index, builderForValue.build()); + public Builder addSliceIds( + int index, context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.add(index, builderForValue.build()); onChanged(); } else { - topologiesBuilder_.addMessage(index, builderForValue.build()); + sliceIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder addAllTopologies( - java.lang.Iterable values) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); + public Builder addAllSliceIds( + java.lang.Iterable values) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, topologies_); + values, sliceIds_); onChanged(); } else { - topologiesBuilder_.addAllMessages(values); + sliceIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder clearTopologies() { - if (topologiesBuilder_ == null) { - topologies_ = java.util.Collections.emptyList(); + public Builder clearSliceIds() { + if (sliceIdsBuilder_ == null) { + sliceIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologiesBuilder_.clear(); + sliceIdsBuilder_.clear(); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public Builder removeTopologies(int index) { - if (topologiesBuilder_ == null) { - ensureTopologiesIsMutable(); - topologies_.remove(index); + public Builder removeSliceIds(int index) { + if (sliceIdsBuilder_ == null) { + ensureSliceIdsIsMutable(); + sliceIds_.remove(index); onChanged(); } else { - topologiesBuilder_.remove(index); + sliceIdsBuilder_.remove(index); } return this; } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder getTopologiesBuilder( + public context.ContextOuterClass.SliceId.Builder getSliceIdsBuilder( int index) { - return getTopologiesFieldBuilder().getBuilder(index); + return getSliceIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.TopologyOrBuilder getTopologiesOrBuilder( + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdsOrBuilder( int index) { - if (topologiesBuilder_ == null) { - return topologies_.get(index); } else { - return topologiesBuilder_.getMessageOrBuilder(index); + if (sliceIdsBuilder_ == null) { + return sliceIds_.get(index); } else { + return sliceIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List - getTopologiesOrBuilderList() { - if (topologiesBuilder_ != null) { - return topologiesBuilder_.getMessageOrBuilderList(); + public java.util.List + getSliceIdsOrBuilderList() { + if (sliceIdsBuilder_ != null) { + return sliceIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(topologies_); + return java.util.Collections.unmodifiableList(sliceIds_); } } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder addTopologiesBuilder() { - return getTopologiesFieldBuilder().addBuilder( - context.ContextOuterClass.Topology.getDefaultInstance()); + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder() { + return getSliceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.SliceId.getDefaultInstance()); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public context.ContextOuterClass.Topology.Builder addTopologiesBuilder( + public context.ContextOuterClass.SliceId.Builder addSliceIdsBuilder( int index) { - return getTopologiesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Topology.getDefaultInstance()); + return getSliceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.SliceId.getDefaultInstance()); } /** - * repeated .context.Topology topologies = 1; + * repeated .context.SliceId slice_ids = 1; */ - public java.util.List - getTopologiesBuilderList() { - return getTopologiesFieldBuilder().getBuilderList(); + public java.util.List + getSliceIdsBuilderList() { + return getSliceIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder> - getTopologiesFieldBuilder() { - if (topologiesBuilder_ == null) { - topologiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Topology, context.ContextOuterClass.Topology.Builder, context.ContextOuterClass.TopologyOrBuilder>( - topologies_, + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdsFieldBuilder() { + if (sliceIdsBuilder_ == null) { + sliceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + sliceIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologies_ = null; + sliceIds_ = null; } - return topologiesBuilder_; + return sliceIdsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -10729,100 +35399,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyList) + // @@protoc_insertion_point(builder_scope:context.SliceIdList) } - // @@protoc_insertion_point(class_scope:context.TopologyList) - private static final context.ContextOuterClass.TopologyList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceIdList) + private static final context.ContextOuterClass.SliceIdList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceIdList(); } - public static context.ContextOuterClass.TopologyList getDefaultInstance() { + public static context.ContextOuterClass.SliceIdList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyList parsePartialFrom( + public SliceIdList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyList(input, extensionRegistry); + return new SliceIdList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyList getDefaultInstanceForType() { + public context.ContextOuterClass.SliceIdList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface TopologyEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.TopologyEvent) + public interface SliceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceList) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.Event getEvent(); + java.util.List + getSlicesList(); /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); - + context.ContextOuterClass.Slice getSlices(int index); /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. + * repeated .context.Slice slices = 1; */ - boolean hasTopologyId(); + int getSlicesCount(); /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.TopologyId getTopologyId(); + java.util.List + getSlicesOrBuilderList(); /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index); } /** - * Protobuf type {@code context.TopologyEvent} + * Protobuf type {@code context.SliceList} */ - public static final class TopologyEvent extends + public static final class SliceList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.TopologyEvent) - TopologyEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceList) + SliceListOrBuilder { private static final long serialVersionUID = 0L; - // Use TopologyEvent.newBuilder() to construct. - private TopologyEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceList.newBuilder() to construct. + private SliceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private TopologyEvent() { + private SliceList() { + slices_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new TopologyEvent(); + return new SliceList(); } @java.lang.Override @@ -10830,7 +35495,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private TopologyEvent( + private SliceList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10838,6 +35503,7 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -10849,29 +35515,12 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); - } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - + slices_.add( + input.readMessage(context.ContextOuterClass.Slice.parser(), extensionRegistry)); break; } default: { @@ -10889,73 +35538,64 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } + public static final int SLICES_FIELD_NUMBER = 1; + private java.util.List slices_; /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public java.util.List getSlicesList() { + return slices_; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public java.util.List + getSlicesOrBuilderList() { + return slices_; } - - public static final int TOPOLOGY_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.TopologyId topologyId_; /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; + public int getSlicesCount() { + return slices_.size(); } /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + public context.ContextOuterClass.Slice getSlices(int index) { + return slices_.get(index); } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + return slices_.get(index); } private byte memoizedIsInitialized = -1; @@ -10972,11 +35612,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); - } - if (topologyId_ != null) { - output.writeMessage(2, getTopologyId()); + for (int i = 0; i < slices_.size(); i++) { + output.writeMessage(1, slices_.get(i)); } unknownFields.writeTo(output); } @@ -10987,13 +35624,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); - } - if (topologyId_ != null) { + for (int i = 0; i < slices_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTopologyId()); + .computeMessageSize(1, slices_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -11005,21 +35638,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.TopologyEvent)) { + if (!(obj instanceof context.ContextOuterClass.SliceList)) { return super.equals(obj); } - context.ContextOuterClass.TopologyEvent other = (context.ContextOuterClass.TopologyEvent) obj; + context.ContextOuterClass.SliceList other = (context.ContextOuterClass.SliceList) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; - } + if (!getSlicesList() + .equals(other.getSlicesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -11031,82 +35656,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); + if (getSlicesCount() > 0) { + hash = (37 * hash) + SLICES_FIELD_NUMBER; + hash = (53 * hash) + getSlicesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom(byte[] data) + public static context.ContextOuterClass.SliceList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.TopologyEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList 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 context.ContextOuterClass.TopologyEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseDelimitedFrom( + public static context.ContextOuterClass.SliceList 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 context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.TopologyEvent parseFrom( + public static context.ContextOuterClass.SliceList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -11119,7 +35740,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.TopologyEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -11135,26 +35756,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.TopologyEvent} + * Protobuf type {@code context.SliceList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.TopologyEvent) - context.ContextOuterClass.TopologyEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceList) + context.ContextOuterClass.SliceListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.TopologyEvent.class, context.ContextOuterClass.TopologyEvent.Builder.class); + context.ContextOuterClass.SliceList.class, context.ContextOuterClass.SliceList.Builder.class); } - // Construct using context.ContextOuterClass.TopologyEvent.newBuilder() + // Construct using context.ContextOuterClass.SliceList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -11167,22 +35788,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getSlicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (topologyIdBuilder_ == null) { - topologyId_ = null; + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - topologyId_ = null; - topologyIdBuilder_ = null; + slicesBuilder_.clear(); } return this; } @@ -11190,17 +35806,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_TopologyEvent_descriptor; + return context.ContextOuterClass.internal_static_context_SliceList_descriptor; } @java.lang.Override - public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { - return context.ContextOuterClass.TopologyEvent.getDefaultInstance(); + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { + return context.ContextOuterClass.SliceList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.TopologyEvent build() { - context.ContextOuterClass.TopologyEvent result = buildPartial(); + public context.ContextOuterClass.SliceList build() { + context.ContextOuterClass.SliceList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -11208,17 +35824,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.TopologyEvent buildPartial() { - context.ContextOuterClass.TopologyEvent result = new context.ContextOuterClass.TopologyEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; + public context.ContextOuterClass.SliceList buildPartial() { + context.ContextOuterClass.SliceList result = new context.ContextOuterClass.SliceList(this); + int from_bitField0_ = bitField0_; + if (slicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + slices_ = java.util.Collections.unmodifiableList(slices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.slices_ = slices_; } else { - result.topologyId_ = topologyIdBuilder_.build(); + result.slices_ = slicesBuilder_.build(); } onBuilt(); return result; @@ -11258,21 +35874,41 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.TopologyEvent) { - return mergeFrom((context.ContextOuterClass.TopologyEvent)other); + if (other instanceof context.ContextOuterClass.SliceList) { + return mergeFrom((context.ContextOuterClass.SliceList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.TopologyEvent other) { - if (other == context.ContextOuterClass.TopologyEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); - } - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); + public Builder mergeFrom(context.ContextOuterClass.SliceList other) { + if (other == context.ContextOuterClass.SliceList.getDefaultInstance()) return this; + if (slicesBuilder_ == null) { + if (!other.slices_.isEmpty()) { + if (slices_.isEmpty()) { + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSlicesIsMutable(); + slices_.addAll(other.slices_); + } + onChanged(); + } + } else { + if (!other.slices_.isEmpty()) { + if (slicesBuilder_.isEmpty()) { + slicesBuilder_.dispose(); + slicesBuilder_ = null; + slices_ = other.slices_; + bitField0_ = (bitField0_ & ~0x00000001); + slicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSlicesFieldBuilder() : null; + } else { + slicesBuilder_.addAllMessages(other.slices_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -11289,11 +35925,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.TopologyEvent parsedMessage = null; + context.ContextOuterClass.SliceList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.TopologyEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -11302,243 +35938,246 @@ public final class ContextOuterClass { } return this; } + private int bitField0_; - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + private java.util.List slices_ = + java.util.Collections.emptyList(); + private void ensureSlicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + slices_ = new java.util.ArrayList(slices_); + bitField0_ |= 0x00000001; + } } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> slicesBuilder_; + /** - * .context.Event event = 1; - * @return The event. + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public java.util.List getSlicesList() { + if (slicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(slices_); } else { - return eventBuilder_.getMessage(); + return slicesBuilder_.getMessageList(); } } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); + public int getSlicesCount() { + if (slicesBuilder_ == null) { + return slices_.size(); } else { - eventBuilder_.setMessage(value); + return slicesBuilder_.getCount(); } - - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); + public context.ContextOuterClass.Slice getSlices(int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { - eventBuilder_.setMessage(builderForValue.build()); + return slicesBuilder_.getMessage(index); } - - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; + public Builder setSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureSlicesIsMutable(); + slices_.set(index, value); onChanged(); } else { - eventBuilder_.mergeFrom(value); + slicesBuilder_.setMessage(index, value); } - return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; + public Builder setSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.set(index, builderForValue.build()); onChanged(); } else { - event_ = null; - eventBuilder_ = null; + slicesBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); + public Builder addSlices(context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(value); + onChanged(); } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; + slicesBuilder_.addMessage(value); } + return this; } /** - * .context.Event event = 1; + * repeated .context.Slice slices = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; + public Builder addSlices( + int index, context.ContextOuterClass.Slice value) { + if (slicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSlicesIsMutable(); + slices_.add(index, value); + onChanged(); + } else { + slicesBuilder_.addMessage(index, value); } - return eventBuilder_; - } - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 2; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; + return this; } /** - * .context.TopologyId topology_id = 2; - * @return The topologyId. + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + public Builder addSlices( + context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(builderForValue.build()); + onChanged(); } else { - return topologyIdBuilder_.getMessage(); + slicesBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; + public Builder addSlices( + int index, context.ContextOuterClass.Slice.Builder builderForValue) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.add(index, builderForValue.build()); onChanged(); } else { - topologyIdBuilder_.setMessage(value); + slicesBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); + public Builder addAllSlices( + java.lang.Iterable values) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, slices_); onChanged(); } else { - topologyIdBuilder_.setMessage(builderForValue.build()); + slicesBuilder_.addAllMessages(values); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } + public Builder clearSlices() { + if (slicesBuilder_ == null) { + slices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - topologyIdBuilder_.mergeFrom(value); + slicesBuilder_.clear(); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; + public Builder removeSlices(int index) { + if (slicesBuilder_ == null) { + ensureSlicesIsMutable(); + slices_.remove(index); onChanged(); } else { - topologyId_ = null; - topologyIdBuilder_ = null; + slicesBuilder_.remove(index); } - return this; } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); + public context.ContextOuterClass.Slice.Builder getSlicesBuilder( + int index) { + return getSlicesFieldBuilder().getBuilder(index); } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.SliceOrBuilder getSlicesOrBuilder( + int index) { + if (slicesBuilder_ == null) { + return slices_.get(index); } else { + return slicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.Slice slices = 1; + */ + public java.util.List + getSlicesOrBuilderList() { + if (slicesBuilder_ != null) { + return slicesBuilder_.getMessageOrBuilderList(); } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; + return java.util.Collections.unmodifiableList(slices_); } } /** - * .context.TopologyId topology_id = 2; + * repeated .context.Slice slices = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), + public context.ContextOuterClass.Slice.Builder addSlicesBuilder() { + return getSlicesFieldBuilder().addBuilder( + context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * repeated .context.Slice slices = 1; + */ + public context.ContextOuterClass.Slice.Builder addSlicesBuilder( + int index) { + return getSlicesFieldBuilder().addBuilder( + index, context.ContextOuterClass.Slice.getDefaultInstance()); + } + /** + * repeated .context.Slice slices = 1; + */ + public java.util.List + getSlicesBuilderList() { + return getSlicesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder> + getSlicesFieldBuilder() { + if (slicesBuilder_ == null) { + slicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Slice, context.ContextOuterClass.Slice.Builder, context.ContextOuterClass.SliceOrBuilder>( + slices_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - topologyId_ = null; + slices_ = null; } - return topologyIdBuilder_; + return slicesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -11553,89 +36192,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.TopologyEvent) + // @@protoc_insertion_point(builder_scope:context.SliceList) } - // @@protoc_insertion_point(class_scope:context.TopologyEvent) - private static final context.ContextOuterClass.TopologyEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceList) + private static final context.ContextOuterClass.SliceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.TopologyEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceList(); } - public static context.ContextOuterClass.TopologyEvent getDefaultInstance() { + public static context.ContextOuterClass.SliceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public TopologyEvent parsePartialFrom( + public SliceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TopologyEvent(input, extensionRegistry); + return new SliceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.TopologyEvent getDefaultInstanceForType() { + public context.ContextOuterClass.SliceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceId) + public interface SliceEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.SliceEvent) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ - boolean hasDeviceUuid(); + boolean hasEvent(); /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ - context.ContextOuterClass.Uuid getDeviceUuid(); + context.ContextOuterClass.Event getEvent(); /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder(); + context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 2; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); } /** - *
-   * ----- Device --------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.DeviceId} + * Protobuf type {@code context.SliceEvent} */ - public static final class DeviceId extends + public static final class SliceEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceId) - DeviceIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.SliceEvent) + SliceEventOrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceId.newBuilder() to construct. - private DeviceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use SliceEvent.newBuilder() to construct. + private SliceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceId() { + private SliceEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceId(); + return new SliceEvent(); } @java.lang.Override @@ -11643,7 +36293,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceId( + private SliceEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -11662,14 +36312,27 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (deviceUuid_ != null) { - subBuilder = deviceUuid_.toBuilder(); + context.ContextOuterClass.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); } - deviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(deviceUuid_); - deviceUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = subBuilder.buildPartial(); } break; @@ -11695,41 +36358,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); } - public static final int DEVICE_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid deviceUuid_; + public static final int EVENT_FIELD_NUMBER = 1; + private context.ContextOuterClass.Event event_; /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ @java.lang.Override - public boolean hasDeviceUuid() { - return deviceUuid_ != null; + public boolean hasEvent() { + return event_ != null; } /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ @java.lang.Override - public context.ContextOuterClass.Uuid getDeviceUuid() { - return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + public context.ContextOuterClass.Event getEvent() { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { - return getDeviceUuid(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); } private byte memoizedIsInitialized = -1; @@ -11746,8 +36435,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (deviceUuid_ != null) { - output.writeMessage(1, getDeviceUuid()); + if (event_ != null) { + output.writeMessage(1, getEvent()); + } + if (sliceId_ != null) { + output.writeMessage(2, getSliceId()); } unknownFields.writeTo(output); } @@ -11758,9 +36450,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (deviceUuid_ != null) { + if (event_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getDeviceUuid()); + .computeMessageSize(1, getEvent()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSliceId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -11772,15 +36468,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceId)) { + if (!(obj instanceof context.ContextOuterClass.SliceEvent)) { return super.equals(obj); } - context.ContextOuterClass.DeviceId other = (context.ContextOuterClass.DeviceId) obj; + context.ContextOuterClass.SliceEvent other = (context.ContextOuterClass.SliceEvent) obj; - if (hasDeviceUuid() != other.hasDeviceUuid()) return false; - if (hasDeviceUuid()) { - if (!getDeviceUuid() - .equals(other.getDeviceUuid())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent() + .equals(other.getEvent())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -11793,78 +36494,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDeviceUuid()) { - hash = (37 * hash) + DEVICE_UUID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceUuid().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom(byte[] data) + public static context.ContextOuterClass.SliceEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent 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 context.ContextOuterClass.DeviceId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.SliceEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseDelimitedFrom( + public static context.ContextOuterClass.SliceEvent 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 context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceId parseFrom( + public static context.ContextOuterClass.SliceEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -11877,7 +36582,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceId prototype) { + public static Builder newBuilder(context.ContextOuterClass.SliceEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -11893,30 +36598,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Device --------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.DeviceId} + * Protobuf type {@code context.SliceEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceId) - context.ContextOuterClass.DeviceIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.SliceEvent) + context.ContextOuterClass.SliceEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_SliceEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceId.class, context.ContextOuterClass.DeviceId.Builder.class); + context.ContextOuterClass.SliceEvent.class, context.ContextOuterClass.SliceEvent.Builder.class); } - // Construct using context.ContextOuterClass.DeviceId.newBuilder() + // Construct using context.ContextOuterClass.SliceEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -11934,11 +36635,17 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (deviceUuidBuilder_ == null) { - deviceUuid_ = null; + if (eventBuilder_ == null) { + event_ = null; } else { - deviceUuid_ = null; - deviceUuidBuilder_ = null; + event_ = null; + eventBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; } return this; } @@ -11946,17 +36653,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceId_descriptor; + return context.ContextOuterClass.internal_static_context_SliceEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceId.getDefaultInstance(); + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { + return context.ContextOuterClass.SliceEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceId build() { - context.ContextOuterClass.DeviceId result = buildPartial(); + public context.ContextOuterClass.SliceEvent build() { + context.ContextOuterClass.SliceEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -11964,12 +36671,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceId buildPartial() { - context.ContextOuterClass.DeviceId result = new context.ContextOuterClass.DeviceId(this); - if (deviceUuidBuilder_ == null) { - result.deviceUuid_ = deviceUuid_; + public context.ContextOuterClass.SliceEvent buildPartial() { + context.ContextOuterClass.SliceEvent result = new context.ContextOuterClass.SliceEvent(this); + if (eventBuilder_ == null) { + result.event_ = event_; } else { - result.deviceUuid_ = deviceUuidBuilder_.build(); + result.event_ = eventBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.build(); } onBuilt(); return result; @@ -12009,18 +36721,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceId) { - return mergeFrom((context.ContextOuterClass.DeviceId)other); + if (other instanceof context.ContextOuterClass.SliceEvent) { + return mergeFrom((context.ContextOuterClass.SliceEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceId other) { - if (other == context.ContextOuterClass.DeviceId.getDefaultInstance()) return this; - if (other.hasDeviceUuid()) { - mergeDeviceUuid(other.getDeviceUuid()); + public Builder mergeFrom(context.ContextOuterClass.SliceEvent other) { + if (other == context.ContextOuterClass.SliceEvent.getDefaultInstance()) return this; + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -12037,11 +36752,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceId parsedMessage = null; + context.ContextOuterClass.SliceEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.SliceEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -12051,123 +36766,242 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid deviceUuid_; + private context.ContextOuterClass.Event event_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> deviceUuidBuilder_; + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; /** - * .context.Uuid device_uuid = 1; - * @return Whether the deviceUuid field is set. + * .context.Event event = 1; + * @return Whether the event field is set. */ - public boolean hasDeviceUuid() { - return deviceUuidBuilder_ != null || deviceUuid_ != null; + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; } /** - * .context.Uuid device_uuid = 1; - * @return The deviceUuid. + * .context.Event event = 1; + * @return The event. */ - public context.ContextOuterClass.Uuid getDeviceUuid() { - if (deviceUuidBuilder_ == null) { - return deviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + public context.ContextOuterClass.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; } else { - return deviceUuidBuilder_.getMessage(); + return eventBuilder_.getMessage(); } } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder setDeviceUuid(context.ContextOuterClass.Uuid value) { - if (deviceUuidBuilder_ == null) { + public Builder setEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - deviceUuid_ = value; + event_ = value; onChanged(); } else { - deviceUuidBuilder_.setMessage(value); + eventBuilder_.setMessage(value); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder setDeviceUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (deviceUuidBuilder_ == null) { - deviceUuid_ = builderForValue.build(); + public Builder setEvent( + context.ContextOuterClass.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); onChanged(); } else { - deviceUuidBuilder_.setMessage(builderForValue.build()); + eventBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder mergeDeviceUuid(context.ContextOuterClass.Uuid value) { - if (deviceUuidBuilder_ == null) { - if (deviceUuid_ != null) { - deviceUuid_ = - context.ContextOuterClass.Uuid.newBuilder(deviceUuid_).mergeFrom(value).buildPartial(); + public Builder mergeEvent(context.ContextOuterClass.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); } else { - deviceUuid_ = value; + event_ = value; } onChanged(); } else { - deviceUuidBuilder_.mergeFrom(value); + eventBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public Builder clearDeviceUuid() { - if (deviceUuidBuilder_ == null) { - deviceUuid_ = null; + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; onChanged(); } else { - deviceUuid_ = null; - deviceUuidBuilder_ = null; + event_ = null; + eventBuilder_ = null; } return this; } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public context.ContextOuterClass.Uuid.Builder getDeviceUuidBuilder() { + public context.ContextOuterClass.Event.Builder getEventBuilder() { onChanged(); - return getDeviceUuidFieldBuilder().getBuilder(); + return getEventFieldBuilder().getBuilder(); } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ - public context.ContextOuterClass.UuidOrBuilder getDeviceUuidOrBuilder() { - if (deviceUuidBuilder_ != null) { - return deviceUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); } else { - return deviceUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : deviceUuid_; + return event_ == null ? + context.ContextOuterClass.Event.getDefaultInstance() : event_; } } /** - * .context.Uuid device_uuid = 1; + * .context.Event event = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getDeviceUuidFieldBuilder() { - if (deviceUuidBuilder_ == null) { - deviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getDeviceUuid(), + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( + getEvent(), getParentForChildren(), isClean()); - deviceUuid_ = null; + event_ = null; } - return deviceUuidBuilder_; + return eventBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 2; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 2; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 2; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 2; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -12182,180 +37016,89 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceId) + // @@protoc_insertion_point(builder_scope:context.SliceEvent) } - // @@protoc_insertion_point(class_scope:context.DeviceId) - private static final context.ContextOuterClass.DeviceId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.SliceEvent) + private static final context.ContextOuterClass.SliceEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.SliceEvent(); } - public static context.ContextOuterClass.DeviceId getDefaultInstance() { + public static context.ContextOuterClass.SliceEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceId parsePartialFrom( + public SliceEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceId(input, extensionRegistry); + return new SliceEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceId getDefaultInstanceForType() { + public context.ContextOuterClass.SliceEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Device) + public interface ConnectionIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionId) com.google.protobuf.MessageOrBuilder { /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - boolean hasDeviceId(); - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - context.ContextOuterClass.DeviceId getDeviceId(); - /** - * .context.DeviceId device_id = 1; - */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); - - /** - * string device_type = 2; - * @return The deviceType. - */ - java.lang.String getDeviceType(); - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - com.google.protobuf.ByteString - getDeviceTypeBytes(); - - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - boolean hasDeviceConfig(); - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - context.ContextOuterClass.DeviceConfig getDeviceConfig(); - /** - * .context.DeviceConfig device_config = 3; - */ - context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder(); - - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - int getDeviceOperationalStatusValue(); - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ - context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus(); - - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - java.util.List getDeviceDriversList(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - int getDeviceDriversCount(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - java.util.List - getDeviceDriversValueList(); - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - int getDeviceDriversValue(int index); - - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - java.util.List - getDeviceEndpointsList(); - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - context.ContextOuterClass.EndPoint getDeviceEndpoints(int index); - /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ - int getDeviceEndpointsCount(); + boolean hasConnectionUuid(); /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ - java.util.List - getDeviceEndpointsOrBuilderList(); + context.ContextOuterClass.Uuid getConnectionUuid(); /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index); + context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); } /** - * Protobuf type {@code context.Device} + *
+   * ----- Connection ----------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.ConnectionId} */ - public static final class Device extends + public static final class ConnectionId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Device) - DeviceOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionId) + ConnectionIdOrBuilder { private static final long serialVersionUID = 0L; - // Use Device.newBuilder() to construct. - private Device(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionId.newBuilder() to construct. + private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Device() { - deviceType_ = ""; - deviceOperationalStatus_ = 0; - deviceDrivers_ = java.util.Collections.emptyList(); - deviceEndpoints_ = java.util.Collections.emptyList(); + private ConnectionId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Device(); + return new ConnectionId(); } @java.lang.Override @@ -12363,7 +37106,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Device( + private ConnectionId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -12371,7 +37114,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -12383,75 +37125,18 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - deviceType_ = s; - break; - } - case 26: { - context.ContextOuterClass.DeviceConfig.Builder subBuilder = null; - if (deviceConfig_ != null) { - subBuilder = deviceConfig_.toBuilder(); + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (connectionUuid_ != null) { + subBuilder = connectionUuid_.toBuilder(); } - deviceConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry); + connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(deviceConfig_); - deviceConfig_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionUuid_); + connectionUuid_ = subBuilder.buildPartial(); } break; } - case 32: { - int rawValue = input.readEnum(); - - deviceOperationalStatus_ = rawValue; - break; - } - case 40: { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceDrivers_.add(rawValue); - break; - } - case 42: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while(input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceDrivers_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - deviceEndpoints_.add( - input.readMessage(context.ContextOuterClass.EndPoint.parser(), extensionRegistry)); - break; - } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -12467,234 +37152,47 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); - } - - public static final int DEVICE_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.DeviceId deviceId_; - /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; - } - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - /** - * .context.DeviceId device_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); - } - - public static final int DEVICE_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object deviceType_; - /** - * string device_type = 2; - * @return The deviceType. - */ - @java.lang.Override - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - 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(); - deviceType_ = s; - return s; - } - } - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEVICE_CONFIG_FIELD_NUMBER = 3; - private context.ContextOuterClass.DeviceConfig deviceConfig_; - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - @java.lang.Override - public boolean hasDeviceConfig() { - return deviceConfig_ != null; - } - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDeviceConfig() { - return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } - /** - * .context.DeviceConfig device_config = 3; - */ - @java.lang.Override - public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { - return getDeviceConfig(); - } - - public static final int DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER = 4; - private int deviceOperationalStatus_; - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - @java.lang.Override public int getDeviceOperationalStatusValue() { - return deviceOperationalStatus_; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ - @java.lang.Override public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); - return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; - } - - public static final int DEVICE_DRIVERS_FIELD_NUMBER = 5; - private java.util.List deviceDrivers_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum> deviceDrivers_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>() { - public context.ContextOuterClass.DeviceDriverEnum convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceDriverEnum result = context.ContextOuterClass.DeviceDriverEnum.valueOf(from); - return result == null ? context.ContextOuterClass.DeviceDriverEnum.UNRECOGNIZED : result; - } - }; - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - @java.lang.Override - public java.util.List getDeviceDriversList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - @java.lang.Override - public int getDeviceDriversCount() { - return deviceDrivers_.size(); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - @java.lang.Override - public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { - return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - @java.lang.Override - public java.util.List - getDeviceDriversValueList() { - return deviceDrivers_; - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - @java.lang.Override - public int getDeviceDriversValue(int index) { - return deviceDrivers_.get(index); + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); } - private int deviceDriversMemoizedSerializedSize; - public static final int DEVICE_ENDPOINTS_FIELD_NUMBER = 6; - private java.util.List deviceEndpoints_; - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - @java.lang.Override - public java.util.List getDeviceEndpointsList() { - return deviceEndpoints_; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - @java.lang.Override - public java.util.List - getDeviceEndpointsOrBuilderList() { - return deviceEndpoints_; - } + public static final int CONNECTION_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid connectionUuid_; /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ @java.lang.Override - public int getDeviceEndpointsCount() { - return deviceEndpoints_.size(); + public boolean hasConnectionUuid() { + return connectionUuid_ != null; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ @java.lang.Override - public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { - return deviceEndpoints_.get(index); + public context.ContextOuterClass.Uuid getConnectionUuid() { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ @java.lang.Override - public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index) { - return deviceEndpoints_.get(index); + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + return getConnectionUuid(); } private byte memoizedIsInitialized = -1; @@ -12711,28 +37209,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (deviceId_ != null) { - output.writeMessage(1, getDeviceId()); - } - if (!getDeviceTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_); - } - if (deviceConfig_ != null) { - output.writeMessage(3, getDeviceConfig()); - } - if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { - output.writeEnum(4, deviceOperationalStatus_); - } - if (getDeviceDriversList().size() > 0) { - output.writeUInt32NoTag(42); - output.writeUInt32NoTag(deviceDriversMemoizedSerializedSize); - } - for (int i = 0; i < deviceDrivers_.size(); i++) { - output.writeEnumNoTag(deviceDrivers_.get(i)); - } - for (int i = 0; i < deviceEndpoints_.size(); i++) { - output.writeMessage(6, deviceEndpoints_.get(i)); + if (connectionUuid_ != null) { + output.writeMessage(1, getConnectionUuid()); } unknownFields.writeTo(output); } @@ -12743,36 +37221,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (deviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getDeviceId()); - } - if (!getDeviceTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_); - } - if (deviceConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getDeviceConfig()); - } - if (deviceOperationalStatus_ != context.ContextOuterClass.DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, deviceOperationalStatus_); - } - { - int dataSize = 0; - for (int i = 0; i < deviceDrivers_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeEnumSizeNoTag(deviceDrivers_.get(i)); - } - size += dataSize; - if (!getDeviceDriversList().isEmpty()) { size += 1; - size += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dataSize); - }deviceDriversMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < deviceEndpoints_.size(); i++) { + if (connectionUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, deviceEndpoints_.get(i)); + .computeMessageSize(1, getConnectionUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -12784,27 +37235,16 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Device)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { return super.equals(obj); } - context.ContextOuterClass.Device other = (context.ContextOuterClass.Device) obj; + context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } - if (!getDeviceType() - .equals(other.getDeviceType())) return false; - if (hasDeviceConfig() != other.hasDeviceConfig()) return false; - if (hasDeviceConfig()) { - if (!getDeviceConfig() - .equals(other.getDeviceConfig())) return false; + if (hasConnectionUuid() != other.hasConnectionUuid()) return false; + if (hasConnectionUuid()) { + if (!getConnectionUuid() + .equals(other.getConnectionUuid())) return false; } - if (deviceOperationalStatus_ != other.deviceOperationalStatus_) return false; - if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; - if (!getDeviceEndpointsList() - .equals(other.getDeviceEndpointsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -12816,94 +37256,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } - hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getDeviceType().hashCode(); - if (hasDeviceConfig()) { - hash = (37 * hash) + DEVICE_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDeviceConfig().hashCode(); - } - hash = (37 * hash) + DEVICE_OPERATIONAL_STATUS_FIELD_NUMBER; - hash = (53 * hash) + deviceOperationalStatus_; - if (getDeviceDriversCount() > 0) { - hash = (37 * hash) + DEVICE_DRIVERS_FIELD_NUMBER; - hash = (53 * hash) + deviceDrivers_.hashCode(); - } - if (getDeviceEndpointsCount() > 0) { - hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceEndpointsList().hashCode(); + if (hasConnectionUuid()) { + hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Device parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId 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 context.ContextOuterClass.Device parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionId 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 context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Device parseFrom( + public static context.ContextOuterClass.ConnectionId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -12916,7 +37340,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Device prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -12932,994 +37356,281 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Device} + *
+     * ----- Connection ----------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.ConnectionId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Device) - context.ContextOuterClass.DeviceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Device_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Device.class, context.ContextOuterClass.Device.Builder.class); - } - - // Construct using context.ContextOuterClass.Device.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDeviceEndpointsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - deviceType_ = ""; - - if (deviceConfigBuilder_ == null) { - deviceConfig_ = null; - } else { - deviceConfig_ = null; - deviceConfigBuilder_ = null; - } - deviceOperationalStatus_ = 0; - - deviceDrivers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - if (deviceEndpointsBuilder_ == null) { - deviceEndpoints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - deviceEndpointsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Device_descriptor; - } - - @java.lang.Override - public context.ContextOuterClass.Device getDefaultInstanceForType() { - return context.ContextOuterClass.Device.getDefaultInstance(); - } - - @java.lang.Override - public context.ContextOuterClass.Device build() { - context.ContextOuterClass.Device result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public context.ContextOuterClass.Device buildPartial() { - context.ContextOuterClass.Device result = new context.ContextOuterClass.Device(this); - int from_bitField0_ = bitField0_; - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); - } - result.deviceType_ = deviceType_; - if (deviceConfigBuilder_ == null) { - result.deviceConfig_ = deviceConfig_; - } else { - result.deviceConfig_ = deviceConfigBuilder_.build(); - } - result.deviceOperationalStatus_ = deviceOperationalStatus_; - if (((bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = java.util.Collections.unmodifiableList(deviceDrivers_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceDrivers_ = deviceDrivers_; - if (deviceEndpointsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.deviceEndpoints_ = deviceEndpoints_; - } else { - result.deviceEndpoints_ = deviceEndpointsBuilder_.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 context.ContextOuterClass.Device) { - return mergeFrom((context.ContextOuterClass.Device)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(context.ContextOuterClass.Device other) { - if (other == context.ContextOuterClass.Device.getDefaultInstance()) return this; - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); - } - if (!other.getDeviceType().isEmpty()) { - deviceType_ = other.deviceType_; - onChanged(); - } - if (other.hasDeviceConfig()) { - mergeDeviceConfig(other.getDeviceConfig()); - } - if (other.deviceOperationalStatus_ != 0) { - setDeviceOperationalStatusValue(other.getDeviceOperationalStatusValue()); - } - if (!other.deviceDrivers_.isEmpty()) { - if (deviceDrivers_.isEmpty()) { - deviceDrivers_ = other.deviceDrivers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceDriversIsMutable(); - deviceDrivers_.addAll(other.deviceDrivers_); - } - onChanged(); - } - if (deviceEndpointsBuilder_ == null) { - if (!other.deviceEndpoints_.isEmpty()) { - if (deviceEndpoints_.isEmpty()) { - deviceEndpoints_ = other.deviceEndpoints_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.addAll(other.deviceEndpoints_); - } - onChanged(); - } - } else { - if (!other.deviceEndpoints_.isEmpty()) { - if (deviceEndpointsBuilder_.isEmpty()) { - deviceEndpointsBuilder_.dispose(); - deviceEndpointsBuilder_ = null; - deviceEndpoints_ = other.deviceEndpoints_; - bitField0_ = (bitField0_ & ~0x00000002); - deviceEndpointsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceEndpointsFieldBuilder() : null; - } else { - deviceEndpointsBuilder_.addAllMessages(other.deviceEndpoints_); - } - } - } - 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 { - context.ContextOuterClass.Device parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Device) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; - /** - * .context.DeviceId device_id = 1; - * @return Whether the deviceId field is set. - */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; - } - /** - * .context.DeviceId device_id = 1; - * @return The deviceId. - */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); - } - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceId_ = value; - onChanged(); - } else { - deviceIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); - } else { - deviceIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; - onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - - return this; - } - /** - * .context.DeviceId device_id = 1; - */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { - - onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); - } - /** - * .context.DeviceId device_id = 1; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - } - /** - * .context.DeviceId device_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; - } - - private java.lang.Object deviceType_ = ""; - /** - * string device_type = 2; - * @return The deviceType. - */ - public java.lang.String getDeviceType() { - java.lang.Object ref = deviceType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - deviceType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string device_type = 2; - * @return The bytes for deviceType. - */ - public com.google.protobuf.ByteString - getDeviceTypeBytes() { - java.lang.Object ref = deviceType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - deviceType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string device_type = 2; - * @param value The deviceType to set. - * @return This builder for chaining. - */ - public Builder setDeviceType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceType_ = value; - onChanged(); - return this; - } - /** - * string device_type = 2; - * @return This builder for chaining. - */ - public Builder clearDeviceType() { - - deviceType_ = getDefaultInstance().getDeviceType(); - onChanged(); - return this; - } - /** - * string device_type = 2; - * @param value The bytes for deviceType to set. - * @return This builder for chaining. - */ - public Builder setDeviceTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - deviceType_ = value; - onChanged(); - return this; - } - - private context.ContextOuterClass.DeviceConfig deviceConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> deviceConfigBuilder_; - /** - * .context.DeviceConfig device_config = 3; - * @return Whether the deviceConfig field is set. - */ - public boolean hasDeviceConfig() { - return deviceConfigBuilder_ != null || deviceConfig_ != null; - } - /** - * .context.DeviceConfig device_config = 3; - * @return The deviceConfig. - */ - public context.ContextOuterClass.DeviceConfig getDeviceConfig() { - if (deviceConfigBuilder_ == null) { - return deviceConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } else { - return deviceConfigBuilder_.getMessage(); - } + // @@protoc_insertion_point(builder_implements:context.ConnectionId) + context.ContextOuterClass.ConnectionIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder setDeviceConfig(context.ContextOuterClass.DeviceConfig value) { - if (deviceConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceConfig_ = value; - onChanged(); - } else { - deviceConfigBuilder_.setMessage(value); - } - return this; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder setDeviceConfig( - context.ContextOuterClass.DeviceConfig.Builder builderForValue) { - if (deviceConfigBuilder_ == null) { - deviceConfig_ = builderForValue.build(); - onChanged(); - } else { - deviceConfigBuilder_.setMessage(builderForValue.build()); - } - return this; + // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder mergeDeviceConfig(context.ContextOuterClass.DeviceConfig value) { - if (deviceConfigBuilder_ == null) { - if (deviceConfig_ != null) { - deviceConfig_ = - context.ContextOuterClass.DeviceConfig.newBuilder(deviceConfig_).mergeFrom(value).buildPartial(); - } else { - deviceConfig_ = value; - } - onChanged(); - } else { - deviceConfigBuilder_.mergeFrom(value); - } - return this; + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public Builder clearDeviceConfig() { - if (deviceConfigBuilder_ == null) { - deviceConfig_ = null; - onChanged(); - } else { - deviceConfig_ = null; - deviceConfigBuilder_ = null; + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } - - return this; - } - /** - * .context.DeviceConfig device_config = 3; - */ - public context.ContextOuterClass.DeviceConfig.Builder getDeviceConfigBuilder() { - - onChanged(); - return getDeviceConfigFieldBuilder().getBuilder(); } - /** - * .context.DeviceConfig device_config = 3; - */ - public context.ContextOuterClass.DeviceConfigOrBuilder getDeviceConfigOrBuilder() { - if (deviceConfigBuilder_ != null) { - return deviceConfigBuilder_.getMessageOrBuilder(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; } else { - return deviceConfig_ == null ? - context.ContextOuterClass.DeviceConfig.getDefaultInstance() : deviceConfig_; - } - } - /** - * .context.DeviceConfig device_config = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> - getDeviceConfigFieldBuilder() { - if (deviceConfigBuilder_ == null) { - deviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>( - getDeviceConfig(), - getParentForChildren(), - isClean()); - deviceConfig_ = null; + connectionUuid_ = null; + connectionUuidBuilder_ = null; } - return deviceConfigBuilder_; - } - - private int deviceOperationalStatus_ = 0; - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The enum numeric value on the wire for deviceOperationalStatus. - */ - @java.lang.Override public int getDeviceOperationalStatusValue() { - return deviceOperationalStatus_; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @param value The enum numeric value on the wire for deviceOperationalStatus to set. - * @return This builder for chaining. - */ - public Builder setDeviceOperationalStatusValue(int value) { - - deviceOperationalStatus_ = value; - onChanged(); return this; } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return The deviceOperationalStatus. - */ + @java.lang.Override - public context.ContextOuterClass.DeviceOperationalStatusEnum getDeviceOperationalStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.DeviceOperationalStatusEnum result = context.ContextOuterClass.DeviceOperationalStatusEnum.valueOf(deviceOperationalStatus_); - return result == null ? context.ContextOuterClass.DeviceOperationalStatusEnum.UNRECOGNIZED : result; - } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @param value The deviceOperationalStatus to set. - * @return This builder for chaining. - */ - public Builder setDeviceOperationalStatus(context.ContextOuterClass.DeviceOperationalStatusEnum value) { - if (value == null) { - throw new NullPointerException(); - } - - deviceOperationalStatus_ = value.getNumber(); - onChanged(); - return this; + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; } - /** - * .context.DeviceOperationalStatusEnum device_operational_status = 4; - * @return This builder for chaining. - */ - public Builder clearDeviceOperationalStatus() { - - deviceOperationalStatus_ = 0; - onChanged(); - return this; + + @java.lang.Override + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionId.getDefaultInstance(); } - private java.util.List deviceDrivers_ = - java.util.Collections.emptyList(); - private void ensureDeviceDriversIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceDrivers_ = new java.util.ArrayList(deviceDrivers_); - bitField0_ |= 0x00000001; + @java.lang.Override + public context.ContextOuterClass.ConnectionId build() { + context.ContextOuterClass.ConnectionId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the deviceDrivers. - */ - public java.util.List getDeviceDriversList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, context.ContextOuterClass.DeviceDriverEnum>(deviceDrivers_, deviceDrivers_converter_); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return The count of deviceDrivers. - */ - public int getDeviceDriversCount() { - return deviceDrivers_.size(); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the element to return. - * @return The deviceDrivers at the given index. - */ - public context.ContextOuterClass.DeviceDriverEnum getDeviceDrivers(int index) { - return deviceDrivers_converter_.convert(deviceDrivers_.get(index)); - } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index to set the value at. - * @param value The deviceDrivers to set. - * @return This builder for chaining. - */ - public Builder setDeviceDrivers( - int index, context.ContextOuterClass.DeviceDriverEnum value) { - if (value == null) { - throw new NullPointerException(); + + @java.lang.Override + public context.ContextOuterClass.ConnectionId buildPartial() { + context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); + if (connectionUuidBuilder_ == null) { + result.connectionUuid_ = connectionUuid_; + } else { + result.connectionUuid_ = connectionUuidBuilder_.build(); } - ensureDeviceDriversIsMutable(); - deviceDrivers_.set(index, value.getNumber()); - onChanged(); - return this; + onBuilt(); + return result; } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param value The deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addDeviceDrivers(context.ContextOuterClass.DeviceDriverEnum value) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceDriversIsMutable(); - deviceDrivers_.add(value.getNumber()); - onChanged(); - return this; + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param values The deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addAllDeviceDrivers( - java.lang.Iterable values) { - ensureDeviceDriversIsMutable(); - for (context.ContextOuterClass.DeviceDriverEnum value : values) { - deviceDrivers_.add(value.getNumber()); - } - onChanged(); - return this; + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return This builder for chaining. - */ - public Builder clearDeviceDrivers() { - deviceDrivers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @return A list containing the enum numeric values on the wire for deviceDrivers. - */ - public java.util.List - getDeviceDriversValueList() { - return java.util.Collections.unmodifiableList(deviceDrivers_); + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - */ - public int getDeviceDriversValue(int index) { - return deviceDrivers_.get(index); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param index The index of the value to return. - * @return The enum numeric value on the wire of deviceDrivers at the given index. - * @return This builder for chaining. - */ - public Builder setDeviceDriversValue( - int index, int value) { - ensureDeviceDriversIsMutable(); - deviceDrivers_.set(index, value); - onChanged(); - return this; + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param value The enum numeric value on the wire for deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addDeviceDriversValue(int value) { - ensureDeviceDriversIsMutable(); - deviceDrivers_.add(value); - onChanged(); - return this; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof context.ContextOuterClass.ConnectionId) { + return mergeFrom((context.ContextOuterClass.ConnectionId)other); + } else { + super.mergeFrom(other); + return this; + } } - /** - * repeated .context.DeviceDriverEnum device_drivers = 5; - * @param values The enum numeric values on the wire for deviceDrivers to add. - * @return This builder for chaining. - */ - public Builder addAllDeviceDriversValue( - java.lang.Iterable values) { - ensureDeviceDriversIsMutable(); - for (int value : values) { - deviceDrivers_.add(value); + + public Builder mergeFrom(context.ContextOuterClass.ConnectionId other) { + if (other == context.ContextOuterClass.ConnectionId.getDefaultInstance()) return this; + if (other.hasConnectionUuid()) { + mergeConnectionUuid(other.getConnectionUuid()); } + this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } - private java.util.List deviceEndpoints_ = - java.util.Collections.emptyList(); - private void ensureDeviceEndpointsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - deviceEndpoints_ = new java.util.ArrayList(deviceEndpoints_); - bitField0_ |= 0x00000002; - } + @java.lang.Override + public final boolean isInitialized() { + return true; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> deviceEndpointsBuilder_; - - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public java.util.List getDeviceEndpointsList() { - if (deviceEndpointsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceEndpoints_); - } else { - return deviceEndpointsBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public int getDeviceEndpointsCount() { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.size(); - } else { - return deviceEndpointsBuilder_.getCount(); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPoint getDeviceEndpoints(int index) { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.get(index); - } else { - return deviceEndpointsBuilder_.getMessage(index); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder setDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.ConnectionId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ConnectionId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.set(index, value); - onChanged(); - } else { - deviceEndpointsBuilder_.setMessage(index, value); } return this; } + + private context.ContextOuterClass.Uuid connectionUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> connectionUuidBuilder_; /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return Whether the connectionUuid field is set. */ - public Builder setDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.setMessage(index, builderForValue.build()); - } - return this; + public boolean hasConnectionUuid() { + return connectionUuidBuilder_ != null || connectionUuid_ != null; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; + * @return The connectionUuid. */ - public Builder addDeviceEndpoints(context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(value); - onChanged(); + public context.ContextOuterClass.Uuid getConnectionUuid() { + if (connectionUuidBuilder_ == null) { + return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; } else { - deviceEndpointsBuilder_.addMessage(value); + return connectionUuidBuilder_.getMessage(); } - return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder addDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint value) { - if (deviceEndpointsBuilder_ == null) { + public Builder setConnectionUuid(context.ContextOuterClass.Uuid value) { + if (connectionUuidBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(index, value); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addDeviceEndpoints( - context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addDeviceEndpoints( - int index, context.ContextOuterClass.EndPoint.Builder builderForValue) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceEndpointsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public Builder addAllDeviceEndpoints( - java.lang.Iterable values) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceEndpoints_); + connectionUuid_ = value; onChanged(); } else { - deviceEndpointsBuilder_.addAllMessages(values); + connectionUuidBuilder_.setMessage(value); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder clearDeviceEndpoints() { - if (deviceEndpointsBuilder_ == null) { - deviceEndpoints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder setConnectionUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (connectionUuidBuilder_ == null) { + connectionUuid_ = builderForValue.build(); onChanged(); } else { - deviceEndpointsBuilder_.clear(); + connectionUuidBuilder_.setMessage(builderForValue.build()); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public Builder removeDeviceEndpoints(int index) { - if (deviceEndpointsBuilder_ == null) { - ensureDeviceEndpointsIsMutable(); - deviceEndpoints_.remove(index); + public Builder mergeConnectionUuid(context.ContextOuterClass.Uuid value) { + if (connectionUuidBuilder_ == null) { + if (connectionUuid_ != null) { + connectionUuid_ = + context.ContextOuterClass.Uuid.newBuilder(connectionUuid_).mergeFrom(value).buildPartial(); + } else { + connectionUuid_ = value; + } onChanged(); } else { - deviceEndpointsBuilder_.remove(index); + connectionUuidBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPoint.Builder getDeviceEndpointsBuilder( - int index) { - return getDeviceEndpointsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.EndPoint device_endpoints = 6; - */ - public context.ContextOuterClass.EndPointOrBuilder getDeviceEndpointsOrBuilder( - int index) { - if (deviceEndpointsBuilder_ == null) { - return deviceEndpoints_.get(index); } else { - return deviceEndpointsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public java.util.List - getDeviceEndpointsOrBuilderList() { - if (deviceEndpointsBuilder_ != null) { - return deviceEndpointsBuilder_.getMessageOrBuilderList(); + public Builder clearConnectionUuid() { + if (connectionUuidBuilder_ == null) { + connectionUuid_ = null; + onChanged(); } else { - return java.util.Collections.unmodifiableList(deviceEndpoints_); + connectionUuid_ = null; + connectionUuidBuilder_ = null; } + + return this; } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder() { - return getDeviceEndpointsFieldBuilder().addBuilder( - context.ContextOuterClass.EndPoint.getDefaultInstance()); + public context.ContextOuterClass.Uuid.Builder getConnectionUuidBuilder() { + + onChanged(); + return getConnectionUuidFieldBuilder().getBuilder(); } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public context.ContextOuterClass.EndPoint.Builder addDeviceEndpointsBuilder( - int index) { - return getDeviceEndpointsFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPoint.getDefaultInstance()); + public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { + if (connectionUuidBuilder_ != null) { + return connectionUuidBuilder_.getMessageOrBuilder(); + } else { + return connectionUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; + } } /** - * repeated .context.EndPoint device_endpoints = 6; + * .context.Uuid connection_uuid = 1; */ - public java.util.List - getDeviceEndpointsBuilderList() { - return getDeviceEndpointsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder> - getDeviceEndpointsFieldBuilder() { - if (deviceEndpointsBuilder_ == null) { - deviceEndpointsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPoint, context.ContextOuterClass.EndPoint.Builder, context.ContextOuterClass.EndPointOrBuilder>( - deviceEndpoints_, - ((bitField0_ & 0x00000002) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getConnectionUuidFieldBuilder() { + if (connectionUuidBuilder_ == null) { + connectionUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getConnectionUuid(), getParentForChildren(), isClean()); - deviceEndpoints_ = null; + connectionUuid_ = null; } - return deviceEndpointsBuilder_; + return connectionUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -13934,95 +37645,83 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Device) + // @@protoc_insertion_point(builder_scope:context.ConnectionId) } - // @@protoc_insertion_point(class_scope:context.Device) - private static final context.ContextOuterClass.Device DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionId) + private static final context.ContextOuterClass.ConnectionId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Device(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionId(); } - public static context.ContextOuterClass.Device getDefaultInstance() { + public static context.ContextOuterClass.ConnectionId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Device parsePartialFrom( + public ConnectionId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Device(input, extensionRegistry); + return new ConnectionId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Device getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceConfig) + public interface ConnectionSettings_L0OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L0) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConfigRule config_rules = 1; - */ - java.util.List - getConfigRulesList(); - /** - * repeated .context.ConfigRule config_rules = 1; - */ - context.ContextOuterClass.ConfigRule getConfigRules(int index); - /** - * repeated .context.ConfigRule config_rules = 1; - */ - int getConfigRulesCount(); - /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ - java.util.List - getConfigRulesOrBuilderList(); + java.lang.String getLspSymbolicName(); /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ - context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index); + com.google.protobuf.ByteString + getLspSymbolicNameBytes(); } /** - * Protobuf type {@code context.DeviceConfig} + * Protobuf type {@code context.ConnectionSettings_L0} */ - public static final class DeviceConfig extends + public static final class ConnectionSettings_L0 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceConfig) - DeviceConfigOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L0) + ConnectionSettings_L0OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceConfig.newBuilder() to construct. - private DeviceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L0.newBuilder() to construct. + private ConnectionSettings_L0(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceConfig() { - configRules_ = java.util.Collections.emptyList(); + private ConnectionSettings_L0() { + lspSymbolicName_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceConfig(); + return new ConnectionSettings_L0(); } @java.lang.Override @@ -14030,7 +37729,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceConfig( + private ConnectionSettings_L0( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -14038,7 +37737,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -14050,12 +37748,9 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - configRules_.add( - input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + lspSymbolicName_ = s; break; } default: { @@ -14073,64 +37768,59 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + context.ContextOuterClass.ConnectionSettings_L0.class, context.ContextOuterClass.ConnectionSettings_L0.Builder.class); } - public static final int CONFIG_RULES_FIELD_NUMBER = 1; - private java.util.List configRules_; - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public java.util.List getConfigRulesList() { - return configRules_; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public java.util.List - getConfigRulesOrBuilderList() { - return configRules_; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - @java.lang.Override - public int getConfigRulesCount() { - return configRules_.size(); - } + public static final int LSP_SYMBOLIC_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object lspSymbolicName_; /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ @java.lang.Override - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - return configRules_.get(index); + public java.lang.String getLspSymbolicName() { + java.lang.Object ref = lspSymbolicName_; + 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(); + lspSymbolicName_ = s; + return s; + } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ @java.lang.Override - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - return configRules_.get(index); + public com.google.protobuf.ByteString + getLspSymbolicNameBytes() { + java.lang.Object ref = lspSymbolicName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lspSymbolicName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -14147,8 +37837,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < configRules_.size(); i++) { - output.writeMessage(1, configRules_.get(i)); + if (!getLspSymbolicNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, lspSymbolicName_); } unknownFields.writeTo(output); } @@ -14159,9 +37849,8 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < configRules_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, configRules_.get(i)); + if (!getLspSymbolicNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, lspSymbolicName_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -14173,13 +37862,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceConfig)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L0)) { return super.equals(obj); } - context.ContextOuterClass.DeviceConfig other = (context.ContextOuterClass.DeviceConfig) obj; + context.ContextOuterClass.ConnectionSettings_L0 other = (context.ContextOuterClass.ConnectionSettings_L0) obj; - if (!getConfigRulesList() - .equals(other.getConfigRulesList())) return false; + if (!getLspSymbolicName() + .equals(other.getLspSymbolicName())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -14191,78 +37880,76 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConfigRulesCount() > 0) { - hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; - hash = (53 * hash) + getConfigRulesList().hashCode(); - } + hash = (37 * hash) + LSP_SYMBOLIC_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLspSymbolicName().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceConfig parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 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 context.ContextOuterClass.DeviceConfig parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L0 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 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 context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceConfig parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L0 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -14275,7 +37962,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceConfig prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L0 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -14291,26 +37978,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceConfig} + * Protobuf type {@code context.ConnectionSettings_L0} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceConfig) - context.ContextOuterClass.DeviceConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L0) + context.ContextOuterClass.ConnectionSettings_L0OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceConfig.class, context.ContextOuterClass.DeviceConfig.Builder.class); + context.ContextOuterClass.ConnectionSettings_L0.class, context.ContextOuterClass.ConnectionSettings_L0.Builder.class); } - // Construct using context.ContextOuterClass.DeviceConfig.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L0.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -14323,35 +38010,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - configRulesBuilder_.clear(); - } + lspSymbolicName_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L0_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceConfig.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceConfig build() { - context.ContextOuterClass.DeviceConfig result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L0 build() { + context.ContextOuterClass.ConnectionSettings_L0 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -14359,18 +38041,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceConfig buildPartial() { - context.ContextOuterClass.DeviceConfig result = new context.ContextOuterClass.DeviceConfig(this); - int from_bitField0_ = bitField0_; - if (configRulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.configRules_ = configRules_; - } else { - result.configRules_ = configRulesBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L0 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L0 result = new context.ContextOuterClass.ConnectionSettings_L0(this); + result.lspSymbolicName_ = lspSymbolicName_; onBuilt(); return result; } @@ -14409,41 +38082,19 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceConfig) { - return mergeFrom((context.ContextOuterClass.DeviceConfig)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L0) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L0)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceConfig other) { - if (other == context.ContextOuterClass.DeviceConfig.getDefaultInstance()) return this; - if (configRulesBuilder_ == null) { - if (!other.configRules_.isEmpty()) { - if (configRules_.isEmpty()) { - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConfigRulesIsMutable(); - configRules_.addAll(other.configRules_); - } - onChanged(); - } - } else { - if (!other.configRules_.isEmpty()) { - if (configRulesBuilder_.isEmpty()) { - configRulesBuilder_.dispose(); - configRulesBuilder_ = null; - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - configRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConfigRulesFieldBuilder() : null; - } else { - configRulesBuilder_.addAllMessages(other.configRules_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L0 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance()) return this; + if (!other.getLspSymbolicName().isEmpty()) { + lspSymbolicName_ = other.lspSymbolicName_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -14460,11 +38111,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceConfig parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L0 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceConfig) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L0) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -14473,246 +38124,81 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List configRules_ = - java.util.Collections.emptyList(); - private void ensureConfigRulesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(configRules_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + private java.lang.Object lspSymbolicName_ = ""; /** - * repeated .context.ConfigRule config_rules = 1; - */ - public java.util.List getConfigRulesList() { - if (configRulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(configRules_); - } else { - return configRulesBuilder_.getMessageList(); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public int getConfigRulesCount() { - if (configRulesBuilder_ == null) { - return configRules_.size(); - } else { - return configRulesBuilder_.getCount(); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); - } else { - return configRulesBuilder_.getMessage(index); - } - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.set(index, value); - onChanged(); - } else { - configRulesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.set(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.add(value); - onChanged(); - } else { - configRulesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConfigRulesIsMutable(); - configRules_.add(index, value); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder addAllConfigRules( - java.lang.Iterable values) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, configRules_); - onChanged(); - } else { - configRulesBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder clearConfigRules() { - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - configRulesBuilder_.clear(); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public Builder removeConfigRules(int index) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.remove(index); - onChanged(); - } else { - configRulesBuilder_.remove(index); - } - return this; - } - /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The lspSymbolicName. */ - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); } else { - return configRulesBuilder_.getMessageOrBuilder(index); + public java.lang.String getLspSymbolicName() { + java.lang.Object ref = lspSymbolicName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lspSymbolicName_ = s; + return s; + } else { + return (java.lang.String) ref; } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return The bytes for lspSymbolicName. */ - public java.util.List - getConfigRulesOrBuilderList() { - if (configRulesBuilder_ != null) { - return configRulesBuilder_.getMessageOrBuilderList(); + public com.google.protobuf.ByteString + getLspSymbolicNameBytes() { + java.lang.Object ref = lspSymbolicName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lspSymbolicName_ = b; + return b; } else { - return java.util.Collections.unmodifiableList(configRules_); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @param value The lspSymbolicName to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { - return getConfigRulesFieldBuilder().addBuilder( - context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public Builder setLspSymbolicName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lspSymbolicName_ = value; + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public Builder clearLspSymbolicName() { + + lspSymbolicName_ = getDefaultInstance().getLspSymbolicName(); + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * string lsp_symbolic_name = 1; + * @param value The bytes for lspSymbolicName to set. + * @return This builder for chaining. */ - public java.util.List - getConfigRulesBuilderList() { - return getConfigRulesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> - getConfigRulesFieldBuilder() { - if (configRulesBuilder_ == null) { - configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( - configRules_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - configRules_ = null; - } - return configRulesBuilder_; + public Builder setLspSymbolicNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lspSymbolicName_ = value; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -14727,95 +38213,120 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceConfig) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L0) } - // @@protoc_insertion_point(class_scope:context.DeviceConfig) - private static final context.ContextOuterClass.DeviceConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L0) + private static final context.ContextOuterClass.ConnectionSettings_L0 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceConfig(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L0(); } - public static context.ContextOuterClass.DeviceConfig getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceConfig parsePartialFrom( + public ConnectionSettings_L0 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceConfig(input, extensionRegistry); + return new ConnectionSettings_L0(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceConfig getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L0 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceIdList) + public interface ConnectionSettings_L2OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L2) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ - java.util.List - getDeviceIdsList(); + java.lang.String getSrcMacAddress(); /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ - context.ContextOuterClass.DeviceId getDeviceIds(int index); + com.google.protobuf.ByteString + getSrcMacAddressBytes(); + /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ - int getDeviceIdsCount(); + java.lang.String getDstMacAddress(); /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ - java.util.List - getDeviceIdsOrBuilderList(); + com.google.protobuf.ByteString + getDstMacAddressBytes(); + /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index); + int getEtherType(); + + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + int getVlanId(); + + /** + * uint32 mpls_label = 5; + * @return The mplsLabel. + */ + int getMplsLabel(); + + /** + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. + */ + int getMplsTrafficClass(); } /** - * Protobuf type {@code context.DeviceIdList} + * Protobuf type {@code context.ConnectionSettings_L2} */ - public static final class DeviceIdList extends + public static final class ConnectionSettings_L2 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceIdList) - DeviceIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L2) + ConnectionSettings_L2OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceIdList.newBuilder() to construct. - private DeviceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L2.newBuilder() to construct. + private ConnectionSettings_L2(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceIdList() { - deviceIds_ = java.util.Collections.emptyList(); + private ConnectionSettings_L2() { + srcMacAddress_ = ""; + dstMacAddress_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceIdList(); + return new ConnectionSettings_L2(); } @java.lang.Override @@ -14823,7 +38334,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceIdList( + private ConnectionSettings_L2( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -14831,7 +38342,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -14843,12 +38353,35 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deviceIds_.add( - input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + srcMacAddress_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + dstMacAddress_ = s; + break; + } + case 24: { + + etherType_ = input.readUInt32(); + break; + } + case 32: { + + vlanId_ = input.readUInt32(); + break; + } + case 40: { + + mplsLabel_ = input.readUInt32(); + break; + } + case 48: { + + mplsTrafficClass_ = input.readUInt32(); break; } default: { @@ -14866,64 +38399,141 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L2.class, context.ContextOuterClass.ConnectionSettings_L2.Builder.class); } - public static final int DEVICE_IDS_FIELD_NUMBER = 1; - private java.util.List deviceIds_; + public static final int SRC_MAC_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object srcMacAddress_; /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ @java.lang.Override - public java.util.List getDeviceIdsList() { - return deviceIds_; + public java.lang.String getSrcMacAddress() { + java.lang.Object ref = srcMacAddress_; + 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(); + srcMacAddress_ = s; + return s; + } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ @java.lang.Override - public java.util.List - getDeviceIdsOrBuilderList() { - return deviceIds_; + public com.google.protobuf.ByteString + getSrcMacAddressBytes() { + java.lang.Object ref = srcMacAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcMacAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DST_MAC_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object dstMacAddress_; /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ @java.lang.Override - public int getDeviceIdsCount() { - return deviceIds_.size(); + public java.lang.String getDstMacAddress() { + java.lang.Object ref = dstMacAddress_; + 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(); + dstMacAddress_ = s; + return s; + } } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - return deviceIds_.get(index); + public com.google.protobuf.ByteString + getDstMacAddressBytes() { + java.lang.Object ref = dstMacAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstMacAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int ETHER_TYPE_FIELD_NUMBER = 3; + private int etherType_; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - return deviceIds_.get(index); + public int getEtherType() { + return etherType_; + } + + public static final int VLAN_ID_FIELD_NUMBER = 4; + private int vlanId_; + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } + + public static final int MPLS_LABEL_FIELD_NUMBER = 5; + private int mplsLabel_; + /** + * uint32 mpls_label = 5; + * @return The mplsLabel. + */ + @java.lang.Override + public int getMplsLabel() { + return mplsLabel_; + } + + public static final int MPLS_TRAFFIC_CLASS_FIELD_NUMBER = 6; + private int mplsTrafficClass_; + /** + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. + */ + @java.lang.Override + public int getMplsTrafficClass() { + return mplsTrafficClass_; } private byte memoizedIsInitialized = -1; @@ -14940,8 +38550,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < deviceIds_.size(); i++) { - output.writeMessage(1, deviceIds_.get(i)); + if (!getSrcMacAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, srcMacAddress_); + } + if (!getDstMacAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dstMacAddress_); + } + if (etherType_ != 0) { + output.writeUInt32(3, etherType_); + } + if (vlanId_ != 0) { + output.writeUInt32(4, vlanId_); + } + if (mplsLabel_ != 0) { + output.writeUInt32(5, mplsLabel_); + } + if (mplsTrafficClass_ != 0) { + output.writeUInt32(6, mplsTrafficClass_); } unknownFields.writeTo(output); } @@ -14952,9 +38577,27 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < deviceIds_.size(); i++) { + if (!getSrcMacAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, srcMacAddress_); + } + if (!getDstMacAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dstMacAddress_); + } + if (etherType_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, deviceIds_.get(i)); + .computeUInt32Size(3, etherType_); + } + if (vlanId_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, vlanId_); + } + if (mplsLabel_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, mplsLabel_); + } + if (mplsTrafficClass_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(6, mplsTrafficClass_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -14966,13 +38609,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceIdList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L2)) { return super.equals(obj); } - context.ContextOuterClass.DeviceIdList other = (context.ContextOuterClass.DeviceIdList) obj; - - if (!getDeviceIdsList() - .equals(other.getDeviceIdsList())) return false; + context.ContextOuterClass.ConnectionSettings_L2 other = (context.ContextOuterClass.ConnectionSettings_L2) obj; + + if (!getSrcMacAddress() + .equals(other.getSrcMacAddress())) return false; + if (!getDstMacAddress() + .equals(other.getDstMacAddress())) return false; + if (getEtherType() + != other.getEtherType()) return false; + if (getVlanId() + != other.getVlanId()) return false; + if (getMplsLabel() + != other.getMplsLabel()) return false; + if (getMplsTrafficClass() + != other.getMplsTrafficClass()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -14984,78 +38637,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getDeviceIdsCount() > 0) { - hash = (37 * hash) + DEVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getDeviceIdsList().hashCode(); - } + hash = (37 * hash) + SRC_MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcMacAddress().hashCode(); + hash = (37 * hash) + DST_MAC_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstMacAddress().hashCode(); + hash = (37 * hash) + ETHER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEtherType(); + hash = (37 * hash) + VLAN_ID_FIELD_NUMBER; + hash = (53 * hash) + getVlanId(); + hash = (37 * hash) + MPLS_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getMplsLabel(); + hash = (37 * hash) + MPLS_TRAFFIC_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getMplsTrafficClass(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 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 context.ContextOuterClass.DeviceIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L2 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 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 context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceIdList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L2 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -15068,7 +38729,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L2 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -15084,26 +38745,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceIdList} + * Protobuf type {@code context.ConnectionSettings_L2} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceIdList) - context.ContextOuterClass.DeviceIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L2) + context.ContextOuterClass.ConnectionSettings_L2OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceIdList.class, context.ContextOuterClass.DeviceIdList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L2.class, context.ContextOuterClass.ConnectionSettings_L2.Builder.class); } - // Construct using context.ContextOuterClass.DeviceIdList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L2.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -15116,35 +38777,40 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDeviceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - deviceIdsBuilder_.clear(); - } + srcMacAddress_ = ""; + + dstMacAddress_ = ""; + + etherType_ = 0; + + vlanId_ = 0; + + mplsLabel_ = 0; + + mplsTrafficClass_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L2_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceIdList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceIdList build() { - context.ContextOuterClass.DeviceIdList result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L2 build() { + context.ContextOuterClass.ConnectionSettings_L2 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -15152,18 +38818,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceIdList buildPartial() { - context.ContextOuterClass.DeviceIdList result = new context.ContextOuterClass.DeviceIdList(this); - int from_bitField0_ = bitField0_; - if (deviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = java.util.Collections.unmodifiableList(deviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.deviceIds_ = deviceIds_; - } else { - result.deviceIds_ = deviceIdsBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L2 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L2 result = new context.ContextOuterClass.ConnectionSettings_L2(this); + result.srcMacAddress_ = srcMacAddress_; + result.dstMacAddress_ = dstMacAddress_; + result.etherType_ = etherType_; + result.vlanId_ = vlanId_; + result.mplsLabel_ = mplsLabel_; + result.mplsTrafficClass_ = mplsTrafficClass_; onBuilt(); return result; } @@ -15202,41 +38864,35 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceIdList) { - return mergeFrom((context.ContextOuterClass.DeviceIdList)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L2) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L2)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceIdList other) { - if (other == context.ContextOuterClass.DeviceIdList.getDefaultInstance()) return this; - if (deviceIdsBuilder_ == null) { - if (!other.deviceIds_.isEmpty()) { - if (deviceIds_.isEmpty()) { - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDeviceIdsIsMutable(); - deviceIds_.addAll(other.deviceIds_); - } - onChanged(); - } - } else { - if (!other.deviceIds_.isEmpty()) { - if (deviceIdsBuilder_.isEmpty()) { - deviceIdsBuilder_.dispose(); - deviceIdsBuilder_ = null; - deviceIds_ = other.deviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - deviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceIdsFieldBuilder() : null; - } else { - deviceIdsBuilder_.addAllMessages(other.deviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L2 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance()) return this; + if (!other.getSrcMacAddress().isEmpty()) { + srcMacAddress_ = other.srcMacAddress_; + onChanged(); + } + if (!other.getDstMacAddress().isEmpty()) { + dstMacAddress_ = other.dstMacAddress_; + onChanged(); + } + if (other.getEtherType() != 0) { + setEtherType(other.getEtherType()); + } + if (other.getVlanId() != 0) { + setVlanId(other.getVlanId()); + } + if (other.getMplsLabel() != 0) { + setMplsLabel(other.getMplsLabel()); + } + if (other.getMplsTrafficClass() != 0) { + setMplsTrafficClass(other.getMplsTrafficClass()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -15253,11 +38909,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceIdList parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L2 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L2) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -15266,246 +38922,281 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List deviceIds_ = - java.util.Collections.emptyList(); - private void ensureDeviceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - deviceIds_ = new java.util.ArrayList(deviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdsBuilder_; + private java.lang.Object srcMacAddress_ = ""; /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The srcMacAddress. */ - public java.util.List getDeviceIdsList() { - if (deviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceIds_); + public java.lang.String getSrcMacAddress() { + java.lang.Object ref = srcMacAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcMacAddress_ = s; + return s; } else { - return deviceIdsBuilder_.getMessageList(); + return (java.lang.String) ref; } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return The bytes for srcMacAddress. */ - public int getDeviceIdsCount() { - if (deviceIdsBuilder_ == null) { - return deviceIds_.size(); + public com.google.protobuf.ByteString + getSrcMacAddressBytes() { + java.lang.Object ref = srcMacAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcMacAddress_ = b; + return b; } else { - return deviceIdsBuilder_.getCount(); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @param value The srcMacAddress to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId getDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); - } else { - return deviceIdsBuilder_.getMessage(index); - } + public Builder setSrcMacAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcMacAddress_ = value; + onChanged(); + return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @return This builder for chaining. */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, value); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, value); - } + public Builder clearSrcMacAddress() { + + srcMacAddress_ = getDefaultInstance().getSrcMacAddress(); + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string src_mac_address = 1; + * @param value The bytes for srcMacAddress to set. + * @return This builder for chaining. */ - public Builder setDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.set(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.setMessage(index, builderForValue.build()); - } + public Builder setSrcMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcMacAddress_ = value; + onChanged(); return this; } + + private java.lang.Object dstMacAddress_ = ""; /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The dstMacAddress. */ - public Builder addDeviceIds(context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(value); - onChanged(); + public java.lang.String getDstMacAddress() { + java.lang.Object ref = dstMacAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstMacAddress_ = s; + return s; } else { - deviceIdsBuilder_.addMessage(value); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return The bytes for dstMacAddress. */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, value); - onChanged(); + public com.google.protobuf.ByteString + getDstMacAddressBytes() { + java.lang.Object ref = dstMacAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstMacAddress_ = b; + return b; } else { - deviceIdsBuilder_.addMessage(index, value); + return (com.google.protobuf.ByteString) ref; } + } + /** + * string dst_mac_address = 2; + * @param value The dstMacAddress to set. + * @return This builder for chaining. + */ + public Builder setDstMacAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstMacAddress_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @return This builder for chaining. */ - public Builder addDeviceIds( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder clearDstMacAddress() { + + dstMacAddress_ = getDefaultInstance().getDstMacAddress(); + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * string dst_mac_address = 2; + * @param value The bytes for dstMacAddress to set. + * @return This builder for chaining. */ - public Builder addDeviceIds( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.add(index, builderForValue.build()); - onChanged(); - } else { - deviceIdsBuilder_.addMessage(index, builderForValue.build()); - } + public Builder setDstMacAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstMacAddress_ = value; + onChanged(); return this; } + + private int etherType_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return The etherType. */ - public Builder addAllDeviceIds( - java.lang.Iterable values) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceIds_); - onChanged(); - } else { - deviceIdsBuilder_.addAllMessages(values); - } + @java.lang.Override + public int getEtherType() { + return etherType_; + } + /** + * uint32 ether_type = 3; + * @param value The etherType to set. + * @return This builder for chaining. + */ + public Builder setEtherType(int value) { + + etherType_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 ether_type = 3; + * @return This builder for chaining. */ - public Builder clearDeviceIds() { - if (deviceIdsBuilder_ == null) { - deviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - deviceIdsBuilder_.clear(); - } + public Builder clearEtherType() { + + etherType_ = 0; + onChanged(); return this; } + + private int vlanId_ ; + /** + * uint32 vlan_id = 4; + * @return The vlanId. + */ + @java.lang.Override + public int getVlanId() { + return vlanId_; + } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 vlan_id = 4; + * @param value The vlanId to set. + * @return This builder for chaining. */ - public Builder removeDeviceIds(int index) { - if (deviceIdsBuilder_ == null) { - ensureDeviceIdsIsMutable(); - deviceIds_.remove(index); - onChanged(); - } else { - deviceIdsBuilder_.remove(index); - } + public Builder setVlanId(int value) { + + vlanId_ = value; + onChanged(); return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 vlan_id = 4; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().getBuilder(index); + public Builder clearVlanId() { + + vlanId_ = 0; + onChanged(); + return this; } + + private int mplsLabel_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @return The mplsLabel. */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdsOrBuilder( - int index) { - if (deviceIdsBuilder_ == null) { - return deviceIds_.get(index); } else { - return deviceIdsBuilder_.getMessageOrBuilder(index); - } + @java.lang.Override + public int getMplsLabel() { + return mplsLabel_; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @param value The mplsLabel to set. + * @return This builder for chaining. */ - public java.util.List - getDeviceIdsOrBuilderList() { - if (deviceIdsBuilder_ != null) { - return deviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(deviceIds_); - } + public Builder setMplsLabel(int value) { + + mplsLabel_ = value; + onChanged(); + return this; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_label = 5; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder() { - return getDeviceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); + public Builder clearMplsLabel() { + + mplsLabel_ = 0; + onChanged(); + return this; } + + private int mplsTrafficClass_ ; /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_traffic_class = 6; + * @return The mplsTrafficClass. */ - public context.ContextOuterClass.DeviceId.Builder addDeviceIdsBuilder( - int index) { - return getDeviceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + @java.lang.Override + public int getMplsTrafficClass() { + return mplsTrafficClass_; } /** - * repeated .context.DeviceId device_ids = 1; + * uint32 mpls_traffic_class = 6; + * @param value The mplsTrafficClass to set. + * @return This builder for chaining. */ - public java.util.List - getDeviceIdsBuilderList() { - return getDeviceIdsFieldBuilder().getBuilderList(); + public Builder setMplsTrafficClass(int value) { + + mplsTrafficClass_ = value; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdsFieldBuilder() { - if (deviceIdsBuilder_ == null) { - deviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - deviceIds_ = null; - } - return deviceIdsBuilder_; + /** + * uint32 mpls_traffic_class = 6; + * @return This builder for chaining. + */ + public Builder clearMplsTrafficClass() { + + mplsTrafficClass_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -15520,95 +39211,114 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceIdList) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L2) } - // @@protoc_insertion_point(class_scope:context.DeviceIdList) - private static final context.ContextOuterClass.DeviceIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L2) + private static final context.ContextOuterClass.ConnectionSettings_L2 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L2(); } - public static context.ContextOuterClass.DeviceIdList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceIdList parsePartialFrom( + public ConnectionSettings_L2 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceIdList(input, extensionRegistry); + return new ConnectionSettings_L2(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L2 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceList) + public interface ConnectionSettings_L3OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L3) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ - java.util.List - getDevicesList(); + java.lang.String getSrcIpAddress(); /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ - context.ContextOuterClass.Device getDevices(int index); + com.google.protobuf.ByteString + getSrcIpAddressBytes(); + /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ - int getDevicesCount(); + java.lang.String getDstIpAddress(); /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ - java.util.List - getDevicesOrBuilderList(); + com.google.protobuf.ByteString + getDstIpAddressBytes(); + /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ - context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index); + int getDscp(); + + /** + * uint32 protocol = 4; + * @return The protocol. + */ + int getProtocol(); + + /** + * uint32 ttl = 5; + * @return The ttl. + */ + int getTtl(); } /** - * Protobuf type {@code context.DeviceList} + * Protobuf type {@code context.ConnectionSettings_L3} */ - public static final class DeviceList extends + public static final class ConnectionSettings_L3 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceList) - DeviceListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L3) + ConnectionSettings_L3OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceList.newBuilder() to construct. - private DeviceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L3.newBuilder() to construct. + private ConnectionSettings_L3(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceList() { - devices_ = java.util.Collections.emptyList(); + private ConnectionSettings_L3() { + srcIpAddress_ = ""; + dstIpAddress_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceList(); + return new ConnectionSettings_L3(); } @java.lang.Override @@ -15616,7 +39326,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceList( + private ConnectionSettings_L3( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -15624,7 +39334,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -15636,12 +39345,30 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - devices_.add( - input.readMessage(context.ContextOuterClass.Device.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + srcIpAddress_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + dstIpAddress_ = s; + break; + } + case 24: { + + dscp_ = input.readUInt32(); + break; + } + case 32: { + + protocol_ = input.readUInt32(); + break; + } + case 40: { + + ttl_ = input.readUInt32(); break; } default: { @@ -15659,64 +39386,130 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - devices_ = java.util.Collections.unmodifiableList(devices_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L3.class, context.ContextOuterClass.ConnectionSettings_L3.Builder.class); } - public static final int DEVICES_FIELD_NUMBER = 1; - private java.util.List devices_; + public static final int SRC_IP_ADDRESS_FIELD_NUMBER = 1; + private volatile java.lang.Object srcIpAddress_; /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ @java.lang.Override - public java.util.List getDevicesList() { - return devices_; + public java.lang.String getSrcIpAddress() { + java.lang.Object ref = srcIpAddress_; + 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(); + srcIpAddress_ = s; + return s; + } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ @java.lang.Override - public java.util.List - getDevicesOrBuilderList() { - return devices_; + public com.google.protobuf.ByteString + getSrcIpAddressBytes() { + java.lang.Object ref = srcIpAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DST_IP_ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object dstIpAddress_; /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ @java.lang.Override - public int getDevicesCount() { - return devices_.size(); + public java.lang.String getDstIpAddress() { + java.lang.Object ref = dstIpAddress_; + 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(); + dstIpAddress_ = s; + return s; + } } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ @java.lang.Override - public context.ContextOuterClass.Device getDevices(int index) { - return devices_.get(index); + public com.google.protobuf.ByteString + getDstIpAddressBytes() { + java.lang.Object ref = dstIpAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int DSCP_FIELD_NUMBER = 3; + private int dscp_; /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ @java.lang.Override - public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index) { - return devices_.get(index); + public int getDscp() { + return dscp_; + } + + public static final int PROTOCOL_FIELD_NUMBER = 4; + private int protocol_; + /** + * uint32 protocol = 4; + * @return The protocol. + */ + @java.lang.Override + public int getProtocol() { + return protocol_; + } + + public static final int TTL_FIELD_NUMBER = 5; + private int ttl_; + /** + * uint32 ttl = 5; + * @return The ttl. + */ + @java.lang.Override + public int getTtl() { + return ttl_; } private byte memoizedIsInitialized = -1; @@ -15733,8 +39526,20 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < devices_.size(); i++) { - output.writeMessage(1, devices_.get(i)); + if (!getSrcIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, srcIpAddress_); + } + if (!getDstIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dstIpAddress_); + } + if (dscp_ != 0) { + output.writeUInt32(3, dscp_); + } + if (protocol_ != 0) { + output.writeUInt32(4, protocol_); + } + if (ttl_ != 0) { + output.writeUInt32(5, ttl_); } unknownFields.writeTo(output); } @@ -15745,9 +39550,23 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < devices_.size(); i++) { + if (!getSrcIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, srcIpAddress_); + } + if (!getDstIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dstIpAddress_); + } + if (dscp_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, devices_.get(i)); + .computeUInt32Size(3, dscp_); + } + if (protocol_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, protocol_); + } + if (ttl_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, ttl_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -15759,13 +39578,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L3)) { return super.equals(obj); } - context.ContextOuterClass.DeviceList other = (context.ContextOuterClass.DeviceList) obj; - - if (!getDevicesList() - .equals(other.getDevicesList())) return false; + context.ContextOuterClass.ConnectionSettings_L3 other = (context.ContextOuterClass.ConnectionSettings_L3) obj; + + if (!getSrcIpAddress() + .equals(other.getSrcIpAddress())) return false; + if (!getDstIpAddress() + .equals(other.getDstIpAddress())) return false; + if (getDscp() + != other.getDscp()) return false; + if (getProtocol() + != other.getProtocol()) return false; + if (getTtl() + != other.getTtl()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -15777,78 +39604,84 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getDevicesCount() > 0) { - hash = (37 * hash) + DEVICES_FIELD_NUMBER; - hash = (53 * hash) + getDevicesList().hashCode(); - } + hash = (37 * hash) + SRC_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getSrcIpAddress().hashCode(); + hash = (37 * hash) + DST_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getDstIpAddress().hashCode(); + hash = (37 * hash) + DSCP_FIELD_NUMBER; + hash = (53 * hash) + getDscp(); + hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + getProtocol(); + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 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 context.ContextOuterClass.DeviceList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L3 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 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 context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceList parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L3 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -15861,7 +39694,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L3 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -15877,26 +39710,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceList} + * Protobuf type {@code context.ConnectionSettings_L3} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceList) - context.ContextOuterClass.DeviceListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L3) + context.ContextOuterClass.ConnectionSettings_L3OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceList.class, context.ContextOuterClass.DeviceList.Builder.class); + context.ContextOuterClass.ConnectionSettings_L3.class, context.ContextOuterClass.ConnectionSettings_L3.Builder.class); } - // Construct using context.ContextOuterClass.DeviceList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L3.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -15909,35 +39742,38 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getDevicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (devicesBuilder_ == null) { - devices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - devicesBuilder_.clear(); - } + srcIpAddress_ = ""; + + dstIpAddress_ = ""; + + dscp_ = 0; + + protocol_ = 0; + + ttl_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L3_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceList build() { - context.ContextOuterClass.DeviceList result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L3 build() { + context.ContextOuterClass.ConnectionSettings_L3 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -15945,18 +39781,13 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceList buildPartial() { - context.ContextOuterClass.DeviceList result = new context.ContextOuterClass.DeviceList(this); - int from_bitField0_ = bitField0_; - if (devicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - devices_ = java.util.Collections.unmodifiableList(devices_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.devices_ = devices_; - } else { - result.devices_ = devicesBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L3 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L3 result = new context.ContextOuterClass.ConnectionSettings_L3(this); + result.srcIpAddress_ = srcIpAddress_; + result.dstIpAddress_ = dstIpAddress_; + result.dscp_ = dscp_; + result.protocol_ = protocol_; + result.ttl_ = ttl_; onBuilt(); return result; } @@ -15995,41 +39826,32 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceList) { - return mergeFrom((context.ContextOuterClass.DeviceList)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L3) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L3)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceList other) { - if (other == context.ContextOuterClass.DeviceList.getDefaultInstance()) return this; - if (devicesBuilder_ == null) { - if (!other.devices_.isEmpty()) { - if (devices_.isEmpty()) { - devices_ = other.devices_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDevicesIsMutable(); - devices_.addAll(other.devices_); - } - onChanged(); - } - } else { - if (!other.devices_.isEmpty()) { - if (devicesBuilder_.isEmpty()) { - devicesBuilder_.dispose(); - devicesBuilder_ = null; - devices_ = other.devices_; - bitField0_ = (bitField0_ & ~0x00000001); - devicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDevicesFieldBuilder() : null; - } else { - devicesBuilder_.addAllMessages(other.devices_); - } - } + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L3 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance()) return this; + if (!other.getSrcIpAddress().isEmpty()) { + srcIpAddress_ = other.srcIpAddress_; + onChanged(); + } + if (!other.getDstIpAddress().isEmpty()) { + dstIpAddress_ = other.dstIpAddress_; + onChanged(); + } + if (other.getDscp() != 0) { + setDscp(other.getDscp()); + } + if (other.getProtocol() != 0) { + setProtocol(other.getProtocol()); + } + if (other.getTtl() != 0) { + setTtl(other.getTtl()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -16046,11 +39868,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceList parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L3 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L3) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -16059,246 +39881,250 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List devices_ = - java.util.Collections.emptyList(); - private void ensureDevicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - devices_ = new java.util.ArrayList(devices_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> devicesBuilder_; + private java.lang.Object srcIpAddress_ = ""; /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The srcIpAddress. */ - public java.util.List getDevicesList() { - if (devicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(devices_); + public java.lang.String getSrcIpAddress() { + java.lang.Object ref = srcIpAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + srcIpAddress_ = s; + return s; } else { - return devicesBuilder_.getMessageList(); + return (java.lang.String) ref; } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return The bytes for srcIpAddress. */ - public int getDevicesCount() { - if (devicesBuilder_ == null) { - return devices_.size(); + public com.google.protobuf.ByteString + getSrcIpAddressBytes() { + java.lang.Object ref = srcIpAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + srcIpAddress_ = b; + return b; } else { - return devicesBuilder_.getCount(); + return (com.google.protobuf.ByteString) ref; } } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @param value The srcIpAddress to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Device getDevices(int index) { - if (devicesBuilder_ == null) { - return devices_.get(index); - } else { - return devicesBuilder_.getMessage(index); - } + public Builder setSrcIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + srcIpAddress_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @return This builder for chaining. */ - public Builder setDevices( - int index, context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.set(index, value); - onChanged(); - } else { - devicesBuilder_.setMessage(index, value); - } + public Builder clearSrcIpAddress() { + + srcIpAddress_ = getDefaultInstance().getSrcIpAddress(); + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * string src_ip_address = 1; + * @param value The bytes for srcIpAddress to set. + * @return This builder for chaining. */ - public Builder setDevices( - int index, context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.set(index, builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.setMessage(index, builderForValue.build()); - } + public Builder setSrcIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + srcIpAddress_ = value; + onChanged(); return this; } + + private java.lang.Object dstIpAddress_ = ""; /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The dstIpAddress. */ - public Builder addDevices(context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.add(value); - onChanged(); + public java.lang.String getDstIpAddress() { + java.lang.Object ref = dstIpAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dstIpAddress_ = s; + return s; } else { - devicesBuilder_.addMessage(value); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return The bytes for dstIpAddress. */ - public Builder addDevices( - int index, context.ContextOuterClass.Device value) { - if (devicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDevicesIsMutable(); - devices_.add(index, value); - onChanged(); + public com.google.protobuf.ByteString + getDstIpAddressBytes() { + java.lang.Object ref = dstIpAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dstIpAddress_ = b; + return b; } else { - devicesBuilder_.addMessage(index, value); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @param value The dstIpAddress to set. + * @return This builder for chaining. */ - public Builder addDevices( - context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.add(builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.addMessage(builderForValue.build()); - } + public Builder setDstIpAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dstIpAddress_ = value; + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * string dst_ip_address = 2; + * @return This builder for chaining. */ - public Builder addDevices( - int index, context.ContextOuterClass.Device.Builder builderForValue) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.add(index, builderForValue.build()); - onChanged(); - } else { - devicesBuilder_.addMessage(index, builderForValue.build()); - } + public Builder clearDstIpAddress() { + + dstIpAddress_ = getDefaultInstance().getDstIpAddress(); + onChanged(); + return this; + } + /** + * string dst_ip_address = 2; + * @param value The bytes for dstIpAddress to set. + * @return This builder for chaining. + */ + public Builder setDstIpAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dstIpAddress_ = value; + onChanged(); return this; } + + private int dscp_ ; /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return The dscp. */ - public Builder addAllDevices( - java.lang.Iterable values) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, devices_); - onChanged(); - } else { - devicesBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public int getDscp() { + return dscp_; } /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @param value The dscp to set. + * @return This builder for chaining. */ - public Builder clearDevices() { - if (devicesBuilder_ == null) { - devices_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - devicesBuilder_.clear(); - } + public Builder setDscp(int value) { + + dscp_ = value; + onChanged(); return this; } /** - * repeated .context.Device devices = 1; + * uint32 dscp = 3; + * @return This builder for chaining. */ - public Builder removeDevices(int index) { - if (devicesBuilder_ == null) { - ensureDevicesIsMutable(); - devices_.remove(index); - onChanged(); - } else { - devicesBuilder_.remove(index); - } + public Builder clearDscp() { + + dscp_ = 0; + onChanged(); return this; } + + private int protocol_ ; /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @return The protocol. */ - public context.ContextOuterClass.Device.Builder getDevicesBuilder( - int index) { - return getDevicesFieldBuilder().getBuilder(index); + @java.lang.Override + public int getProtocol() { + return protocol_; } /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @param value The protocol to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceOrBuilder getDevicesOrBuilder( - int index) { - if (devicesBuilder_ == null) { - return devices_.get(index); } else { - return devicesBuilder_.getMessageOrBuilder(index); - } + public Builder setProtocol(int value) { + + protocol_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * uint32 protocol = 4; + * @return This builder for chaining. */ - public java.util.List - getDevicesOrBuilderList() { - if (devicesBuilder_ != null) { - return devicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(devices_); - } + public Builder clearProtocol() { + + protocol_ = 0; + onChanged(); + return this; } + + private int ttl_ ; /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @return The ttl. */ - public context.ContextOuterClass.Device.Builder addDevicesBuilder() { - return getDevicesFieldBuilder().addBuilder( - context.ContextOuterClass.Device.getDefaultInstance()); + @java.lang.Override + public int getTtl() { + return ttl_; } /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @param value The ttl to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Device.Builder addDevicesBuilder( - int index) { - return getDevicesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Device.getDefaultInstance()); + public Builder setTtl(int value) { + + ttl_ = value; + onChanged(); + return this; } /** - * repeated .context.Device devices = 1; + * uint32 ttl = 5; + * @return This builder for chaining. */ - public java.util.List - getDevicesBuilderList() { - return getDevicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder> - getDevicesFieldBuilder() { - if (devicesBuilder_ == null) { - devicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Device, context.ContextOuterClass.Device.Builder, context.ContextOuterClass.DeviceOrBuilder>( - devices_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - devices_ = null; - } - return devicesBuilder_; + public Builder clearTtl() { + + ttl_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -16313,100 +40139,94 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceList) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L3) } - // @@protoc_insertion_point(class_scope:context.DeviceList) - private static final context.ContextOuterClass.DeviceList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L3) + private static final context.ContextOuterClass.ConnectionSettings_L3 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L3(); } - public static context.ContextOuterClass.DeviceList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceList parsePartialFrom( + public ConnectionSettings_L3 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceList(input, extensionRegistry); + return new ConnectionSettings_L3(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L3 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeviceEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.DeviceEvent) + public interface ConnectionSettings_L4OrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings_L4) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. - */ - context.ContextOuterClass.Event getEvent(); - /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return The srcPort. */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + int getSrcPort(); /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * uint32 dst_port = 2; + * @return The dstPort. */ - boolean hasDeviceId(); + int getDstPort(); + /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ - context.ContextOuterClass.DeviceId getDeviceId(); + int getTcpFlags(); + /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + int getTtl(); } /** - * Protobuf type {@code context.DeviceEvent} + * Protobuf type {@code context.ConnectionSettings_L4} */ - public static final class DeviceEvent extends + public static final class ConnectionSettings_L4 extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.DeviceEvent) - DeviceEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings_L4) + ConnectionSettings_L4OrBuilder { private static final long serialVersionUID = 0L; - // Use DeviceEvent.newBuilder() to construct. - private DeviceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings_L4.newBuilder() to construct. + private ConnectionSettings_L4(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private DeviceEvent() { + private ConnectionSettings_L4() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new DeviceEvent(); + return new ConnectionSettings_L4(); } @java.lang.Override @@ -16414,7 +40234,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private DeviceEvent( + private ConnectionSettings_L4( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -16432,30 +40252,24 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } + case 8: { + srcPort_ = input.readUInt32(); break; } - case 18: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); - } + case 16: { + + dstPort_ = input.readUInt32(); + break; + } + case 24: { + + tcpFlags_ = input.readUInt32(); + break; + } + case 32: { + ttl_ = input.readUInt32(); break; } default: { @@ -16479,67 +40293,59 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + context.ContextOuterClass.ConnectionSettings_L4.class, context.ContextOuterClass.ConnectionSettings_L4.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; + public static final int SRC_PORT_FIELD_NUMBER = 1; + private int srcPort_; /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return The srcPort. */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public int getSrcPort() { + return srcPort_; } - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.DeviceId deviceId_; + public static final int DST_PORT_FIELD_NUMBER = 2; + private int dstPort_; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * uint32 dst_port = 2; + * @return The dstPort. */ @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; + public int getDstPort() { + return dstPort_; } + + public static final int TCP_FLAGS_FIELD_NUMBER = 3; + private int tcpFlags_; /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + public int getTcpFlags() { + return tcpFlags_; } + + public static final int TTL_FIELD_NUMBER = 4; + private int ttl_; /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); + public int getTtl() { + return ttl_; } private byte memoizedIsInitialized = -1; @@ -16556,11 +40362,17 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (srcPort_ != 0) { + output.writeUInt32(1, srcPort_); } - if (deviceId_ != null) { - output.writeMessage(2, getDeviceId()); + if (dstPort_ != 0) { + output.writeUInt32(2, dstPort_); + } + if (tcpFlags_ != 0) { + output.writeUInt32(3, tcpFlags_); + } + if (ttl_ != 0) { + output.writeUInt32(4, ttl_); } unknownFields.writeTo(output); } @@ -16571,13 +40383,21 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (srcPort_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeUInt32Size(1, srcPort_); } - if (deviceId_ != null) { + if (dstPort_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDeviceId()); + .computeUInt32Size(2, dstPort_); + } + if (tcpFlags_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, tcpFlags_); + } + if (ttl_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, ttl_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -16589,21 +40409,19 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.DeviceEvent)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings_L4)) { return super.equals(obj); } - context.ContextOuterClass.DeviceEvent other = (context.ContextOuterClass.DeviceEvent) obj; + context.ContextOuterClass.ConnectionSettings_L4 other = (context.ContextOuterClass.ConnectionSettings_L4) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } + if (getSrcPort() + != other.getSrcPort()) return false; + if (getDstPort() + != other.getDstPort()) return false; + if (getTcpFlags() + != other.getTcpFlags()) return false; + if (getTtl() + != other.getTtl()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -16615,82 +40433,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } + hash = (37 * hash) + SRC_PORT_FIELD_NUMBER; + hash = (53 * hash) + getSrcPort(); + hash = (37 * hash) + DST_PORT_FIELD_NUMBER; + hash = (53 * hash) + getDstPort(); + hash = (37 * hash) + TCP_FLAGS_FIELD_NUMBER; + hash = (53 * hash) + getTcpFlags(); + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.DeviceEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 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 context.ContextOuterClass.DeviceEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings_L4 parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 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 context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.DeviceEvent parseFrom( + public static context.ContextOuterClass.ConnectionSettings_L4 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -16703,7 +40521,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.DeviceEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings_L4 prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -16719,26 +40537,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.DeviceEvent} + * Protobuf type {@code context.ConnectionSettings_L4} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.DeviceEvent) - context.ContextOuterClass.DeviceEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings_L4) + context.ContextOuterClass.ConnectionSettings_L4OrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.DeviceEvent.class, context.ContextOuterClass.DeviceEvent.Builder.class); + context.ContextOuterClass.ConnectionSettings_L4.class, context.ContextOuterClass.ConnectionSettings_L4.Builder.class); } - // Construct using context.ContextOuterClass.DeviceEvent.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings_L4.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -16756,35 +40574,31 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } + srcPort_ = 0; + + dstPort_ = 0; + + tcpFlags_ = 0; + + ttl_ = 0; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_DeviceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_L4_descriptor; } @java.lang.Override - public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { - return context.ContextOuterClass.DeviceEvent.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.DeviceEvent build() { - context.ContextOuterClass.DeviceEvent result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings_L4 build() { + context.ContextOuterClass.ConnectionSettings_L4 result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -16792,18 +40606,12 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.DeviceEvent buildPartial() { - context.ContextOuterClass.DeviceEvent result = new context.ContextOuterClass.DeviceEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); - } + public context.ContextOuterClass.ConnectionSettings_L4 buildPartial() { + context.ContextOuterClass.ConnectionSettings_L4 result = new context.ContextOuterClass.ConnectionSettings_L4(this); + result.srcPort_ = srcPort_; + result.dstPort_ = dstPort_; + result.tcpFlags_ = tcpFlags_; + result.ttl_ = ttl_; onBuilt(); return result; } @@ -16842,21 +40650,27 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.DeviceEvent) { - return mergeFrom((context.ContextOuterClass.DeviceEvent)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings_L4) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings_L4)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.DeviceEvent other) { - if (other == context.ContextOuterClass.DeviceEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings_L4 other) { + if (other == context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance()) return this; + if (other.getSrcPort() != 0) { + setSrcPort(other.getSrcPort()); } - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); + if (other.getDstPort() != 0) { + setDstPort(other.getDstPort()); + } + if (other.getTcpFlags() != 0) { + setTcpFlags(other.getTcpFlags()); + } + if (other.getTtl() != 0) { + setTtl(other.getTtl()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -16873,11 +40687,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.DeviceEvent parsedMessage = null; + context.ContextOuterClass.ConnectionSettings_L4 parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.DeviceEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings_L4) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -16887,242 +40701,128 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + private int srcPort_ ; /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. + * uint32 src_port = 1; + * @return The srcPort. */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } + @java.lang.Override + public int getSrcPort() { + return srcPort_; } /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @param value The srcPort to set. + * @return This builder for chaining. */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } - + public Builder setSrcPort(int value) { + + srcPort_ = value; + onChanged(); return this; } /** - * .context.Event event = 1; + * uint32 src_port = 1; + * @return This builder for chaining. */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearSrcPort() { + + srcPort_ = 0; + onChanged(); return this; } - /** - * .context.Event event = 1; - */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } - return this; - } + private int dstPort_ ; /** - * .context.Event event = 1; + * uint32 dst_port = 2; + * @return The dstPort. */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } - - return this; + @java.lang.Override + public int getDstPort() { + return dstPort_; } /** - * .context.Event event = 1; + * uint32 dst_port = 2; + * @param value The dstPort to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { + public Builder setDstPort(int value) { + dstPort_ = value; onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - } - /** - * .context.Event event = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; - /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. - */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; - } - /** - * .context.DeviceId device_id = 2; - * @return The deviceId. - */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); - } - } - /** - * .context.DeviceId device_id = 2; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - deviceId_ = value; - onChanged(); - } else { - deviceIdBuilder_.setMessage(value); - } - return this; } /** - * .context.DeviceId device_id = 2; + * uint32 dst_port = 2; + * @return This builder for chaining. */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); - } else { - deviceIdBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearDstPort() { + + dstPort_ = 0; + onChanged(); return this; } + + private int tcpFlags_ ; /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @return The tcpFlags. */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public int getTcpFlags() { + return tcpFlags_; } /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @param value The tcpFlags to set. + * @return This builder for chaining. */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; - onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - + public Builder setTcpFlags(int value) { + + tcpFlags_ = value; + onChanged(); return this; } /** - * .context.DeviceId device_id = 2; + * uint32 tcp_flags = 3; + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + public Builder clearTcpFlags() { + tcpFlags_ = 0; onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); + return this; } + + private int ttl_ ; /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @return The ttl. */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } + @java.lang.Override + public int getTtl() { + return ttl_; } /** - * .context.DeviceId device_id = 2; + * uint32 ttl = 4; + * @param value The ttl to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; + public Builder setTtl(int value) { + + ttl_ = value; + onChanged(); + return this; + } + /** + * uint32 ttl = 4; + * @return This builder for chaining. + */ + public Builder clearTtl() { + + ttl_ = 0; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -17137,89 +40837,130 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.DeviceEvent) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings_L4) } - // @@protoc_insertion_point(class_scope:context.DeviceEvent) - private static final context.ContextOuterClass.DeviceEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings_L4) + private static final context.ContextOuterClass.ConnectionSettings_L4 DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.DeviceEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings_L4(); } - public static context.ContextOuterClass.DeviceEvent getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeviceEvent parsePartialFrom( + public ConnectionSettings_L4 parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeviceEvent(input, extensionRegistry); + return new ConnectionSettings_L4(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.DeviceEvent getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings_L4 getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkId) + public interface ConnectionSettingsOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionSettings) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ - boolean hasLinkUuid(); + boolean hasL0(); /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ - context.ContextOuterClass.Uuid getLinkUuid(); + context.ContextOuterClass.ConnectionSettings_L0 getL0(); /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder(); + context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder(); + + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + boolean hasL2(); + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + context.ContextOuterClass.ConnectionSettings_L2 getL2(); + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder(); + + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + boolean hasL3(); + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + context.ContextOuterClass.ConnectionSettings_L3 getL3(); + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder(); + + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + boolean hasL4(); + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + context.ContextOuterClass.ConnectionSettings_L4 getL4(); + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder(); } /** - *
-   * ----- Link ----------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.LinkId} + * Protobuf type {@code context.ConnectionSettings} */ - public static final class LinkId extends + public static final class ConnectionSettings extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkId) - LinkIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionSettings) + ConnectionSettingsOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkId.newBuilder() to construct. - private LinkId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionSettings.newBuilder() to construct. + private ConnectionSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkId() { + private ConnectionSettings() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkId(); + return new ConnectionSettings(); } @java.lang.Override @@ -17227,7 +40968,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkId( + private ConnectionSettings( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -17246,14 +40987,53 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (linkUuid_ != null) { - subBuilder = linkUuid_.toBuilder(); + context.ContextOuterClass.ConnectionSettings_L0.Builder subBuilder = null; + if (l0_ != null) { + subBuilder = l0_.toBuilder(); } - linkUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + l0_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L0.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkUuid_); - linkUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(l0_); + l0_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + context.ContextOuterClass.ConnectionSettings_L2.Builder subBuilder = null; + if (l2_ != null) { + subBuilder = l2_.toBuilder(); + } + l2_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L2.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l2_); + l2_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + context.ContextOuterClass.ConnectionSettings_L3.Builder subBuilder = null; + if (l3_ != null) { + subBuilder = l3_.toBuilder(); + } + l3_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L3.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l3_); + l3_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + context.ContextOuterClass.ConnectionSettings_L4.Builder subBuilder = null; + if (l4_ != null) { + subBuilder = l4_.toBuilder(); + } + l4_ = input.readMessage(context.ContextOuterClass.ConnectionSettings_L4.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(l4_); + l4_ = subBuilder.buildPartial(); } break; @@ -17279,41 +41059,119 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + context.ContextOuterClass.ConnectionSettings.class, context.ContextOuterClass.ConnectionSettings.Builder.class); } - public static final int LINK_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid linkUuid_; + public static final int L0_FIELD_NUMBER = 1; + private context.ContextOuterClass.ConnectionSettings_L0 l0_; /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ @java.lang.Override - public boolean hasLinkUuid() { - return linkUuid_ != null; + public boolean hasL0() { + return l0_ != null; } /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ @java.lang.Override - public context.ContextOuterClass.Uuid getLinkUuid() { - return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + public context.ContextOuterClass.ConnectionSettings_L0 getL0() { + return l0_ == null ? context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { - return getLinkUuid(); + public context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder() { + return getL0(); + } + + public static final int L2_FIELD_NUMBER = 2; + private context.ContextOuterClass.ConnectionSettings_L2 l2_; + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + @java.lang.Override + public boolean hasL2() { + return l2_ != null; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L2 getL2() { + return l2_ == null ? context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder() { + return getL2(); + } + + public static final int L3_FIELD_NUMBER = 3; + private context.ContextOuterClass.ConnectionSettings_L3 l3_; + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + @java.lang.Override + public boolean hasL3() { + return l3_ != null; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L3 getL3() { + return l3_ == null ? context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder() { + return getL3(); + } + + public static final int L4_FIELD_NUMBER = 4; + private context.ContextOuterClass.ConnectionSettings_L4 l4_; + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + @java.lang.Override + public boolean hasL4() { + return l4_ != null; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L4 getL4() { + return l4_ == null ? context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder() { + return getL4(); } private byte memoizedIsInitialized = -1; @@ -17330,8 +41188,17 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (linkUuid_ != null) { - output.writeMessage(1, getLinkUuid()); + if (l0_ != null) { + output.writeMessage(1, getL0()); + } + if (l2_ != null) { + output.writeMessage(2, getL2()); + } + if (l3_ != null) { + output.writeMessage(3, getL3()); + } + if (l4_ != null) { + output.writeMessage(4, getL4()); } unknownFields.writeTo(output); } @@ -17342,9 +41209,21 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (linkUuid_ != null) { + if (l0_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getLinkUuid()); + .computeMessageSize(1, getL0()); + } + if (l2_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getL2()); + } + if (l3_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getL3()); + } + if (l4_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getL4()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -17356,15 +41235,30 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkId)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionSettings)) { return super.equals(obj); } - context.ContextOuterClass.LinkId other = (context.ContextOuterClass.LinkId) obj; + context.ContextOuterClass.ConnectionSettings other = (context.ContextOuterClass.ConnectionSettings) obj; - if (hasLinkUuid() != other.hasLinkUuid()) return false; - if (hasLinkUuid()) { - if (!getLinkUuid() - .equals(other.getLinkUuid())) return false; + if (hasL0() != other.hasL0()) return false; + if (hasL0()) { + if (!getL0() + .equals(other.getL0())) return false; + } + if (hasL2() != other.hasL2()) return false; + if (hasL2()) { + if (!getL2() + .equals(other.getL2())) return false; + } + if (hasL3() != other.hasL3()) return false; + if (hasL3()) { + if (!getL3() + .equals(other.getL3())) return false; + } + if (hasL4() != other.hasL4()) return false; + if (hasL4()) { + if (!getL4() + .equals(other.getL4())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -17377,78 +41271,90 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasLinkUuid()) { - hash = (37 * hash) + LINK_UUID_FIELD_NUMBER; - hash = (53 * hash) + getLinkUuid().hashCode(); + if (hasL0()) { + hash = (37 * hash) + L0_FIELD_NUMBER; + hash = (53 * hash) + getL0().hashCode(); + } + if (hasL2()) { + hash = (37 * hash) + L2_FIELD_NUMBER; + hash = (53 * hash) + getL2().hashCode(); + } + if (hasL3()) { + hash = (37 * hash) + L3_FIELD_NUMBER; + hash = (53 * hash) + getL3().hashCode(); + } + if (hasL4()) { + hash = (37 * hash) + L4_FIELD_NUMBER; + hash = (53 * hash) + getL4().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionSettings parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings 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 context.ContextOuterClass.LinkId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionSettings 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 context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkId parseFrom( + public static context.ContextOuterClass.ConnectionSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -17461,7 +41367,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkId prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionSettings prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -17477,30 +41383,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Link ----------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.LinkId} + * Protobuf type {@code context.ConnectionSettings} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkId) - context.ContextOuterClass.LinkIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionSettings) + context.ContextOuterClass.ConnectionSettingsOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkId.class, context.ContextOuterClass.LinkId.Builder.class); + context.ContextOuterClass.ConnectionSettings.class, context.ContextOuterClass.ConnectionSettings.Builder.class); } - // Construct using context.ContextOuterClass.LinkId.newBuilder() + // Construct using context.ContextOuterClass.ConnectionSettings.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -17518,11 +41420,29 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (linkUuidBuilder_ == null) { - linkUuid_ = null; + if (l0Builder_ == null) { + l0_ = null; } else { - linkUuid_ = null; - linkUuidBuilder_ = null; + l0_ = null; + l0Builder_ = null; + } + if (l2Builder_ == null) { + l2_ = null; + } else { + l2_ = null; + l2Builder_ = null; + } + if (l3Builder_ == null) { + l3_ = null; + } else { + l3_ = null; + l3Builder_ = null; + } + if (l4Builder_ == null) { + l4_ = null; + } else { + l4_ = null; + l4Builder_ = null; } return this; } @@ -17530,17 +41450,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkId_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionSettings_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkId getDefaultInstanceForType() { - return context.ContextOuterClass.LinkId.getDefaultInstance(); + public context.ContextOuterClass.ConnectionSettings getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionSettings.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkId build() { - context.ContextOuterClass.LinkId result = buildPartial(); + public context.ContextOuterClass.ConnectionSettings build() { + context.ContextOuterClass.ConnectionSettings result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -17548,12 +41468,27 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkId buildPartial() { - context.ContextOuterClass.LinkId result = new context.ContextOuterClass.LinkId(this); - if (linkUuidBuilder_ == null) { - result.linkUuid_ = linkUuid_; + public context.ContextOuterClass.ConnectionSettings buildPartial() { + context.ContextOuterClass.ConnectionSettings result = new context.ContextOuterClass.ConnectionSettings(this); + if (l0Builder_ == null) { + result.l0_ = l0_; } else { - result.linkUuid_ = linkUuidBuilder_.build(); + result.l0_ = l0Builder_.build(); + } + if (l2Builder_ == null) { + result.l2_ = l2_; + } else { + result.l2_ = l2Builder_.build(); + } + if (l3Builder_ == null) { + result.l3_ = l3_; + } else { + result.l3_ = l3Builder_.build(); + } + if (l4Builder_ == null) { + result.l4_ = l4_; + } else { + result.l4_ = l4Builder_.build(); } onBuilt(); return result; @@ -17593,18 +41528,27 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkId) { - return mergeFrom((context.ContextOuterClass.LinkId)other); + if (other instanceof context.ContextOuterClass.ConnectionSettings) { + return mergeFrom((context.ContextOuterClass.ConnectionSettings)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkId other) { - if (other == context.ContextOuterClass.LinkId.getDefaultInstance()) return this; - if (other.hasLinkUuid()) { - mergeLinkUuid(other.getLinkUuid()); + public Builder mergeFrom(context.ContextOuterClass.ConnectionSettings other) { + if (other == context.ContextOuterClass.ConnectionSettings.getDefaultInstance()) return this; + if (other.hasL0()) { + mergeL0(other.getL0()); + } + if (other.hasL2()) { + mergeL2(other.getL2()); + } + if (other.hasL3()) { + mergeL3(other.getL3()); + } + if (other.hasL4()) { + mergeL4(other.getL4()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -17621,11 +41565,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkId parsedMessage = null; + context.ContextOuterClass.ConnectionSettings parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionSettings) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -17635,123 +41579,480 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid linkUuid_; + private context.ContextOuterClass.ConnectionSettings_L0 l0_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> linkUuidBuilder_; + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder> l0Builder_; /** - * .context.Uuid link_uuid = 1; - * @return Whether the linkUuid field is set. + * .context.ConnectionSettings_L0 l0 = 1; + * @return Whether the l0 field is set. */ - public boolean hasLinkUuid() { - return linkUuidBuilder_ != null || linkUuid_ != null; + public boolean hasL0() { + return l0Builder_ != null || l0_ != null; } /** - * .context.Uuid link_uuid = 1; - * @return The linkUuid. + * .context.ConnectionSettings_L0 l0 = 1; + * @return The l0. */ - public context.ContextOuterClass.Uuid getLinkUuid() { - if (linkUuidBuilder_ == null) { - return linkUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + public context.ContextOuterClass.ConnectionSettings_L0 getL0() { + if (l0Builder_ == null) { + return l0_ == null ? context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } else { - return linkUuidBuilder_.getMessage(); + return l0Builder_.getMessage(); } } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder setLinkUuid(context.ContextOuterClass.Uuid value) { - if (linkUuidBuilder_ == null) { + public Builder setL0(context.ContextOuterClass.ConnectionSettings_L0 value) { + if (l0Builder_ == null) { if (value == null) { throw new NullPointerException(); } - linkUuid_ = value; + l0_ = value; onChanged(); } else { - linkUuidBuilder_.setMessage(value); + l0Builder_.setMessage(value); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder setLinkUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (linkUuidBuilder_ == null) { - linkUuid_ = builderForValue.build(); + public Builder setL0( + context.ContextOuterClass.ConnectionSettings_L0.Builder builderForValue) { + if (l0Builder_ == null) { + l0_ = builderForValue.build(); onChanged(); } else { - linkUuidBuilder_.setMessage(builderForValue.build()); + l0Builder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder mergeLinkUuid(context.ContextOuterClass.Uuid value) { - if (linkUuidBuilder_ == null) { - if (linkUuid_ != null) { - linkUuid_ = - context.ContextOuterClass.Uuid.newBuilder(linkUuid_).mergeFrom(value).buildPartial(); + public Builder mergeL0(context.ContextOuterClass.ConnectionSettings_L0 value) { + if (l0Builder_ == null) { + if (l0_ != null) { + l0_ = + context.ContextOuterClass.ConnectionSettings_L0.newBuilder(l0_).mergeFrom(value).buildPartial(); } else { - linkUuid_ = value; + l0_ = value; } onChanged(); } else { - linkUuidBuilder_.mergeFrom(value); + l0Builder_.mergeFrom(value); } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public Builder clearLinkUuid() { - if (linkUuidBuilder_ == null) { - linkUuid_ = null; + public Builder clearL0() { + if (l0Builder_ == null) { + l0_ = null; onChanged(); } else { - linkUuid_ = null; - linkUuidBuilder_ = null; + l0_ = null; + l0Builder_ = null; } return this; } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public context.ContextOuterClass.Uuid.Builder getLinkUuidBuilder() { + public context.ContextOuterClass.ConnectionSettings_L0.Builder getL0Builder() { onChanged(); - return getLinkUuidFieldBuilder().getBuilder(); + return getL0FieldBuilder().getBuilder(); } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ - public context.ContextOuterClass.UuidOrBuilder getLinkUuidOrBuilder() { - if (linkUuidBuilder_ != null) { - return linkUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ConnectionSettings_L0OrBuilder getL0OrBuilder() { + if (l0Builder_ != null) { + return l0Builder_.getMessageOrBuilder(); } else { - return linkUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : linkUuid_; + return l0_ == null ? + context.ContextOuterClass.ConnectionSettings_L0.getDefaultInstance() : l0_; } } /** - * .context.Uuid link_uuid = 1; + * .context.ConnectionSettings_L0 l0 = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getLinkUuidFieldBuilder() { - if (linkUuidBuilder_ == null) { - linkUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getLinkUuid(), + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder> + getL0FieldBuilder() { + if (l0Builder_ == null) { + l0Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L0, context.ContextOuterClass.ConnectionSettings_L0.Builder, context.ContextOuterClass.ConnectionSettings_L0OrBuilder>( + getL0(), getParentForChildren(), isClean()); - linkUuid_ = null; + l0_ = null; + } + return l0Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L2 l2_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder> l2Builder_; + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return Whether the l2 field is set. + */ + public boolean hasL2() { + return l2Builder_ != null || l2_ != null; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + * @return The l2. + */ + public context.ContextOuterClass.ConnectionSettings_L2 getL2() { + if (l2Builder_ == null) { + return l2_ == null ? context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } else { + return l2Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder setL2(context.ContextOuterClass.ConnectionSettings_L2 value) { + if (l2Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l2_ = value; + onChanged(); + } else { + l2Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder setL2( + context.ContextOuterClass.ConnectionSettings_L2.Builder builderForValue) { + if (l2Builder_ == null) { + l2_ = builderForValue.build(); + onChanged(); + } else { + l2Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder mergeL2(context.ContextOuterClass.ConnectionSettings_L2 value) { + if (l2Builder_ == null) { + if (l2_ != null) { + l2_ = + context.ContextOuterClass.ConnectionSettings_L2.newBuilder(l2_).mergeFrom(value).buildPartial(); + } else { + l2_ = value; + } + onChanged(); + } else { + l2Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public Builder clearL2() { + if (l2Builder_ == null) { + l2_ = null; + onChanged(); + } else { + l2_ = null; + l2Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public context.ContextOuterClass.ConnectionSettings_L2.Builder getL2Builder() { + + onChanged(); + return getL2FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + public context.ContextOuterClass.ConnectionSettings_L2OrBuilder getL2OrBuilder() { + if (l2Builder_ != null) { + return l2Builder_.getMessageOrBuilder(); + } else { + return l2_ == null ? + context.ContextOuterClass.ConnectionSettings_L2.getDefaultInstance() : l2_; + } + } + /** + * .context.ConnectionSettings_L2 l2 = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder> + getL2FieldBuilder() { + if (l2Builder_ == null) { + l2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L2, context.ContextOuterClass.ConnectionSettings_L2.Builder, context.ContextOuterClass.ConnectionSettings_L2OrBuilder>( + getL2(), + getParentForChildren(), + isClean()); + l2_ = null; + } + return l2Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L3 l3_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder> l3Builder_; + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return Whether the l3 field is set. + */ + public boolean hasL3() { + return l3Builder_ != null || l3_ != null; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + * @return The l3. + */ + public context.ContextOuterClass.ConnectionSettings_L3 getL3() { + if (l3Builder_ == null) { + return l3_ == null ? context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } else { + return l3Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder setL3(context.ContextOuterClass.ConnectionSettings_L3 value) { + if (l3Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l3_ = value; + onChanged(); + } else { + l3Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder setL3( + context.ContextOuterClass.ConnectionSettings_L3.Builder builderForValue) { + if (l3Builder_ == null) { + l3_ = builderForValue.build(); + onChanged(); + } else { + l3Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder mergeL3(context.ContextOuterClass.ConnectionSettings_L3 value) { + if (l3Builder_ == null) { + if (l3_ != null) { + l3_ = + context.ContextOuterClass.ConnectionSettings_L3.newBuilder(l3_).mergeFrom(value).buildPartial(); + } else { + l3_ = value; + } + onChanged(); + } else { + l3Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public Builder clearL3() { + if (l3Builder_ == null) { + l3_ = null; + onChanged(); + } else { + l3_ = null; + l3Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public context.ContextOuterClass.ConnectionSettings_L3.Builder getL3Builder() { + + onChanged(); + return getL3FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + public context.ContextOuterClass.ConnectionSettings_L3OrBuilder getL3OrBuilder() { + if (l3Builder_ != null) { + return l3Builder_.getMessageOrBuilder(); + } else { + return l3_ == null ? + context.ContextOuterClass.ConnectionSettings_L3.getDefaultInstance() : l3_; + } + } + /** + * .context.ConnectionSettings_L3 l3 = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder> + getL3FieldBuilder() { + if (l3Builder_ == null) { + l3Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L3, context.ContextOuterClass.ConnectionSettings_L3.Builder, context.ContextOuterClass.ConnectionSettings_L3OrBuilder>( + getL3(), + getParentForChildren(), + isClean()); + l3_ = null; + } + return l3Builder_; + } + + private context.ContextOuterClass.ConnectionSettings_L4 l4_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder> l4Builder_; + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return Whether the l4 field is set. + */ + public boolean hasL4() { + return l4Builder_ != null || l4_ != null; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + * @return The l4. + */ + public context.ContextOuterClass.ConnectionSettings_L4 getL4() { + if (l4Builder_ == null) { + return l4_ == null ? context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } else { + return l4Builder_.getMessage(); + } + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder setL4(context.ContextOuterClass.ConnectionSettings_L4 value) { + if (l4Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + l4_ = value; + onChanged(); + } else { + l4Builder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder setL4( + context.ContextOuterClass.ConnectionSettings_L4.Builder builderForValue) { + if (l4Builder_ == null) { + l4_ = builderForValue.build(); + onChanged(); + } else { + l4Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder mergeL4(context.ContextOuterClass.ConnectionSettings_L4 value) { + if (l4Builder_ == null) { + if (l4_ != null) { + l4_ = + context.ContextOuterClass.ConnectionSettings_L4.newBuilder(l4_).mergeFrom(value).buildPartial(); + } else { + l4_ = value; + } + onChanged(); + } else { + l4Builder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public Builder clearL4() { + if (l4Builder_ == null) { + l4_ = null; + onChanged(); + } else { + l4_ = null; + l4Builder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public context.ContextOuterClass.ConnectionSettings_L4.Builder getL4Builder() { + + onChanged(); + return getL4FieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + public context.ContextOuterClass.ConnectionSettings_L4OrBuilder getL4OrBuilder() { + if (l4Builder_ != null) { + return l4Builder_.getMessageOrBuilder(); + } else { + return l4_ == null ? + context.ContextOuterClass.ConnectionSettings_L4.getDefaultInstance() : l4_; + } + } + /** + * .context.ConnectionSettings_L4 l4 = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder> + getL4FieldBuilder() { + if (l4Builder_ == null) { + l4Builder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings_L4, context.ContextOuterClass.ConnectionSettings_L4.Builder, context.ContextOuterClass.ConnectionSettings_L4OrBuilder>( + getL4(), + getParentForChildren(), + isClean()); + l4_ = null; } - return linkUuidBuilder_; + return l4Builder_; } @java.lang.Override public final Builder setUnknownFields( @@ -17766,110 +42067,165 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkId) + // @@protoc_insertion_point(builder_scope:context.ConnectionSettings) } - // @@protoc_insertion_point(class_scope:context.LinkId) - private static final context.ContextOuterClass.LinkId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionSettings) + private static final context.ContextOuterClass.ConnectionSettings DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionSettings(); } - public static context.ContextOuterClass.LinkId getDefaultInstance() { + public static context.ContextOuterClass.ConnectionSettings getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkId parsePartialFrom( + public ConnectionSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkId(input, extensionRegistry); + return new ConnectionSettings(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkId getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionSettings getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Link) + public interface ConnectionOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Connection) com.google.protobuf.MessageOrBuilder { /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. */ - boolean hasLinkId(); + boolean hasConnectionId(); /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ConnectionId connection_id = 1; + * @return The connectionId. */ - context.ContextOuterClass.LinkId getLinkId(); + context.ContextOuterClass.ConnectionId getConnectionId(); /** - * .context.LinkId link_id = 1; + * .context.ConnectionId connection_id = 1; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 2; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ java.util.List - getLinkEndpointIdsList(); + getPathHopsEndpointIdsList(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - context.ContextOuterClass.EndPointId getLinkEndpointIds(int index); + context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - int getLinkEndpointIdsCount(); + int getPathHopsEndpointIdsCount(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ java.util.List - getLinkEndpointIdsOrBuilderList(); + getPathHopsEndpointIdsOrBuilderList(); /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( + int index); + + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + java.util.List + getSubServiceIdsList(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + context.ContextOuterClass.ServiceId getSubServiceIds(int index); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + int getSubServiceIdsCount(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + java.util.List + getSubServiceIdsOrBuilderList(); + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( int index); + + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + boolean hasSettings(); + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + context.ContextOuterClass.ConnectionSettings getSettings(); + /** + * .context.ConnectionSettings settings = 5; + */ + context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder(); } /** - * Protobuf type {@code context.Link} + * Protobuf type {@code context.Connection} */ - public static final class Link extends + public static final class Connection extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Link) - LinkOrBuilder { + // @@protoc_insertion_point(message_implements:context.Connection) + ConnectionOrBuilder { private static final long serialVersionUID = 0L; - // Use Link.newBuilder() to construct. - private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Connection.newBuilder() to construct. + private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Link() { - linkEndpointIds_ = java.util.Collections.emptyList(); + private Connection() { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); + subServiceIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Link(); + return new Connection(); } @java.lang.Override @@ -17877,7 +42233,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Link( + private Connection( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -17897,27 +42253,62 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.LinkId.Builder subBuilder = null; - if (linkId_ != null) { - subBuilder = linkId_.toBuilder(); + context.ContextOuterClass.ConnectionId.Builder subBuilder = null; + if (connectionId_ != null) { + subBuilder = connectionId_.toBuilder(); } - linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkId_); - linkId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionId_); + connectionId_ = subBuilder.buildPartial(); } break; } case 18: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = new java.util.ArrayList(); + pathHopsEndpointIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - linkEndpointIds_.add( + pathHopsEndpointIds_.add( input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); break; } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + subServiceIds_.add( + input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + break; + } + case 42: { + context.ContextOuterClass.ConnectionSettings.Builder subBuilder = null; + if (settings_ != null) { + subBuilder = settings_.toBuilder(); + } + settings_ = input.readMessage(context.ContextOuterClass.ConnectionSettings.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(settings_); + settings_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -17934,7 +42325,10 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + pathHopsEndpointIds_ = java.util.Collections.unmodifiableList(pathHopsEndpointIds_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = java.util.Collections.unmodifiableList(subServiceIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -17942,81 +42336,173 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); } - public static final int LINK_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.LinkId linkId_; + public static final int CONNECTION_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.ConnectionId connectionId_; /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. */ @java.lang.Override - public boolean hasLinkId() { - return linkId_ != null; + public boolean hasConnectionId() { + return connectionId_ != null; } /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ConnectionId connection_id = 1; + * @return The connectionId. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkId() { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } /** - * .context.LinkId link_id = 1; + * .context.ConnectionId connection_id = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - return getLinkId(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + return getConnectionId(); } - public static final int LINK_ENDPOINT_IDS_FIELD_NUMBER = 2; - private java.util.List linkEndpointIds_; + public static final int SERVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ @java.lang.Override - public java.util.List getLinkEndpointIdsList() { - return linkEndpointIds_; + public boolean hasServiceId() { + return serviceId_ != null; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * .context.ServiceId service_id = 2; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int PATH_HOPS_ENDPOINT_IDS_FIELD_NUMBER = 3; + private java.util.List pathHopsEndpointIds_; + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; + */ + @java.lang.Override + public java.util.List getPathHopsEndpointIdsList() { + return pathHopsEndpointIds_; + } + /** + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override public java.util.List - getLinkEndpointIdsOrBuilderList() { - return linkEndpointIds_; + getPathHopsEndpointIdsOrBuilderList() { + return pathHopsEndpointIds_; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public int getLinkEndpointIdsCount() { - return linkEndpointIds_.size(); + public int getPathHopsEndpointIdsCount() { + return pathHopsEndpointIds_.size(); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { - return linkEndpointIds_.get(index); + public context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index) { + return pathHopsEndpointIds_.get(index); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + public context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( int index) { - return linkEndpointIds_.get(index); + return pathHopsEndpointIds_.get(index); + } + + public static final int SUB_SERVICE_IDS_FIELD_NUMBER = 4; + private java.util.List subServiceIds_; + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public java.util.List getSubServiceIdsList() { + return subServiceIds_; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public java.util.List + getSubServiceIdsOrBuilderList() { + return subServiceIds_; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public int getSubServiceIdsCount() { + return subServiceIds_.size(); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getSubServiceIds(int index) { + return subServiceIds_.get(index); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( + int index) { + return subServiceIds_.get(index); + } + + public static final int SETTINGS_FIELD_NUMBER = 5; + private context.ContextOuterClass.ConnectionSettings settings_; + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + @java.lang.Override + public boolean hasSettings() { + return settings_ != null; + } + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettings getSettings() { + return settings_ == null ? context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } + /** + * .context.ConnectionSettings settings = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder() { + return getSettings(); } private byte memoizedIsInitialized = -1; @@ -18033,11 +42519,20 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (linkId_ != null) { - output.writeMessage(1, getLinkId()); + if (connectionId_ != null) { + output.writeMessage(1, getConnectionId()); } - for (int i = 0; i < linkEndpointIds_.size(); i++) { - output.writeMessage(2, linkEndpointIds_.get(i)); + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); + } + for (int i = 0; i < pathHopsEndpointIds_.size(); i++) { + output.writeMessage(3, pathHopsEndpointIds_.get(i)); + } + for (int i = 0; i < subServiceIds_.size(); i++) { + output.writeMessage(4, subServiceIds_.get(i)); + } + if (settings_ != null) { + output.writeMessage(5, getSettings()); } unknownFields.writeTo(output); } @@ -18048,13 +42543,25 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (linkId_ != null) { + if (connectionId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getLinkId()); + .computeMessageSize(1, getConnectionId()); } - for (int i = 0; i < linkEndpointIds_.size(); i++) { + if (serviceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, linkEndpointIds_.get(i)); + .computeMessageSize(2, getServiceId()); + } + for (int i = 0; i < pathHopsEndpointIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, pathHopsEndpointIds_.get(i)); + } + for (int i = 0; i < subServiceIds_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, subServiceIds_.get(i)); + } + if (settings_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getSettings()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18066,18 +42573,30 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Link)) { + if (!(obj instanceof context.ContextOuterClass.Connection)) { return super.equals(obj); } - context.ContextOuterClass.Link other = (context.ContextOuterClass.Link) obj; + context.ContextOuterClass.Connection other = (context.ContextOuterClass.Connection) obj; - if (hasLinkId() != other.hasLinkId()) return false; - if (hasLinkId()) { - if (!getLinkId() - .equals(other.getLinkId())) return false; + if (hasConnectionId() != other.hasConnectionId()) return false; + if (hasConnectionId()) { + if (!getConnectionId() + .equals(other.getConnectionId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (!getPathHopsEndpointIdsList() + .equals(other.getPathHopsEndpointIdsList())) return false; + if (!getSubServiceIdsList() + .equals(other.getSubServiceIdsList())) return false; + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings() + .equals(other.getSettings())) return false; } - if (!getLinkEndpointIdsList() - .equals(other.getLinkEndpointIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18089,82 +42608,94 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasLinkId()) { - hash = (37 * hash) + LINK_ID_FIELD_NUMBER; - hash = (53 * hash) + getLinkId().hashCode(); + if (hasConnectionId()) { + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); } - if (getLinkEndpointIdsCount() > 0) { - hash = (37 * hash) + LINK_ENDPOINT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkEndpointIdsList().hashCode(); + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (getPathHopsEndpointIdsCount() > 0) { + hash = (37 * hash) + PATH_HOPS_ENDPOINT_IDS_FIELD_NUMBER; + hash = (53 * hash) + getPathHopsEndpointIdsList().hashCode(); + } + if (getSubServiceIdsCount() > 0) { + hash = (37 * hash) + SUB_SERVICE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getSubServiceIdsList().hashCode(); + } + if (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom(byte[] data) + public static context.ContextOuterClass.Connection parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Link parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Connection parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection 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 context.ContextOuterClass.Link parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Connection parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseDelimitedFrom( + public static context.ContextOuterClass.Connection 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 context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Link parseFrom( + public static context.ContextOuterClass.Connection parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -18177,7 +42708,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Link prototype) { + public static Builder newBuilder(context.ContextOuterClass.Connection prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -18193,26 +42724,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Link} + * Protobuf type {@code context.Connection} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Link) - context.ContextOuterClass.LinkOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Connection) + context.ContextOuterClass.ConnectionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Link_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Link.class, context.ContextOuterClass.Link.Builder.class); + context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); } - // Construct using context.ContextOuterClass.Link.newBuilder() + // Construct using context.ContextOuterClass.Connection.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -18225,23 +42756,42 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinkEndpointIdsFieldBuilder(); + getPathHopsEndpointIdsFieldBuilder(); + getSubServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linkIdBuilder_ == null) { - linkId_ = null; + if (connectionIdBuilder_ == null) { + connectionId_ = null; } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIds_ = java.util.Collections.emptyList(); + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linkEndpointIdsBuilder_.clear(); + pathHopsEndpointIdsBuilder_.clear(); + } + if (subServiceIdsBuilder_ == null) { + subServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + subServiceIdsBuilder_.clear(); + } + if (settingsBuilder_ == null) { + settings_ = null; + } else { + settings_ = null; + settingsBuilder_ = null; } return this; } @@ -18249,17 +42799,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Link_descriptor; + return context.ContextOuterClass.internal_static_context_Connection_descriptor; } @java.lang.Override - public context.ContextOuterClass.Link getDefaultInstanceForType() { - return context.ContextOuterClass.Link.getDefaultInstance(); + public context.ContextOuterClass.Connection getDefaultInstanceForType() { + return context.ContextOuterClass.Connection.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Link build() { - context.ContextOuterClass.Link result = buildPartial(); + public context.ContextOuterClass.Connection build() { + context.ContextOuterClass.Connection result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -18267,22 +42817,41 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Link buildPartial() { - context.ContextOuterClass.Link result = new context.ContextOuterClass.Link(this); + public context.ContextOuterClass.Connection buildPartial() { + context.ContextOuterClass.Connection result = new context.ContextOuterClass.Connection(this); int from_bitField0_ = bitField0_; - if (linkIdBuilder_ == null) { - result.linkId_ = linkId_; + if (connectionIdBuilder_ == null) { + result.connectionId_ = connectionId_; } else { - result.linkId_ = linkIdBuilder_.build(); + result.connectionId_ = connectionIdBuilder_.build(); } - if (linkEndpointIdsBuilder_ == null) { + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (pathHopsEndpointIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = java.util.Collections.unmodifiableList(linkEndpointIds_); + pathHopsEndpointIds_ = java.util.Collections.unmodifiableList(pathHopsEndpointIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.linkEndpointIds_ = linkEndpointIds_; + result.pathHopsEndpointIds_ = pathHopsEndpointIds_; } else { - result.linkEndpointIds_ = linkEndpointIdsBuilder_.build(); + result.pathHopsEndpointIds_ = pathHopsEndpointIdsBuilder_.build(); + } + if (subServiceIdsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = java.util.Collections.unmodifiableList(subServiceIds_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.subServiceIds_ = subServiceIds_; + } else { + result.subServiceIds_ = subServiceIdsBuilder_.build(); + } + if (settingsBuilder_ == null) { + result.settings_ = settings_; + } else { + result.settings_ = settingsBuilder_.build(); } onBuilt(); return result; @@ -18322,432 +42891,942 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Link) { - return mergeFrom((context.ContextOuterClass.Link)other); + if (other instanceof context.ContextOuterClass.Connection) { + return mergeFrom((context.ContextOuterClass.Connection)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Link other) { - if (other == context.ContextOuterClass.Link.getDefaultInstance()) return this; - if (other.hasLinkId()) { - mergeLinkId(other.getLinkId()); + public Builder mergeFrom(context.ContextOuterClass.Connection other) { + if (other == context.ContextOuterClass.Connection.getDefaultInstance()) return this; + if (other.hasConnectionId()) { + mergeConnectionId(other.getConnectionId()); } - if (linkEndpointIdsBuilder_ == null) { - if (!other.linkEndpointIds_.isEmpty()) { - if (linkEndpointIds_.isEmpty()) { - linkEndpointIds_ = other.linkEndpointIds_; + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (pathHopsEndpointIdsBuilder_ == null) { + if (!other.pathHopsEndpointIds_.isEmpty()) { + if (pathHopsEndpointIds_.isEmpty()) { + pathHopsEndpointIds_ = other.pathHopsEndpointIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.addAll(other.linkEndpointIds_); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.addAll(other.pathHopsEndpointIds_); } onChanged(); } } else { - if (!other.linkEndpointIds_.isEmpty()) { - if (linkEndpointIdsBuilder_.isEmpty()) { - linkEndpointIdsBuilder_.dispose(); - linkEndpointIdsBuilder_ = null; - linkEndpointIds_ = other.linkEndpointIds_; + if (!other.pathHopsEndpointIds_.isEmpty()) { + if (pathHopsEndpointIdsBuilder_.isEmpty()) { + pathHopsEndpointIdsBuilder_.dispose(); + pathHopsEndpointIdsBuilder_ = null; + pathHopsEndpointIds_ = other.pathHopsEndpointIds_; bitField0_ = (bitField0_ & ~0x00000001); - linkEndpointIdsBuilder_ = + pathHopsEndpointIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkEndpointIdsFieldBuilder() : null; + getPathHopsEndpointIdsFieldBuilder() : null; } else { - linkEndpointIdsBuilder_.addAllMessages(other.linkEndpointIds_); + pathHopsEndpointIdsBuilder_.addAllMessages(other.pathHopsEndpointIds_); + } + } + } + if (subServiceIdsBuilder_ == null) { + if (!other.subServiceIds_.isEmpty()) { + if (subServiceIds_.isEmpty()) { + subServiceIds_ = other.subServiceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSubServiceIdsIsMutable(); + subServiceIds_.addAll(other.subServiceIds_); + } + onChanged(); + } + } else { + if (!other.subServiceIds_.isEmpty()) { + if (subServiceIdsBuilder_.isEmpty()) { + subServiceIdsBuilder_.dispose(); + subServiceIdsBuilder_ = null; + subServiceIds_ = other.subServiceIds_; + bitField0_ = (bitField0_ & ~0x00000002); + subServiceIdsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSubServiceIdsFieldBuilder() : null; + } else { + subServiceIdsBuilder_.addAllMessages(other.subServiceIds_); } } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + 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 { + context.ContextOuterClass.Connection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Connection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private context.ContextOuterClass.ConnectionId connectionId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; + /** + * .context.ConnectionId connection_id = 1; + * @return Whether the connectionId field is set. + */ + public boolean hasConnectionId() { + return connectionIdBuilder_ != null || connectionId_ != null; + } + /** + * .context.ConnectionId connection_id = 1; + * @return The connectionId. + */ + public context.ContextOuterClass.ConnectionId getConnectionId() { + if (connectionIdBuilder_ == null) { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; + } else { + return connectionIdBuilder_.getMessage(); + } + } + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionId_ = value; + onChanged(); + } else { + connectionIdBuilder_.setMessage(value); + } + return this; } + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder setConnectionId( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdBuilder_ == null) { + connectionId_ = builderForValue.build(); + onChanged(); + } else { + connectionIdBuilder_.setMessage(builderForValue.build()); + } - @java.lang.Override - public final boolean isInitialized() { - return true; + return this; } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - context.ContextOuterClass.Link parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Link) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (connectionId_ != null) { + connectionId_ = + context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); + } else { + connectionId_ = value; } + onChanged(); + } else { + connectionIdBuilder_.mergeFrom(value); } + return this; } - private int bitField0_; + /** + * .context.ConnectionId connection_id = 1; + */ + public Builder clearConnectionId() { + if (connectionIdBuilder_ == null) { + connectionId_ = null; + onChanged(); + } else { + connectionId_ = null; + connectionIdBuilder_ = null; + } - private context.ContextOuterClass.LinkId linkId_; + return this; + } + /** + * .context.ConnectionId connection_id = 1; + */ + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { + + onChanged(); + return getConnectionIdFieldBuilder().getBuilder(); + } + /** + * .context.ConnectionId connection_id = 1; + */ + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + if (connectionIdBuilder_ != null) { + return connectionIdBuilder_.getMessageOrBuilder(); + } else { + return connectionId_ == null ? + context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; + } + } + /** + * .context.ConnectionId connection_id = 1; + */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdFieldBuilder() { + if (connectionIdBuilder_ == null) { + connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + getConnectionId(), + getParentForChildren(), + isClean()); + connectionId_ = null; + } + return connectionIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; /** - * .context.LinkId link_id = 1; - * @return Whether the linkId field is set. + * .context.ServiceId service_id = 2; + * @return Whether the serviceId field is set. */ - public boolean hasLinkId() { - return linkIdBuilder_ != null || linkId_ != null; + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; } /** - * .context.LinkId link_id = 1; - * @return The linkId. + * .context.ServiceId service_id = 2; + * @return The serviceId. */ - public context.ContextOuterClass.LinkId getLinkId() { - if (linkIdBuilder_ == null) { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } else { - return linkIdBuilder_.getMessage(); + return serviceIdBuilder_.getMessage(); } } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder setLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - linkId_ = value; + serviceId_ = value; onChanged(); } else { - linkIdBuilder_.setMessage(value); + serviceIdBuilder_.setMessage(value); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder setLinkId( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdBuilder_ == null) { - linkId_ = builderForValue.build(); + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); onChanged(); } else { - linkIdBuilder_.setMessage(builderForValue.build()); + serviceIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { - if (linkId_ != null) { - linkId_ = - context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); } else { - linkId_ = value; + serviceId_ = value; } onChanged(); } else { - linkIdBuilder_.mergeFrom(value); + serviceIdBuilder_.mergeFrom(value); } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public Builder clearLinkId() { - if (linkIdBuilder_ == null) { - linkId_ = null; + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; onChanged(); } else { - linkId_ = null; - linkIdBuilder_ = null; + serviceId_ = null; + serviceIdBuilder_ = null; } return this; } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { onChanged(); - return getLinkIdFieldBuilder().getBuilder(); + return getServiceIdFieldBuilder().getBuilder(); } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - if (linkIdBuilder_ != null) { - return linkIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); } else { - return linkId_ == null ? - context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; } } /** - * .context.LinkId link_id = 1; + * .context.ServiceId service_id = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdFieldBuilder() { - if (linkIdBuilder_ == null) { - linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - getLinkId(), + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), getParentForChildren(), isClean()); - linkId_ = null; + serviceId_ = null; } - return linkIdBuilder_; + return serviceIdBuilder_; } - private java.util.List linkEndpointIds_ = + private java.util.List pathHopsEndpointIds_ = java.util.Collections.emptyList(); - private void ensureLinkEndpointIdsIsMutable() { + private void ensurePathHopsEndpointIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - linkEndpointIds_ = new java.util.ArrayList(linkEndpointIds_); + pathHopsEndpointIds_ = new java.util.ArrayList(pathHopsEndpointIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> linkEndpointIdsBuilder_; + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> pathHopsEndpointIdsBuilder_; /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public java.util.List getLinkEndpointIdsList() { - if (linkEndpointIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkEndpointIds_); + public java.util.List getPathHopsEndpointIdsList() { + if (pathHopsEndpointIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pathHopsEndpointIds_); } else { - return linkEndpointIdsBuilder_.getMessageList(); + return pathHopsEndpointIdsBuilder_.getMessageList(); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public int getLinkEndpointIdsCount() { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.size(); + public int getPathHopsEndpointIdsCount() { + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.size(); } else { - return linkEndpointIdsBuilder_.getCount(); + return pathHopsEndpointIdsBuilder_.getCount(); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId getLinkEndpointIds(int index) { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.get(index); + public context.ContextOuterClass.EndPointId getPathHopsEndpointIds(int index) { + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.get(index); } else { - return linkEndpointIdsBuilder_.getMessage(index); + return pathHopsEndpointIdsBuilder_.getMessage(index); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder setLinkEndpointIds( + public Builder setPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.set(index, value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.set(index, value); onChanged(); } else { - linkEndpointIdsBuilder_.setMessage(index, value); + pathHopsEndpointIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder setLinkEndpointIds( + public Builder setPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.set(index, builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.set(index, builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.setMessage(index, builderForValue.build()); + pathHopsEndpointIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds(context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + public Builder addPathHopsEndpointIds(context.ContextOuterClass.EndPointId value) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(value); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(value); + pathHopsEndpointIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId value) { - if (linkEndpointIdsBuilder_ == null) { + if (pathHopsEndpointIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(index, value); + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(index, value); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(index, value); + pathHopsEndpointIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(builderForValue.build()); + pathHopsEndpointIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addLinkEndpointIds( + public Builder addPathHopsEndpointIds( int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.add(index, builderForValue.build()); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.add(index, builderForValue.build()); onChanged(); } else { - linkEndpointIdsBuilder_.addMessage(index, builderForValue.build()); + pathHopsEndpointIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder addAllLinkEndpointIds( + public Builder addAllPathHopsEndpointIds( java.lang.Iterable values) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkEndpointIds_); + values, pathHopsEndpointIds_); onChanged(); } else { - linkEndpointIdsBuilder_.addAllMessages(values); + pathHopsEndpointIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder clearLinkEndpointIds() { - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIds_ = java.util.Collections.emptyList(); + public Builder clearPathHopsEndpointIds() { + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linkEndpointIdsBuilder_.clear(); + pathHopsEndpointIdsBuilder_.clear(); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public Builder removeLinkEndpointIds(int index) { - if (linkEndpointIdsBuilder_ == null) { - ensureLinkEndpointIdsIsMutable(); - linkEndpointIds_.remove(index); + public Builder removePathHopsEndpointIds(int index) { + if (pathHopsEndpointIdsBuilder_ == null) { + ensurePathHopsEndpointIdsIsMutable(); + pathHopsEndpointIds_.remove(index); onChanged(); } else { - linkEndpointIdsBuilder_.remove(index); + pathHopsEndpointIdsBuilder_.remove(index); } return this; } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder getLinkEndpointIdsBuilder( + public context.ContextOuterClass.EndPointId.Builder getPathHopsEndpointIdsBuilder( int index) { - return getLinkEndpointIdsFieldBuilder().getBuilder(index); + return getPathHopsEndpointIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointIdOrBuilder getLinkEndpointIdsOrBuilder( + public context.ContextOuterClass.EndPointIdOrBuilder getPathHopsEndpointIdsOrBuilder( int index) { - if (linkEndpointIdsBuilder_ == null) { - return linkEndpointIds_.get(index); } else { - return linkEndpointIdsBuilder_.getMessageOrBuilder(index); + if (pathHopsEndpointIdsBuilder_ == null) { + return pathHopsEndpointIds_.get(index); } else { + return pathHopsEndpointIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ public java.util.List - getLinkEndpointIdsOrBuilderList() { - if (linkEndpointIdsBuilder_ != null) { - return linkEndpointIdsBuilder_.getMessageOrBuilderList(); + getPathHopsEndpointIdsOrBuilderList() { + if (pathHopsEndpointIdsBuilder_ != null) { + return pathHopsEndpointIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(linkEndpointIds_); + return java.util.Collections.unmodifiableList(pathHopsEndpointIds_); } } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder() { - return getLinkEndpointIdsFieldBuilder().addBuilder( + public context.ContextOuterClass.EndPointId.Builder addPathHopsEndpointIdsBuilder() { + return getPathHopsEndpointIdsFieldBuilder().addBuilder( context.ContextOuterClass.EndPointId.getDefaultInstance()); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ - public context.ContextOuterClass.EndPointId.Builder addLinkEndpointIdsBuilder( + public context.ContextOuterClass.EndPointId.Builder addPathHopsEndpointIdsBuilder( int index) { - return getLinkEndpointIdsFieldBuilder().addBuilder( + return getPathHopsEndpointIdsFieldBuilder().addBuilder( index, context.ContextOuterClass.EndPointId.getDefaultInstance()); } /** - * repeated .context.EndPointId link_endpoint_ids = 2; + * repeated .context.EndPointId path_hops_endpoint_ids = 3; */ public java.util.List - getLinkEndpointIdsBuilderList() { - return getLinkEndpointIdsFieldBuilder().getBuilderList(); + getPathHopsEndpointIdsBuilderList() { + return getPathHopsEndpointIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getLinkEndpointIdsFieldBuilder() { - if (linkEndpointIdsBuilder_ == null) { - linkEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getPathHopsEndpointIdsFieldBuilder() { + if (pathHopsEndpointIdsBuilder_ == null) { + pathHopsEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - linkEndpointIds_, + pathHopsEndpointIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - linkEndpointIds_ = null; + pathHopsEndpointIds_ = null; + } + return pathHopsEndpointIdsBuilder_; + } + + private java.util.List subServiceIds_ = + java.util.Collections.emptyList(); + private void ensureSubServiceIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + subServiceIds_ = new java.util.ArrayList(subServiceIds_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> subServiceIdsBuilder_; + + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List getSubServiceIdsList() { + if (subServiceIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(subServiceIds_); + } else { + return subServiceIdsBuilder_.getMessageList(); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public int getSubServiceIdsCount() { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.size(); + } else { + return subServiceIdsBuilder_.getCount(); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId getSubServiceIds(int index) { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.get(index); + } else { + return subServiceIdsBuilder_.getMessage(index); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder setSubServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.set(index, value); + onChanged(); + } else { + subServiceIdsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder setSubServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.set(index, builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds(context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(value); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + int index, context.ContextOuterClass.ServiceId value) { + if (subServiceIdsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(index, value); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addSubServiceIds( + int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.add(index, builderForValue.build()); + onChanged(); + } else { + subServiceIdsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder addAllSubServiceIds( + java.lang.Iterable values) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subServiceIds_); + onChanged(); + } else { + subServiceIdsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder clearSubServiceIds() { + if (subServiceIdsBuilder_ == null) { + subServiceIds_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + subServiceIdsBuilder_.clear(); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public Builder removeSubServiceIds(int index) { + if (subServiceIdsBuilder_ == null) { + ensureSubServiceIdsIsMutable(); + subServiceIds_.remove(index); + onChanged(); + } else { + subServiceIdsBuilder_.remove(index); + } + return this; + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder getSubServiceIdsBuilder( + int index) { + return getSubServiceIdsFieldBuilder().getBuilder(index); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getSubServiceIdsOrBuilder( + int index) { + if (subServiceIdsBuilder_ == null) { + return subServiceIds_.get(index); } else { + return subServiceIdsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List + getSubServiceIdsOrBuilderList() { + if (subServiceIdsBuilder_ != null) { + return subServiceIdsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subServiceIds_); + } + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSubServiceIdsBuilder() { + return getSubServiceIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public context.ContextOuterClass.ServiceId.Builder addSubServiceIdsBuilder( + int index) { + return getSubServiceIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + } + /** + * repeated .context.ServiceId sub_service_ids = 4; + */ + public java.util.List + getSubServiceIdsBuilderList() { + return getSubServiceIdsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getSubServiceIdsFieldBuilder() { + if (subServiceIdsBuilder_ == null) { + subServiceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + subServiceIds_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + subServiceIds_ = null; + } + return subServiceIdsBuilder_; + } + + private context.ContextOuterClass.ConnectionSettings settings_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder> settingsBuilder_; + /** + * .context.ConnectionSettings settings = 5; + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return settingsBuilder_ != null || settings_ != null; + } + /** + * .context.ConnectionSettings settings = 5; + * @return The settings. + */ + public context.ContextOuterClass.ConnectionSettings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null ? context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder setSettings(context.ContextOuterClass.ConnectionSettings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + onChanged(); + } else { + settingsBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder setSettings( + context.ContextOuterClass.ConnectionSettings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + onChanged(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder mergeSettings(context.ContextOuterClass.ConnectionSettings value) { + if (settingsBuilder_ == null) { + if (settings_ != null) { + settings_ = + context.ContextOuterClass.ConnectionSettings.newBuilder(settings_).mergeFrom(value).buildPartial(); + } else { + settings_ = value; + } + onChanged(); + } else { + settingsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public Builder clearSettings() { + if (settingsBuilder_ == null) { + settings_ = null; + onChanged(); + } else { + settings_ = null; + settingsBuilder_ = null; + } + + return this; + } + /** + * .context.ConnectionSettings settings = 5; + */ + public context.ContextOuterClass.ConnectionSettings.Builder getSettingsBuilder() { + + onChanged(); + return getSettingsFieldBuilder().getBuilder(); + } + /** + * .context.ConnectionSettings settings = 5; + */ + public context.ContextOuterClass.ConnectionSettingsOrBuilder getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null ? + context.ContextOuterClass.ConnectionSettings.getDefaultInstance() : settings_; + } + } + /** + * .context.ConnectionSettings settings = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder> + getSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionSettings, context.ContextOuterClass.ConnectionSettings.Builder, context.ContextOuterClass.ConnectionSettingsOrBuilder>( + getSettings(), + getParentForChildren(), + isClean()); + settings_ = null; } - return linkEndpointIdsBuilder_; + return settingsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -18762,95 +43841,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Link) + // @@protoc_insertion_point(builder_scope:context.Connection) } - // @@protoc_insertion_point(class_scope:context.Link) - private static final context.ContextOuterClass.Link DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Connection) + private static final context.ContextOuterClass.Connection DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Link(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Connection(); } - public static context.ContextOuterClass.Link getDefaultInstance() { + public static context.ContextOuterClass.Connection getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Link parsePartialFrom( + public Connection parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Link(input, extensionRegistry); + return new Connection(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Link getDefaultInstanceForType() { + public context.ContextOuterClass.Connection getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkIdList) + public interface ConnectionIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionIdList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - java.util.List - getLinkIdsList(); + java.util.List + getConnectionIdsList(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - context.ContextOuterClass.LinkId getLinkIds(int index); + context.ContextOuterClass.ConnectionId getConnectionIds(int index); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - int getLinkIdsCount(); + int getConnectionIdsCount(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - java.util.List - getLinkIdsOrBuilderList(); + java.util.List + getConnectionIdsOrBuilderList(); /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index); } /** - * Protobuf type {@code context.LinkIdList} + * Protobuf type {@code context.ConnectionIdList} */ - public static final class LinkIdList extends + public static final class ConnectionIdList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkIdList) - LinkIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionIdList) + ConnectionIdListOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkIdList.newBuilder() to construct. - private LinkIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionIdList.newBuilder() to construct. + private ConnectionIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkIdList() { - linkIds_ = java.util.Collections.emptyList(); + private ConnectionIdList() { + connectionIds_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkIdList(); + return new ConnectionIdList(); } @java.lang.Override @@ -18858,7 +43937,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkIdList( + private ConnectionIdList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -18879,11 +43958,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - linkIds_ = new java.util.ArrayList(); + connectionIds_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - linkIds_.add( - input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry)); + connectionIds_.add( + input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry)); break; } default: { @@ -18902,7 +43981,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -18910,55 +43989,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); } - public static final int LINK_IDS_FIELD_NUMBER = 1; - private java.util.List linkIds_; + public static final int CONNECTION_IDS_FIELD_NUMBER = 1; + private java.util.List connectionIds_; /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public java.util.List getLinkIdsList() { - return linkIds_; + public java.util.List getConnectionIdsList() { + return connectionIds_; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public java.util.List - getLinkIdsOrBuilderList() { - return linkIds_; + public java.util.List + getConnectionIdsOrBuilderList() { + return connectionIds_; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public int getLinkIdsCount() { - return linkIds_.size(); + public int getConnectionIdsCount() { + return connectionIds_.size(); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkIds(int index) { - return linkIds_.get(index); + public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { + return connectionIds_.get(index); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index) { - return linkIds_.get(index); + return connectionIds_.get(index); } private byte memoizedIsInitialized = -1; @@ -18975,8 +44054,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < linkIds_.size(); i++) { - output.writeMessage(1, linkIds_.get(i)); + for (int i = 0; i < connectionIds_.size(); i++) { + output.writeMessage(1, connectionIds_.get(i)); } unknownFields.writeTo(output); } @@ -18987,9 +44066,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < linkIds_.size(); i++) { + for (int i = 0; i < connectionIds_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, linkIds_.get(i)); + .computeMessageSize(1, connectionIds_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -19001,13 +44080,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkIdList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionIdList)) { return super.equals(obj); } - context.ContextOuterClass.LinkIdList other = (context.ContextOuterClass.LinkIdList) obj; + context.ContextOuterClass.ConnectionIdList other = (context.ContextOuterClass.ConnectionIdList) obj; - if (!getLinkIdsList() - .equals(other.getLinkIdsList())) return false; + if (!getConnectionIdsList() + .equals(other.getConnectionIdsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -19019,78 +44098,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getLinkIdsCount() > 0) { - hash = (37 * hash) + LINK_IDS_FIELD_NUMBER; - hash = (53 * hash) + getLinkIdsList().hashCode(); + if (getConnectionIdsCount() > 0) { + hash = (37 * hash) + CONNECTION_IDS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionIdList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionIdList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList 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 context.ContextOuterClass.LinkIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionIdList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionIdList 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 context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkIdList parseFrom( + public static context.ContextOuterClass.ConnectionIdList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -19103,7 +44182,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionIdList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -19119,26 +44198,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkIdList} + * Protobuf type {@code context.ConnectionIdList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkIdList) - context.ContextOuterClass.LinkIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionIdList) + context.ContextOuterClass.ConnectionIdListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkIdList.class, context.ContextOuterClass.LinkIdList.Builder.class); + context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); } - // Construct using context.ContextOuterClass.LinkIdList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionIdList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -19151,17 +44230,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinkIdsFieldBuilder(); + getConnectionIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); + if (connectionIdsBuilder_ == null) { + connectionIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linkIdsBuilder_.clear(); + connectionIdsBuilder_.clear(); } return this; } @@ -19169,17 +44248,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkIdList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { - return context.ContextOuterClass.LinkIdList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionIdList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkIdList build() { - context.ContextOuterClass.LinkIdList result = buildPartial(); + public context.ContextOuterClass.ConnectionIdList build() { + context.ContextOuterClass.ConnectionIdList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -19187,17 +44266,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkIdList buildPartial() { - context.ContextOuterClass.LinkIdList result = new context.ContextOuterClass.LinkIdList(this); + public context.ContextOuterClass.ConnectionIdList buildPartial() { + context.ContextOuterClass.ConnectionIdList result = new context.ContextOuterClass.ConnectionIdList(this); int from_bitField0_ = bitField0_; - if (linkIdsBuilder_ == null) { + if (connectionIdsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - linkIds_ = java.util.Collections.unmodifiableList(linkIds_); + connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); bitField0_ = (bitField0_ & ~0x00000001); } - result.linkIds_ = linkIds_; + result.connectionIds_ = connectionIds_; } else { - result.linkIds_ = linkIdsBuilder_.build(); + result.connectionIds_ = connectionIdsBuilder_.build(); } onBuilt(); return result; @@ -19237,39 +44316,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkIdList) { - return mergeFrom((context.ContextOuterClass.LinkIdList)other); + if (other instanceof context.ContextOuterClass.ConnectionIdList) { + return mergeFrom((context.ContextOuterClass.ConnectionIdList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkIdList other) { - if (other == context.ContextOuterClass.LinkIdList.getDefaultInstance()) return this; - if (linkIdsBuilder_ == null) { - if (!other.linkIds_.isEmpty()) { - if (linkIds_.isEmpty()) { - linkIds_ = other.linkIds_; + public Builder mergeFrom(context.ContextOuterClass.ConnectionIdList other) { + if (other == context.ContextOuterClass.ConnectionIdList.getDefaultInstance()) return this; + if (connectionIdsBuilder_ == null) { + if (!other.connectionIds_.isEmpty()) { + if (connectionIds_.isEmpty()) { + connectionIds_ = other.connectionIds_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinkIdsIsMutable(); - linkIds_.addAll(other.linkIds_); + ensureConnectionIdsIsMutable(); + connectionIds_.addAll(other.connectionIds_); } onChanged(); } } else { - if (!other.linkIds_.isEmpty()) { - if (linkIdsBuilder_.isEmpty()) { - linkIdsBuilder_.dispose(); - linkIdsBuilder_ = null; - linkIds_ = other.linkIds_; + if (!other.connectionIds_.isEmpty()) { + if (connectionIdsBuilder_.isEmpty()) { + connectionIdsBuilder_.dispose(); + connectionIdsBuilder_ = null; + connectionIds_ = other.connectionIds_; bitField0_ = (bitField0_ & ~0x00000001); - linkIdsBuilder_ = + connectionIdsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinkIdsFieldBuilder() : null; + getConnectionIdsFieldBuilder() : null; } else { - linkIdsBuilder_.addAllMessages(other.linkIds_); + connectionIdsBuilder_.addAllMessages(other.connectionIds_); } } } @@ -19288,11 +44367,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkIdList parsedMessage = null; + context.ContextOuterClass.ConnectionIdList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionIdList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -19303,244 +44382,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List linkIds_ = + private java.util.List connectionIds_ = java.util.Collections.emptyList(); - private void ensureLinkIdsIsMutable() { + private void ensureConnectionIdsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - linkIds_ = new java.util.ArrayList(linkIds_); + connectionIds_ = new java.util.ArrayList(connectionIds_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdsBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdsBuilder_; /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List getLinkIdsList() { - if (linkIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(linkIds_); + public java.util.List getConnectionIdsList() { + if (connectionIdsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connectionIds_); } else { - return linkIdsBuilder_.getMessageList(); + return connectionIdsBuilder_.getMessageList(); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public int getLinkIdsCount() { - if (linkIdsBuilder_ == null) { - return linkIds_.size(); + public int getConnectionIdsCount() { + if (connectionIdsBuilder_ == null) { + return connectionIds_.size(); } else { - return linkIdsBuilder_.getCount(); + return connectionIdsBuilder_.getCount(); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId getLinkIds(int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); + public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { + if (connectionIdsBuilder_ == null) { + return connectionIds_.get(index); } else { - return linkIdsBuilder_.getMessage(index); + return connectionIdsBuilder_.getMessage(index); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder setConnectionIds( + int index, context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.set(index, value); + ensureConnectionIdsIsMutable(); + connectionIds_.set(index, value); onChanged(); } else { - linkIdsBuilder_.setMessage(index, value); + connectionIdsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder setLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.set(index, builderForValue.build()); + public Builder setConnectionIds( + int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.set(index, builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.setMessage(index, builderForValue.build()); + connectionIdsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds(context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder addConnectionIds(context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.add(value); + ensureConnectionIdsIsMutable(); + connectionIds_.add(value); onChanged(); } else { - linkIdsBuilder_.addMessage(value); + connectionIdsBuilder_.addMessage(value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId value) { - if (linkIdsBuilder_ == null) { + public Builder addConnectionIds( + int index, context.ContextOuterClass.ConnectionId value) { + if (connectionIdsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinkIdsIsMutable(); - linkIds_.add(index, value); + ensureConnectionIdsIsMutable(); + connectionIds_.add(index, value); onChanged(); } else { - linkIdsBuilder_.addMessage(index, value); + connectionIdsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(builderForValue.build()); + public Builder addConnectionIds( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.add(builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.addMessage(builderForValue.build()); + connectionIdsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addLinkIds( - int index, context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.add(index, builderForValue.build()); + public Builder addConnectionIds( + int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.add(index, builderForValue.build()); onChanged(); } else { - linkIdsBuilder_.addMessage(index, builderForValue.build()); + connectionIdsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder addAllLinkIds( - java.lang.Iterable values) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); + public Builder addAllConnectionIds( + java.lang.Iterable values) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, linkIds_); + values, connectionIds_); onChanged(); } else { - linkIdsBuilder_.addAllMessages(values); + connectionIdsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder clearLinkIds() { - if (linkIdsBuilder_ == null) { - linkIds_ = java.util.Collections.emptyList(); + public Builder clearConnectionIds() { + if (connectionIdsBuilder_ == null) { + connectionIds_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linkIdsBuilder_.clear(); + connectionIdsBuilder_.clear(); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public Builder removeLinkIds(int index) { - if (linkIdsBuilder_ == null) { - ensureLinkIdsIsMutable(); - linkIds_.remove(index); + public Builder removeConnectionIds(int index) { + if (connectionIdsBuilder_ == null) { + ensureConnectionIdsIsMutable(); + connectionIds_.remove(index); onChanged(); } else { - linkIdsBuilder_.remove(index); + connectionIdsBuilder_.remove(index); } return this; } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdsBuilder( + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdsBuilder( int index) { - return getLinkIdsFieldBuilder().getBuilder(index); + return getConnectionIdsFieldBuilder().getBuilder(index); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdsOrBuilder( + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( int index) { - if (linkIdsBuilder_ == null) { - return linkIds_.get(index); } else { - return linkIdsBuilder_.getMessageOrBuilder(index); + if (connectionIdsBuilder_ == null) { + return connectionIds_.get(index); } else { + return connectionIdsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List - getLinkIdsOrBuilderList() { - if (linkIdsBuilder_ != null) { - return linkIdsBuilder_.getMessageOrBuilderList(); + public java.util.List + getConnectionIdsOrBuilderList() { + if (connectionIdsBuilder_ != null) { + return connectionIdsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(linkIds_); + return java.util.Collections.unmodifiableList(connectionIds_); } } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder() { - return getLinkIdsFieldBuilder().addBuilder( - context.ContextOuterClass.LinkId.getDefaultInstance()); + public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder() { + return getConnectionIdsFieldBuilder().addBuilder( + context.ContextOuterClass.ConnectionId.getDefaultInstance()); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public context.ContextOuterClass.LinkId.Builder addLinkIdsBuilder( + public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder( int index) { - return getLinkIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.LinkId.getDefaultInstance()); + return getConnectionIdsFieldBuilder().addBuilder( + index, context.ContextOuterClass.ConnectionId.getDefaultInstance()); } /** - * repeated .context.LinkId link_ids = 1; + * repeated .context.ConnectionId connection_ids = 1; */ - public java.util.List - getLinkIdsBuilderList() { - return getLinkIdsFieldBuilder().getBuilderList(); + public java.util.List + getConnectionIdsBuilderList() { + return getConnectionIdsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdsFieldBuilder() { - if (linkIdsBuilder_ == null) { - linkIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - linkIds_, + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdsFieldBuilder() { + if (connectionIdsBuilder_ == null) { + connectionIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + connectionIds_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - linkIds_ = null; + connectionIds_ = null; } - return linkIdsBuilder_; + return connectionIdsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -19555,95 +44634,95 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkIdList) + // @@protoc_insertion_point(builder_scope:context.ConnectionIdList) } - // @@protoc_insertion_point(class_scope:context.LinkIdList) - private static final context.ContextOuterClass.LinkIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionIdList) + private static final context.ContextOuterClass.ConnectionIdList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionIdList(); } - public static context.ContextOuterClass.LinkIdList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionIdList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkIdList parsePartialFrom( + public ConnectionIdList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkIdList(input, extensionRegistry); + return new ConnectionIdList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkIdList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkList) + public interface ConnectionListOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionList) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - java.util.List - getLinksList(); + java.util.List + getConnectionsList(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - context.ContextOuterClass.Link getLinks(int index); + context.ContextOuterClass.Connection getConnections(int index); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - int getLinksCount(); + int getConnectionsCount(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - java.util.List - getLinksOrBuilderList(); + java.util.List + getConnectionsOrBuilderList(); /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index); } /** - * Protobuf type {@code context.LinkList} + * Protobuf type {@code context.ConnectionList} */ - public static final class LinkList extends + public static final class ConnectionList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkList) - LinkListOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionList) + ConnectionListOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkList.newBuilder() to construct. - private LinkList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionList.newBuilder() to construct. + private ConnectionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkList() { - links_ = java.util.Collections.emptyList(); + private ConnectionList() { + connections_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkList(); + return new ConnectionList(); } @java.lang.Override @@ -19651,7 +44730,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkList( + private ConnectionList( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -19672,11 +44751,11 @@ public final class ContextOuterClass { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - links_ = new java.util.ArrayList(); + connections_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - links_.add( - input.readMessage(context.ContextOuterClass.Link.parser(), extensionRegistry)); + connections_.add( + input.readMessage(context.ContextOuterClass.Connection.parser(), extensionRegistry)); break; } default: { @@ -19695,7 +44774,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - links_ = java.util.Collections.unmodifiableList(links_); + connections_ = java.util.Collections.unmodifiableList(connections_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -19703,55 +44782,55 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); } - public static final int LINKS_FIELD_NUMBER = 1; - private java.util.List links_; + public static final int CONNECTIONS_FIELD_NUMBER = 1; + private java.util.List connections_; /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public java.util.List getLinksList() { - return links_; + public java.util.List getConnectionsList() { + return connections_; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public java.util.List - getLinksOrBuilderList() { - return links_; + public java.util.List + getConnectionsOrBuilderList() { + return connections_; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public int getLinksCount() { - return links_.size(); + public int getConnectionsCount() { + return connections_.size(); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public context.ContextOuterClass.Link getLinks(int index) { - return links_.get(index); + public context.ContextOuterClass.Connection getConnections(int index) { + return connections_.get(index); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ @java.lang.Override - public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index) { - return links_.get(index); + return connections_.get(index); } private byte memoizedIsInitialized = -1; @@ -19768,8 +44847,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < links_.size(); i++) { - output.writeMessage(1, links_.get(i)); + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(1, connections_.get(i)); } unknownFields.writeTo(output); } @@ -19780,9 +44859,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < links_.size(); i++) { + for (int i = 0; i < connections_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, links_.get(i)); + .computeMessageSize(1, connections_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -19794,13 +44873,13 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkList)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionList)) { return super.equals(obj); } - context.ContextOuterClass.LinkList other = (context.ContextOuterClass.LinkList) obj; + context.ContextOuterClass.ConnectionList other = (context.ContextOuterClass.ConnectionList) obj; - if (!getLinksList() - .equals(other.getLinksList())) return false; + if (!getConnectionsList() + .equals(other.getConnectionsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -19812,78 +44891,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getLinksCount() > 0) { - hash = (37 * hash) + LINKS_FIELD_NUMBER; - hash = (53 * hash) + getLinksList().hashCode(); + if (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList 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 context.ContextOuterClass.LinkList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionList 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 context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkList parseFrom( + public static context.ContextOuterClass.ConnectionList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -19896,7 +44975,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkList prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -19912,26 +44991,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkList} + * Protobuf type {@code context.ConnectionList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkList) - context.ContextOuterClass.LinkListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionList) + context.ContextOuterClass.ConnectionListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkList.class, context.ContextOuterClass.LinkList.Builder.class); + context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); } - // Construct using context.ContextOuterClass.LinkList.newBuilder() + // Construct using context.ContextOuterClass.ConnectionList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -19944,17 +45023,17 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getLinksFieldBuilder(); + getConnectionsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (linksBuilder_ == null) { - links_ = java.util.Collections.emptyList(); + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - linksBuilder_.clear(); + connectionsBuilder_.clear(); } return this; } @@ -19962,17 +45041,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkList_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkList getDefaultInstanceForType() { - return context.ContextOuterClass.LinkList.getDefaultInstance(); + public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionList.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkList build() { - context.ContextOuterClass.LinkList result = buildPartial(); + public context.ContextOuterClass.ConnectionList build() { + context.ContextOuterClass.ConnectionList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -19980,17 +45059,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkList buildPartial() { - context.ContextOuterClass.LinkList result = new context.ContextOuterClass.LinkList(this); + public context.ContextOuterClass.ConnectionList buildPartial() { + context.ContextOuterClass.ConnectionList result = new context.ContextOuterClass.ConnectionList(this); int from_bitField0_ = bitField0_; - if (linksBuilder_ == null) { + if (connectionsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - links_ = java.util.Collections.unmodifiableList(links_); + connections_ = java.util.Collections.unmodifiableList(connections_); bitField0_ = (bitField0_ & ~0x00000001); } - result.links_ = links_; + result.connections_ = connections_; } else { - result.links_ = linksBuilder_.build(); + result.connections_ = connectionsBuilder_.build(); } onBuilt(); return result; @@ -20030,39 +45109,39 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkList) { - return mergeFrom((context.ContextOuterClass.LinkList)other); + if (other instanceof context.ContextOuterClass.ConnectionList) { + return mergeFrom((context.ContextOuterClass.ConnectionList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkList other) { - if (other == context.ContextOuterClass.LinkList.getDefaultInstance()) return this; - if (linksBuilder_ == null) { - if (!other.links_.isEmpty()) { - if (links_.isEmpty()) { - links_ = other.links_; + public Builder mergeFrom(context.ContextOuterClass.ConnectionList other) { + if (other == context.ContextOuterClass.ConnectionList.getDefaultInstance()) return this; + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensureLinksIsMutable(); - links_.addAll(other.links_); + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); } onChanged(); } } else { - if (!other.links_.isEmpty()) { - if (linksBuilder_.isEmpty()) { - linksBuilder_.dispose(); - linksBuilder_ = null; - links_ = other.links_; + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; bitField0_ = (bitField0_ & ~0x00000001); - linksBuilder_ = + connectionsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getLinksFieldBuilder() : null; + getConnectionsFieldBuilder() : null; } else { - linksBuilder_.addAllMessages(other.links_); + connectionsBuilder_.addAllMessages(other.connections_); } } } @@ -20081,11 +45160,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkList parsedMessage = null; + context.ContextOuterClass.ConnectionList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -20096,244 +45175,244 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List links_ = + private java.util.List connections_ = java.util.Collections.emptyList(); - private void ensureLinksIsMutable() { + private void ensureConnectionsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - links_ = new java.util.ArrayList(links_); + connections_ = new java.util.ArrayList(connections_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> linksBuilder_; + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> connectionsBuilder_; /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List getLinksList() { - if (linksBuilder_ == null) { - return java.util.Collections.unmodifiableList(links_); + public java.util.List getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); } else { - return linksBuilder_.getMessageList(); + return connectionsBuilder_.getMessageList(); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public int getLinksCount() { - if (linksBuilder_ == null) { - return links_.size(); + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); } else { - return linksBuilder_.getCount(); + return connectionsBuilder_.getCount(); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link getLinks(int index) { - if (linksBuilder_ == null) { - return links_.get(index); + public context.ContextOuterClass.Connection getConnections(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); } else { - return linksBuilder_.getMessage(index); + return connectionsBuilder_.getMessage(index); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder setLinks( - int index, context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder setConnections( + int index, context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.set(index, value); + ensureConnectionsIsMutable(); + connections_.set(index, value); onChanged(); } else { - linksBuilder_.setMessage(index, value); + connectionsBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder setLinks( - int index, context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.set(index, builderForValue.build()); + public Builder setConnections( + int index, context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); onChanged(); } else { - linksBuilder_.setMessage(index, builderForValue.build()); + connectionsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks(context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder addConnections(context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.add(value); + ensureConnectionsIsMutable(); + connections_.add(value); onChanged(); } else { - linksBuilder_.addMessage(value); + connectionsBuilder_.addMessage(value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - int index, context.ContextOuterClass.Link value) { - if (linksBuilder_ == null) { + public Builder addConnections( + int index, context.ContextOuterClass.Connection value) { + if (connectionsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureLinksIsMutable(); - links_.add(index, value); + ensureConnectionsIsMutable(); + connections_.add(index, value); onChanged(); } else { - linksBuilder_.addMessage(index, value); + connectionsBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.add(builderForValue.build()); + public Builder addConnections( + context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); onChanged(); } else { - linksBuilder_.addMessage(builderForValue.build()); + connectionsBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addLinks( - int index, context.ContextOuterClass.Link.Builder builderForValue) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.add(index, builderForValue.build()); + public Builder addConnections( + int index, context.ContextOuterClass.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); onChanged(); } else { - linksBuilder_.addMessage(index, builderForValue.build()); + connectionsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder addAllLinks( - java.lang.Iterable values) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); + public Builder addAllConnections( + java.lang.Iterable values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, links_); + values, connections_); onChanged(); } else { - linksBuilder_.addAllMessages(values); + connectionsBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder clearLinks() { - if (linksBuilder_ == null) { - links_ = java.util.Collections.emptyList(); + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - linksBuilder_.clear(); + connectionsBuilder_.clear(); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public Builder removeLinks(int index) { - if (linksBuilder_ == null) { - ensureLinksIsMutable(); - links_.remove(index); + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); onChanged(); } else { - linksBuilder_.remove(index); + connectionsBuilder_.remove(index); } return this; } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder getLinksBuilder( + public context.ContextOuterClass.Connection.Builder getConnectionsBuilder( int index) { - return getLinksFieldBuilder().getBuilder(index); + return getConnectionsFieldBuilder().getBuilder(index); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.LinkOrBuilder getLinksOrBuilder( + public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( int index) { - if (linksBuilder_ == null) { - return links_.get(index); } else { - return linksBuilder_.getMessageOrBuilder(index); + if (connectionsBuilder_ == null) { + return connections_.get(index); } else { + return connectionsBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List - getLinksOrBuilderList() { - if (linksBuilder_ != null) { - return linksBuilder_.getMessageOrBuilderList(); + public java.util.List + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(links_); + return java.util.Collections.unmodifiableList(connections_); } } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder addLinksBuilder() { - return getLinksFieldBuilder().addBuilder( - context.ContextOuterClass.Link.getDefaultInstance()); + public context.ContextOuterClass.Connection.Builder addConnectionsBuilder() { + return getConnectionsFieldBuilder().addBuilder( + context.ContextOuterClass.Connection.getDefaultInstance()); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public context.ContextOuterClass.Link.Builder addLinksBuilder( + public context.ContextOuterClass.Connection.Builder addConnectionsBuilder( int index) { - return getLinksFieldBuilder().addBuilder( - index, context.ContextOuterClass.Link.getDefaultInstance()); + return getConnectionsFieldBuilder().addBuilder( + index, context.ContextOuterClass.Connection.getDefaultInstance()); } /** - * repeated .context.Link links = 1; + * repeated .context.Connection connections = 1; */ - public java.util.List - getLinksBuilderList() { - return getLinksFieldBuilder().getBuilderList(); + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder> - getLinksFieldBuilder() { - if (linksBuilder_ == null) { - linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Link, context.ContextOuterClass.Link.Builder, context.ContextOuterClass.LinkOrBuilder>( - links_, + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder>( + connections_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - links_ = null; + connections_ = null; } - return linksBuilder_; + return connectionsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -20348,48 +45427,48 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkList) + // @@protoc_insertion_point(builder_scope:context.ConnectionList) } - // @@protoc_insertion_point(class_scope:context.LinkList) - private static final context.ContextOuterClass.LinkList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionList) + private static final context.ContextOuterClass.ConnectionList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionList(); } - public static context.ContextOuterClass.LinkList getDefaultInstance() { + public static context.ContextOuterClass.ConnectionList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkList parsePartialFrom( + public ConnectionList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkList(input, extensionRegistry); + return new ConnectionList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkList getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface LinkEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.LinkEvent) + public interface ConnectionEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConnectionEvent) com.google.protobuf.MessageOrBuilder { /** @@ -20408,40 +45487,40 @@ public final class ContextOuterClass { context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ - boolean hasLinkId(); + boolean hasConnectionId(); /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ - context.ContextOuterClass.LinkId getLinkId(); + context.ContextOuterClass.ConnectionId getConnectionId(); /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder(); + context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); } /** - * Protobuf type {@code context.LinkEvent} + * Protobuf type {@code context.ConnectionEvent} */ - public static final class LinkEvent extends + public static final class ConnectionEvent extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.LinkEvent) - LinkEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConnectionEvent) + ConnectionEventOrBuilder { private static final long serialVersionUID = 0L; - // Use LinkEvent.newBuilder() to construct. - private LinkEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConnectionEvent.newBuilder() to construct. + private ConnectionEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private LinkEvent() { + private ConnectionEvent() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new LinkEvent(); + return new ConnectionEvent(); } @java.lang.Override @@ -20449,7 +45528,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private LinkEvent( + private ConnectionEvent( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -20481,14 +45560,14 @@ public final class ContextOuterClass { break; } case 18: { - context.ContextOuterClass.LinkId.Builder subBuilder = null; - if (linkId_ != null) { - subBuilder = linkId_.toBuilder(); + context.ContextOuterClass.ConnectionId.Builder subBuilder = null; + if (connectionId_ != null) { + subBuilder = connectionId_.toBuilder(); } - linkId_ = input.readMessage(context.ContextOuterClass.LinkId.parser(), extensionRegistry); + connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(linkId_); - linkId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(connectionId_); + connectionId_ = subBuilder.buildPartial(); } break; @@ -20514,15 +45593,15 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + context.ContextOuterClass.ConnectionEvent.class, context.ContextOuterClass.ConnectionEvent.Builder.class); } public static final int EVENT_FIELD_NUMBER = 1; @@ -20551,30 +45630,30 @@ public final class ContextOuterClass { return getEvent(); } - public static final int LINK_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.LinkId linkId_; + public static final int CONNECTION_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ConnectionId connectionId_; /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ @java.lang.Override - public boolean hasLinkId() { - return linkId_ != null; + public boolean hasConnectionId() { + return connectionId_ != null; } /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ @java.lang.Override - public context.ContextOuterClass.LinkId getLinkId() { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ @java.lang.Override - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - return getLinkId(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + return getConnectionId(); } private byte memoizedIsInitialized = -1; @@ -20594,8 +45673,8 @@ public final class ContextOuterClass { if (event_ != null) { output.writeMessage(1, getEvent()); } - if (linkId_ != null) { - output.writeMessage(2, getLinkId()); + if (connectionId_ != null) { + output.writeMessage(2, getConnectionId()); } unknownFields.writeTo(output); } @@ -20610,9 +45689,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getEvent()); } - if (linkId_ != null) { + if (connectionId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getLinkId()); + .computeMessageSize(2, getConnectionId()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -20624,20 +45703,20 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.LinkEvent)) { + if (!(obj instanceof context.ContextOuterClass.ConnectionEvent)) { return super.equals(obj); } - context.ContextOuterClass.LinkEvent other = (context.ContextOuterClass.LinkEvent) obj; + context.ContextOuterClass.ConnectionEvent other = (context.ContextOuterClass.ConnectionEvent) obj; if (hasEvent() != other.hasEvent()) return false; if (hasEvent()) { if (!getEvent() .equals(other.getEvent())) return false; } - if (hasLinkId() != other.hasLinkId()) return false; - if (hasLinkId()) { - if (!getLinkId() - .equals(other.getLinkId())) return false; + if (hasConnectionId() != other.hasConnectionId()) return false; + if (hasConnectionId()) { + if (!getConnectionId() + .equals(other.getConnectionId())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -20654,78 +45733,78 @@ public final class ContextOuterClass { hash = (37 * hash) + EVENT_FIELD_NUMBER; hash = (53 * hash) + getEvent().hashCode(); } - if (hasLinkId()) { - hash = (37 * hash) + LINK_ID_FIELD_NUMBER; - hash = (53 * hash) + getLinkId().hashCode(); + if (hasConnectionId()) { + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom(byte[] data) + public static context.ContextOuterClass.ConnectionEvent parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.LinkEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionEvent parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent 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 context.ContextOuterClass.LinkEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConnectionEvent parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseDelimitedFrom( + public static context.ContextOuterClass.ConnectionEvent 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 context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.LinkEvent parseFrom( + public static context.ContextOuterClass.ConnectionEvent parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -20738,7 +45817,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.LinkEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConnectionEvent prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -20754,26 +45833,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.LinkEvent} + * Protobuf type {@code context.ConnectionEvent} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.LinkEvent) - context.ContextOuterClass.LinkEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConnectionEvent) + context.ContextOuterClass.ConnectionEventOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_LinkEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConnectionEvent_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.LinkEvent.class, context.ContextOuterClass.LinkEvent.Builder.class); + context.ContextOuterClass.ConnectionEvent.class, context.ContextOuterClass.ConnectionEvent.Builder.class); } - // Construct using context.ContextOuterClass.LinkEvent.newBuilder() + // Construct using context.ContextOuterClass.ConnectionEvent.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -20797,11 +45876,11 @@ public final class ContextOuterClass { event_ = null; eventBuilder_ = null; } - if (linkIdBuilder_ == null) { - linkId_ = null; + if (connectionIdBuilder_ == null) { + connectionId_ = null; } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } return this; } @@ -20809,17 +45888,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_LinkEvent_descriptor; + return context.ContextOuterClass.internal_static_context_ConnectionEvent_descriptor; } @java.lang.Override - public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { - return context.ContextOuterClass.LinkEvent.getDefaultInstance(); + public context.ContextOuterClass.ConnectionEvent getDefaultInstanceForType() { + return context.ContextOuterClass.ConnectionEvent.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.LinkEvent build() { - context.ContextOuterClass.LinkEvent result = buildPartial(); + public context.ContextOuterClass.ConnectionEvent build() { + context.ContextOuterClass.ConnectionEvent result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -20827,17 +45906,17 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.LinkEvent buildPartial() { - context.ContextOuterClass.LinkEvent result = new context.ContextOuterClass.LinkEvent(this); + public context.ContextOuterClass.ConnectionEvent buildPartial() { + context.ContextOuterClass.ConnectionEvent result = new context.ContextOuterClass.ConnectionEvent(this); if (eventBuilder_ == null) { result.event_ = event_; } else { result.event_ = eventBuilder_.build(); } - if (linkIdBuilder_ == null) { - result.linkId_ = linkId_; + if (connectionIdBuilder_ == null) { + result.connectionId_ = connectionId_; } else { - result.linkId_ = linkIdBuilder_.build(); + result.connectionId_ = connectionIdBuilder_.build(); } onBuilt(); return result; @@ -20877,21 +45956,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.LinkEvent) { - return mergeFrom((context.ContextOuterClass.LinkEvent)other); + if (other instanceof context.ContextOuterClass.ConnectionEvent) { + return mergeFrom((context.ContextOuterClass.ConnectionEvent)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.LinkEvent other) { - if (other == context.ContextOuterClass.LinkEvent.getDefaultInstance()) return this; + public Builder mergeFrom(context.ContextOuterClass.ConnectionEvent other) { + if (other == context.ContextOuterClass.ConnectionEvent.getDefaultInstance()) return this; if (other.hasEvent()) { mergeEvent(other.getEvent()); } - if (other.hasLinkId()) { - mergeLinkId(other.getLinkId()); + if (other.hasConnectionId()) { + mergeConnectionId(other.getConnectionId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -20908,11 +45987,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.LinkEvent parsedMessage = null; + context.ContextOuterClass.ConnectionEvent parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.LinkEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConnectionEvent) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -21041,123 +46120,123 @@ public final class ContextOuterClass { return eventBuilder_; } - private context.ContextOuterClass.LinkId linkId_; + private context.ContextOuterClass.ConnectionId connectionId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> linkIdBuilder_; + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; /** - * .context.LinkId link_id = 2; - * @return Whether the linkId field is set. + * .context.ConnectionId connection_id = 2; + * @return Whether the connectionId field is set. */ - public boolean hasLinkId() { - return linkIdBuilder_ != null || linkId_ != null; + public boolean hasConnectionId() { + return connectionIdBuilder_ != null || connectionId_ != null; } /** - * .context.LinkId link_id = 2; - * @return The linkId. + * .context.ConnectionId connection_id = 2; + * @return The connectionId. */ - public context.ContextOuterClass.LinkId getLinkId() { - if (linkIdBuilder_ == null) { - return linkId_ == null ? context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + public context.ContextOuterClass.ConnectionId getConnectionId() { + if (connectionIdBuilder_ == null) { + return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } else { - return linkIdBuilder_.getMessage(); + return connectionIdBuilder_.getMessage(); } } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder setLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { + public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - linkId_ = value; + connectionId_ = value; onChanged(); } else { - linkIdBuilder_.setMessage(value); + connectionIdBuilder_.setMessage(value); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder setLinkId( - context.ContextOuterClass.LinkId.Builder builderForValue) { - if (linkIdBuilder_ == null) { - linkId_ = builderForValue.build(); + public Builder setConnectionId( + context.ContextOuterClass.ConnectionId.Builder builderForValue) { + if (connectionIdBuilder_ == null) { + connectionId_ = builderForValue.build(); onChanged(); } else { - linkIdBuilder_.setMessage(builderForValue.build()); + connectionIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder mergeLinkId(context.ContextOuterClass.LinkId value) { - if (linkIdBuilder_ == null) { - if (linkId_ != null) { - linkId_ = - context.ContextOuterClass.LinkId.newBuilder(linkId_).mergeFrom(value).buildPartial(); + public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { + if (connectionIdBuilder_ == null) { + if (connectionId_ != null) { + connectionId_ = + context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); } else { - linkId_ = value; + connectionId_ = value; } onChanged(); } else { - linkIdBuilder_.mergeFrom(value); + connectionIdBuilder_.mergeFrom(value); } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public Builder clearLinkId() { - if (linkIdBuilder_ == null) { - linkId_ = null; + public Builder clearConnectionId() { + if (connectionIdBuilder_ == null) { + connectionId_ = null; onChanged(); } else { - linkId_ = null; - linkIdBuilder_ = null; + connectionId_ = null; + connectionIdBuilder_ = null; } return this; } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public context.ContextOuterClass.LinkId.Builder getLinkIdBuilder() { + public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { onChanged(); - return getLinkIdFieldBuilder().getBuilder(); + return getConnectionIdFieldBuilder().getBuilder(); } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ - public context.ContextOuterClass.LinkIdOrBuilder getLinkIdOrBuilder() { - if (linkIdBuilder_ != null) { - return linkIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { + if (connectionIdBuilder_ != null) { + return connectionIdBuilder_.getMessageOrBuilder(); } else { - return linkId_ == null ? - context.ContextOuterClass.LinkId.getDefaultInstance() : linkId_; + return connectionId_ == null ? + context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; } } /** - * .context.LinkId link_id = 2; + * .context.ConnectionId connection_id = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder> - getLinkIdFieldBuilder() { - if (linkIdBuilder_ == null) { - linkIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.LinkId, context.ContextOuterClass.LinkId.Builder, context.ContextOuterClass.LinkIdOrBuilder>( - getLinkId(), + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> + getConnectionIdFieldBuilder() { + if (connectionIdBuilder_ == null) { + connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( + getConnectionId(), getParentForChildren(), isClean()); - linkId_ = null; + connectionId_ = null; } - return linkIdBuilder_; + return connectionIdBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -21172,104 +46251,119 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.LinkEvent) + // @@protoc_insertion_point(builder_scope:context.ConnectionEvent) } - // @@protoc_insertion_point(class_scope:context.LinkEvent) - private static final context.ContextOuterClass.LinkEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConnectionEvent) + private static final context.ContextOuterClass.ConnectionEvent DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.LinkEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionEvent(); } - public static context.ContextOuterClass.LinkEvent getDefaultInstance() { + public static context.ContextOuterClass.ConnectionEvent getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public LinkEvent parsePartialFrom( + public ConnectionEvent parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new LinkEvent(input, extensionRegistry); + return new ConnectionEvent(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.LinkEvent getDefaultInstanceForType() { + public context.ContextOuterClass.ConnectionEvent getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceId) + public interface EndPointIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.EndPointId) com.google.protobuf.MessageOrBuilder { /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ - boolean hasContextId(); + boolean hasTopologyId(); /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ - context.ContextOuterClass.ContextId getContextId(); + context.ContextOuterClass.TopologyId getTopologyId(); /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder(); + context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ - boolean hasServiceUuid(); + boolean hasDeviceId(); /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ - context.ContextOuterClass.Uuid getServiceUuid(); + context.ContextOuterClass.DeviceId getDeviceId(); /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder(); + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + boolean hasEndpointUuid(); + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + context.ContextOuterClass.Uuid getEndpointUuid(); + /** + * .context.Uuid endpoint_uuid = 3; + */ + context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder(); } /** *
-   * ----- Service -------------------------------------------------------------------------------------------------------
+   * ----- Endpoint ------------------------------------------------------------------------------------------------------
    * 
* - * Protobuf type {@code context.ServiceId} + * Protobuf type {@code context.EndPointId} */ - public static final class ServiceId extends + public static final class EndPointId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceId) - ServiceIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.EndPointId) + EndPointIdOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceId.newBuilder() to construct. - private ServiceId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use EndPointId.newBuilder() to construct. + private EndPointId(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceId() { + private EndPointId() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceId(); + return new EndPointId(); } @java.lang.Override @@ -21277,7 +46371,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceId( + private EndPointId( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -21296,27 +46390,40 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ContextId.Builder subBuilder = null; - if (contextId_ != null) { - subBuilder = contextId_.toBuilder(); + context.ContextOuterClass.TopologyId.Builder subBuilder = null; + if (topologyId_ != null) { + subBuilder = topologyId_.toBuilder(); } - contextId_ = input.readMessage(context.ContextOuterClass.ContextId.parser(), extensionRegistry); + topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(contextId_); - contextId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(topologyId_); + topologyId_ = subBuilder.buildPartial(); } break; } case 18: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (serviceUuid_ != null) { - subBuilder = serviceUuid_.toBuilder(); + if (endpointUuid_ != null) { + subBuilder = endpointUuid_.toBuilder(); } - serviceUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + endpointUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceUuid_); - serviceUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointUuid_); + endpointUuid_ = subBuilder.buildPartial(); } break; @@ -21342,67 +46449,93 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); } - public static final int CONTEXT_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ContextId contextId_; + public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.TopologyId topologyId_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ @java.lang.Override - public boolean hasContextId() { - return contextId_ != null; + public boolean hasTopologyId() { + return topologyId_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ @java.lang.Override - public context.ContextOuterClass.ContextId getContextId() { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.TopologyId getTopologyId() { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ @java.lang.Override - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - return getContextId(); + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + return getTopologyId(); } - public static final int SERVICE_UUID_FIELD_NUMBER = 2; - private context.ContextOuterClass.Uuid serviceUuid_; + public static final int DEVICE_ID_FIELD_NUMBER = 2; + private context.ContextOuterClass.DeviceId deviceId_; /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ @java.lang.Override - public boolean hasServiceUuid() { - return serviceUuid_ != null; + public boolean hasDeviceId() { + return deviceId_ != null; } /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ @java.lang.Override - public context.ContextOuterClass.Uuid getServiceUuid() { - return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { - return getServiceUuid(); + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_UUID_FIELD_NUMBER = 3; + private context.ContextOuterClass.Uuid endpointUuid_; + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + @java.lang.Override + public boolean hasEndpointUuid() { + return endpointUuid_ != null; + } + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getEndpointUuid() { + return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { + return getEndpointUuid(); } private byte memoizedIsInitialized = -1; @@ -21419,11 +46552,14 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contextId_ != null) { - output.writeMessage(1, getContextId()); + if (topologyId_ != null) { + output.writeMessage(1, getTopologyId()); } - if (serviceUuid_ != null) { - output.writeMessage(2, getServiceUuid()); + if (deviceId_ != null) { + output.writeMessage(2, getDeviceId()); + } + if (endpointUuid_ != null) { + output.writeMessage(3, getEndpointUuid()); } unknownFields.writeTo(output); } @@ -21434,13 +46570,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (contextId_ != null) { + if (topologyId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTopologyId()); + } + if (deviceId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getContextId()); + .computeMessageSize(2, getDeviceId()); } - if (serviceUuid_ != null) { + if (endpointUuid_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getServiceUuid()); + .computeMessageSize(3, getEndpointUuid()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -21452,20 +46592,25 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceId)) { + if (!(obj instanceof context.ContextOuterClass.EndPointId)) { return super.equals(obj); } - context.ContextOuterClass.ServiceId other = (context.ContextOuterClass.ServiceId) obj; + context.ContextOuterClass.EndPointId other = (context.ContextOuterClass.EndPointId) obj; - if (hasContextId() != other.hasContextId()) return false; - if (hasContextId()) { - if (!getContextId() - .equals(other.getContextId())) return false; + if (hasTopologyId() != other.hasTopologyId()) return false; + if (hasTopologyId()) { + if (!getTopologyId() + .equals(other.getTopologyId())) return false; } - if (hasServiceUuid() != other.hasServiceUuid()) return false; - if (hasServiceUuid()) { - if (!getServiceUuid() - .equals(other.getServiceUuid())) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointUuid() != other.hasEndpointUuid()) return false; + if (hasEndpointUuid()) { + if (!getEndpointUuid() + .equals(other.getEndpointUuid())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -21478,82 +46623,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasContextId()) { - hash = (37 * hash) + CONTEXT_ID_FIELD_NUMBER; - hash = (53 * hash) + getContextId().hashCode(); + if (hasTopologyId()) { + hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; + hash = (53 * hash) + getTopologyId().hashCode(); } - if (hasServiceUuid()) { - hash = (37 * hash) + SERVICE_UUID_FIELD_NUMBER; - hash = (53 * hash) + getServiceUuid().hashCode(); + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointUuid()) { + hash = (37 * hash) + ENDPOINT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointUuid().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom(byte[] data) + public static context.ContextOuterClass.EndPointId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPointId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId 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 context.ContextOuterClass.ServiceId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPointId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseDelimitedFrom( + public static context.ContextOuterClass.EndPointId 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 context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceId parseFrom( + public static context.ContextOuterClass.EndPointId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -21566,7 +46715,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceId prototype) { + public static Builder newBuilder(context.ContextOuterClass.EndPointId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -21583,29 +46732,29 @@ public final class ContextOuterClass { } /** *
-     * ----- Service -------------------------------------------------------------------------------------------------------
+     * ----- Endpoint ------------------------------------------------------------------------------------------------------
      * 
* - * Protobuf type {@code context.ServiceId} + * Protobuf type {@code context.EndPointId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceId) - context.ContextOuterClass.ServiceIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.EndPointId) + context.ContextOuterClass.EndPointIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceId.class, context.ContextOuterClass.ServiceId.Builder.class); + context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); } - // Construct using context.ContextOuterClass.ServiceId.newBuilder() + // Construct using context.ContextOuterClass.EndPointId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -21623,17 +46772,23 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (contextIdBuilder_ == null) { - contextId_ = null; + if (topologyIdBuilder_ == null) { + topologyId_ = null; } else { - contextId_ = null; - contextIdBuilder_ = null; + topologyId_ = null; + topologyIdBuilder_ = null; } - if (serviceUuidBuilder_ == null) { - serviceUuid_ = null; + if (deviceIdBuilder_ == null) { + deviceId_ = null; } else { - serviceUuid_ = null; - serviceUuidBuilder_ = null; + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointUuidBuilder_ == null) { + endpointUuid_ = null; + } else { + endpointUuid_ = null; + endpointUuidBuilder_ = null; } return this; } @@ -21641,17 +46796,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceId_descriptor; + return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceId.getDefaultInstance(); + public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { + return context.ContextOuterClass.EndPointId.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceId build() { - context.ContextOuterClass.ServiceId result = buildPartial(); + public context.ContextOuterClass.EndPointId build() { + context.ContextOuterClass.EndPointId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -21659,17 +46814,22 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceId buildPartial() { - context.ContextOuterClass.ServiceId result = new context.ContextOuterClass.ServiceId(this); - if (contextIdBuilder_ == null) { - result.contextId_ = contextId_; + public context.ContextOuterClass.EndPointId buildPartial() { + context.ContextOuterClass.EndPointId result = new context.ContextOuterClass.EndPointId(this); + if (topologyIdBuilder_ == null) { + result.topologyId_ = topologyId_; } else { - result.contextId_ = contextIdBuilder_.build(); + result.topologyId_ = topologyIdBuilder_.build(); } - if (serviceUuidBuilder_ == null) { - result.serviceUuid_ = serviceUuid_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; } else { - result.serviceUuid_ = serviceUuidBuilder_.build(); + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointUuidBuilder_ == null) { + result.endpointUuid_ = endpointUuid_; + } else { + result.endpointUuid_ = endpointUuidBuilder_.build(); } onBuilt(); return result; @@ -21709,21 +46869,24 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceId) { - return mergeFrom((context.ContextOuterClass.ServiceId)other); + if (other instanceof context.ContextOuterClass.EndPointId) { + return mergeFrom((context.ContextOuterClass.EndPointId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceId other) { - if (other == context.ContextOuterClass.ServiceId.getDefaultInstance()) return this; - if (other.hasContextId()) { - mergeContextId(other.getContextId()); + public Builder mergeFrom(context.ContextOuterClass.EndPointId other) { + if (other == context.ContextOuterClass.EndPointId.getDefaultInstance()) return this; + if (other.hasTopologyId()) { + mergeTopologyId(other.getTopologyId()); } - if (other.hasServiceUuid()) { - mergeServiceUuid(other.getServiceUuid()); + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointUuid()) { + mergeEndpointUuid(other.getEndpointUuid()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -21740,11 +46903,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceId parsedMessage = null; + context.ContextOuterClass.EndPointId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.EndPointId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -21754,242 +46917,361 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.ContextId contextId_; + private context.ContextOuterClass.TopologyId topologyId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> contextIdBuilder_; + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; /** - * .context.ContextId context_id = 1; - * @return Whether the contextId field is set. + * .context.TopologyId topology_id = 1; + * @return Whether the topologyId field is set. */ - public boolean hasContextId() { - return contextIdBuilder_ != null || contextId_ != null; + public boolean hasTopologyId() { + return topologyIdBuilder_ != null || topologyId_ != null; } /** - * .context.ContextId context_id = 1; - * @return The contextId. + * .context.TopologyId topology_id = 1; + * @return The topologyId. */ - public context.ContextOuterClass.ContextId getContextId() { - if (contextIdBuilder_ == null) { - return contextId_ == null ? context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + public context.ContextOuterClass.TopologyId getTopologyId() { + if (topologyIdBuilder_ == null) { + return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } else { - return contextIdBuilder_.getMessage(); + return topologyIdBuilder_.getMessage(); } } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder setContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { + public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - contextId_ = value; + topologyId_ = value; onChanged(); } else { - contextIdBuilder_.setMessage(value); + topologyIdBuilder_.setMessage(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder setContextId( - context.ContextOuterClass.ContextId.Builder builderForValue) { - if (contextIdBuilder_ == null) { - contextId_ = builderForValue.build(); + public Builder setTopologyId( + context.ContextOuterClass.TopologyId.Builder builderForValue) { + if (topologyIdBuilder_ == null) { + topologyId_ = builderForValue.build(); onChanged(); } else { - contextIdBuilder_.setMessage(builderForValue.build()); + topologyIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder mergeContextId(context.ContextOuterClass.ContextId value) { - if (contextIdBuilder_ == null) { - if (contextId_ != null) { - contextId_ = - context.ContextOuterClass.ContextId.newBuilder(contextId_).mergeFrom(value).buildPartial(); + public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { + if (topologyIdBuilder_ == null) { + if (topologyId_ != null) { + topologyId_ = + context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); } else { - contextId_ = value; + topologyId_ = value; } onChanged(); } else { - contextIdBuilder_.mergeFrom(value); + topologyIdBuilder_.mergeFrom(value); } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public Builder clearContextId() { - if (contextIdBuilder_ == null) { - contextId_ = null; + public Builder clearTopologyId() { + if (topologyIdBuilder_ == null) { + topologyId_ = null; onChanged(); } else { - contextId_ = null; - contextIdBuilder_ = null; + topologyId_ = null; + topologyIdBuilder_ = null; } return this; } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public context.ContextOuterClass.ContextId.Builder getContextIdBuilder() { + public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { onChanged(); - return getContextIdFieldBuilder().getBuilder(); + return getTopologyIdFieldBuilder().getBuilder(); } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ - public context.ContextOuterClass.ContextIdOrBuilder getContextIdOrBuilder() { - if (contextIdBuilder_ != null) { - return contextIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { + if (topologyIdBuilder_ != null) { + return topologyIdBuilder_.getMessageOrBuilder(); } else { - return contextId_ == null ? - context.ContextOuterClass.ContextId.getDefaultInstance() : contextId_; + return topologyId_ == null ? + context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; } } /** - * .context.ContextId context_id = 1; + * .context.TopologyId topology_id = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder> - getContextIdFieldBuilder() { - if (contextIdBuilder_ == null) { - contextIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ContextId, context.ContextOuterClass.ContextId.Builder, context.ContextOuterClass.ContextIdOrBuilder>( - getContextId(), + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> + getTopologyIdFieldBuilder() { + if (topologyIdBuilder_ == null) { + topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( + getTopologyId(), getParentForChildren(), isClean()); - contextId_ = null; + topologyId_ = null; } - return contextIdBuilder_; + return topologyIdBuilder_; } - private context.ContextOuterClass.Uuid serviceUuid_; + private context.ContextOuterClass.DeviceId deviceId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> serviceUuidBuilder_; + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; /** - * .context.Uuid service_uuid = 2; - * @return Whether the serviceUuid field is set. + * .context.DeviceId device_id = 2; + * @return Whether the deviceId field is set. */ - public boolean hasServiceUuid() { - return serviceUuidBuilder_ != null || serviceUuid_ != null; + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; } /** - * .context.Uuid service_uuid = 2; - * @return The serviceUuid. + * .context.DeviceId device_id = 2; + * @return The deviceId. */ - public context.ContextOuterClass.Uuid getServiceUuid() { - if (serviceUuidBuilder_ == null) { - return serviceUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; } else { - return serviceUuidBuilder_.getMessage(); + return deviceIdBuilder_.getMessage(); } } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - public Builder setServiceUuid(context.ContextOuterClass.Uuid value) { - if (serviceUuidBuilder_ == null) { + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - serviceUuid_ = value; + deviceId_ = value; onChanged(); } else { - serviceUuidBuilder_.setMessage(value); + deviceIdBuilder_.setMessage(value); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.DeviceId device_id = 2; */ - public Builder setServiceUuid( + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.Uuid endpointUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> endpointUuidBuilder_; + /** + * .context.Uuid endpoint_uuid = 3; + * @return Whether the endpointUuid field is set. + */ + public boolean hasEndpointUuid() { + return endpointUuidBuilder_ != null || endpointUuid_ != null; + } + /** + * .context.Uuid endpoint_uuid = 3; + * @return The endpointUuid. + */ + public context.ContextOuterClass.Uuid getEndpointUuid() { + if (endpointUuidBuilder_ == null) { + return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + } else { + return endpointUuidBuilder_.getMessage(); + } + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + public Builder setEndpointUuid(context.ContextOuterClass.Uuid value) { + if (endpointUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointUuid_ = value; + onChanged(); + } else { + endpointUuidBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid endpoint_uuid = 3; + */ + public Builder setEndpointUuid( context.ContextOuterClass.Uuid.Builder builderForValue) { - if (serviceUuidBuilder_ == null) { - serviceUuid_ = builderForValue.build(); + if (endpointUuidBuilder_ == null) { + endpointUuid_ = builderForValue.build(); onChanged(); } else { - serviceUuidBuilder_.setMessage(builderForValue.build()); + endpointUuidBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public Builder mergeServiceUuid(context.ContextOuterClass.Uuid value) { - if (serviceUuidBuilder_ == null) { - if (serviceUuid_ != null) { - serviceUuid_ = - context.ContextOuterClass.Uuid.newBuilder(serviceUuid_).mergeFrom(value).buildPartial(); + public Builder mergeEndpointUuid(context.ContextOuterClass.Uuid value) { + if (endpointUuidBuilder_ == null) { + if (endpointUuid_ != null) { + endpointUuid_ = + context.ContextOuterClass.Uuid.newBuilder(endpointUuid_).mergeFrom(value).buildPartial(); } else { - serviceUuid_ = value; + endpointUuid_ = value; } onChanged(); } else { - serviceUuidBuilder_.mergeFrom(value); + endpointUuidBuilder_.mergeFrom(value); } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public Builder clearServiceUuid() { - if (serviceUuidBuilder_ == null) { - serviceUuid_ = null; + public Builder clearEndpointUuid() { + if (endpointUuidBuilder_ == null) { + endpointUuid_ = null; onChanged(); } else { - serviceUuid_ = null; - serviceUuidBuilder_ = null; + endpointUuid_ = null; + endpointUuidBuilder_ = null; } return this; } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public context.ContextOuterClass.Uuid.Builder getServiceUuidBuilder() { + public context.ContextOuterClass.Uuid.Builder getEndpointUuidBuilder() { onChanged(); - return getServiceUuidFieldBuilder().getBuilder(); + return getEndpointUuidFieldBuilder().getBuilder(); } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ - public context.ContextOuterClass.UuidOrBuilder getServiceUuidOrBuilder() { - if (serviceUuidBuilder_ != null) { - return serviceUuidBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { + if (endpointUuidBuilder_ != null) { + return endpointUuidBuilder_.getMessageOrBuilder(); } else { - return serviceUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : serviceUuid_; + return endpointUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; } } /** - * .context.Uuid service_uuid = 2; + * .context.Uuid endpoint_uuid = 3; */ private com.google.protobuf.SingleFieldBuilderV3< context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getServiceUuidFieldBuilder() { - if (serviceUuidBuilder_ == null) { - serviceUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + getEndpointUuidFieldBuilder() { + if (endpointUuidBuilder_ == null) { + endpointUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getServiceUuid(), + getEndpointUuid(), getParentForChildren(), isClean()); - serviceUuid_ = null; + endpointUuid_ = null; } - return serviceUuidBuilder_; + return endpointUuidBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -22004,177 +47286,143 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceId) + // @@protoc_insertion_point(builder_scope:context.EndPointId) } - // @@protoc_insertion_point(class_scope:context.ServiceId) - private static final context.ContextOuterClass.ServiceId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.EndPointId) + private static final context.ContextOuterClass.EndPointId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.EndPointId(); } - public static context.ContextOuterClass.ServiceId getDefaultInstance() { + public static context.ContextOuterClass.EndPointId getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceId parsePartialFrom( + public EndPointId parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceId(input, extensionRegistry); + return new EndPointId(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceId getDefaultInstanceForType() { + public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Service) + public interface EndPointOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.EndPoint) com.google.protobuf.MessageOrBuilder { /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. - */ - boolean hasServiceId(); - /** - * .context.ServiceId service_id = 1; - * @return The serviceId. - */ - context.ContextOuterClass.ServiceId getServiceId(); - /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); - + boolean hasEndpointId(); /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - int getServiceTypeValue(); + context.ContextOuterClass.EndPointId getEndpointId(); /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. + * .context.EndPointId endpoint_id = 1; */ - context.ContextOuterClass.ServiceTypeEnum getServiceType(); + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - java.util.List - getServiceEndpointIdsList(); - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - context.ContextOuterClass.EndPointId getServiceEndpointIds(int index); - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - int getServiceEndpointIdsCount(); - /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The endpointType. */ - java.util.List - getServiceEndpointIdsOrBuilderList(); + java.lang.String getEndpointType(); /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The bytes for endpointType. */ - context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index); + com.google.protobuf.ByteString + getEndpointTypeBytes(); /** - * repeated .context.Constraint service_constraints = 4; - */ - java.util.List - getServiceConstraintsList(); - /** - * repeated .context.Constraint service_constraints = 4; - */ - context.ContextOuterClass.Constraint getServiceConstraints(int index); - /** - * repeated .context.Constraint service_constraints = 4; - */ - int getServiceConstraintsCount(); - /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ - java.util.List - getServiceConstraintsOrBuilderList(); + java.util.List getKpiSampleTypesList(); /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ - context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index); - + int getKpiSampleTypesCount(); /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ - boolean hasServiceStatus(); + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index); /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ - context.ContextOuterClass.ServiceStatus getServiceStatus(); + java.util.List + getKpiSampleTypesValueList(); /** - * .context.ServiceStatus service_status = 5; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ - context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder(); + int getKpiSampleTypesValue(int index); /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. */ - boolean hasServiceConfig(); + boolean hasEndpointLocation(); /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ - context.ContextOuterClass.ServiceConfig getServiceConfig(); + context.ContextOuterClass.Location getEndpointLocation(); /** - * .context.ServiceConfig service_config = 6; + * .context.Location endpoint_location = 4; */ - context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder(); } /** - * Protobuf type {@code context.Service} + * Protobuf type {@code context.EndPoint} */ - public static final class Service extends + public static final class EndPoint extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Service) - ServiceOrBuilder { + // @@protoc_insertion_point(message_implements:context.EndPoint) + EndPointOrBuilder { private static final long serialVersionUID = 0L; - // Use Service.newBuilder() to construct. - private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use EndPoint.newBuilder() to construct. + private EndPoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Service() { - serviceType_ = 0; - serviceEndpointIds_ = java.util.Collections.emptyList(); - serviceConstraints_ = java.util.Collections.emptyList(); + private EndPoint() { + endpointType_ = ""; + kpiSampleTypes_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Service(); + return new EndPoint(); } @java.lang.Override @@ -22182,7 +47430,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Service( + private EndPoint( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -22202,64 +47450,56 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (serviceId_ != null) { - subBuilder = serviceId_.toBuilder(); + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); } - serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceId_); - serviceId_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); } break; } - case 16: { - int rawValue = input.readEnum(); + case 18: { + java.lang.String s = input.readStringRequireUtf8(); - serviceType_ = rawValue; + endpointType_ = s; break; } - case 26: { + case 24: { + int rawValue = input.readEnum(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = new java.util.ArrayList(); + kpiSampleTypes_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - serviceEndpointIds_.add( - input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - serviceConstraints_.add( - input.readMessage(context.ContextOuterClass.Constraint.parser(), extensionRegistry)); + kpiSampleTypes_.add(rawValue); break; } - case 42: { - context.ContextOuterClass.ServiceStatus.Builder subBuilder = null; - if (serviceStatus_ != null) { - subBuilder = serviceStatus_.toBuilder(); - } - serviceStatus_ = input.readMessage(context.ContextOuterClass.ServiceStatus.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(serviceStatus_); - serviceStatus_ = subBuilder.buildPartial(); + case 26: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiSampleTypes_.add(rawValue); } - + input.popLimit(oldLimit); break; } - case 50: { - context.ContextOuterClass.ServiceConfig.Builder subBuilder = null; - if (serviceConfig_ != null) { - subBuilder = serviceConfig_.toBuilder(); + case 34: { + context.ContextOuterClass.Location.Builder subBuilder = null; + if (endpointLocation_ != null) { + subBuilder = endpointLocation_.toBuilder(); } - serviceConfig_ = input.readMessage(context.ContextOuterClass.ServiceConfig.parser(), extensionRegistry); + endpointLocation_ = input.readMessage(context.ContextOuterClass.Location.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(serviceConfig_); - serviceConfig_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(endpointLocation_); + endpointLocation_ = subBuilder.buildPartial(); } break; @@ -22280,10 +47520,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -22291,192 +47528,163 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); } - public static final int SERVICE_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ServiceId serviceId_; + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ @java.lang.Override - public boolean hasServiceId() { - return serviceId_ != null; + public boolean hasEndpointId() { + return endpointId_ != null; } /** - * .context.ServiceId service_id = 1; - * @return The serviceId. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceId() { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - return getServiceId(); - } - - public static final int SERVICE_TYPE_FIELD_NUMBER = 2; - private int serviceType_; - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. - */ - @java.lang.Override public int getServiceTypeValue() { - return serviceType_; - } - /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. - */ - @java.lang.Override public context.ContextOuterClass.ServiceTypeEnum getServiceType() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); - return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); } - public static final int SERVICE_ENDPOINT_IDS_FIELD_NUMBER = 3; - private java.util.List serviceEndpointIds_; - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public java.util.List getServiceEndpointIdsList() { - return serviceEndpointIds_; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public java.util.List - getServiceEndpointIdsOrBuilderList() { - return serviceEndpointIds_; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - @java.lang.Override - public int getServiceEndpointIdsCount() { - return serviceEndpointIds_.size(); - } + public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object endpointType_; /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The endpointType. */ @java.lang.Override - public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { - return serviceEndpointIds_.get(index); + public java.lang.String getEndpointType() { + java.lang.Object ref = endpointType_; + 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(); + endpointType_ = s; + return s; + } } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * string endpoint_type = 2; + * @return The bytes for endpointType. */ @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index) { - return serviceEndpointIds_.get(index); + public com.google.protobuf.ByteString + getEndpointTypeBytes() { + java.lang.Object ref = endpointType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpointType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int SERVICE_CONSTRAINTS_FIELD_NUMBER = 4; - private java.util.List serviceConstraints_; - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public java.util.List getServiceConstraintsList() { - return serviceConstraints_; - } - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public java.util.List - getServiceConstraintsOrBuilderList() { - return serviceConstraints_; - } - /** - * repeated .context.Constraint service_constraints = 4; - */ - @java.lang.Override - public int getServiceConstraintsCount() { - return serviceConstraints_.size(); - } + public static final int KPI_SAMPLE_TYPES_FIELD_NUMBER = 3; + private java.util.List kpiSampleTypes_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType> kpiSampleTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>() { + public kpi_sample_types.KpiSampleTypes.KpiSampleType convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(from); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + }; /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.Constraint getServiceConstraints(int index) { - return serviceConstraints_.get(index); + public java.util.List getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); } /** - * repeated .context.Constraint service_constraints = 4; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index) { - return serviceConstraints_.get(index); + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); } - - public static final int SERVICE_STATUS_FIELD_NUMBER = 5; - private context.ContextOuterClass.ServiceStatus serviceStatus_; /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ @java.lang.Override - public boolean hasServiceStatus() { - return serviceStatus_ != null; + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); } /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ @java.lang.Override - public context.ContextOuterClass.ServiceStatus getServiceStatus() { - return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + public java.util.List + getKpiSampleTypesValueList() { + return kpiSampleTypes_; } /** - * .context.ServiceStatus service_status = 5; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ @java.lang.Override - public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { - return getServiceStatus(); + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); } + private int kpiSampleTypesMemoizedSerializedSize; - public static final int SERVICE_CONFIG_FIELD_NUMBER = 6; - private context.ContextOuterClass.ServiceConfig serviceConfig_; + public static final int ENDPOINT_LOCATION_FIELD_NUMBER = 4; + private context.ContextOuterClass.Location endpointLocation_; /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. */ @java.lang.Override - public boolean hasServiceConfig() { - return serviceConfig_ != null; + public boolean hasEndpointLocation() { + return endpointLocation_ != null; } /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ @java.lang.Override - public context.ContextOuterClass.ServiceConfig getServiceConfig() { - return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; + public context.ContextOuterClass.Location getEndpointLocation() { + return endpointLocation_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } /** - * .context.ServiceConfig service_config = 6; + * .context.Location endpoint_location = 4; */ @java.lang.Override - public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { - return getServiceConfig(); + public context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder() { + return getEndpointLocation(); } private byte memoizedIsInitialized = -1; @@ -22493,23 +47701,22 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (serviceId_ != null) { - output.writeMessage(1, getServiceId()); - } - if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { - output.writeEnum(2, serviceType_); + getSerializedSize(); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); } - for (int i = 0; i < serviceEndpointIds_.size(); i++) { - output.writeMessage(3, serviceEndpointIds_.get(i)); + if (!getEndpointTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointType_); } - for (int i = 0; i < serviceConstraints_.size(); i++) { - output.writeMessage(4, serviceConstraints_.get(i)); + if (getKpiSampleTypesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(kpiSampleTypesMemoizedSerializedSize); } - if (serviceStatus_ != null) { - output.writeMessage(5, getServiceStatus()); + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + output.writeEnumNoTag(kpiSampleTypes_.get(i)); } - if (serviceConfig_ != null) { - output.writeMessage(6, getServiceConfig()); + if (endpointLocation_ != null) { + output.writeMessage(4, getEndpointLocation()); } unknownFields.writeTo(output); } @@ -22520,29 +47727,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (serviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getServiceId()); - } - if (serviceType_ != context.ContextOuterClass.ServiceTypeEnum.SERVICETYPE_UNKNOWN.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, serviceType_); - } - for (int i = 0; i < serviceEndpointIds_.size(); i++) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, serviceEndpointIds_.get(i)); + .computeMessageSize(1, getEndpointId()); } - for (int i = 0; i < serviceConstraints_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, serviceConstraints_.get(i)); + if (!getEndpointTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointType_); } - if (serviceStatus_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getServiceStatus()); + { + int dataSize = 0; + for (int i = 0; i < kpiSampleTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(kpiSampleTypes_.get(i)); + } + size += dataSize; + if (!getKpiSampleTypesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }kpiSampleTypesMemoizedSerializedSize = dataSize; } - if (serviceConfig_ != null) { + if (endpointLocation_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getServiceConfig()); + .computeMessageSize(4, getEndpointLocation()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -22554,30 +47760,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Service)) { + if (!(obj instanceof context.ContextOuterClass.EndPoint)) { return super.equals(obj); } - context.ContextOuterClass.Service other = (context.ContextOuterClass.Service) obj; + context.ContextOuterClass.EndPoint other = (context.ContextOuterClass.EndPoint) obj; - if (hasServiceId() != other.hasServiceId()) return false; - if (hasServiceId()) { - if (!getServiceId() - .equals(other.getServiceId())) return false; - } - if (serviceType_ != other.serviceType_) return false; - if (!getServiceEndpointIdsList() - .equals(other.getServiceEndpointIdsList())) return false; - if (!getServiceConstraintsList() - .equals(other.getServiceConstraintsList())) return false; - if (hasServiceStatus() != other.hasServiceStatus()) return false; - if (hasServiceStatus()) { - if (!getServiceStatus() - .equals(other.getServiceStatus())) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; } - if (hasServiceConfig() != other.hasServiceConfig()) return false; - if (hasServiceConfig()) { - if (!getServiceConfig() - .equals(other.getServiceConfig())) return false; + if (!getEndpointType() + .equals(other.getEndpointType())) return false; + if (!kpiSampleTypes_.equals(other.kpiSampleTypes_)) return false; + if (hasEndpointLocation() != other.hasEndpointLocation()) return false; + if (hasEndpointLocation()) { + if (!getEndpointLocation() + .equals(other.getEndpointLocation())) return false; } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -22590,96 +47789,88 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasServiceId()) { - hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getServiceId().hashCode(); - } - hash = (37 * hash) + SERVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + serviceType_; - if (getServiceEndpointIdsCount() > 0) { - hash = (37 * hash) + SERVICE_ENDPOINT_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceEndpointIdsList().hashCode(); - } - if (getServiceConstraintsCount() > 0) { - hash = (37 * hash) + SERVICE_CONSTRAINTS_FIELD_NUMBER; - hash = (53 * hash) + getServiceConstraintsList().hashCode(); + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); } - if (hasServiceStatus()) { - hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + getServiceStatus().hashCode(); + hash = (37 * hash) + ENDPOINT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEndpointType().hashCode(); + if (getKpiSampleTypesCount() > 0) { + hash = (37 * hash) + KPI_SAMPLE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleTypes_.hashCode(); } - if (hasServiceConfig()) { - hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getServiceConfig().hashCode(); + if (hasEndpointLocation()) { + hash = (37 * hash) + ENDPOINT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndpointLocation().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom(byte[] data) + public static context.ContextOuterClass.EndPoint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Service parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPoint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint 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 context.ContextOuterClass.Service parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.EndPoint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseDelimitedFrom( + public static context.ContextOuterClass.EndPoint 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 context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Service parseFrom( + public static context.ContextOuterClass.EndPoint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -22692,7 +47883,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Service prototype) { + public static Builder newBuilder(context.ContextOuterClass.EndPoint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -22708,26 +47899,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Service} + * Protobuf type {@code context.EndPoint} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Service) - context.ContextOuterClass.ServiceOrBuilder { + // @@protoc_insertion_point(builder_implements:context.EndPoint) + context.ContextOuterClass.EndPointOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Service_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Service.class, context.ContextOuterClass.Service.Builder.class); + context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); } - // Construct using context.ContextOuterClass.Service.newBuilder() + // Construct using context.ContextOuterClass.EndPoint.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -22740,44 +47931,26 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getServiceEndpointIdsFieldBuilder(); - getServiceConstraintsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (serviceIdBuilder_ == null) { - serviceId_ = null; + if (endpointIdBuilder_ == null) { + endpointId_ = null; } else { - serviceId_ = null; - serviceIdBuilder_ = null; + endpointId_ = null; + endpointIdBuilder_ = null; } - serviceType_ = 0; + endpointType_ = ""; - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - serviceEndpointIdsBuilder_.clear(); - } - if (serviceConstraintsBuilder_ == null) { - serviceConstraints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - serviceConstraintsBuilder_.clear(); - } - if (serviceStatusBuilder_ == null) { - serviceStatus_ = null; - } else { - serviceStatus_ = null; - serviceStatusBuilder_ = null; - } - if (serviceConfigBuilder_ == null) { - serviceConfig_ = null; + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + if (endpointLocationBuilder_ == null) { + endpointLocation_ = null; } else { - serviceConfig_ = null; - serviceConfigBuilder_ = null; + endpointLocation_ = null; + endpointLocationBuilder_ = null; } return this; } @@ -22785,17 +47958,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Service_descriptor; + return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; } @java.lang.Override - public context.ContextOuterClass.Service getDefaultInstanceForType() { - return context.ContextOuterClass.Service.getDefaultInstance(); + public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + return context.ContextOuterClass.EndPoint.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Service build() { - context.ContextOuterClass.Service result = buildPartial(); + public context.ContextOuterClass.EndPoint build() { + context.ContextOuterClass.EndPoint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -22803,42 +47976,24 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Service buildPartial() { - context.ContextOuterClass.Service result = new context.ContextOuterClass.Service(this); + public context.ContextOuterClass.EndPoint buildPartial() { + context.ContextOuterClass.EndPoint result = new context.ContextOuterClass.EndPoint(this); int from_bitField0_ = bitField0_; - if (serviceIdBuilder_ == null) { - result.serviceId_ = serviceId_; - } else { - result.serviceId_ = serviceIdBuilder_.build(); - } - result.serviceType_ = serviceType_; - if (serviceEndpointIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = java.util.Collections.unmodifiableList(serviceEndpointIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.serviceEndpointIds_ = serviceEndpointIds_; - } else { - result.serviceEndpointIds_ = serviceEndpointIdsBuilder_.build(); - } - if (serviceConstraintsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = java.util.Collections.unmodifiableList(serviceConstraints_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.serviceConstraints_ = serviceConstraints_; + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; } else { - result.serviceConstraints_ = serviceConstraintsBuilder_.build(); + result.endpointId_ = endpointIdBuilder_.build(); } - if (serviceStatusBuilder_ == null) { - result.serviceStatus_ = serviceStatus_; - } else { - result.serviceStatus_ = serviceStatusBuilder_.build(); + result.endpointType_ = endpointType_; + if (((bitField0_ & 0x00000001) != 0)) { + kpiSampleTypes_ = java.util.Collections.unmodifiableList(kpiSampleTypes_); + bitField0_ = (bitField0_ & ~0x00000001); } - if (serviceConfigBuilder_ == null) { - result.serviceConfig_ = serviceConfig_; + result.kpiSampleTypes_ = kpiSampleTypes_; + if (endpointLocationBuilder_ == null) { + result.endpointLocation_ = endpointLocation_; } else { - result.serviceConfig_ = serviceConfigBuilder_.build(); + result.endpointLocation_ = endpointLocationBuilder_.build(); } onBuilt(); return result; @@ -22878,79 +48033,35 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Service) { - return mergeFrom((context.ContextOuterClass.Service)other); + if (other instanceof context.ContextOuterClass.EndPoint) { + return mergeFrom((context.ContextOuterClass.EndPoint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Service other) { - if (other == context.ContextOuterClass.Service.getDefaultInstance()) return this; - if (other.hasServiceId()) { - mergeServiceId(other.getServiceId()); - } - if (other.serviceType_ != 0) { - setServiceTypeValue(other.getServiceTypeValue()); + public Builder mergeFrom(context.ContextOuterClass.EndPoint other) { + if (other == context.ContextOuterClass.EndPoint.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); } - if (serviceEndpointIdsBuilder_ == null) { - if (!other.serviceEndpointIds_.isEmpty()) { - if (serviceEndpointIds_.isEmpty()) { - serviceEndpointIds_ = other.serviceEndpointIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.addAll(other.serviceEndpointIds_); - } - onChanged(); - } - } else { - if (!other.serviceEndpointIds_.isEmpty()) { - if (serviceEndpointIdsBuilder_.isEmpty()) { - serviceEndpointIdsBuilder_.dispose(); - serviceEndpointIdsBuilder_ = null; - serviceEndpointIds_ = other.serviceEndpointIds_; - bitField0_ = (bitField0_ & ~0x00000001); - serviceEndpointIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceEndpointIdsFieldBuilder() : null; - } else { - serviceEndpointIdsBuilder_.addAllMessages(other.serviceEndpointIds_); - } - } + if (!other.getEndpointType().isEmpty()) { + endpointType_ = other.endpointType_; + onChanged(); } - if (serviceConstraintsBuilder_ == null) { - if (!other.serviceConstraints_.isEmpty()) { - if (serviceConstraints_.isEmpty()) { - serviceConstraints_ = other.serviceConstraints_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.addAll(other.serviceConstraints_); - } - onChanged(); - } - } else { - if (!other.serviceConstraints_.isEmpty()) { - if (serviceConstraintsBuilder_.isEmpty()) { - serviceConstraintsBuilder_.dispose(); - serviceConstraintsBuilder_ = null; - serviceConstraints_ = other.serviceConstraints_; - bitField0_ = (bitField0_ & ~0x00000002); - serviceConstraintsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceConstraintsFieldBuilder() : null; - } else { - serviceConstraintsBuilder_.addAllMessages(other.serviceConstraints_); - } + if (!other.kpiSampleTypes_.isEmpty()) { + if (kpiSampleTypes_.isEmpty()) { + kpiSampleTypes_ = other.kpiSampleTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.addAll(other.kpiSampleTypes_); } + onChanged(); } - if (other.hasServiceStatus()) { - mergeServiceStatus(other.getServiceStatus()); - } - if (other.hasServiceConfig()) { - mergeServiceConfig(other.getServiceConfig()); + if (other.hasEndpointLocation()) { + mergeEndpointLocation(other.getEndpointLocation()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -22967,11 +48078,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Service parsedMessage = null; + context.ContextOuterClass.EndPoint parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Service) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.EndPoint) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -22982,895 +48093,1176 @@ public final class ContextOuterClass { } private int bitField0_; - private context.ContextOuterClass.ServiceId serviceId_; + private context.ContextOuterClass.EndPointId endpointId_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ServiceId service_id = 1; - * @return Whether the serviceId field is set. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - public boolean hasServiceId() { - return serviceIdBuilder_ != null || serviceId_ != null; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ServiceId service_id = 1; - * @return The serviceId. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public context.ContextOuterClass.ServiceId getServiceId() { - if (serviceIdBuilder_ == null) { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } else { - return serviceIdBuilder_.getMessage(); + return endpointIdBuilder_.getMessage(); } } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - serviceId_ = value; + endpointId_ = value; onChanged(); } else { - serviceIdBuilder_.setMessage(value); + endpointIdBuilder_.setMessage(value); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdBuilder_ == null) { - serviceId_ = builderForValue.build(); + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); onChanged(); } else { - serviceIdBuilder_.setMessage(builderForValue.build()); + endpointIdBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (serviceId_ != null) { - serviceId_ = - context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); } else { - serviceId_ = value; + endpointId_ = value; } onChanged(); } else { - serviceIdBuilder_.mergeFrom(value); + endpointIdBuilder_.mergeFrom(value); } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public Builder clearServiceId() { - if (serviceIdBuilder_ == null) { - serviceId_ = null; + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; onChanged(); } else { - serviceId_ = null; - serviceIdBuilder_ = null; + endpointId_ = null; + endpointIdBuilder_ = null; } return this; } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { onChanged(); - return getServiceIdFieldBuilder().getBuilder(); + return getEndpointIdFieldBuilder().getBuilder(); } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - if (serviceIdBuilder_ != null) { - return serviceIdBuilder_.getMessageOrBuilder(); + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); } else { - return serviceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } } /** - * .context.ServiceId service_id = 1; + * .context.EndPointId endpoint_id = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdFieldBuilder() { - if (serviceIdBuilder_ == null) { - serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getServiceId(), + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), getParentForChildren(), isClean()); - serviceId_ = null; + endpointId_ = null; } - return serviceIdBuilder_; + return endpointIdBuilder_; } - private int serviceType_ = 0; + private java.lang.Object endpointType_ = ""; /** - * .context.ServiceTypeEnum service_type = 2; - * @return The enum numeric value on the wire for serviceType. + * string endpoint_type = 2; + * @return The endpointType. */ - @java.lang.Override public int getServiceTypeValue() { - return serviceType_; + public java.lang.String getEndpointType() { + java.lang.Object ref = endpointType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointType_ = s; + return s; + } else { + return (java.lang.String) ref; + } } /** - * .context.ServiceTypeEnum service_type = 2; - * @param value The enum numeric value on the wire for serviceType to set. - * @return This builder for chaining. + * string endpoint_type = 2; + * @return The bytes for endpointType. */ - public Builder setServiceTypeValue(int value) { - - serviceType_ = value; - onChanged(); - return this; + public com.google.protobuf.ByteString + getEndpointTypeBytes() { + java.lang.Object ref = endpointType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endpointType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * .context.ServiceTypeEnum service_type = 2; - * @return The serviceType. + * string endpoint_type = 2; + * @param value The endpointType to set. + * @return This builder for chaining. */ - @java.lang.Override - public context.ContextOuterClass.ServiceTypeEnum getServiceType() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceTypeEnum result = context.ContextOuterClass.ServiceTypeEnum.valueOf(serviceType_); - return result == null ? context.ContextOuterClass.ServiceTypeEnum.UNRECOGNIZED : result; + public Builder setEndpointType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endpointType_ = value; + onChanged(); + return this; } /** - * .context.ServiceTypeEnum service_type = 2; - * @param value The serviceType to set. + * string endpoint_type = 2; * @return This builder for chaining. */ - public Builder setServiceType(context.ContextOuterClass.ServiceTypeEnum value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder clearEndpointType() { - serviceType_ = value.getNumber(); + endpointType_ = getDefaultInstance().getEndpointType(); onChanged(); return this; } /** - * .context.ServiceTypeEnum service_type = 2; + * string endpoint_type = 2; + * @param value The bytes for endpointType to set. * @return This builder for chaining. */ - public Builder clearServiceType() { + public Builder setEndpointTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); - serviceType_ = 0; + endpointType_ = value; onChanged(); return this; } - private java.util.List serviceEndpointIds_ = + private java.util.List kpiSampleTypes_ = java.util.Collections.emptyList(); - private void ensureServiceEndpointIdsIsMutable() { + private void ensureKpiSampleTypesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - serviceEndpointIds_ = new java.util.ArrayList(serviceEndpointIds_); + kpiSampleTypes_ = new java.util.ArrayList(kpiSampleTypes_); bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> serviceEndpointIdsBuilder_; - - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public java.util.List getServiceEndpointIdsList() { - if (serviceEndpointIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceEndpointIds_); - } else { - return serviceEndpointIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public int getServiceEndpointIdsCount() { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.size(); - } else { - return serviceEndpointIdsBuilder_.getCount(); - } - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public context.ContextOuterClass.EndPointId getServiceEndpointIds(int index) { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.get(index); - } else { - return serviceEndpointIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder setServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.set(index, value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder setServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.set(index, builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId service_endpoint_ids = 3; - */ - public Builder addServiceEndpointIds(context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(value); } - return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the kpiSampleTypes. */ - public Builder addServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId value) { - if (serviceEndpointIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(index, value); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(index, value); - } - return this; + public java.util.List getKpiSampleTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, kpi_sample_types.KpiSampleTypes.KpiSampleType>(kpiSampleTypes_, kpiSampleTypes_converter_); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return The count of kpiSampleTypes. */ - public Builder addServiceEndpointIds( - context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(builderForValue.build()); - } - return this; + public int getKpiSampleTypesCount() { + return kpiSampleTypes_.size(); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the element to return. + * @return The kpiSampleTypes at the given index. */ - public Builder addServiceEndpointIds( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleTypes(int index) { + return kpiSampleTypes_converter_.convert(kpiSampleTypes_.get(index)); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index to set the value at. + * @param value The kpiSampleTypes to set. + * @return This builder for chaining. */ - public Builder addAllServiceEndpointIds( - java.lang.Iterable values) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceEndpointIds_); - onChanged(); - } else { - serviceEndpointIdsBuilder_.addAllMessages(values); + public Builder setKpiSampleTypes( + int index, kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value.getNumber()); + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param value The kpiSampleTypes to add. + * @return This builder for chaining. */ - public Builder clearServiceEndpointIds() { - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - serviceEndpointIdsBuilder_.clear(); + public Builder addKpiSampleTypes(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); } + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value.getNumber()); + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param values The kpiSampleTypes to add. + * @return This builder for chaining. */ - public Builder removeServiceEndpointIds(int index) { - if (serviceEndpointIdsBuilder_ == null) { - ensureServiceEndpointIdsIsMutable(); - serviceEndpointIds_.remove(index); - onChanged(); - } else { - serviceEndpointIdsBuilder_.remove(index); + public Builder addAllKpiSampleTypes( + java.lang.Iterable values) { + ensureKpiSampleTypesIsMutable(); + for (kpi_sample_types.KpiSampleTypes.KpiSampleType value : values) { + kpiSampleTypes_.add(value.getNumber()); } + onChanged(); return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return This builder for chaining. */ - public context.ContextOuterClass.EndPointId.Builder getServiceEndpointIdsBuilder( - int index) { - return getServiceEndpointIdsFieldBuilder().getBuilder(index); + public Builder clearKpiSampleTypes() { + kpiSampleTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @return A list containing the enum numeric values on the wire for kpiSampleTypes. */ - public context.ContextOuterClass.EndPointIdOrBuilder getServiceEndpointIdsOrBuilder( - int index) { - if (serviceEndpointIdsBuilder_ == null) { - return serviceEndpointIds_.get(index); } else { - return serviceEndpointIdsBuilder_.getMessageOrBuilder(index); - } + public java.util.List + getKpiSampleTypesValueList() { + return java.util.Collections.unmodifiableList(kpiSampleTypes_); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. */ - public java.util.List - getServiceEndpointIdsOrBuilderList() { - if (serviceEndpointIdsBuilder_ != null) { - return serviceEndpointIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceEndpointIds_); - } + public int getKpiSampleTypesValue(int index) { + return kpiSampleTypes_.get(index); } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of kpiSampleTypes at the given index. + * @return This builder for chaining. */ - public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder() { - return getServiceEndpointIdsFieldBuilder().addBuilder( - context.ContextOuterClass.EndPointId.getDefaultInstance()); + public Builder setKpiSampleTypesValue( + int index, int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.set(index, value); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param value The enum numeric value on the wire for kpiSampleTypes to add. + * @return This builder for chaining. */ - public context.ContextOuterClass.EndPointId.Builder addServiceEndpointIdsBuilder( - int index) { - return getServiceEndpointIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPointId.getDefaultInstance()); + public Builder addKpiSampleTypesValue(int value) { + ensureKpiSampleTypesIsMutable(); + kpiSampleTypes_.add(value); + onChanged(); + return this; } /** - * repeated .context.EndPointId service_endpoint_ids = 3; + * repeated .kpi_sample_types.KpiSampleType kpi_sample_types = 3; + * @param values The enum numeric values on the wire for kpiSampleTypes to add. + * @return This builder for chaining. */ - public java.util.List - getServiceEndpointIdsBuilderList() { - return getServiceEndpointIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getServiceEndpointIdsFieldBuilder() { - if (serviceEndpointIdsBuilder_ == null) { - serviceEndpointIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - serviceEndpointIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - serviceEndpointIds_ = null; + public Builder addAllKpiSampleTypesValue( + java.lang.Iterable values) { + ensureKpiSampleTypesIsMutable(); + for (int value : values) { + kpiSampleTypes_.add(value); } - return serviceEndpointIdsBuilder_; + onChanged(); + return this; } - private java.util.List serviceConstraints_ = - java.util.Collections.emptyList(); - private void ensureServiceConstraintsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - serviceConstraints_ = new java.util.ArrayList(serviceConstraints_); - bitField0_ |= 0x00000002; - } + private context.ContextOuterClass.Location endpointLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> endpointLocationBuilder_; + /** + * .context.Location endpoint_location = 4; + * @return Whether the endpointLocation field is set. + */ + public boolean hasEndpointLocation() { + return endpointLocationBuilder_ != null || endpointLocation_ != null; } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> serviceConstraintsBuilder_; - /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; + * @return The endpointLocation. */ - public java.util.List getServiceConstraintsList() { - if (serviceConstraintsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceConstraints_); + public context.ContextOuterClass.Location getEndpointLocation() { + if (endpointLocationBuilder_ == null) { + return endpointLocation_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } else { - return serviceConstraintsBuilder_.getMessageList(); + return endpointLocationBuilder_.getMessage(); } } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public int getServiceConstraintsCount() { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.size(); + public Builder setEndpointLocation(context.ContextOuterClass.Location value) { + if (endpointLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointLocation_ = value; + onChanged(); } else { - return serviceConstraintsBuilder_.getCount(); + endpointLocationBuilder_.setMessage(value); } + + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public context.ContextOuterClass.Constraint getServiceConstraints(int index) { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.get(index); + public Builder setEndpointLocation( + context.ContextOuterClass.Location.Builder builderForValue) { + if (endpointLocationBuilder_ == null) { + endpointLocation_ = builderForValue.build(); + onChanged(); } else { - return serviceConstraintsBuilder_.getMessage(index); + endpointLocationBuilder_.setMessage(builderForValue.build()); } + + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder setServiceConstraints( - int index, context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEndpointLocation(context.ContextOuterClass.Location value) { + if (endpointLocationBuilder_ == null) { + if (endpointLocation_ != null) { + endpointLocation_ = + context.ContextOuterClass.Location.newBuilder(endpointLocation_).mergeFrom(value).buildPartial(); + } else { + endpointLocation_ = value; } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.set(index, value); onChanged(); } else { - serviceConstraintsBuilder_.setMessage(index, value); + endpointLocationBuilder_.mergeFrom(value); } + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder setServiceConstraints( - int index, context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.set(index, builderForValue.build()); + public Builder clearEndpointLocation() { + if (endpointLocationBuilder_ == null) { + endpointLocation_ = null; onChanged(); } else { - serviceConstraintsBuilder_.setMessage(index, builderForValue.build()); + endpointLocation_ = null; + endpointLocationBuilder_ = null; } + return this; } /** - * repeated .context.Constraint service_constraints = 4; + * .context.Location endpoint_location = 4; */ - public Builder addServiceConstraints(context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(value); - onChanged(); + public context.ContextOuterClass.Location.Builder getEndpointLocationBuilder() { + + onChanged(); + return getEndpointLocationFieldBuilder().getBuilder(); + } + /** + * .context.Location endpoint_location = 4; + */ + public context.ContextOuterClass.LocationOrBuilder getEndpointLocationOrBuilder() { + if (endpointLocationBuilder_ != null) { + return endpointLocationBuilder_.getMessageOrBuilder(); } else { - serviceConstraintsBuilder_.addMessage(value); + return endpointLocation_ == null ? + context.ContextOuterClass.Location.getDefaultInstance() : endpointLocation_; } - return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - int index, context.ContextOuterClass.Constraint value) { - if (serviceConstraintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(index, value); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(index, value); - } - return this; + /** + * .context.Location endpoint_location = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> + getEndpointLocationFieldBuilder() { + if (endpointLocationBuilder_ == null) { + endpointLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder>( + getEndpointLocation(), + getParentForChildren(), + isClean()); + endpointLocation_ = null; + } + return endpointLocationBuilder_; + } + @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:context.EndPoint) + } + + // @@protoc_insertion_point(class_scope:context.EndPoint) + private static final context.ContextOuterClass.EndPoint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new context.ContextOuterClass.EndPoint(); + } + + public static context.ContextOuterClass.EndPoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EndPoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EndPoint(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 context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigRule_CustomOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule_Custom) + com.google.protobuf.MessageOrBuilder { + + /** + * string resource_key = 1; + * @return The resourceKey. + */ + java.lang.String getResourceKey(); + /** + * string resource_key = 1; + * @return The bytes for resourceKey. + */ + com.google.protobuf.ByteString + getResourceKeyBytes(); + + /** + * string resource_value = 2; + * @return The resourceValue. + */ + java.lang.String getResourceValue(); + /** + * string resource_value = 2; + * @return The bytes for resourceValue. + */ + com.google.protobuf.ByteString + getResourceValueBytes(); + } + /** + * Protobuf type {@code context.ConfigRule_Custom} + */ + public static final class ConfigRule_Custom extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:context.ConfigRule_Custom) + ConfigRule_CustomOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigRule_Custom.newBuilder() to construct. + private ConfigRule_Custom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigRule_Custom() { + resourceKey_ = ""; + resourceValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConfigRule_Custom(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigRule_Custom( + 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(); + + resourceKey_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceValue_ = 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 context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule_Custom.class, context.ContextOuterClass.ConfigRule_Custom.Builder.class); + } + + public static final int RESOURCE_KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceKey_; + /** + * string resource_key = 1; + * @return The resourceKey. + */ + @java.lang.Override + public java.lang.String getResourceKey() { + java.lang.Object ref = resourceKey_; + 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(); + resourceKey_ = s; + return s; + } + } + /** + * string resource_key = 1; + * @return The bytes for resourceKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceKeyBytes() { + java.lang.Object ref = resourceKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceValue_; + /** + * string resource_value = 2; + * @return The resourceValue. + */ + @java.lang.Override + public java.lang.String getResourceValue() { + java.lang.Object ref = resourceValue_; + 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(); + resourceValue_ = s; + return s; + } + } + /** + * string resource_value = 2; + * @return The bytes for resourceValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceValueBytes() { + java.lang.Object ref = resourceValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceValue_ = 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 (!getResourceKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceKey_); + } + if (!getResourceValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceKey_); + } + if (!getResourceValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceValue_); + } + 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 context.ContextOuterClass.ConfigRule_Custom)) { + return super.equals(obj); + } + context.ContextOuterClass.ConfigRule_Custom other = (context.ContextOuterClass.ConfigRule_Custom) obj; + + if (!getResourceKey() + .equals(other.getResourceKey())) return false; + if (!getResourceValue() + .equals(other.getResourceValue())) 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) + RESOURCE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getResourceKey().hashCode(); + hash = (37 * hash) + RESOURCE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getResourceValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static context.ContextOuterClass.ConfigRule_Custom parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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 context.ContextOuterClass.ConfigRule_Custom parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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 context.ContextOuterClass.ConfigRule_Custom parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static context.ContextOuterClass.ConfigRule_Custom 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(context.ContextOuterClass.ConfigRule_Custom 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 context.ConfigRule_Custom} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:context.ConfigRule_Custom) + context.ContextOuterClass.ConfigRule_CustomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule_Custom.class, context.ContextOuterClass.ConfigRule_Custom.Builder.class); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(builderForValue.build()); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(builderForValue.build()); - } - return this; + + // Construct using context.ContextOuterClass.ConfigRule_Custom.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addServiceConstraints( - int index, context.ContextOuterClass.Constraint.Builder builderForValue) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceConstraintsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder addAllServiceConstraints( - java.lang.Iterable values) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceConstraints_); - onChanged(); - } else { - serviceConstraintsBuilder_.addAllMessages(values); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { } - return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder clearServiceConstraints() { - if (serviceConstraintsBuilder_ == null) { - serviceConstraints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - serviceConstraintsBuilder_.clear(); - } + @java.lang.Override + public Builder clear() { + super.clear(); + resourceKey_ = ""; + + resourceValue_ = ""; + return this; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public Builder removeServiceConstraints(int index) { - if (serviceConstraintsBuilder_ == null) { - ensureServiceConstraintsIsMutable(); - serviceConstraints_.remove(index); - onChanged(); - } else { - serviceConstraintsBuilder_.remove(index); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return context.ContextOuterClass.internal_static_context_ConfigRule_Custom_descriptor; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder getServiceConstraintsBuilder( - int index) { - return getServiceConstraintsFieldBuilder().getBuilder(index); + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.ConstraintOrBuilder getServiceConstraintsOrBuilder( - int index) { - if (serviceConstraintsBuilder_ == null) { - return serviceConstraints_.get(index); } else { - return serviceConstraintsBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom build() { + context.ContextOuterClass.ConfigRule_Custom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public java.util.List - getServiceConstraintsOrBuilderList() { - if (serviceConstraintsBuilder_ != null) { - return serviceConstraintsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceConstraints_); - } + + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom buildPartial() { + context.ContextOuterClass.ConfigRule_Custom result = new context.ContextOuterClass.ConfigRule_Custom(this); + result.resourceKey_ = resourceKey_; + result.resourceValue_ = resourceValue_; + onBuilt(); + return result; } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder() { - return getServiceConstraintsFieldBuilder().addBuilder( - context.ContextOuterClass.Constraint.getDefaultInstance()); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public context.ContextOuterClass.Constraint.Builder addServiceConstraintsBuilder( - int index) { - return getServiceConstraintsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Constraint.getDefaultInstance()); + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - * repeated .context.Constraint service_constraints = 4; - */ - public java.util.List - getServiceConstraintsBuilderList() { - return getServiceConstraintsFieldBuilder().getBuilderList(); + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder> - getServiceConstraintsFieldBuilder() { - if (serviceConstraintsBuilder_ == null) { - serviceConstraintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Constraint, context.ContextOuterClass.Constraint.Builder, context.ContextOuterClass.ConstraintOrBuilder>( - serviceConstraints_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - serviceConstraints_ = null; - } - return serviceConstraintsBuilder_; + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - - private context.ContextOuterClass.ServiceStatus serviceStatus_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> serviceStatusBuilder_; - /** - * .context.ServiceStatus service_status = 5; - * @return Whether the serviceStatus field is set. - */ - public boolean hasServiceStatus() { - return serviceStatusBuilder_ != null || serviceStatus_ != null; + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - * .context.ServiceStatus service_status = 5; - * @return The serviceStatus. - */ - public context.ContextOuterClass.ServiceStatus getServiceStatus() { - if (serviceStatusBuilder_ == null) { - return serviceStatus_ == null ? context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + @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 context.ContextOuterClass.ConfigRule_Custom) { + return mergeFrom((context.ContextOuterClass.ConfigRule_Custom)other); } else { - return serviceStatusBuilder_.getMessage(); + super.mergeFrom(other); + return this; } } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder setServiceStatus(context.ContextOuterClass.ServiceStatus value) { - if (serviceStatusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceStatus_ = value; + + public Builder mergeFrom(context.ContextOuterClass.ConfigRule_Custom other) { + if (other == context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance()) return this; + if (!other.getResourceKey().isEmpty()) { + resourceKey_ = other.resourceKey_; onChanged(); - } else { - serviceStatusBuilder_.setMessage(value); } - - return this; - } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder setServiceStatus( - context.ContextOuterClass.ServiceStatus.Builder builderForValue) { - if (serviceStatusBuilder_ == null) { - serviceStatus_ = builderForValue.build(); + if (!other.getResourceValue().isEmpty()) { + resourceValue_ = other.resourceValue_; onChanged(); - } else { - serviceStatusBuilder_.setMessage(builderForValue.build()); } - + this.mergeUnknownFields(other.unknownFields); + onChanged(); return this; } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder mergeServiceStatus(context.ContextOuterClass.ServiceStatus value) { - if (serviceStatusBuilder_ == null) { - if (serviceStatus_ != null) { - serviceStatus_ = - context.ContextOuterClass.ServiceStatus.newBuilder(serviceStatus_).mergeFrom(value).buildPartial(); - } else { - serviceStatus_ = value; - } - onChanged(); - } else { - serviceStatusBuilder_.mergeFrom(value); - } - return this; + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * .context.ServiceStatus service_status = 5; - */ - public Builder clearServiceStatus() { - if (serviceStatusBuilder_ == null) { - serviceStatus_ = null; - onChanged(); - } else { - serviceStatus_ = null; - serviceStatusBuilder_ = null; - } + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.ConfigRule_Custom parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.ConfigRule_Custom) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } return this; } + + private java.lang.Object resourceKey_ = ""; /** - * .context.ServiceStatus service_status = 5; - */ - public context.ContextOuterClass.ServiceStatus.Builder getServiceStatusBuilder() { - - onChanged(); - return getServiceStatusFieldBuilder().getBuilder(); - } - /** - * .context.ServiceStatus service_status = 5; + * string resource_key = 1; + * @return The resourceKey. */ - public context.ContextOuterClass.ServiceStatusOrBuilder getServiceStatusOrBuilder() { - if (serviceStatusBuilder_ != null) { - return serviceStatusBuilder_.getMessageOrBuilder(); + public java.lang.String getResourceKey() { + java.lang.Object ref = resourceKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceKey_ = s; + return s; } else { - return serviceStatus_ == null ? - context.ContextOuterClass.ServiceStatus.getDefaultInstance() : serviceStatus_; + return (java.lang.String) ref; } } /** - * .context.ServiceStatus service_status = 5; + * string resource_key = 1; + * @return The bytes for resourceKey. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder> - getServiceStatusFieldBuilder() { - if (serviceStatusBuilder_ == null) { - serviceStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceStatus, context.ContextOuterClass.ServiceStatus.Builder, context.ContextOuterClass.ServiceStatusOrBuilder>( - getServiceStatus(), - getParentForChildren(), - isClean()); - serviceStatus_ = null; + public com.google.protobuf.ByteString + getResourceKeyBytes() { + java.lang.Object ref = resourceKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - return serviceStatusBuilder_; - } - - private context.ContextOuterClass.ServiceConfig serviceConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> serviceConfigBuilder_; - /** - * .context.ServiceConfig service_config = 6; - * @return Whether the serviceConfig field is set. - */ - public boolean hasServiceConfig() { - return serviceConfigBuilder_ != null || serviceConfig_ != null; } /** - * .context.ServiceConfig service_config = 6; - * @return The serviceConfig. + * string resource_key = 1; + * @param value The resourceKey to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceConfig getServiceConfig() { - if (serviceConfigBuilder_ == null) { - return serviceConfig_ == null ? context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; - } else { - return serviceConfigBuilder_.getMessage(); - } + public Builder setResourceKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceKey_ = value; + onChanged(); + return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_key = 1; + * @return This builder for chaining. */ - public Builder setServiceConfig(context.ContextOuterClass.ServiceConfig value) { - if (serviceConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceConfig_ = value; - onChanged(); - } else { - serviceConfigBuilder_.setMessage(value); - } - + public Builder clearResourceKey() { + + resourceKey_ = getDefaultInstance().getResourceKey(); + onChanged(); return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_key = 1; + * @param value The bytes for resourceKey to set. + * @return This builder for chaining. */ - public Builder setServiceConfig( - context.ContextOuterClass.ServiceConfig.Builder builderForValue) { - if (serviceConfigBuilder_ == null) { - serviceConfig_ = builderForValue.build(); - onChanged(); - } else { - serviceConfigBuilder_.setMessage(builderForValue.build()); - } - + public Builder setResourceKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceKey_ = value; + onChanged(); return this; } + + private java.lang.Object resourceValue_ = ""; /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return The resourceValue. */ - public Builder mergeServiceConfig(context.ContextOuterClass.ServiceConfig value) { - if (serviceConfigBuilder_ == null) { - if (serviceConfig_ != null) { - serviceConfig_ = - context.ContextOuterClass.ServiceConfig.newBuilder(serviceConfig_).mergeFrom(value).buildPartial(); - } else { - serviceConfig_ = value; - } - onChanged(); + public java.lang.String getResourceValue() { + java.lang.Object ref = resourceValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceValue_ = s; + return s; } else { - serviceConfigBuilder_.mergeFrom(value); + return (java.lang.String) ref; } - - return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return The bytes for resourceValue. */ - public Builder clearServiceConfig() { - if (serviceConfigBuilder_ == null) { - serviceConfig_ = null; - onChanged(); + public com.google.protobuf.ByteString + getResourceValueBytes() { + java.lang.Object ref = resourceValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceValue_ = b; + return b; } else { - serviceConfig_ = null; - serviceConfigBuilder_ = null; + return (com.google.protobuf.ByteString) ref; } - - return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @param value The resourceValue to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceConfig.Builder getServiceConfigBuilder() { - + public Builder setResourceValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceValue_ = value; onChanged(); - return getServiceConfigFieldBuilder().getBuilder(); - } - /** - * .context.ServiceConfig service_config = 6; - */ - public context.ContextOuterClass.ServiceConfigOrBuilder getServiceConfigOrBuilder() { - if (serviceConfigBuilder_ != null) { - return serviceConfigBuilder_.getMessageOrBuilder(); - } else { - return serviceConfig_ == null ? - context.ContextOuterClass.ServiceConfig.getDefaultInstance() : serviceConfig_; - } + return this; } /** - * .context.ServiceConfig service_config = 6; + * string resource_value = 2; + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder> - getServiceConfigFieldBuilder() { - if (serviceConfigBuilder_ == null) { - serviceConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceConfig, context.ContextOuterClass.ServiceConfig.Builder, context.ContextOuterClass.ServiceConfigOrBuilder>( - getServiceConfig(), - getParentForChildren(), - isClean()); - serviceConfig_ = null; - } - return serviceConfigBuilder_; + public Builder clearResourceValue() { + + resourceValue_ = getDefaultInstance().getResourceValue(); + onChanged(); + return this; + } + /** + * string resource_value = 2; + * @param value The bytes for resourceValue to set. + * @return This builder for chaining. + */ + public Builder setResourceValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceValue_ = value; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -23885,82 +49277,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Service) + // @@protoc_insertion_point(builder_scope:context.ConfigRule_Custom) } - // @@protoc_insertion_point(class_scope:context.Service) - private static final context.ContextOuterClass.Service DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule_Custom) + private static final context.ContextOuterClass.ConfigRule_Custom DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Service(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule_Custom(); } - public static context.ContextOuterClass.Service getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule_Custom getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Service parsePartialFrom( + public ConfigRule_Custom parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Service(input, extensionRegistry); + return new ConfigRule_Custom(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Service getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule_Custom getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceStatusOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceStatus) + public interface ConfigRule_ACLOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule_ACL) com.google.protobuf.MessageOrBuilder { /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - int getServiceStatusValue(); + boolean hasEndpointId(); /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - context.ContextOuterClass.ServiceStatusEnum getServiceStatus(); + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 1; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + boolean hasRuleSet(); + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + acl.Acl.AclRuleSet getRuleSet(); + /** + * .acl.AclRuleSet rule_set = 2; + */ + acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder(); } /** - * Protobuf type {@code context.ServiceStatus} + * Protobuf type {@code context.ConfigRule_ACL} */ - public static final class ServiceStatus extends + public static final class ConfigRule_ACL extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceStatus) - ServiceStatusOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConfigRule_ACL) + ConfigRule_ACLOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceStatus.newBuilder() to construct. - private ServiceStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConfigRule_ACL.newBuilder() to construct. + private ConfigRule_ACL(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceStatus() { - serviceStatus_ = 0; + private ConfigRule_ACL() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceStatus(); + return new ConfigRule_ACL(); } @java.lang.Override @@ -23968,7 +49378,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceStatus( + private ConfigRule_ACL( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -23986,10 +49396,30 @@ public final class ContextOuterClass { case 0: done = true; break; - case 8: { - int rawValue = input.readEnum(); + case 10: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + acl.Acl.AclRuleSet.Builder subBuilder = null; + if (ruleSet_ != null) { + subBuilder = ruleSet_.toBuilder(); + } + ruleSet_ = input.readMessage(acl.Acl.AclRuleSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(ruleSet_); + ruleSet_ = subBuilder.buildPartial(); + } - serviceStatus_ = rawValue; break; } default: { @@ -24013,34 +49443,67 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + context.ContextOuterClass.ConfigRule_ACL.class, context.ContextOuterClass.ConfigRule_ACL.Builder.class); } - public static final int SERVICE_STATUS_FIELD_NUMBER = 1; - private int serviceStatus_; + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override public int getServiceStatusValue() { - return serviceStatus_; + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - @java.lang.Override public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); - return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int RULE_SET_FIELD_NUMBER = 2; + private acl.Acl.AclRuleSet ruleSet_; + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + @java.lang.Override + public boolean hasRuleSet() { + return ruleSet_ != null; + } + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + @java.lang.Override + public acl.Acl.AclRuleSet getRuleSet() { + return ruleSet_ == null ? acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + @java.lang.Override + public acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder() { + return getRuleSet(); } private byte memoizedIsInitialized = -1; @@ -24057,8 +49520,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { - output.writeEnum(1, serviceStatus_); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); + } + if (ruleSet_ != null) { + output.writeMessage(2, getRuleSet()); } unknownFields.writeTo(output); } @@ -24069,9 +49535,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (serviceStatus_ != context.ContextOuterClass.ServiceStatusEnum.SERVICESTATUS_UNDEFINED.getNumber()) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, serviceStatus_); + .computeMessageSize(1, getEndpointId()); + } + if (ruleSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getRuleSet()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -24083,12 +49553,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceStatus)) { + if (!(obj instanceof context.ContextOuterClass.ConfigRule_ACL)) { return super.equals(obj); } - context.ContextOuterClass.ServiceStatus other = (context.ContextOuterClass.ServiceStatus) obj; + context.ContextOuterClass.ConfigRule_ACL other = (context.ContextOuterClass.ConfigRule_ACL) obj; - if (serviceStatus_ != other.serviceStatus_) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasRuleSet() != other.hasRuleSet()) return false; + if (hasRuleSet()) { + if (!getRuleSet() + .equals(other.getRuleSet())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24100,76 +49579,82 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SERVICE_STATUS_FIELD_NUMBER; - hash = (53 * hash) + serviceStatus_; + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasRuleSet()) { + hash = (37 * hash) + RULE_SET_FIELD_NUMBER; + hash = (53 * hash) + getRuleSet().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom(byte[] data) + public static context.ContextOuterClass.ConfigRule_ACL parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceStatus parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule_ACL parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL 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 context.ContextOuterClass.ServiceStatus parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule_ACL parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseDelimitedFrom( + public static context.ContextOuterClass.ConfigRule_ACL 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 context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceStatus parseFrom( + public static context.ContextOuterClass.ConfigRule_ACL parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -24182,7 +49667,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceStatus prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConfigRule_ACL prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -24198,26 +49683,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceStatus} + * Protobuf type {@code context.ConfigRule_ACL} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceStatus) - context.ContextOuterClass.ServiceStatusOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConfigRule_ACL) + context.ContextOuterClass.ConfigRule_ACLOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceStatus.class, context.ContextOuterClass.ServiceStatus.Builder.class); + context.ContextOuterClass.ConfigRule_ACL.class, context.ContextOuterClass.ConfigRule_ACL.Builder.class); } - // Construct using context.ContextOuterClass.ServiceStatus.newBuilder() + // Construct using context.ContextOuterClass.ConfigRule_ACL.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -24235,25 +49720,35 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - serviceStatus_ = 0; - + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceStatus_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_ACL_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceStatus.getDefaultInstance(); + public context.ContextOuterClass.ConfigRule_ACL getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceStatus build() { - context.ContextOuterClass.ServiceStatus result = buildPartial(); + public context.ContextOuterClass.ConfigRule_ACL build() { + context.ContextOuterClass.ConfigRule_ACL result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -24261,9 +49756,18 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceStatus buildPartial() { - context.ContextOuterClass.ServiceStatus result = new context.ContextOuterClass.ServiceStatus(this); - result.serviceStatus_ = serviceStatus_; + public context.ContextOuterClass.ConfigRule_ACL buildPartial() { + context.ContextOuterClass.ConfigRule_ACL result = new context.ContextOuterClass.ConfigRule_ACL(this); + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (ruleSetBuilder_ == null) { + result.ruleSet_ = ruleSet_; + } else { + result.ruleSet_ = ruleSetBuilder_.build(); + } onBuilt(); return result; } @@ -24302,18 +49806,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceStatus) { - return mergeFrom((context.ContextOuterClass.ServiceStatus)other); + if (other instanceof context.ContextOuterClass.ConfigRule_ACL) { + return mergeFrom((context.ContextOuterClass.ConfigRule_ACL)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceStatus other) { - if (other == context.ContextOuterClass.ServiceStatus.getDefaultInstance()) return this; - if (other.serviceStatus_ != 0) { - setServiceStatusValue(other.getServiceStatusValue()); + public Builder mergeFrom(context.ContextOuterClass.ConfigRule_ACL other) { + if (other == context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasRuleSet()) { + mergeRuleSet(other.getRuleSet()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -24330,11 +49837,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceStatus parsedMessage = null; + context.ContextOuterClass.ConfigRule_ACL parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceStatus) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConfigRule_ACL) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -24344,58 +49851,242 @@ public final class ContextOuterClass { return this; } - private int serviceStatus_ = 0; + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ServiceStatusEnum service_status = 1; - * @return The enum numeric value on the wire for serviceStatus. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override public int getServiceStatusValue() { - return serviceStatus_; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ServiceStatusEnum service_status = 1; - * @param value The enum numeric value on the wire for serviceStatus to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public Builder setServiceStatusValue(int value) { - - serviceStatus_ = value; - onChanged(); + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return The serviceStatus. + * .context.EndPointId endpoint_id = 1; */ - @java.lang.Override - public context.ContextOuterClass.ServiceStatusEnum getServiceStatus() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ServiceStatusEnum result = context.ContextOuterClass.ServiceStatusEnum.valueOf(serviceStatus_); - return result == null ? context.ContextOuterClass.ServiceStatusEnum.UNRECOGNIZED : result; + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @param value The serviceStatus to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder setServiceStatus(context.ContextOuterClass.ServiceStatusEnum value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; } + + return this; + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { - serviceStatus_ = value.getNumber(); onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 1; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private acl.Acl.AclRuleSet ruleSet_; + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder> ruleSetBuilder_; + /** + * .acl.AclRuleSet rule_set = 2; + * @return Whether the ruleSet field is set. + */ + public boolean hasRuleSet() { + return ruleSetBuilder_ != null || ruleSet_ != null; + } + /** + * .acl.AclRuleSet rule_set = 2; + * @return The ruleSet. + */ + public acl.Acl.AclRuleSet getRuleSet() { + if (ruleSetBuilder_ == null) { + return ruleSet_ == null ? acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } else { + return ruleSetBuilder_.getMessage(); + } + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder setRuleSet(acl.Acl.AclRuleSet value) { + if (ruleSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ruleSet_ = value; + onChanged(); + } else { + ruleSetBuilder_.setMessage(value); + } + return this; } /** - * .context.ServiceStatusEnum service_status = 1; - * @return This builder for chaining. + * .acl.AclRuleSet rule_set = 2; */ - public Builder clearServiceStatus() { + public Builder setRuleSet( + acl.Acl.AclRuleSet.Builder builderForValue) { + if (ruleSetBuilder_ == null) { + ruleSet_ = builderForValue.build(); + onChanged(); + } else { + ruleSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder mergeRuleSet(acl.Acl.AclRuleSet value) { + if (ruleSetBuilder_ == null) { + if (ruleSet_ != null) { + ruleSet_ = + acl.Acl.AclRuleSet.newBuilder(ruleSet_).mergeFrom(value).buildPartial(); + } else { + ruleSet_ = value; + } + onChanged(); + } else { + ruleSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public Builder clearRuleSet() { + if (ruleSetBuilder_ == null) { + ruleSet_ = null; + onChanged(); + } else { + ruleSet_ = null; + ruleSetBuilder_ = null; + } + + return this; + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public acl.Acl.AclRuleSet.Builder getRuleSetBuilder() { - serviceStatus_ = 0; onChanged(); - return this; + return getRuleSetFieldBuilder().getBuilder(); + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + public acl.Acl.AclRuleSetOrBuilder getRuleSetOrBuilder() { + if (ruleSetBuilder_ != null) { + return ruleSetBuilder_.getMessageOrBuilder(); + } else { + return ruleSet_ == null ? + acl.Acl.AclRuleSet.getDefaultInstance() : ruleSet_; + } + } + /** + * .acl.AclRuleSet rule_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder> + getRuleSetFieldBuilder() { + if (ruleSetBuilder_ == null) { + ruleSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + acl.Acl.AclRuleSet, acl.Acl.AclRuleSet.Builder, acl.Acl.AclRuleSetOrBuilder>( + getRuleSet(), + getParentForChildren(), + isClean()); + ruleSet_ = null; + } + return ruleSetBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -24410,95 +50101,114 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceStatus) + // @@protoc_insertion_point(builder_scope:context.ConfigRule_ACL) } - // @@protoc_insertion_point(class_scope:context.ServiceStatus) - private static final context.ContextOuterClass.ServiceStatus DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule_ACL) + private static final context.ContextOuterClass.ConfigRule_ACL DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceStatus(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule_ACL(); } - public static context.ContextOuterClass.ServiceStatus getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule_ACL getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceStatus parsePartialFrom( + public ConfigRule_ACL parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceStatus(input, extensionRegistry); + return new ConfigRule_ACL(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceStatus getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule_ACL getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceConfig) + public interface ConfigRuleOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.ConfigRule) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. */ - java.util.List - getConfigRulesList(); + int getActionValue(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The action. */ - context.ContextOuterClass.ConfigRule getConfigRules(int index); + context.ContextOuterClass.ConfigActionEnum getAction(); + /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. */ - int getConfigRulesCount(); + boolean hasCustom(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return The custom. */ - java.util.List - getConfigRulesOrBuilderList(); + context.ContextOuterClass.ConfigRule_Custom getCustom(); /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index); + context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder(); + + /** + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. + */ + boolean hasAcl(); + /** + * .context.ConfigRule_ACL acl = 3; + * @return The acl. + */ + context.ContextOuterClass.ConfigRule_ACL getAcl(); + /** + * .context.ConfigRule_ACL acl = 3; + */ + context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder(); + + public context.ContextOuterClass.ConfigRule.ConfigRuleCase getConfigRuleCase(); } /** - * Protobuf type {@code context.ServiceConfig} + * Protobuf type {@code context.ConfigRule} */ - public static final class ServiceConfig extends + public static final class ConfigRule extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceConfig) - ServiceConfigOrBuilder { + // @@protoc_insertion_point(message_implements:context.ConfigRule) + ConfigRuleOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceConfig.newBuilder() to construct. - private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use ConfigRule.newBuilder() to construct. + private ConfigRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceConfig() { - configRules_ = java.util.Collections.emptyList(); + private ConfigRule() { + action_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceConfig(); + return new ConfigRule(); } @java.lang.Override @@ -24506,7 +50216,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceConfig( + private ConfigRule( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -24514,7 +50224,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -24525,13 +50234,38 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + case 8: { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 18: { + context.ContextOuterClass.ConfigRule_Custom.Builder subBuilder = null; + if (configRuleCase_ == 2) { + subBuilder = ((context.ContextOuterClass.ConfigRule_Custom) configRule_).toBuilder(); } - configRules_.add( - input.readMessage(context.ContextOuterClass.ConfigRule.parser(), extensionRegistry)); + configRule_ = + input.readMessage(context.ContextOuterClass.ConfigRule_Custom.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.ConfigRule_Custom) configRule_); + configRule_ = subBuilder.buildPartial(); + } + configRuleCase_ = 2; + break; + } + case 26: { + context.ContextOuterClass.ConfigRule_ACL.Builder subBuilder = null; + if (configRuleCase_ == 3) { + subBuilder = ((context.ContextOuterClass.ConfigRule_ACL) configRule_).toBuilder(); + } + configRule_ = + input.readMessage(context.ContextOuterClass.ConfigRule_ACL.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.ConfigRule_ACL) configRule_); + configRule_ = subBuilder.buildPartial(); + } + configRuleCase_ = 3; break; } default: { @@ -24549,64 +50283,143 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + } + + private int configRuleCase_ = 0; + private java.lang.Object configRule_; + public enum ConfigRuleCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CUSTOM(2), + ACL(3), + CONFIGRULE_NOT_SET(0); + private final int value; + private ConfigRuleCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConfigRuleCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigRuleCase forNumber(int value) { + switch (value) { + case 2: return CUSTOM; + case 3: return ACL; + case 0: return CONFIGRULE_NOT_SET; + default: return null; } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); } + public int getNumber() { + return this.value; + } + }; + + public ConfigRuleCase + getConfigRuleCase() { + return ConfigRuleCase.forNumber( + configRuleCase_); } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_; + /** + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * .context.ConfigActionEnum action = 1; + * @return The action. + */ + @java.lang.Override public context.ContextOuterClass.ConfigActionEnum getAction() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); + return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; } + public static final int CUSTOM_FIELD_NUMBER = 2; + /** + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + public boolean hasCustom() { + return configRuleCase_ == 2; } - - public static final int CONFIG_RULES_FIELD_NUMBER = 1; - private java.util.List configRules_; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; + * @return The custom. */ @java.lang.Override - public java.util.List getConfigRulesList() { - return configRules_; + public context.ContextOuterClass.ConfigRule_Custom getCustom() { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ @java.lang.Override - public java.util.List - getConfigRulesOrBuilderList() { - return configRules_; + public context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder() { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } + + public static final int ACL_FIELD_NUMBER = 3; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. */ @java.lang.Override - public int getConfigRulesCount() { - return configRules_.size(); + public boolean hasAcl() { + return configRuleCase_ == 3; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return The acl. */ @java.lang.Override - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - return configRules_.get(index); + public context.ContextOuterClass.ConfigRule_ACL getAcl() { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ @java.lang.Override - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - return configRules_.get(index); + public context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder() { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -24623,8 +50436,14 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < configRules_.size(); i++) { - output.writeMessage(1, configRules_.get(i)); + if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { + output.writeEnum(1, action_); + } + if (configRuleCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.ConfigRule_Custom) configRule_); + } + if (configRuleCase_ == 3) { + output.writeMessage(3, (context.ContextOuterClass.ConfigRule_ACL) configRule_); } unknownFields.writeTo(output); } @@ -24635,9 +50454,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < configRules_.size(); i++) { + if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, configRules_.get(i)); + .computeEnumSize(1, action_); + } + if (configRuleCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (context.ContextOuterClass.ConfigRule_Custom) configRule_); + } + if (configRuleCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (context.ContextOuterClass.ConfigRule_ACL) configRule_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -24649,13 +50476,25 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceConfig)) { + if (!(obj instanceof context.ContextOuterClass.ConfigRule)) { return super.equals(obj); } - context.ContextOuterClass.ServiceConfig other = (context.ContextOuterClass.ServiceConfig) obj; + context.ContextOuterClass.ConfigRule other = (context.ContextOuterClass.ConfigRule) obj; - if (!getConfigRulesList() - .equals(other.getConfigRulesList())) return false; + if (action_ != other.action_) return false; + if (!getConfigRuleCase().equals(other.getConfigRuleCase())) return false; + switch (configRuleCase_) { + case 2: + if (!getCustom() + .equals(other.getCustom())) return false; + break; + case 3: + if (!getAcl() + .equals(other.getAcl())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -24667,78 +50506,88 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConfigRulesCount() > 0) { - hash = (37 * hash) + CONFIG_RULES_FIELD_NUMBER; - hash = (53 * hash) + getConfigRulesList().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + switch (configRuleCase_) { + case 2: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 3: + hash = (37 * hash) + ACL_FIELD_NUMBER; + hash = (53 * hash) + getAcl().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom(byte[] data) + public static context.ContextOuterClass.ConfigRule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceConfig parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule 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 context.ContextOuterClass.ServiceConfig parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.ConfigRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseDelimitedFrom( + public static context.ContextOuterClass.ConfigRule 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 context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceConfig parseFrom( + public static context.ContextOuterClass.ConfigRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -24751,7 +50600,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceConfig prototype) { + public static Builder newBuilder(context.ContextOuterClass.ConfigRule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -24767,26 +50616,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceConfig} + * Protobuf type {@code context.ConfigRule} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceConfig) - context.ContextOuterClass.ServiceConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:context.ConfigRule) + context.ContextOuterClass.ConfigRuleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceConfig.class, context.ContextOuterClass.ServiceConfig.Builder.class); + context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); } - // Construct using context.ContextOuterClass.ServiceConfig.newBuilder() + // Construct using context.ContextOuterClass.ConfigRule.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -24799,35 +50648,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConfigRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - configRulesBuilder_.clear(); - } + action_ = 0; + + configRuleCase_ = 0; + configRule_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceConfig_descriptor; + return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceConfig.getDefaultInstance(); + public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { + return context.ContextOuterClass.ConfigRule.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceConfig build() { - context.ContextOuterClass.ServiceConfig result = buildPartial(); + public context.ContextOuterClass.ConfigRule build() { + context.ContextOuterClass.ConfigRule result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -24835,18 +50681,24 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceConfig buildPartial() { - context.ContextOuterClass.ServiceConfig result = new context.ContextOuterClass.ServiceConfig(this); - int from_bitField0_ = bitField0_; - if (configRulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - configRules_ = java.util.Collections.unmodifiableList(configRules_); - bitField0_ = (bitField0_ & ~0x00000001); + public context.ContextOuterClass.ConfigRule buildPartial() { + context.ContextOuterClass.ConfigRule result = new context.ContextOuterClass.ConfigRule(this); + result.action_ = action_; + if (configRuleCase_ == 2) { + if (customBuilder_ == null) { + result.configRule_ = configRule_; + } else { + result.configRule_ = customBuilder_.build(); + } + } + if (configRuleCase_ == 3) { + if (aclBuilder_ == null) { + result.configRule_ = configRule_; + } else { + result.configRule_ = aclBuilder_.build(); } - result.configRules_ = configRules_; - } else { - result.configRules_ = configRulesBuilder_.build(); } + result.configRuleCase_ = configRuleCase_; onBuilt(); return result; } @@ -24885,40 +50737,30 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceConfig) { - return mergeFrom((context.ContextOuterClass.ServiceConfig)other); + if (other instanceof context.ContextOuterClass.ConfigRule) { + return mergeFrom((context.ContextOuterClass.ConfigRule)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceConfig other) { - if (other == context.ContextOuterClass.ServiceConfig.getDefaultInstance()) return this; - if (configRulesBuilder_ == null) { - if (!other.configRules_.isEmpty()) { - if (configRules_.isEmpty()) { - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConfigRulesIsMutable(); - configRules_.addAll(other.configRules_); - } - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.ConfigRule other) { + if (other == context.ContextOuterClass.ConfigRule.getDefaultInstance()) return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + switch (other.getConfigRuleCase()) { + case CUSTOM: { + mergeCustom(other.getCustom()); + break; } - } else { - if (!other.configRules_.isEmpty()) { - if (configRulesBuilder_.isEmpty()) { - configRulesBuilder_.dispose(); - configRulesBuilder_ = null; - configRules_ = other.configRules_; - bitField0_ = (bitField0_ & ~0x00000001); - configRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConfigRulesFieldBuilder() : null; - } else { - configRulesBuilder_.addAllMessages(other.configRules_); - } + case ACL: { + mergeAcl(other.getAcl()); + break; + } + case CONFIGRULE_NOT_SET: { + break; } } this.mergeUnknownFields(other.unknownFields); @@ -24936,11 +50778,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceConfig parsedMessage = null; + context.ContextOuterClass.ConfigRule parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceConfig) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.ConfigRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -24949,246 +50791,356 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; + private int configRuleCase_ = 0; + private java.lang.Object configRule_; + public ConfigRuleCase + getConfigRuleCase() { + return ConfigRuleCase.forNumber( + configRuleCase_); + } - private java.util.List configRules_ = - java.util.Collections.emptyList(); - private void ensureConfigRulesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - configRules_ = new java.util.ArrayList(configRules_); - bitField0_ |= 0x00000001; - } + public Builder clearConfigRule() { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> configRulesBuilder_; + private int action_ = 0; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return The enum numeric value on the wire for action. */ - public java.util.List getConfigRulesList() { - if (configRulesBuilder_ == null) { - return java.util.Collections.unmodifiableList(configRules_); - } else { - return configRulesBuilder_.getMessageList(); - } + @java.lang.Override public int getActionValue() { + return action_; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. */ - public int getConfigRulesCount() { - if (configRulesBuilder_ == null) { - return configRules_.size(); - } else { - return configRulesBuilder_.getCount(); + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * .context.ConfigActionEnum action = 1; + * @return The action. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigActionEnum getAction() { + @SuppressWarnings("deprecation") + context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); + return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; + } + /** + * .context.ConfigActionEnum action = 1; + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(context.ContextOuterClass.ConfigActionEnum value) { + if (value == null) { + throw new NullPointerException(); } + + action_ = value.getNumber(); + onChanged(); + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigActionEnum action = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.ConfigRule getConfigRules(int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder> customBuilder_; + /** + * .context.ConfigRule_Custom custom = 2; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return configRuleCase_ == 2; + } + /** + * .context.ConfigRule_Custom custom = 2; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_Custom getCustom() { + if (customBuilder_ == null) { + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } else { - return configRulesBuilder_.getMessage(index); + if (configRuleCase_ == 2) { + return customBuilder_.getMessage(); + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { + public Builder setCustom(context.ContextOuterClass.ConfigRule_Custom value) { + if (customBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConfigRulesIsMutable(); - configRules_.set(index, value); + configRule_ = value; onChanged(); } else { - configRulesBuilder_.setMessage(index, value); + customBuilder_.setMessage(value); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder setConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.set(index, builderForValue.build()); + public Builder setCustom( + context.ContextOuterClass.ConfigRule_Custom.Builder builderForValue) { + if (customBuilder_ == null) { + configRule_ = builderForValue.build(); onChanged(); } else { - configRulesBuilder_.setMessage(index, builderForValue.build()); + customBuilder_.setMessage(builderForValue.build()); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules(context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeCustom(context.ContextOuterClass.ConfigRule_Custom value) { + if (customBuilder_ == null) { + if (configRuleCase_ == 2 && + configRule_ != context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance()) { + configRule_ = context.ContextOuterClass.ConfigRule_Custom.newBuilder((context.ContextOuterClass.ConfigRule_Custom) configRule_) + .mergeFrom(value).buildPartial(); + } else { + configRule_ = value; } - ensureConfigRulesIsMutable(); - configRules_.add(value); onChanged(); } else { - configRulesBuilder_.addMessage(value); + if (configRuleCase_ == 2) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); } + configRuleCase_ = 2; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule value) { - if (configRulesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder clearCustom() { + if (customBuilder_ == null) { + if (configRuleCase_ == 2) { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); } - ensureConfigRulesIsMutable(); - configRules_.add(index, value); - onChanged(); } else { - configRulesBuilder_.addMessage(index, value); + if (configRuleCase_ == 2) { + configRuleCase_ = 0; + configRule_ = null; + } + customBuilder_.clear(); } return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(builderForValue.build()); - onChanged(); + public context.ContextOuterClass.ConfigRule_Custom.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * .context.ConfigRule_Custom custom = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_CustomOrBuilder getCustomOrBuilder() { + if ((configRuleCase_ == 2) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); } else { - configRulesBuilder_.addMessage(builderForValue.build()); + if (configRuleCase_ == 2) { + return (context.ContextOuterClass.ConfigRule_Custom) configRule_; + } + return context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); } - return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_Custom custom = 2; */ - public Builder addConfigRules( - int index, context.ContextOuterClass.ConfigRule.Builder builderForValue) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.add(index, builderForValue.build()); - onChanged(); - } else { - configRulesBuilder_.addMessage(index, builderForValue.build()); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(configRuleCase_ == 2)) { + configRule_ = context.ContextOuterClass.ConfigRule_Custom.getDefaultInstance(); + } + customBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_Custom, context.ContextOuterClass.ConfigRule_Custom.Builder, context.ContextOuterClass.ConfigRule_CustomOrBuilder>( + (context.ContextOuterClass.ConfigRule_Custom) configRule_, + getParentForChildren(), + isClean()); + configRule_ = null; } - return this; + configRuleCase_ = 2; + onChanged();; + return customBuilder_; } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder> aclBuilder_; /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; + * @return Whether the acl field is set. */ - public Builder addAllConfigRules( - java.lang.Iterable values) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, configRules_); - onChanged(); + @java.lang.Override + public boolean hasAcl() { + return configRuleCase_ == 3; + } + /** + * .context.ConfigRule_ACL acl = 3; + * @return The acl. + */ + @java.lang.Override + public context.ContextOuterClass.ConfigRule_ACL getAcl() { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } else { - configRulesBuilder_.addAllMessages(values); + if (configRuleCase_ == 3) { + return aclBuilder_.getMessage(); + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); } - return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public Builder clearConfigRules() { - if (configRulesBuilder_ == null) { - configRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setAcl(context.ContextOuterClass.ConfigRule_ACL value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + configRule_ = value; onChanged(); } else { - configRulesBuilder_.clear(); + aclBuilder_.setMessage(value); } + configRuleCase_ = 3; return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public Builder removeConfigRules(int index) { - if (configRulesBuilder_ == null) { - ensureConfigRulesIsMutable(); - configRules_.remove(index); + public Builder setAcl( + context.ContextOuterClass.ConfigRule_ACL.Builder builderForValue) { + if (aclBuilder_ == null) { + configRule_ = builderForValue.build(); onChanged(); } else { - configRulesBuilder_.remove(index); + aclBuilder_.setMessage(builderForValue.build()); } + configRuleCase_ = 3; return this; } /** - * repeated .context.ConfigRule config_rules = 1; - */ - public context.ContextOuterClass.ConfigRule.Builder getConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRuleOrBuilder getConfigRulesOrBuilder( - int index) { - if (configRulesBuilder_ == null) { - return configRules_.get(index); } else { - return configRulesBuilder_.getMessageOrBuilder(index); + public Builder mergeAcl(context.ContextOuterClass.ConfigRule_ACL value) { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3 && + configRule_ != context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance()) { + configRule_ = context.ContextOuterClass.ConfigRule_ACL.newBuilder((context.ContextOuterClass.ConfigRule_ACL) configRule_) + .mergeFrom(value).buildPartial(); + } else { + configRule_ = value; + } + onChanged(); + } else { + if (configRuleCase_ == 3) { + aclBuilder_.mergeFrom(value); + } + aclBuilder_.setMessage(value); } + configRuleCase_ = 3; + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public java.util.List - getConfigRulesOrBuilderList() { - if (configRulesBuilder_ != null) { - return configRulesBuilder_.getMessageOrBuilderList(); + public Builder clearAcl() { + if (aclBuilder_ == null) { + if (configRuleCase_ == 3) { + configRuleCase_ = 0; + configRule_ = null; + onChanged(); + } } else { - return java.util.Collections.unmodifiableList(configRules_); + if (configRuleCase_ == 3) { + configRuleCase_ = 0; + configRule_ = null; + } + aclBuilder_.clear(); } + return this; } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder() { - return getConfigRulesFieldBuilder().addBuilder( - context.ContextOuterClass.ConfigRule.getDefaultInstance()); + public context.ContextOuterClass.ConfigRule_ACL.Builder getAclBuilder() { + return getAclFieldBuilder().getBuilder(); } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public context.ContextOuterClass.ConfigRule.Builder addConfigRulesBuilder( - int index) { - return getConfigRulesFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConfigRule.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.ConfigRule_ACLOrBuilder getAclOrBuilder() { + if ((configRuleCase_ == 3) && (aclBuilder_ != null)) { + return aclBuilder_.getMessageOrBuilder(); + } else { + if (configRuleCase_ == 3) { + return (context.ContextOuterClass.ConfigRule_ACL) configRule_; + } + return context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); + } } /** - * repeated .context.ConfigRule config_rules = 1; + * .context.ConfigRule_ACL acl = 3; */ - public java.util.List - getConfigRulesBuilderList() { - return getConfigRulesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder> - getConfigRulesFieldBuilder() { - if (configRulesBuilder_ == null) { - configRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConfigRule, context.ContextOuterClass.ConfigRule.Builder, context.ContextOuterClass.ConfigRuleOrBuilder>( - configRules_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder> + getAclFieldBuilder() { + if (aclBuilder_ == null) { + if (!(configRuleCase_ == 3)) { + configRule_ = context.ContextOuterClass.ConfigRule_ACL.getDefaultInstance(); + } + aclBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ConfigRule_ACL, context.ContextOuterClass.ConfigRule_ACL.Builder, context.ContextOuterClass.ConfigRule_ACLOrBuilder>( + (context.ContextOuterClass.ConfigRule_ACL) configRule_, getParentForChildren(), isClean()); - configRules_ = null; + configRule_ = null; } - return configRulesBuilder_; + configRuleCase_ = 3; + onChanged();; + return aclBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -25203,95 +51155,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceConfig) + // @@protoc_insertion_point(builder_scope:context.ConfigRule) } - // @@protoc_insertion_point(class_scope:context.ServiceConfig) - private static final context.ContextOuterClass.ServiceConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.ConfigRule) + private static final context.ContextOuterClass.ConfigRule DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceConfig(); + DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule(); } - public static context.ContextOuterClass.ServiceConfig getDefaultInstance() { + public static context.ContextOuterClass.ConfigRule getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceConfig parsePartialFrom( + public ConfigRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceConfig(input, extensionRegistry); + return new ConfigRule(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceConfig getDefaultInstanceForType() { + public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceIdList) + public interface Constraint_CustomOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_Custom) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ServiceId service_ids = 1; - */ - java.util.List - getServiceIdsList(); - /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ - context.ContextOuterClass.ServiceId getServiceIds(int index); + java.lang.String getConstraintType(); /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ - int getServiceIdsCount(); + com.google.protobuf.ByteString + getConstraintTypeBytes(); + /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ - java.util.List - getServiceIdsOrBuilderList(); + java.lang.String getConstraintValue(); /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index); + com.google.protobuf.ByteString + getConstraintValueBytes(); } /** - * Protobuf type {@code context.ServiceIdList} + *
+   * ----- Constraint ----------------------------------------------------------------------------------------------------
+   * 
+ * + * Protobuf type {@code context.Constraint_Custom} */ - public static final class ServiceIdList extends + public static final class Constraint_Custom extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceIdList) - ServiceIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_Custom) + Constraint_CustomOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceIdList.newBuilder() to construct. - private ServiceIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_Custom.newBuilder() to construct. + private Constraint_Custom(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceIdList() { - serviceIds_ = java.util.Collections.emptyList(); + private Constraint_Custom() { + constraintType_ = ""; + constraintValue_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceIdList(); + return new Constraint_Custom(); } @java.lang.Override @@ -25299,7 +51256,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceIdList( + private Constraint_Custom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -25307,7 +51264,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -25319,12 +51275,15 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - serviceIds_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - serviceIds_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + constraintType_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + constraintValue_ = s; break; } default: { @@ -25342,64 +51301,97 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Custom_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + context.ContextOuterClass.Constraint_Custom.class, context.ContextOuterClass.Constraint_Custom.Builder.class); } - public static final int SERVICE_IDS_FIELD_NUMBER = 1; - private java.util.List serviceIds_; - /** - * repeated .context.ServiceId service_ids = 1; - */ - @java.lang.Override - public java.util.List getServiceIdsList() { - return serviceIds_; - } + public static final int CONSTRAINT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object constraintType_; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ @java.lang.Override - public java.util.List - getServiceIdsOrBuilderList() { - return serviceIds_; + public java.lang.String getConstraintType() { + java.lang.Object ref = constraintType_; + 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(); + constraintType_ = s; + return s; + } } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ @java.lang.Override - public int getServiceIdsCount() { - return serviceIds_.size(); + public com.google.protobuf.ByteString + getConstraintTypeBytes() { + java.lang.Object ref = constraintType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + + public static final int CONSTRAINT_VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object constraintValue_; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - return serviceIds_.get(index); + public java.lang.String getConstraintValue() { + java.lang.Object ref = constraintValue_; + 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(); + constraintValue_ = s; + return s; + } } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - return serviceIds_.get(index); + public com.google.protobuf.ByteString + getConstraintValueBytes() { + java.lang.Object ref = constraintValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -25416,8 +51408,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < serviceIds_.size(); i++) { - output.writeMessage(1, serviceIds_.get(i)); + if (!getConstraintTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraintType_); + } + if (!getConstraintValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, constraintValue_); } unknownFields.writeTo(output); } @@ -25428,9 +51423,11 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < serviceIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, serviceIds_.get(i)); + if (!getConstraintTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraintType_); + } + if (!getConstraintValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, constraintValue_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -25442,13 +51439,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceIdList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_Custom)) { return super.equals(obj); } - context.ContextOuterClass.ServiceIdList other = (context.ContextOuterClass.ServiceIdList) obj; + context.ContextOuterClass.Constraint_Custom other = (context.ContextOuterClass.Constraint_Custom) obj; - if (!getServiceIdsList() - .equals(other.getServiceIdsList())) return false; + if (!getConstraintType() + .equals(other.getConstraintType())) return false; + if (!getConstraintValue() + .equals(other.getConstraintValue())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -25460,78 +51459,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getServiceIdsCount() > 0) { - hash = (37 * hash) + SERVICE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getServiceIdsList().hashCode(); - } + hash = (37 * hash) + CONSTRAINT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getConstraintType().hashCode(); + hash = (37 * hash) + CONSTRAINT_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getConstraintValue().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_Custom parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Custom parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom 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 context.ContextOuterClass.ServiceIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Custom parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_Custom 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 context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceIdList parseFrom( + public static context.ContextOuterClass.Constraint_Custom parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -25544,7 +51543,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_Custom prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -25560,26 +51559,30 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceIdList} + *
+     * ----- Constraint ----------------------------------------------------------------------------------------------------
+     * 
+ * + * Protobuf type {@code context.Constraint_Custom} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceIdList) - context.ContextOuterClass.ServiceIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_Custom) + context.ContextOuterClass.Constraint_CustomOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Custom_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceIdList.class, context.ContextOuterClass.ServiceIdList.Builder.class); + context.ContextOuterClass.Constraint_Custom.class, context.ContextOuterClass.Constraint_Custom.Builder.class); } - // Construct using context.ContextOuterClass.ServiceIdList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_Custom.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -25592,35 +51595,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getServiceIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - serviceIdsBuilder_.clear(); - } + constraintType_ = ""; + + constraintValue_ = ""; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Custom_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceIdList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_Custom getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceIdList build() { - context.ContextOuterClass.ServiceIdList result = buildPartial(); + public context.ContextOuterClass.Constraint_Custom build() { + context.ContextOuterClass.Constraint_Custom result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -25628,18 +51628,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceIdList buildPartial() { - context.ContextOuterClass.ServiceIdList result = new context.ContextOuterClass.ServiceIdList(this); - int from_bitField0_ = bitField0_; - if (serviceIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - serviceIds_ = java.util.Collections.unmodifiableList(serviceIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.serviceIds_ = serviceIds_; - } else { - result.serviceIds_ = serviceIdsBuilder_.build(); - } + public context.ContextOuterClass.Constraint_Custom buildPartial() { + context.ContextOuterClass.Constraint_Custom result = new context.ContextOuterClass.Constraint_Custom(this); + result.constraintType_ = constraintType_; + result.constraintValue_ = constraintValue_; onBuilt(); return result; } @@ -25678,41 +51670,23 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceIdList) { - return mergeFrom((context.ContextOuterClass.ServiceIdList)other); + if (other instanceof context.ContextOuterClass.Constraint_Custom) { + return mergeFrom((context.ContextOuterClass.Constraint_Custom)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceIdList other) { - if (other == context.ContextOuterClass.ServiceIdList.getDefaultInstance()) return this; - if (serviceIdsBuilder_ == null) { - if (!other.serviceIds_.isEmpty()) { - if (serviceIds_.isEmpty()) { - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServiceIdsIsMutable(); - serviceIds_.addAll(other.serviceIds_); - } - onChanged(); - } - } else { - if (!other.serviceIds_.isEmpty()) { - if (serviceIdsBuilder_.isEmpty()) { - serviceIdsBuilder_.dispose(); - serviceIdsBuilder_ = null; - serviceIds_ = other.serviceIds_; - bitField0_ = (bitField0_ & ~0x00000001); - serviceIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceIdsFieldBuilder() : null; - } else { - serviceIdsBuilder_.addAllMessages(other.serviceIds_); - } - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_Custom other) { + if (other == context.ContextOuterClass.Constraint_Custom.getDefaultInstance()) return this; + if (!other.getConstraintType().isEmpty()) { + constraintType_ = other.constraintType_; + onChanged(); + } + if (!other.getConstraintValue().isEmpty()) { + constraintValue_ = other.constraintValue_; + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -25729,11 +51703,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceIdList parsedMessage = null; + context.ContextOuterClass.Constraint_Custom parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_Custom) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -25742,246 +51716,157 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List serviceIds_ = - java.util.Collections.emptyList(); - private void ensureServiceIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - serviceIds_ = new java.util.ArrayList(serviceIds_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdsBuilder_; + private java.lang.Object constraintType_ = ""; /** - * repeated .context.ServiceId service_ids = 1; - */ - public java.util.List getServiceIdsList() { - if (serviceIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceIds_); - } else { - return serviceIdsBuilder_.getMessageList(); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public int getServiceIdsCount() { - if (serviceIdsBuilder_ == null) { - return serviceIds_.size(); - } else { - return serviceIdsBuilder_.getCount(); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId getServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); - } else { - return serviceIdsBuilder_.getMessage(index); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.set(index, value); - onChanged(); - } else { - serviceIdsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The constraintType. */ - public Builder setServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.set(index, builderForValue.build()); - onChanged(); + public java.lang.String getConstraintType() { + java.lang.Object ref = constraintType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraintType_ = s; + return s; } else { - serviceIdsBuilder_.setMessage(index, builderForValue.build()); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return The bytes for constraintType. */ - public Builder addServiceIds(context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.add(value); - onChanged(); + public com.google.protobuf.ByteString + getConstraintTypeBytes() { + java.lang.Object ref = constraintType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintType_ = b; + return b; } else { - serviceIdsBuilder_.addMessage(value); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @param value The constraintType to set. + * @return This builder for chaining. */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceIdsIsMutable(); - serviceIds_.add(index, value); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(index, value); - } + public Builder setConstraintType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + constraintType_ = value; + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @return This builder for chaining. */ - public Builder addServiceIds( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(builderForValue.build()); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder clearConstraintType() { + + constraintType_ = getDefaultInstance().getConstraintType(); + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_type = 1; + * @param value The bytes for constraintType to set. + * @return This builder for chaining. */ - public Builder addServiceIds( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceIdsBuilder_.addMessage(index, builderForValue.build()); - } + public Builder setConstraintTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + constraintType_ = value; + onChanged(); return this; } + + private java.lang.Object constraintValue_ = ""; /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The constraintValue. */ - public Builder addAllServiceIds( - java.lang.Iterable values) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceIds_); - onChanged(); + public java.lang.String getConstraintValue() { + java.lang.Object ref = constraintValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + constraintValue_ = s; + return s; } else { - serviceIdsBuilder_.addAllMessages(values); + return (java.lang.String) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return The bytes for constraintValue. */ - public Builder clearServiceIds() { - if (serviceIdsBuilder_ == null) { - serviceIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + public com.google.protobuf.ByteString + getConstraintValueBytes() { + java.lang.Object ref = constraintValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + constraintValue_ = b; + return b; } else { - serviceIdsBuilder_.clear(); + return (com.google.protobuf.ByteString) ref; } - return this; } /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @param value The constraintValue to set. + * @return This builder for chaining. */ - public Builder removeServiceIds(int index) { - if (serviceIdsBuilder_ == null) { - ensureServiceIdsIsMutable(); - serviceIds_.remove(index); - onChanged(); - } else { - serviceIdsBuilder_.remove(index); - } + public Builder setConstraintValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + constraintValue_ = value; + onChanged(); return this; } /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdsBuilder( - int index) { - return getServiceIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdsOrBuilder( - int index) { - if (serviceIdsBuilder_ == null) { - return serviceIds_.get(index); } else { - return serviceIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public java.util.List - getServiceIdsOrBuilderList() { - if (serviceIdsBuilder_ != null) { - return serviceIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(serviceIds_); - } - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder() { - return getServiceIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); - } - /** - * repeated .context.ServiceId service_ids = 1; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceIdsBuilder( - int index) { - return getServiceIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); - } - /** - * repeated .context.ServiceId service_ids = 1; + * string constraint_value = 2; + * @return This builder for chaining. */ - public java.util.List - getServiceIdsBuilderList() { - return getServiceIdsFieldBuilder().getBuilderList(); + public Builder clearConstraintValue() { + + constraintValue_ = getDefaultInstance().getConstraintValue(); + onChanged(); + return this; } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdsFieldBuilder() { - if (serviceIdsBuilder_ == null) { - serviceIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - serviceIds_ = null; - } - return serviceIdsBuilder_; + /** + * string constraint_value = 2; + * @param value The bytes for constraintValue to set. + * @return This builder for chaining. + */ + public Builder setConstraintValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + constraintValue_ = value; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -25996,95 +51881,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceIdList) + // @@protoc_insertion_point(builder_scope:context.Constraint_Custom) } - // @@protoc_insertion_point(class_scope:context.ServiceIdList) - private static final context.ContextOuterClass.ServiceIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_Custom) + private static final context.ContextOuterClass.Constraint_Custom DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_Custom(); } - public static context.ContextOuterClass.ServiceIdList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_Custom getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceIdList parsePartialFrom( + public Constraint_Custom parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceIdList(input, extensionRegistry); + return new Constraint_Custom(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceIdList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_Custom getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceList) + public interface Constraint_ScheduleOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_Schedule) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Service services = 1; - */ - java.util.List - getServicesList(); - /** - * repeated .context.Service services = 1; - */ - context.ContextOuterClass.Service getServices(int index); - /** - * repeated .context.Service services = 1; - */ - int getServicesCount(); - /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ - java.util.List - getServicesOrBuilderList(); + float getStartTimestamp(); + /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ - context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index); + float getDurationDays(); } /** - * Protobuf type {@code context.ServiceList} + * Protobuf type {@code context.Constraint_Schedule} */ - public static final class ServiceList extends + public static final class Constraint_Schedule extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceList) - ServiceListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_Schedule) + Constraint_ScheduleOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceList.newBuilder() to construct. - private ServiceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_Schedule.newBuilder() to construct. + private Constraint_Schedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceList() { - services_ = java.util.Collections.emptyList(); + private Constraint_Schedule() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceList(); + return new Constraint_Schedule(); } @java.lang.Override @@ -26092,7 +51964,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceList( + private Constraint_Schedule( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -26100,7 +51972,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -26111,13 +51982,14 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - services_.add( - input.readMessage(context.ContextOuterClass.Service.parser(), extensionRegistry)); + case 13: { + + startTimestamp_ = input.readFloat(); + break; + } + case 21: { + + durationDays_ = input.readFloat(); break; } default: { @@ -26135,64 +52007,43 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + context.ContextOuterClass.Constraint_Schedule.class, context.ContextOuterClass.Constraint_Schedule.Builder.class); } - public static final int SERVICES_FIELD_NUMBER = 1; - private java.util.List services_; - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public java.util.List getServicesList() { - return services_; - } - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public java.util.List - getServicesOrBuilderList() { - return services_; - } - /** - * repeated .context.Service services = 1; - */ - @java.lang.Override - public int getServicesCount() { - return services_.size(); - } + public static final int START_TIMESTAMP_FIELD_NUMBER = 1; + private float startTimestamp_; /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ @java.lang.Override - public context.ContextOuterClass.Service getServices(int index) { - return services_.get(index); + public float getStartTimestamp() { + return startTimestamp_; } + + public static final int DURATION_DAYS_FIELD_NUMBER = 2; + private float durationDays_; /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ @java.lang.Override - public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index) { - return services_.get(index); + public float getDurationDays() { + return durationDays_; } private byte memoizedIsInitialized = -1; @@ -26209,8 +52060,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < services_.size(); i++) { - output.writeMessage(1, services_.get(i)); + if (startTimestamp_ != 0F) { + output.writeFloat(1, startTimestamp_); + } + if (durationDays_ != 0F) { + output.writeFloat(2, durationDays_); } unknownFields.writeTo(output); } @@ -26221,9 +52075,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < services_.size(); i++) { + if (startTimestamp_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, services_.get(i)); + .computeFloatSize(1, startTimestamp_); + } + if (durationDays_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, durationDays_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -26235,13 +52093,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_Schedule)) { return super.equals(obj); } - context.ContextOuterClass.ServiceList other = (context.ContextOuterClass.ServiceList) obj; + context.ContextOuterClass.Constraint_Schedule other = (context.ContextOuterClass.Constraint_Schedule) obj; - if (!getServicesList() - .equals(other.getServicesList())) return false; + if (java.lang.Float.floatToIntBits(getStartTimestamp()) + != java.lang.Float.floatToIntBits( + other.getStartTimestamp())) return false; + if (java.lang.Float.floatToIntBits(getDurationDays()) + != java.lang.Float.floatToIntBits( + other.getDurationDays())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -26253,78 +52115,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getServicesCount() > 0) { - hash = (37 * hash) + SERVICES_FIELD_NUMBER; - hash = (53 * hash) + getServicesList().hashCode(); - } + hash = (37 * hash) + START_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getStartTimestamp()); + hash = (37 * hash) + DURATION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getDurationDays()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_Schedule parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Schedule parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule 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 context.ContextOuterClass.ServiceList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_Schedule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_Schedule 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 context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceList parseFrom( + public static context.ContextOuterClass.Constraint_Schedule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -26337,7 +52201,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_Schedule prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -26353,26 +52217,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceList} + * Protobuf type {@code context.Constraint_Schedule} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceList) - context.ContextOuterClass.ServiceListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_Schedule) + context.ContextOuterClass.Constraint_ScheduleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceList.class, context.ContextOuterClass.ServiceList.Builder.class); + context.ContextOuterClass.Constraint_Schedule.class, context.ContextOuterClass.Constraint_Schedule.Builder.class); } - // Construct using context.ContextOuterClass.ServiceList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_Schedule.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -26385,35 +52249,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getServicesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - servicesBuilder_.clear(); - } + startTimestamp_ = 0F; + + durationDays_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_Schedule_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_Schedule getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceList build() { - context.ContextOuterClass.ServiceList result = buildPartial(); + public context.ContextOuterClass.Constraint_Schedule build() { + context.ContextOuterClass.Constraint_Schedule result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -26421,18 +52282,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceList buildPartial() { - context.ContextOuterClass.ServiceList result = new context.ContextOuterClass.ServiceList(this); - int from_bitField0_ = bitField0_; - if (servicesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - services_ = java.util.Collections.unmodifiableList(services_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.services_ = services_; - } else { - result.services_ = servicesBuilder_.build(); - } + public context.ContextOuterClass.Constraint_Schedule buildPartial() { + context.ContextOuterClass.Constraint_Schedule result = new context.ContextOuterClass.Constraint_Schedule(this); + result.startTimestamp_ = startTimestamp_; + result.durationDays_ = durationDays_; onBuilt(); return result; } @@ -26471,41 +52324,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceList) { - return mergeFrom((context.ContextOuterClass.ServiceList)other); + if (other instanceof context.ContextOuterClass.Constraint_Schedule) { + return mergeFrom((context.ContextOuterClass.Constraint_Schedule)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceList other) { - if (other == context.ContextOuterClass.ServiceList.getDefaultInstance()) return this; - if (servicesBuilder_ == null) { - if (!other.services_.isEmpty()) { - if (services_.isEmpty()) { - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureServicesIsMutable(); - services_.addAll(other.services_); - } - onChanged(); - } - } else { - if (!other.services_.isEmpty()) { - if (servicesBuilder_.isEmpty()) { - servicesBuilder_.dispose(); - servicesBuilder_ = null; - services_ = other.services_; - bitField0_ = (bitField0_ & ~0x00000001); - servicesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServicesFieldBuilder() : null; - } else { - servicesBuilder_.addAllMessages(other.services_); - } - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_Schedule other) { + if (other == context.ContextOuterClass.Constraint_Schedule.getDefaultInstance()) return this; + if (other.getStartTimestamp() != 0F) { + setStartTimestamp(other.getStartTimestamp()); + } + if (other.getDurationDays() != 0F) { + setDurationDays(other.getDurationDays()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -26522,11 +52355,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceList parsedMessage = null; + context.ContextOuterClass.Constraint_Schedule parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_Schedule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -26535,247 +52368,68 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List services_ = - java.util.Collections.emptyList(); - private void ensureServicesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - services_ = new java.util.ArrayList(services_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> servicesBuilder_; + private float startTimestamp_ ; /** - * repeated .context.Service services = 1; - */ - public java.util.List getServicesList() { - if (servicesBuilder_ == null) { - return java.util.Collections.unmodifiableList(services_); - } else { - return servicesBuilder_.getMessageList(); - } - } - /** - * repeated .context.Service services = 1; - */ - public int getServicesCount() { - if (servicesBuilder_ == null) { - return services_.size(); - } else { - return servicesBuilder_.getCount(); - } - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service getServices(int index) { - if (servicesBuilder_ == null) { - return services_.get(index); - } else { - return servicesBuilder_.getMessage(index); - } - } - /** - * repeated .context.Service services = 1; - */ - public Builder setServices( - int index, context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.set(index, value); - onChanged(); - } else { - servicesBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.Service services = 1; - */ - public Builder setServices( - int index, context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.set(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.Service services = 1; - */ - public Builder addServices(context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(value); - onChanged(); - } else { - servicesBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return The startTimestamp. */ - public Builder addServices( - int index, context.ContextOuterClass.Service value) { - if (servicesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServicesIsMutable(); - services_.add(index, value); - onChanged(); - } else { - servicesBuilder_.addMessage(index, value); - } - return this; + @java.lang.Override + public float getStartTimestamp() { + return startTimestamp_; } /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @param value The startTimestamp to set. + * @return This builder for chaining. */ - public Builder addServices( - context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(builderForValue.build()); - } + public Builder setStartTimestamp(float value) { + + startTimestamp_ = value; + onChanged(); return this; } /** - * repeated .context.Service services = 1; + * float start_timestamp = 1; + * @return This builder for chaining. */ - public Builder addServices( - int index, context.ContextOuterClass.Service.Builder builderForValue) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.add(index, builderForValue.build()); - onChanged(); - } else { - servicesBuilder_.addMessage(index, builderForValue.build()); - } + public Builder clearStartTimestamp() { + + startTimestamp_ = 0F; + onChanged(); return this; } + + private float durationDays_ ; /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return The durationDays. */ - public Builder addAllServices( - java.lang.Iterable values) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, services_); - onChanged(); - } else { - servicesBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public float getDurationDays() { + return durationDays_; } /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @param value The durationDays to set. + * @return This builder for chaining. */ - public Builder clearServices() { - if (servicesBuilder_ == null) { - services_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - servicesBuilder_.clear(); - } + public Builder setDurationDays(float value) { + + durationDays_ = value; + onChanged(); return this; } /** - * repeated .context.Service services = 1; + * float duration_days = 2; + * @return This builder for chaining. */ - public Builder removeServices(int index) { - if (servicesBuilder_ == null) { - ensureServicesIsMutable(); - services_.remove(index); - onChanged(); - } else { - servicesBuilder_.remove(index); - } + public Builder clearDurationDays() { + + durationDays_ = 0F; + onChanged(); return this; } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder getServicesBuilder( - int index) { - return getServicesFieldBuilder().getBuilder(index); - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.ServiceOrBuilder getServicesOrBuilder( - int index) { - if (servicesBuilder_ == null) { - return services_.get(index); } else { - return servicesBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.Service services = 1; - */ - public java.util.List - getServicesOrBuilderList() { - if (servicesBuilder_ != null) { - return servicesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(services_); - } - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder addServicesBuilder() { - return getServicesFieldBuilder().addBuilder( - context.ContextOuterClass.Service.getDefaultInstance()); - } - /** - * repeated .context.Service services = 1; - */ - public context.ContextOuterClass.Service.Builder addServicesBuilder( - int index) { - return getServicesFieldBuilder().addBuilder( - index, context.ContextOuterClass.Service.getDefaultInstance()); - } - /** - * repeated .context.Service services = 1; - */ - public java.util.List - getServicesBuilderList() { - return getServicesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder> - getServicesFieldBuilder() { - if (servicesBuilder_ == null) { - servicesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Service, context.ContextOuterClass.Service.Builder, context.ContextOuterClass.ServiceOrBuilder>( - services_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - services_ = null; - } - return servicesBuilder_; - } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -26789,100 +52443,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceList) + // @@protoc_insertion_point(builder_scope:context.Constraint_Schedule) } - // @@protoc_insertion_point(class_scope:context.ServiceList) - private static final context.ContextOuterClass.ServiceList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_Schedule) + private static final context.ContextOuterClass.Constraint_Schedule DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_Schedule(); } - public static context.ContextOuterClass.ServiceList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_Schedule getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceList parsePartialFrom( + public Constraint_Schedule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceList(input, extensionRegistry); + return new Constraint_Schedule(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_Schedule getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ServiceEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ServiceEvent) + public interface GPS_PositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.GPS_Position) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - * .context.Event event = 1; - * @return The event. - */ - context.ContextOuterClass.Event getEvent(); - /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + float getLatitude(); /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - boolean hasServiceId(); - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - context.ContextOuterClass.ServiceId getServiceId(); - /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + float getLongitude(); } /** - * Protobuf type {@code context.ServiceEvent} + * Protobuf type {@code context.GPS_Position} */ - public static final class ServiceEvent extends + public static final class GPS_Position extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ServiceEvent) - ServiceEventOrBuilder { + // @@protoc_insertion_point(message_implements:context.GPS_Position) + GPS_PositionOrBuilder { private static final long serialVersionUID = 0L; - // Use ServiceEvent.newBuilder() to construct. - private ServiceEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use GPS_Position.newBuilder() to construct. + private GPS_Position(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ServiceEvent() { + private GPS_Position() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ServiceEvent(); + return new GPS_Position(); } @java.lang.Override @@ -26890,7 +52526,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ServiceEvent( + private GPS_Position( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -26903,35 +52539,19 @@ public final class ContextOuterClass { try { boolean done = false; while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + latitude_ = input.readFloat(); break; } - case 18: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (serviceId_ != null) { - subBuilder = serviceId_.toBuilder(); - } - serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(serviceId_); - serviceId_ = subBuilder.buildPartial(); - } + case 21: { + longitude_ = input.readFloat(); break; } default: { @@ -26955,67 +52575,37 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_GPS_Position_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); + context.ContextOuterClass.GPS_Position.class, context.ContextOuterClass.GPS_Position.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } + public static final int LATITUDE_FIELD_NUMBER = 1; + private float latitude_; /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public float getLatitude() { + return latitude_; } - public static final int SERVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ServiceId serviceId_; - /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - @java.lang.Override - public boolean hasServiceId() { - return serviceId_ != null; - } - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceId() { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } + public static final int LONGITUDE_FIELD_NUMBER = 2; + private float longitude_; /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - return getServiceId(); + public float getLongitude() { + return longitude_; } private byte memoizedIsInitialized = -1; @@ -27032,11 +52622,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (event_ != null) { - output.writeMessage(1, getEvent()); + if (latitude_ != 0F) { + output.writeFloat(1, latitude_); } - if (serviceId_ != null) { - output.writeMessage(2, getServiceId()); + if (longitude_ != 0F) { + output.writeFloat(2, longitude_); } unknownFields.writeTo(output); } @@ -27047,13 +52637,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (event_ != null) { + if (latitude_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeFloatSize(1, latitude_); } - if (serviceId_ != null) { + if (longitude_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getServiceId()); + .computeFloatSize(2, longitude_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27065,21 +52655,17 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ServiceEvent)) { + if (!(obj instanceof context.ContextOuterClass.GPS_Position)) { return super.equals(obj); } - context.ContextOuterClass.ServiceEvent other = (context.ContextOuterClass.ServiceEvent) obj; + context.ContextOuterClass.GPS_Position other = (context.ContextOuterClass.GPS_Position) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (hasServiceId() != other.hasServiceId()) return false; - if (hasServiceId()) { - if (!getServiceId() - .equals(other.getServiceId())) return false; - } + if (java.lang.Float.floatToIntBits(getLatitude()) + != java.lang.Float.floatToIntBits( + other.getLatitude())) return false; + if (java.lang.Float.floatToIntBits(getLongitude()) + != java.lang.Float.floatToIntBits( + other.getLongitude())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -27091,82 +52677,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (hasServiceId()) { - hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getServiceId().hashCode(); - } + hash = (37 * hash) + LATITUDE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLatitude()); + hash = (37 * hash) + LONGITUDE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLongitude()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom(byte[] data) + public static context.ContextOuterClass.GPS_Position parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ServiceEvent parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.GPS_Position parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position 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 context.ContextOuterClass.ServiceEvent parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.GPS_Position parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseDelimitedFrom( + public static context.ContextOuterClass.GPS_Position 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 context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ServiceEvent parseFrom( + public static context.ContextOuterClass.GPS_Position parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -27179,7 +52763,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ServiceEvent prototype) { + public static Builder newBuilder(context.ContextOuterClass.GPS_Position prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -27195,26 +52779,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ServiceEvent} + * Protobuf type {@code context.GPS_Position} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ServiceEvent) - context.ContextOuterClass.ServiceEventOrBuilder { + // @@protoc_insertion_point(builder_implements:context.GPS_Position) + context.ContextOuterClass.GPS_PositionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_GPS_Position_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ServiceEvent.class, context.ContextOuterClass.ServiceEvent.Builder.class); + context.ContextOuterClass.GPS_Position.class, context.ContextOuterClass.GPS_Position.Builder.class); } - // Construct using context.ContextOuterClass.ServiceEvent.newBuilder() + // Construct using context.ContextOuterClass.GPS_Position.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -27232,35 +52816,27 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (serviceIdBuilder_ == null) { - serviceId_ = null; - } else { - serviceId_ = null; - serviceIdBuilder_ = null; - } + latitude_ = 0F; + + longitude_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ServiceEvent_descriptor; + return context.ContextOuterClass.internal_static_context_GPS_Position_descriptor; } @java.lang.Override - public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { - return context.ContextOuterClass.ServiceEvent.getDefaultInstance(); + public context.ContextOuterClass.GPS_Position getDefaultInstanceForType() { + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ServiceEvent build() { - context.ContextOuterClass.ServiceEvent result = buildPartial(); + public context.ContextOuterClass.GPS_Position build() { + context.ContextOuterClass.GPS_Position result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -27268,18 +52844,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ServiceEvent buildPartial() { - context.ContextOuterClass.ServiceEvent result = new context.ContextOuterClass.ServiceEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (serviceIdBuilder_ == null) { - result.serviceId_ = serviceId_; - } else { - result.serviceId_ = serviceIdBuilder_.build(); - } + public context.ContextOuterClass.GPS_Position buildPartial() { + context.ContextOuterClass.GPS_Position result = new context.ContextOuterClass.GPS_Position(this); + result.latitude_ = latitude_; + result.longitude_ = longitude_; onBuilt(); return result; } @@ -27318,21 +52886,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ServiceEvent) { - return mergeFrom((context.ContextOuterClass.ServiceEvent)other); + if (other instanceof context.ContextOuterClass.GPS_Position) { + return mergeFrom((context.ContextOuterClass.GPS_Position)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ServiceEvent other) { - if (other == context.ContextOuterClass.ServiceEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(context.ContextOuterClass.GPS_Position other) { + if (other == context.ContextOuterClass.GPS_Position.getDefaultInstance()) return this; + if (other.getLatitude() != 0F) { + setLatitude(other.getLatitude()); } - if (other.hasServiceId()) { - mergeServiceId(other.getServiceId()); + if (other.getLongitude() != 0F) { + setLongitude(other.getLongitude()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -27349,11 +52917,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ServiceEvent parsedMessage = null; + context.ContextOuterClass.GPS_Position parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ServiceEvent) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.GPS_Position) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -27363,242 +52931,66 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Event event_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; - /** - * .context.Event event = 1; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; - } - /** - * .context.Event event = 1; - * @return The event. - */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } - } - /** - * .context.Event event = 1; - */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.Event event = 1; - */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } - - return this; - } + private float latitude_ ; /** - * .context.Event event = 1; + * float latitude = 1; + * @return The latitude. */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getLatitude() { + return latitude_; } /** - * .context.Event event = 1; + * float latitude = 1; + * @param value The latitude to set. + * @return This builder for chaining. */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } - + public Builder setLatitude(float value) { + + latitude_ = value; + onChanged(); return this; } /** - * .context.Event event = 1; + * float latitude = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { + public Builder clearLatitude() { + latitude_ = 0F; onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - * .context.Event event = 1; - */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; - } - } - /** - * .context.Event event = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - - private context.ContextOuterClass.ServiceId serviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; - /** - * .context.ServiceId service_id = 2; - * @return Whether the serviceId field is set. - */ - public boolean hasServiceId() { - return serviceIdBuilder_ != null || serviceId_ != null; - } - /** - * .context.ServiceId service_id = 2; - * @return The serviceId. - */ - public context.ContextOuterClass.ServiceId getServiceId() { - if (serviceIdBuilder_ == null) { - return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } else { - return serviceIdBuilder_.getMessage(); - } - } - /** - * .context.ServiceId service_id = 2; - */ - public Builder setServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - serviceId_ = value; - onChanged(); - } else { - serviceIdBuilder_.setMessage(value); - } - return this; } - /** - * .context.ServiceId service_id = 2; - */ - public Builder setServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceIdBuilder_ == null) { - serviceId_ = builderForValue.build(); - onChanged(); - } else { - serviceIdBuilder_.setMessage(builderForValue.build()); - } - return this; - } + private float longitude_ ; /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return The longitude. */ - public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { - if (serviceIdBuilder_ == null) { - if (serviceId_ != null) { - serviceId_ = - context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); - } else { - serviceId_ = value; - } - onChanged(); - } else { - serviceIdBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getLongitude() { + return longitude_; } /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @param value The longitude to set. + * @return This builder for chaining. */ - public Builder clearServiceId() { - if (serviceIdBuilder_ == null) { - serviceId_ = null; - onChanged(); - } else { - serviceId_ = null; - serviceIdBuilder_ = null; - } - + public Builder setLongitude(float value) { + + longitude_ = value; + onChanged(); return this; } /** - * .context.ServiceId service_id = 2; + * float longitude = 2; + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + public Builder clearLongitude() { + longitude_ = 0F; onChanged(); - return getServiceIdFieldBuilder().getBuilder(); - } - /** - * .context.ServiceId service_id = 2; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { - if (serviceIdBuilder_ != null) { - return serviceIdBuilder_.getMessageOrBuilder(); - } else { - return serviceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; - } - } - /** - * .context.ServiceId service_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceIdFieldBuilder() { - if (serviceIdBuilder_ == null) { - serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getServiceId(), - getParentForChildren(), - isClean()); - serviceId_ = null; - } - return serviceIdBuilder_; + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -27613,119 +53005,104 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ServiceEvent) + // @@protoc_insertion_point(builder_scope:context.GPS_Position) } - // @@protoc_insertion_point(class_scope:context.ServiceEvent) - private static final context.ContextOuterClass.ServiceEvent DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.GPS_Position) + private static final context.ContextOuterClass.GPS_Position DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ServiceEvent(); + DEFAULT_INSTANCE = new context.ContextOuterClass.GPS_Position(); } - public static context.ContextOuterClass.ServiceEvent getDefaultInstance() { + public static context.ContextOuterClass.GPS_Position getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ServiceEvent parsePartialFrom( + public GPS_Position parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ServiceEvent(input, extensionRegistry); + return new GPS_Position(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ServiceEvent getDefaultInstanceForType() { + public context.ContextOuterClass.GPS_Position getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface EndPointIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.EndPointId) + public interface LocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Location) com.google.protobuf.MessageOrBuilder { /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. + * string region = 1; + * @return Whether the region field is set. */ - boolean hasTopologyId(); + boolean hasRegion(); /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. + * string region = 1; + * @return The region. */ - context.ContextOuterClass.TopologyId getTopologyId(); + java.lang.String getRegion(); /** - * .context.TopologyId topology_id = 1; + * string region = 1; + * @return The bytes for region. */ - context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder(); + com.google.protobuf.ByteString + getRegionBytes(); /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ - boolean hasDeviceId(); + boolean hasGpsPosition(); /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ - context.ContextOuterClass.DeviceId getDeviceId(); + context.ContextOuterClass.GPS_Position getGpsPosition(); /** - * .context.DeviceId device_id = 2; + * .context.GPS_Position gps_position = 2; */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder(); - /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. - */ - boolean hasEndpointUuid(); - /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. - */ - context.ContextOuterClass.Uuid getEndpointUuid(); - /** - * .context.Uuid endpoint_uuid = 3; - */ - context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder(); + public context.ContextOuterClass.Location.LocationCase getLocationCase(); } /** - *
-   * ----- Endpoint ------------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.EndPointId} + * Protobuf type {@code context.Location} */ - public static final class EndPointId extends + public static final class Location extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.EndPointId) - EndPointIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Location) + LocationOrBuilder { private static final long serialVersionUID = 0L; - // Use EndPointId.newBuilder() to construct. - private EndPointId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private EndPointId() { + private Location() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new EndPointId(); + return new Location(); } @java.lang.Override @@ -27733,7 +53110,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private EndPointId( + private Location( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -27752,42 +53129,23 @@ public final class ContextOuterClass { done = true; break; case 10: { - context.ContextOuterClass.TopologyId.Builder subBuilder = null; - if (topologyId_ != null) { - subBuilder = topologyId_.toBuilder(); - } - topologyId_ = input.readMessage(context.ContextOuterClass.TopologyId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(topologyId_); - topologyId_ = subBuilder.buildPartial(); - } - + java.lang.String s = input.readStringRequireUtf8(); + locationCase_ = 1; + location_ = s; break; } case 18: { - context.ContextOuterClass.DeviceId.Builder subBuilder = null; - if (deviceId_ != null) { - subBuilder = deviceId_.toBuilder(); - } - deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deviceId_); - deviceId_ = subBuilder.buildPartial(); + context.ContextOuterClass.GPS_Position.Builder subBuilder = null; + if (locationCase_ == 2) { + subBuilder = ((context.ContextOuterClass.GPS_Position) location_).toBuilder(); } - - break; - } - case 26: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (endpointUuid_ != null) { - subBuilder = endpointUuid_.toBuilder(); - } - endpointUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + location_ = + input.readMessage(context.ContextOuterClass.GPS_Position.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(endpointUuid_); - endpointUuid_ = subBuilder.buildPartial(); + subBuilder.mergeFrom((context.ContextOuterClass.GPS_Position) location_); + location_ = subBuilder.buildPartial(); } - + locationCase_ = 2; break; } default: { @@ -27811,93 +53169,139 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); + context.ContextOuterClass.Location.class, context.ContextOuterClass.Location.Builder.class); } - public static final int TOPOLOGY_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.TopologyId topologyId_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - @java.lang.Override - public boolean hasTopologyId() { - return topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - @java.lang.Override - public context.ContextOuterClass.TopologyId getTopologyId() { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - /** - * .context.TopologyId topology_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - return getTopologyId(); + private int locationCase_ = 0; + private java.lang.Object location_; + public enum LocationCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + REGION(1), + GPS_POSITION(2), + LOCATION_NOT_SET(0); + private final int value; + private LocationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LocationCase valueOf(int value) { + return forNumber(value); + } + + public static LocationCase forNumber(int value) { + switch (value) { + case 1: return REGION; + case 2: return GPS_POSITION; + case 0: return LOCATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public LocationCase + getLocationCase() { + return LocationCase.forNumber( + locationCase_); } - public static final int DEVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.DeviceId deviceId_; + public static final int REGION_FIELD_NUMBER = 1; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * string region = 1; + * @return Whether the region field is set. */ - @java.lang.Override - public boolean hasDeviceId() { - return deviceId_ != null; + public boolean hasRegion() { + return locationCase_ == 1; } /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * string region = 1; + * @return The region. */ - @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceId() { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + public java.lang.String getRegion() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + 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(); + if (locationCase_ == 1) { + location_ = s; + } + return s; + } } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return The bytes for region. */ - @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - return getDeviceId(); + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (locationCase_ == 1) { + location_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - public static final int ENDPOINT_UUID_FIELD_NUMBER = 3; - private context.ContextOuterClass.Uuid endpointUuid_; + public static final int GPS_POSITION_FIELD_NUMBER = 2; /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ @java.lang.Override - public boolean hasEndpointUuid() { - return endpointUuid_ != null; + public boolean hasGpsPosition() { + return locationCase_ == 2; } /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ @java.lang.Override - public context.ContextOuterClass.Uuid getEndpointUuid() { - return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + public context.ContextOuterClass.GPS_Position getGpsPosition() { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { - return getEndpointUuid(); + public context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder() { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -27914,14 +53318,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (topologyId_ != null) { - output.writeMessage(1, getTopologyId()); - } - if (deviceId_ != null) { - output.writeMessage(2, getDeviceId()); + if (locationCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); } - if (endpointUuid_ != null) { - output.writeMessage(3, getEndpointUuid()); + if (locationCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.GPS_Position) location_); } unknownFields.writeTo(output); } @@ -27932,17 +53333,12 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (topologyId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTopologyId()); - } - if (deviceId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDeviceId()); + if (locationCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); } - if (endpointUuid_ != null) { + if (locationCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getEndpointUuid()); + .computeMessageSize(2, (context.ContextOuterClass.GPS_Position) location_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -27954,25 +53350,23 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.EndPointId)) { + if (!(obj instanceof context.ContextOuterClass.Location)) { return super.equals(obj); } - context.ContextOuterClass.EndPointId other = (context.ContextOuterClass.EndPointId) obj; - - if (hasTopologyId() != other.hasTopologyId()) return false; - if (hasTopologyId()) { - if (!getTopologyId() - .equals(other.getTopologyId())) return false; - } - if (hasDeviceId() != other.hasDeviceId()) return false; - if (hasDeviceId()) { - if (!getDeviceId() - .equals(other.getDeviceId())) return false; - } - if (hasEndpointUuid() != other.hasEndpointUuid()) return false; - if (hasEndpointUuid()) { - if (!getEndpointUuid() - .equals(other.getEndpointUuid())) return false; + context.ContextOuterClass.Location other = (context.ContextOuterClass.Location) obj; + + if (!getLocationCase().equals(other.getLocationCase())) return false; + switch (locationCase_) { + case 1: + if (!getRegion() + .equals(other.getRegion())) return false; + break; + case 2: + if (!getGpsPosition() + .equals(other.getGpsPosition())) return false; + break; + case 0: + default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -27985,86 +53379,86 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTopologyId()) { - hash = (37 * hash) + TOPOLOGY_ID_FIELD_NUMBER; - hash = (53 * hash) + getTopologyId().hashCode(); - } - if (hasDeviceId()) { - hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getDeviceId().hashCode(); - } - if (hasEndpointUuid()) { - hash = (37 * hash) + ENDPOINT_UUID_FIELD_NUMBER; - hash = (53 * hash) + getEndpointUuid().hashCode(); + switch (locationCase_) { + case 1: + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + break; + case 2: + hash = (37 * hash) + GPS_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getGpsPosition().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom(byte[] data) + public static context.ContextOuterClass.Location parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPointId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Location parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location 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 context.ContextOuterClass.EndPointId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Location parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseDelimitedFrom( + public static context.ContextOuterClass.Location 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 context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPointId parseFrom( + public static context.ContextOuterClass.Location parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -28077,7 +53471,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.EndPointId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Location prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -28093,30 +53487,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Endpoint ------------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.EndPointId} + * Protobuf type {@code context.Location} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.EndPointId) - context.ContextOuterClass.EndPointIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Location) + context.ContextOuterClass.LocationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPointId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPointId.class, context.ContextOuterClass.EndPointId.Builder.class); + context.ContextOuterClass.Location.class, context.ContextOuterClass.Location.Builder.class); } - // Construct using context.ContextOuterClass.EndPointId.newBuilder() + // Construct using context.ContextOuterClass.Location.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -28134,41 +53524,25 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (topologyIdBuilder_ == null) { - topologyId_ = null; - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - if (deviceIdBuilder_ == null) { - deviceId_ = null; - } else { - deviceId_ = null; - deviceIdBuilder_ = null; - } - if (endpointUuidBuilder_ == null) { - endpointUuid_ = null; - } else { - endpointUuid_ = null; - endpointUuidBuilder_ = null; - } + locationCase_ = 0; + location_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_EndPointId_descriptor; + return context.ContextOuterClass.internal_static_context_Location_descriptor; } @java.lang.Override - public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { - return context.ContextOuterClass.EndPointId.getDefaultInstance(); + public context.ContextOuterClass.Location getDefaultInstanceForType() { + return context.ContextOuterClass.Location.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.EndPointId build() { - context.ContextOuterClass.EndPointId result = buildPartial(); + public context.ContextOuterClass.Location build() { + context.ContextOuterClass.Location result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -28176,23 +53550,19 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.EndPointId buildPartial() { - context.ContextOuterClass.EndPointId result = new context.ContextOuterClass.EndPointId(this); - if (topologyIdBuilder_ == null) { - result.topologyId_ = topologyId_; - } else { - result.topologyId_ = topologyIdBuilder_.build(); - } - if (deviceIdBuilder_ == null) { - result.deviceId_ = deviceId_; - } else { - result.deviceId_ = deviceIdBuilder_.build(); + public context.ContextOuterClass.Location buildPartial() { + context.ContextOuterClass.Location result = new context.ContextOuterClass.Location(this); + if (locationCase_ == 1) { + result.location_ = location_; } - if (endpointUuidBuilder_ == null) { - result.endpointUuid_ = endpointUuid_; - } else { - result.endpointUuid_ = endpointUuidBuilder_.build(); + if (locationCase_ == 2) { + if (gpsPositionBuilder_ == null) { + result.location_ = location_; + } else { + result.location_ = gpsPositionBuilder_.build(); + } } + result.locationCase_ = locationCase_; onBuilt(); return result; } @@ -28231,24 +53601,30 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.EndPointId) { - return mergeFrom((context.ContextOuterClass.EndPointId)other); + if (other instanceof context.ContextOuterClass.Location) { + return mergeFrom((context.ContextOuterClass.Location)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.EndPointId other) { - if (other == context.ContextOuterClass.EndPointId.getDefaultInstance()) return this; - if (other.hasTopologyId()) { - mergeTopologyId(other.getTopologyId()); - } - if (other.hasDeviceId()) { - mergeDeviceId(other.getDeviceId()); - } - if (other.hasEndpointUuid()) { - mergeEndpointUuid(other.getEndpointUuid()); + public Builder mergeFrom(context.ContextOuterClass.Location other) { + if (other == context.ContextOuterClass.Location.getDefaultInstance()) return this; + switch (other.getLocationCase()) { + case REGION: { + locationCase_ = 1; + location_ = other.location_; + onChanged(); + break; + } + case GPS_POSITION: { + mergeGpsPosition(other.getGpsPosition()); + break; + } + case LOCATION_NOT_SET: { + break; + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -28265,11 +53641,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.EndPointId parsedMessage = null; + context.ContextOuterClass.Location parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.EndPointId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Location) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -28278,362 +53654,258 @@ public final class ContextOuterClass { } return this; } - - private context.ContextOuterClass.TopologyId topologyId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> topologyIdBuilder_; - /** - * .context.TopologyId topology_id = 1; - * @return Whether the topologyId field is set. - */ - public boolean hasTopologyId() { - return topologyIdBuilder_ != null || topologyId_ != null; - } - /** - * .context.TopologyId topology_id = 1; - * @return The topologyId. - */ - public context.ContextOuterClass.TopologyId getTopologyId() { - if (topologyIdBuilder_ == null) { - return topologyId_ == null ? context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } else { - return topologyIdBuilder_.getMessage(); - } - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - topologyId_ = value; - onChanged(); - } else { - topologyIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder setTopologyId( - context.ContextOuterClass.TopologyId.Builder builderForValue) { - if (topologyIdBuilder_ == null) { - topologyId_ = builderForValue.build(); - onChanged(); - } else { - topologyIdBuilder_.setMessage(builderForValue.build()); - } - - return this; + private int locationCase_ = 0; + private java.lang.Object location_; + public LocationCase + getLocationCase() { + return LocationCase.forNumber( + locationCase_); } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder mergeTopologyId(context.ContextOuterClass.TopologyId value) { - if (topologyIdBuilder_ == null) { - if (topologyId_ != null) { - topologyId_ = - context.ContextOuterClass.TopologyId.newBuilder(topologyId_).mergeFrom(value).buildPartial(); - } else { - topologyId_ = value; - } - onChanged(); - } else { - topologyIdBuilder_.mergeFrom(value); - } + public Builder clearLocation() { + locationCase_ = 0; + location_ = null; + onChanged(); return this; } - /** - * .context.TopologyId topology_id = 1; - */ - public Builder clearTopologyId() { - if (topologyIdBuilder_ == null) { - topologyId_ = null; - onChanged(); - } else { - topologyId_ = null; - topologyIdBuilder_ = null; - } - return this; - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyId.Builder getTopologyIdBuilder() { - - onChanged(); - return getTopologyIdFieldBuilder().getBuilder(); - } - /** - * .context.TopologyId topology_id = 1; - */ - public context.ContextOuterClass.TopologyIdOrBuilder getTopologyIdOrBuilder() { - if (topologyIdBuilder_ != null) { - return topologyIdBuilder_.getMessageOrBuilder(); - } else { - return topologyId_ == null ? - context.ContextOuterClass.TopologyId.getDefaultInstance() : topologyId_; - } - } - /** - * .context.TopologyId topology_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder> - getTopologyIdFieldBuilder() { - if (topologyIdBuilder_ == null) { - topologyIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.TopologyId, context.ContextOuterClass.TopologyId.Builder, context.ContextOuterClass.TopologyIdOrBuilder>( - getTopologyId(), - getParentForChildren(), - isClean()); - topologyId_ = null; - } - return topologyIdBuilder_; - } - private context.ContextOuterClass.DeviceId deviceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; /** - * .context.DeviceId device_id = 2; - * @return Whether the deviceId field is set. + * string region = 1; + * @return Whether the region field is set. */ - public boolean hasDeviceId() { - return deviceIdBuilder_ != null || deviceId_ != null; + @java.lang.Override + public boolean hasRegion() { + return locationCase_ == 1; } /** - * .context.DeviceId device_id = 2; - * @return The deviceId. + * string region = 1; + * @return The region. */ - public context.ContextOuterClass.DeviceId getDeviceId() { - if (deviceIdBuilder_ == null) { - return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } else { - return deviceIdBuilder_.getMessage(); + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; } - } - /** - * .context.DeviceId device_id = 2; - */ - public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (locationCase_ == 1) { + location_ = s; } - deviceId_ = value; - onChanged(); + return s; } else { - deviceIdBuilder_.setMessage(value); + return (java.lang.String) ref; } - - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return The bytes for region. */ - public Builder setDeviceId( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceIdBuilder_ == null) { - deviceId_ = builderForValue.build(); - onChanged(); + @java.lang.Override + public com.google.protobuf.ByteString + getRegionBytes() { + java.lang.Object ref = ""; + if (locationCase_ == 1) { + ref = location_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (locationCase_ == 1) { + location_ = b; + } + return b; } else { - deviceIdBuilder_.setMessage(builderForValue.build()); + return (com.google.protobuf.ByteString) ref; } - - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @param value The region to set. + * @return This builder for chaining. */ - public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { - if (deviceIdBuilder_ == null) { - if (deviceId_ != null) { - deviceId_ = - context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); - } else { - deviceId_ = value; - } - onChanged(); - } else { - deviceIdBuilder_.mergeFrom(value); - } - + public Builder setRegion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationCase_ = 1; + location_ = value; + onChanged(); return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @return This builder for chaining. */ - public Builder clearDeviceId() { - if (deviceIdBuilder_ == null) { - deviceId_ = null; + public Builder clearRegion() { + if (locationCase_ == 1) { + locationCase_ = 0; + location_ = null; onChanged(); - } else { - deviceId_ = null; - deviceIdBuilder_ = null; } - return this; } /** - * .context.DeviceId device_id = 2; + * string region = 1; + * @param value The bytes for region to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { - + public Builder setRegionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationCase_ = 1; + location_ = value; onChanged(); - return getDeviceIdFieldBuilder().getBuilder(); - } - /** - * .context.DeviceId device_id = 2; - */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { - if (deviceIdBuilder_ != null) { - return deviceIdBuilder_.getMessageOrBuilder(); - } else { - return deviceId_ == null ? - context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; - } - } - /** - * .context.DeviceId device_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceIdFieldBuilder() { - if (deviceIdBuilder_ == null) { - deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - getDeviceId(), - getParentForChildren(), - isClean()); - deviceId_ = null; - } - return deviceIdBuilder_; + return this; } - private context.ContextOuterClass.Uuid endpointUuid_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> endpointUuidBuilder_; + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder> gpsPositionBuilder_; /** - * .context.Uuid endpoint_uuid = 3; - * @return Whether the endpointUuid field is set. + * .context.GPS_Position gps_position = 2; + * @return Whether the gpsPosition field is set. */ - public boolean hasEndpointUuid() { - return endpointUuidBuilder_ != null || endpointUuid_ != null; + @java.lang.Override + public boolean hasGpsPosition() { + return locationCase_ == 2; } /** - * .context.Uuid endpoint_uuid = 3; - * @return The endpointUuid. + * .context.GPS_Position gps_position = 2; + * @return The gpsPosition. */ - public context.ContextOuterClass.Uuid getEndpointUuid() { - if (endpointUuidBuilder_ == null) { - return endpointUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + @java.lang.Override + public context.ContextOuterClass.GPS_Position getGpsPosition() { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } else { - return endpointUuidBuilder_.getMessage(); + if (locationCase_ == 2) { + return gpsPositionBuilder_.getMessage(); + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder setEndpointUuid(context.ContextOuterClass.Uuid value) { - if (endpointUuidBuilder_ == null) { + public Builder setGpsPosition(context.ContextOuterClass.GPS_Position value) { + if (gpsPositionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - endpointUuid_ = value; + location_ = value; onChanged(); } else { - endpointUuidBuilder_.setMessage(value); + gpsPositionBuilder_.setMessage(value); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder setEndpointUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (endpointUuidBuilder_ == null) { - endpointUuid_ = builderForValue.build(); + public Builder setGpsPosition( + context.ContextOuterClass.GPS_Position.Builder builderForValue) { + if (gpsPositionBuilder_ == null) { + location_ = builderForValue.build(); onChanged(); } else { - endpointUuidBuilder_.setMessage(builderForValue.build()); + gpsPositionBuilder_.setMessage(builderForValue.build()); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder mergeEndpointUuid(context.ContextOuterClass.Uuid value) { - if (endpointUuidBuilder_ == null) { - if (endpointUuid_ != null) { - endpointUuid_ = - context.ContextOuterClass.Uuid.newBuilder(endpointUuid_).mergeFrom(value).buildPartial(); + public Builder mergeGpsPosition(context.ContextOuterClass.GPS_Position value) { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2 && + location_ != context.ContextOuterClass.GPS_Position.getDefaultInstance()) { + location_ = context.ContextOuterClass.GPS_Position.newBuilder((context.ContextOuterClass.GPS_Position) location_) + .mergeFrom(value).buildPartial(); } else { - endpointUuid_ = value; + location_ = value; } onChanged(); } else { - endpointUuidBuilder_.mergeFrom(value); + if (locationCase_ == 2) { + gpsPositionBuilder_.mergeFrom(value); + } + gpsPositionBuilder_.setMessage(value); } - + locationCase_ = 2; return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public Builder clearEndpointUuid() { - if (endpointUuidBuilder_ == null) { - endpointUuid_ = null; - onChanged(); + public Builder clearGpsPosition() { + if (gpsPositionBuilder_ == null) { + if (locationCase_ == 2) { + locationCase_ = 0; + location_ = null; + onChanged(); + } } else { - endpointUuid_ = null; - endpointUuidBuilder_ = null; + if (locationCase_ == 2) { + locationCase_ = 0; + location_ = null; + } + gpsPositionBuilder_.clear(); } - return this; } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public context.ContextOuterClass.Uuid.Builder getEndpointUuidBuilder() { - - onChanged(); - return getEndpointUuidFieldBuilder().getBuilder(); + public context.ContextOuterClass.GPS_Position.Builder getGpsPositionBuilder() { + return getGpsPositionFieldBuilder().getBuilder(); } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ - public context.ContextOuterClass.UuidOrBuilder getEndpointUuidOrBuilder() { - if (endpointUuidBuilder_ != null) { - return endpointUuidBuilder_.getMessageOrBuilder(); + @java.lang.Override + public context.ContextOuterClass.GPS_PositionOrBuilder getGpsPositionOrBuilder() { + if ((locationCase_ == 2) && (gpsPositionBuilder_ != null)) { + return gpsPositionBuilder_.getMessageOrBuilder(); } else { - return endpointUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : endpointUuid_; + if (locationCase_ == 2) { + return (context.ContextOuterClass.GPS_Position) location_; + } + return context.ContextOuterClass.GPS_Position.getDefaultInstance(); } } /** - * .context.Uuid endpoint_uuid = 3; + * .context.GPS_Position gps_position = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getEndpointUuidFieldBuilder() { - if (endpointUuidBuilder_ == null) { - endpointUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getEndpointUuid(), + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder> + getGpsPositionFieldBuilder() { + if (gpsPositionBuilder_ == null) { + if (!(locationCase_ == 2)) { + location_ = context.ContextOuterClass.GPS_Position.getDefaultInstance(); + } + gpsPositionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.GPS_Position, context.ContextOuterClass.GPS_Position.Builder, context.ContextOuterClass.GPS_PositionOrBuilder>( + (context.ContextOuterClass.GPS_Position) location_, getParentForChildren(), isClean()); - endpointUuid_ = null; + location_ = null; } - return endpointUuidBuilder_; + locationCase_ = 2; + onChanged();; + return gpsPositionBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -28648,48 +53920,48 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.EndPointId) + // @@protoc_insertion_point(builder_scope:context.Location) } - // @@protoc_insertion_point(class_scope:context.EndPointId) - private static final context.ContextOuterClass.EndPointId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Location) + private static final context.ContextOuterClass.Location DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.EndPointId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Location(); } - public static context.ContextOuterClass.EndPointId getDefaultInstance() { + public static context.ContextOuterClass.Location getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public EndPointId parsePartialFrom( + public Location parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EndPointId(input, extensionRegistry); + return new Location(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.EndPointId getDefaultInstanceForType() { + public context.ContextOuterClass.Location getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface EndPointOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.EndPoint) + public interface Constraint_EndPointLocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_EndPointLocation) com.google.protobuf.MessageOrBuilder { /** @@ -28708,38 +53980,40 @@ public final class ContextOuterClass { context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ - java.lang.String getEndpointType(); + boolean hasLocation(); /** - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; + * @return The location. */ - com.google.protobuf.ByteString - getEndpointTypeBytes(); + context.ContextOuterClass.Location getLocation(); + /** + * .context.Location location = 2; + */ + context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder(); } /** - * Protobuf type {@code context.EndPoint} + * Protobuf type {@code context.Constraint_EndPointLocation} */ - public static final class EndPoint extends + public static final class Constraint_EndPointLocation extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.EndPoint) - EndPointOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_EndPointLocation) + Constraint_EndPointLocationOrBuilder { private static final long serialVersionUID = 0L; - // Use EndPoint.newBuilder() to construct. - private EndPoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_EndPointLocation.newBuilder() to construct. + private Constraint_EndPointLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private EndPoint() { - endpointType_ = ""; + private Constraint_EndPointLocation() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new EndPoint(); + return new Constraint_EndPointLocation(); } @java.lang.Override @@ -28747,7 +54021,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private EndPoint( + private Constraint_EndPointLocation( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -28779,9 +54053,16 @@ public final class ContextOuterClass { break; } case 18: { - java.lang.String s = input.readStringRequireUtf8(); + context.ContextOuterClass.Location.Builder subBuilder = null; + if (location_ != null) { + subBuilder = location_.toBuilder(); + } + location_ = input.readMessage(context.ContextOuterClass.Location.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(location_); + location_ = subBuilder.buildPartial(); + } - endpointType_ = s; break; } default: { @@ -28805,15 +54086,15 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); + context.ContextOuterClass.Constraint_EndPointLocation.class, context.ContextOuterClass.Constraint_EndPointLocation.Builder.class); } public static final int ENDPOINT_ID_FIELD_NUMBER = 1; @@ -28842,42 +54123,30 @@ public final class ContextOuterClass { return getEndpointId(); } - public static final int ENDPOINT_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object endpointType_; + public static final int LOCATION_FIELD_NUMBER = 2; + private context.ContextOuterClass.Location location_; /** - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ @java.lang.Override - public java.lang.String getEndpointType() { - java.lang.Object ref = endpointType_; - 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(); - endpointType_ = s; - return s; - } + public boolean hasLocation() { + return location_ != null; } /** - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; + * @return The location. */ @java.lang.Override - public com.google.protobuf.ByteString - getEndpointTypeBytes() { - java.lang.Object ref = endpointType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpointType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public context.ContextOuterClass.Location getLocation() { + return location_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : location_; + } + /** + * .context.Location location = 2; + */ + @java.lang.Override + public context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder() { + return getLocation(); } private byte memoizedIsInitialized = -1; @@ -28897,8 +54166,8 @@ public final class ContextOuterClass { if (endpointId_ != null) { output.writeMessage(1, getEndpointId()); } - if (!getEndpointTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointType_); + if (location_ != null) { + output.writeMessage(2, getLocation()); } unknownFields.writeTo(output); } @@ -28913,8 +54182,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getEndpointId()); } - if (!getEndpointTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointType_); + if (location_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLocation()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -28926,18 +54196,21 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.EndPoint)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_EndPointLocation)) { return super.equals(obj); } - context.ContextOuterClass.EndPoint other = (context.ContextOuterClass.EndPoint) obj; + context.ContextOuterClass.Constraint_EndPointLocation other = (context.ContextOuterClass.Constraint_EndPointLocation) obj; if (hasEndpointId() != other.hasEndpointId()) return false; if (hasEndpointId()) { if (!getEndpointId() .equals(other.getEndpointId())) return false; } - if (!getEndpointType() - .equals(other.getEndpointType())) return false; + if (hasLocation() != other.hasLocation()) return false; + if (hasLocation()) { + if (!getLocation() + .equals(other.getLocation())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -28953,76 +54226,78 @@ public final class ContextOuterClass { hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; hash = (53 * hash) + getEndpointId().hashCode(); } - hash = (37 * hash) + ENDPOINT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getEndpointType().hashCode(); + if (hasLocation()) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.EndPoint parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation 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 context.ContextOuterClass.EndPoint parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointLocation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation 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 context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.EndPoint parseFrom( + public static context.ContextOuterClass.Constraint_EndPointLocation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -29035,7 +54310,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.EndPoint prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_EndPointLocation prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -29051,26 +54326,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.EndPoint} + * Protobuf type {@code context.Constraint_EndPointLocation} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.EndPoint) - context.ContextOuterClass.EndPointOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_EndPointLocation) + context.ContextOuterClass.Constraint_EndPointLocationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_EndPoint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.EndPoint.class, context.ContextOuterClass.EndPoint.Builder.class); + context.ContextOuterClass.Constraint_EndPointLocation.class, context.ContextOuterClass.Constraint_EndPointLocation.Builder.class); } - // Construct using context.ContextOuterClass.EndPoint.newBuilder() + // Construct using context.ContextOuterClass.Constraint_EndPointLocation.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -29094,25 +54369,29 @@ public final class ContextOuterClass { endpointId_ = null; endpointIdBuilder_ = null; } - endpointType_ = ""; - + if (locationBuilder_ == null) { + location_ = null; + } else { + location_ = null; + locationBuilder_ = null; + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_EndPoint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointLocation_descriptor; } @java.lang.Override - public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { - return context.ContextOuterClass.EndPoint.getDefaultInstance(); + public context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.EndPoint build() { - context.ContextOuterClass.EndPoint result = buildPartial(); + public context.ContextOuterClass.Constraint_EndPointLocation build() { + context.ContextOuterClass.Constraint_EndPointLocation result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -29120,14 +54399,18 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.EndPoint buildPartial() { - context.ContextOuterClass.EndPoint result = new context.ContextOuterClass.EndPoint(this); + public context.ContextOuterClass.Constraint_EndPointLocation buildPartial() { + context.ContextOuterClass.Constraint_EndPointLocation result = new context.ContextOuterClass.Constraint_EndPointLocation(this); if (endpointIdBuilder_ == null) { result.endpointId_ = endpointId_; } else { result.endpointId_ = endpointIdBuilder_.build(); } - result.endpointType_ = endpointType_; + if (locationBuilder_ == null) { + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); + } onBuilt(); return result; } @@ -29166,22 +54449,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.EndPoint) { - return mergeFrom((context.ContextOuterClass.EndPoint)other); + if (other instanceof context.ContextOuterClass.Constraint_EndPointLocation) { + return mergeFrom((context.ContextOuterClass.Constraint_EndPointLocation)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.EndPoint other) { - if (other == context.ContextOuterClass.EndPoint.getDefaultInstance()) return this; + public Builder mergeFrom(context.ContextOuterClass.Constraint_EndPointLocation other) { + if (other == context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance()) return this; if (other.hasEndpointId()) { mergeEndpointId(other.getEndpointId()); } - if (!other.getEndpointType().isEmpty()) { - endpointType_ = other.endpointType_; - onChanged(); + if (other.hasLocation()) { + mergeLocation(other.getLocation()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -29198,11 +54480,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.EndPoint parsedMessage = null; + context.ContextOuterClass.Constraint_EndPointLocation parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.EndPoint) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_EndPointLocation) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -29331,80 +54613,123 @@ public final class ContextOuterClass { return endpointIdBuilder_; } - private java.lang.Object endpointType_ = ""; + private context.ContextOuterClass.Location location_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> locationBuilder_; /** - * string endpoint_type = 2; - * @return The endpointType. + * .context.Location location = 2; + * @return Whether the location field is set. */ - public java.lang.String getEndpointType() { - java.lang.Object ref = endpointType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - endpointType_ = s; - return s; + public boolean hasLocation() { + return locationBuilder_ != null || location_ != null; + } + /** + * .context.Location location = 2; + * @return The location. + */ + public context.ContextOuterClass.Location getLocation() { + if (locationBuilder_ == null) { + return location_ == null ? context.ContextOuterClass.Location.getDefaultInstance() : location_; } else { - return (java.lang.String) ref; + return locationBuilder_.getMessage(); } } /** - * string endpoint_type = 2; - * @return The bytes for endpointType. + * .context.Location location = 2; */ - public com.google.protobuf.ByteString - getEndpointTypeBytes() { - java.lang.Object ref = endpointType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - endpointType_ = b; - return b; + public Builder setLocation(context.ContextOuterClass.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + locationBuilder_.setMessage(value); } + + return this; } /** - * string endpoint_type = 2; - * @param value The endpointType to set. - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder setEndpointType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - endpointType_ = value; - onChanged(); + public Builder setLocation( + context.ContextOuterClass.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + location_ = builderForValue.build(); + onChanged(); + } else { + locationBuilder_.setMessage(builderForValue.build()); + } + return this; } /** - * string endpoint_type = 2; - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder clearEndpointType() { - - endpointType_ = getDefaultInstance().getEndpointType(); - onChanged(); + public Builder mergeLocation(context.ContextOuterClass.Location value) { + if (locationBuilder_ == null) { + if (location_ != null) { + location_ = + context.ContextOuterClass.Location.newBuilder(location_).mergeFrom(value).buildPartial(); + } else { + location_ = value; + } + onChanged(); + } else { + locationBuilder_.mergeFrom(value); + } + return this; } /** - * string endpoint_type = 2; - * @param value The bytes for endpointType to set. - * @return This builder for chaining. + * .context.Location location = 2; */ - public Builder setEndpointTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearLocation() { + if (locationBuilder_ == null) { + location_ = null; + onChanged(); + } else { + location_ = null; + locationBuilder_ = null; + } + + return this; + } + /** + * .context.Location location = 2; + */ + public context.ContextOuterClass.Location.Builder getLocationBuilder() { - endpointType_ = value; onChanged(); - return this; + return getLocationFieldBuilder().getBuilder(); + } + /** + * .context.Location location = 2; + */ + public context.ContextOuterClass.LocationOrBuilder getLocationOrBuilder() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilder(); + } else { + return location_ == null ? + context.ContextOuterClass.Location.getDefaultInstance() : location_; + } + } + /** + * .context.Location location = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Location, context.ContextOuterClass.Location.Builder, context.ContextOuterClass.LocationOrBuilder>( + getLocation(), + getParentForChildren(), + isClean()); + location_ = null; + } + return locationBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -29419,108 +54744,91 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.EndPoint) + // @@protoc_insertion_point(builder_scope:context.Constraint_EndPointLocation) } - // @@protoc_insertion_point(class_scope:context.EndPoint) - private static final context.ContextOuterClass.EndPoint DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_EndPointLocation) + private static final context.ContextOuterClass.Constraint_EndPointLocation DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.EndPoint(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_EndPointLocation(); } - public static context.ContextOuterClass.EndPoint getDefaultInstance() { + public static context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public EndPoint parsePartialFrom( + public Constraint_EndPointLocation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EndPoint(input, extensionRegistry); + return new Constraint_EndPointLocation(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.EndPoint getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_EndPointLocation getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConfigRuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConfigRule) + public interface Constraint_EndPointPriorityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_EndPointPriority) com.google.protobuf.MessageOrBuilder { /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - int getActionValue(); - /** - * .context.ConfigActionEnum action = 1; - * @return The action. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - context.ContextOuterClass.ConfigActionEnum getAction(); - + boolean hasEndpointId(); /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - java.lang.String getResourceKey(); + context.ContextOuterClass.EndPointId getEndpointId(); /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; */ - com.google.protobuf.ByteString - getResourceKeyBytes(); + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); /** - * string resource_value = 3; - * @return The resourceValue. - */ - java.lang.String getResourceValue(); - /** - * string resource_value = 3; - * @return The bytes for resourceValue. + * uint32 priority = 2; + * @return The priority. */ - com.google.protobuf.ByteString - getResourceValueBytes(); + int getPriority(); } /** - * Protobuf type {@code context.ConfigRule} + * Protobuf type {@code context.Constraint_EndPointPriority} */ - public static final class ConfigRule extends + public static final class Constraint_EndPointPriority extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConfigRule) - ConfigRuleOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_EndPointPriority) + Constraint_EndPointPriorityOrBuilder { private static final long serialVersionUID = 0L; - // Use ConfigRule.newBuilder() to construct. - private ConfigRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_EndPointPriority.newBuilder() to construct. + private Constraint_EndPointPriority(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConfigRule() { - action_ = 0; - resourceKey_ = ""; - resourceValue_ = ""; + private Constraint_EndPointPriority() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConfigRule(); + return new Constraint_EndPointPriority(); } @java.lang.Override @@ -29528,7 +54836,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConfigRule( + private Constraint_EndPointPriority( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -29546,22 +54854,22 @@ public final class ContextOuterClass { case 0: done = true; break; - case 8: { - int rawValue = input.readEnum(); - - action_ = rawValue; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); + case 10: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } - resourceKey_ = s; break; } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); + case 16: { - resourceValue_ = s; + priority_ = input.readUInt32(); break; } default: { @@ -29585,110 +54893,52 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + context.ContextOuterClass.Constraint_EndPointPriority.class, context.ContextOuterClass.Constraint_EndPointPriority.Builder.class); } - public static final int ACTION_FIELD_NUMBER = 1; - private int action_; - /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } + public static final int ENDPOINT_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.EndPointId endpointId_; /** - * .context.ConfigActionEnum action = 1; - * @return The action. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override public context.ContextOuterClass.ConfigActionEnum getAction() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); - return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; } - - public static final int RESOURCE_KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object resourceKey_; /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ @java.lang.Override - public java.lang.String getResourceKey() { - java.lang.Object ref = resourceKey_; - 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(); - resourceKey_ = s; - return s; - } + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; */ @java.lang.Override - public com.google.protobuf.ByteString - getResourceKeyBytes() { - java.lang.Object ref = resourceKey_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceKey_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); } - public static final int RESOURCE_VALUE_FIELD_NUMBER = 3; - private volatile java.lang.Object resourceValue_; + public static final int PRIORITY_FIELD_NUMBER = 2; + private int priority_; /** - * string resource_value = 3; - * @return The resourceValue. + * uint32 priority = 2; + * @return The priority. */ @java.lang.Override - public java.lang.String getResourceValue() { - java.lang.Object ref = resourceValue_; - 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(); - resourceValue_ = s; - return s; - } - } - /** - * string resource_value = 3; - * @return The bytes for resourceValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getResourceValueBytes() { - java.lang.Object ref = resourceValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getPriority() { + return priority_; } private byte memoizedIsInitialized = -1; @@ -29705,14 +54955,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { - output.writeEnum(1, action_); - } - if (!getResourceKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceKey_); + if (endpointId_ != null) { + output.writeMessage(1, getEndpointId()); } - if (!getResourceValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resourceValue_); + if (priority_ != 0) { + output.writeUInt32(2, priority_); } unknownFields.writeTo(output); } @@ -29723,15 +54970,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (action_ != context.ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED.getNumber()) { + if (endpointId_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, action_); - } - if (!getResourceKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceKey_); + .computeMessageSize(1, getEndpointId()); } - if (!getResourceValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resourceValue_); + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, priority_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -29743,16 +54988,18 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConfigRule)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_EndPointPriority)) { return super.equals(obj); } - context.ContextOuterClass.ConfigRule other = (context.ContextOuterClass.ConfigRule) obj; + context.ContextOuterClass.Constraint_EndPointPriority other = (context.ContextOuterClass.Constraint_EndPointPriority) obj; - if (action_ != other.action_) return false; - if (!getResourceKey() - .equals(other.getResourceKey())) return false; - if (!getResourceValue() - .equals(other.getResourceValue())) return false; + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (getPriority() + != other.getPriority()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -29764,80 +55011,80 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + action_; - hash = (37 * hash) + RESOURCE_KEY_FIELD_NUMBER; - hash = (53 * hash) + getResourceKey().hashCode(); - hash = (37 * hash) + RESOURCE_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getResourceValue().hashCode(); + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConfigRule parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority 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 context.ContextOuterClass.ConfigRule parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_EndPointPriority parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority 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 context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConfigRule parseFrom( + public static context.ContextOuterClass.Constraint_EndPointPriority parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -29850,7 +55097,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConfigRule prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_EndPointPriority prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -29866,26 +55113,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConfigRule} + * Protobuf type {@code context.Constraint_EndPointPriority} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConfigRule) - context.ContextOuterClass.ConfigRuleOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_EndPointPriority) + context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConfigRule_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConfigRule.class, context.ContextOuterClass.ConfigRule.Builder.class); + context.ContextOuterClass.Constraint_EndPointPriority.class, context.ContextOuterClass.Constraint_EndPointPriority.Builder.class); } - // Construct using context.ContextOuterClass.ConfigRule.newBuilder() + // Construct using context.ContextOuterClass.Constraint_EndPointPriority.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -29903,11 +55150,13 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - action_ = 0; - - resourceKey_ = ""; - - resourceValue_ = ""; + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + priority_ = 0; return this; } @@ -29915,17 +55164,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConfigRule_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_EndPointPriority_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { - return context.ContextOuterClass.ConfigRule.getDefaultInstance(); + public context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConfigRule build() { - context.ContextOuterClass.ConfigRule result = buildPartial(); + public context.ContextOuterClass.Constraint_EndPointPriority build() { + context.ContextOuterClass.Constraint_EndPointPriority result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -29933,11 +55182,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConfigRule buildPartial() { - context.ContextOuterClass.ConfigRule result = new context.ContextOuterClass.ConfigRule(this); - result.action_ = action_; - result.resourceKey_ = resourceKey_; - result.resourceValue_ = resourceValue_; + public context.ContextOuterClass.Constraint_EndPointPriority buildPartial() { + context.ContextOuterClass.Constraint_EndPointPriority result = new context.ContextOuterClass.Constraint_EndPointPriority(this); + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + result.priority_ = priority_; onBuilt(); return result; } @@ -29976,26 +55228,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConfigRule) { - return mergeFrom((context.ContextOuterClass.ConfigRule)other); + if (other instanceof context.ContextOuterClass.Constraint_EndPointPriority) { + return mergeFrom((context.ContextOuterClass.Constraint_EndPointPriority)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConfigRule other) { - if (other == context.ContextOuterClass.ConfigRule.getDefaultInstance()) return this; - if (other.action_ != 0) { - setActionValue(other.getActionValue()); - } - if (!other.getResourceKey().isEmpty()) { - resourceKey_ = other.resourceKey_; - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.Constraint_EndPointPriority other) { + if (other == context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance()) return this; + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); } - if (!other.getResourceValue().isEmpty()) { - resourceValue_ = other.resourceValue_; - onChanged(); + if (other.getPriority() != 0) { + setPriority(other.getPriority()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -30012,11 +55259,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConfigRule parsedMessage = null; + context.ContextOuterClass.Constraint_EndPointPriority parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConfigRule) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_EndPointPriority) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -30026,208 +55273,152 @@ public final class ContextOuterClass { return this; } - private int action_ = 0; - /** - * .context.ConfigActionEnum action = 1; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } - /** - * .context.ConfigActionEnum action = 1; - * @param value The enum numeric value on the wire for action to set. - * @return This builder for chaining. - */ - public Builder setActionValue(int value) { - - action_ = value; - onChanged(); - return this; - } + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; /** - * .context.ConfigActionEnum action = 1; - * @return The action. + * .context.EndPointId endpoint_id = 1; + * @return Whether the endpointId field is set. */ - @java.lang.Override - public context.ContextOuterClass.ConfigActionEnum getAction() { - @SuppressWarnings("deprecation") - context.ContextOuterClass.ConfigActionEnum result = context.ContextOuterClass.ConfigActionEnum.valueOf(action_); - return result == null ? context.ContextOuterClass.ConfigActionEnum.UNRECOGNIZED : result; + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; } /** - * .context.ConfigActionEnum action = 1; - * @param value The action to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; + * @return The endpointId. */ - public Builder setAction(context.ContextOuterClass.ConfigActionEnum value) { - if (value == null) { - throw new NullPointerException(); + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); } - - action_ = value.getNumber(); - onChanged(); - return this; } /** - * .context.ConfigActionEnum action = 1; - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder clearAction() { - - action_ = 0; - onChanged(); + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + return this; } - - private java.lang.Object resourceKey_ = ""; /** - * string resource_key = 2; - * @return The resourceKey. + * .context.EndPointId endpoint_id = 1; */ - public java.lang.String getResourceKey() { - java.lang.Object ref = resourceKey_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resourceKey_ = s; - return s; + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); } else { - return (java.lang.String) ref; + endpointIdBuilder_.setMessage(builderForValue.build()); } + + return this; } /** - * string resource_key = 2; - * @return The bytes for resourceKey. + * .context.EndPointId endpoint_id = 1; */ - public com.google.protobuf.ByteString - getResourceKeyBytes() { - java.lang.Object ref = resourceKey_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceKey_ = b; - return b; + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + endpointIdBuilder_.mergeFrom(value); } - } - /** - * string resource_key = 2; - * @param value The resourceKey to set. - * @return This builder for chaining. - */ - public Builder setResourceKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resourceKey_ = value; - onChanged(); + return this; } /** - * string resource_key = 2; - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder clearResourceKey() { - - resourceKey_ = getDefaultInstance().getResourceKey(); - onChanged(); + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + return this; } /** - * string resource_key = 2; - * @param value The bytes for resourceKey to set. - * @return This builder for chaining. + * .context.EndPointId endpoint_id = 1; */ - public Builder setResourceKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { - resourceKey_ = value; onChanged(); - return this; + return getEndpointIdFieldBuilder().getBuilder(); } - - private java.lang.Object resourceValue_ = ""; /** - * string resource_value = 3; - * @return The resourceValue. + * .context.EndPointId endpoint_id = 1; */ - public java.lang.String getResourceValue() { - java.lang.Object ref = resourceValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - resourceValue_ = s; - return s; + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); } else { - return (java.lang.String) ref; + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; } } /** - * string resource_value = 3; - * @return The bytes for resourceValue. + * .context.EndPointId endpoint_id = 1; */ - public com.google.protobuf.ByteString - getResourceValueBytes() { - java.lang.Object ref = resourceValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - resourceValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; } + return endpointIdBuilder_; } + + private int priority_ ; /** - * string resource_value = 3; - * @param value The resourceValue to set. - * @return This builder for chaining. + * uint32 priority = 2; + * @return The priority. */ - public Builder setResourceValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - resourceValue_ = value; - onChanged(); - return this; + @java.lang.Override + public int getPriority() { + return priority_; } /** - * string resource_value = 3; + * uint32 priority = 2; + * @param value The priority to set. * @return This builder for chaining. */ - public Builder clearResourceValue() { + public Builder setPriority(int value) { - resourceValue_ = getDefaultInstance().getResourceValue(); + priority_ = value; onChanged(); return this; } /** - * string resource_value = 3; - * @param value The bytes for resourceValue to set. + * uint32 priority = 2; * @return This builder for chaining. */ - public Builder setResourceValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearPriority() { - resourceValue_ = value; + priority_ = 0; onChanged(); return this; } @@ -30244,100 +55435,76 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConfigRule) + // @@protoc_insertion_point(builder_scope:context.Constraint_EndPointPriority) } - // @@protoc_insertion_point(class_scope:context.ConfigRule) - private static final context.ContextOuterClass.ConfigRule DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_EndPointPriority) + private static final context.ContextOuterClass.Constraint_EndPointPriority DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConfigRule(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_EndPointPriority(); } - public static context.ContextOuterClass.ConfigRule getDefaultInstance() { + public static context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConfigRule parsePartialFrom( + public Constraint_EndPointPriority parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConfigRule(input, extensionRegistry); + return new Constraint_EndPointPriority(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConfigRule getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_EndPointPriority getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConstraintOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Constraint) + public interface Constraint_SLA_LatencyOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Latency) com.google.protobuf.MessageOrBuilder { /** - * string constraint_type = 1; - * @return The constraintType. - */ - java.lang.String getConstraintType(); - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - com.google.protobuf.ByteString - getConstraintTypeBytes(); - - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - java.lang.String getConstraintValue(); - /** - * string constraint_value = 2; - * @return The bytes for constraintValue. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ - com.google.protobuf.ByteString - getConstraintValueBytes(); + float getE2ELatencyMs(); } /** - *
-   * ----- Constraint ----------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.Constraint} + * Protobuf type {@code context.Constraint_SLA_Latency} */ - public static final class Constraint extends + public static final class Constraint_SLA_Latency extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Constraint) - ConstraintOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Latency) + Constraint_SLA_LatencyOrBuilder { private static final long serialVersionUID = 0L; - // Use Constraint.newBuilder() to construct. - private Constraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Latency.newBuilder() to construct. + private Constraint_SLA_Latency(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Constraint() { - constraintType_ = ""; - constraintValue_ = ""; + private Constraint_SLA_Latency() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Constraint(); + return new Constraint_SLA_Latency(); } @java.lang.Override @@ -30345,7 +55512,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Constraint( + private Constraint_SLA_Latency( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -30363,16 +55530,9 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - constraintType_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); + case 13: { - constraintValue_ = s; + e2ELatencyMs_ = input.readFloat(); break; } default: { @@ -30396,91 +55556,26 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); - } - - public static final int CONSTRAINT_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object constraintType_; - /** - * string constraint_type = 1; - * @return The constraintType. - */ - @java.lang.Override - public java.lang.String getConstraintType() { - java.lang.Object ref = constraintType_; - 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(); - constraintType_ = s; - return s; - } - } - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getConstraintTypeBytes() { - java.lang.Object ref = constraintType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + context.ContextOuterClass.Constraint_SLA_Latency.class, context.ContextOuterClass.Constraint_SLA_Latency.Builder.class); } - public static final int CONSTRAINT_VALUE_FIELD_NUMBER = 2; - private volatile java.lang.Object constraintValue_; - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - @java.lang.Override - public java.lang.String getConstraintValue() { - java.lang.Object ref = constraintValue_; - 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(); - constraintValue_ = s; - return s; - } - } + public static final int E2E_LATENCY_MS_FIELD_NUMBER = 1; + private float e2ELatencyMs_; /** - * string constraint_value = 2; - * @return The bytes for constraintValue. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ @java.lang.Override - public com.google.protobuf.ByteString - getConstraintValueBytes() { - java.lang.Object ref = constraintValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public float getE2ELatencyMs() { + return e2ELatencyMs_; } private byte memoizedIsInitialized = -1; @@ -30497,11 +55592,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getConstraintTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraintType_); - } - if (!getConstraintValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, constraintValue_); + if (e2ELatencyMs_ != 0F) { + output.writeFloat(1, e2ELatencyMs_); } unknownFields.writeTo(output); } @@ -30512,11 +55604,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (!getConstraintTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraintType_); - } - if (!getConstraintValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, constraintValue_); + if (e2ELatencyMs_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, e2ELatencyMs_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -30528,15 +55618,14 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Constraint)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Latency)) { return super.equals(obj); } - context.ContextOuterClass.Constraint other = (context.ContextOuterClass.Constraint) obj; + context.ContextOuterClass.Constraint_SLA_Latency other = (context.ContextOuterClass.Constraint_SLA_Latency) obj; - if (!getConstraintType() - .equals(other.getConstraintType())) return false; - if (!getConstraintValue() - .equals(other.getConstraintValue())) return false; + if (java.lang.Float.floatToIntBits(getE2ELatencyMs()) + != java.lang.Float.floatToIntBits( + other.getE2ELatencyMs())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -30548,78 +55637,77 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONSTRAINT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getConstraintType().hashCode(); - hash = (37 * hash) + CONSTRAINT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getConstraintValue().hashCode(); + hash = (37 * hash) + E2E_LATENCY_MS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getE2ELatencyMs()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Constraint parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency 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 context.ContextOuterClass.Constraint parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Latency parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency 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 context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Constraint parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Latency parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -30632,7 +55720,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Constraint prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Latency prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -30648,30 +55736,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Constraint ----------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.Constraint} + * Protobuf type {@code context.Constraint_SLA_Latency} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Constraint) - context.ContextOuterClass.ConstraintOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Latency) + context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); + context.ContextOuterClass.Constraint_SLA_Latency.class, context.ContextOuterClass.Constraint_SLA_Latency.Builder.class); } - // Construct using context.ContextOuterClass.Constraint.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Latency.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -30689,9 +55773,7 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - constraintType_ = ""; - - constraintValue_ = ""; + e2ELatencyMs_ = 0F; return this; } @@ -30699,17 +55781,17 @@ public final class ContextOuterClass { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Latency_descriptor; } @java.lang.Override - public context.ContextOuterClass.Constraint getDefaultInstanceForType() { - return context.ContextOuterClass.Constraint.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Constraint build() { - context.ContextOuterClass.Constraint result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Latency build() { + context.ContextOuterClass.Constraint_SLA_Latency result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -30717,10 +55799,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Constraint buildPartial() { - context.ContextOuterClass.Constraint result = new context.ContextOuterClass.Constraint(this); - result.constraintType_ = constraintType_; - result.constraintValue_ = constraintValue_; + public context.ContextOuterClass.Constraint_SLA_Latency buildPartial() { + context.ContextOuterClass.Constraint_SLA_Latency result = new context.ContextOuterClass.Constraint_SLA_Latency(this); + result.e2ELatencyMs_ = e2ELatencyMs_; onBuilt(); return result; } @@ -30759,201 +55840,75 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Constraint) { - return mergeFrom((context.ContextOuterClass.Constraint)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Latency) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Latency)other); } else { super.mergeFrom(other); return this; - } - } - - public Builder mergeFrom(context.ContextOuterClass.Constraint other) { - if (other == context.ContextOuterClass.Constraint.getDefaultInstance()) return this; - if (!other.getConstraintType().isEmpty()) { - constraintType_ = other.constraintType_; - onChanged(); - } - if (!other.getConstraintValue().isEmpty()) { - constraintValue_ = other.constraintValue_; - 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 { - context.ContextOuterClass.Constraint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Constraint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object constraintType_ = ""; - /** - * string constraint_type = 1; - * @return The constraintType. - */ - public java.lang.String getConstraintType() { - java.lang.Object ref = constraintType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - constraintType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string constraint_type = 1; - * @return The bytes for constraintType. - */ - public com.google.protobuf.ByteString - getConstraintTypeBytes() { - java.lang.Object ref = constraintType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string constraint_type = 1; - * @param value The constraintType to set. - * @return This builder for chaining. - */ - public Builder setConstraintType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - constraintType_ = value; - onChanged(); - return this; - } - /** - * string constraint_type = 1; - * @return This builder for chaining. - */ - public Builder clearConstraintType() { - - constraintType_ = getDefaultInstance().getConstraintType(); - onChanged(); - return this; + } } - /** - * string constraint_type = 1; - * @param value The bytes for constraintType to set. - * @return This builder for chaining. - */ - public Builder setConstraintTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - constraintType_ = value; + + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Latency other) { + if (other == context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance()) return this; + if (other.getE2ELatencyMs() != 0F) { + setE2ELatencyMs(other.getE2ELatencyMs()); + } + this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } - private java.lang.Object constraintValue_ = ""; - /** - * string constraint_value = 2; - * @return The constraintValue. - */ - public java.lang.String getConstraintValue() { - java.lang.Object ref = constraintValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - constraintValue_ = s; - return s; - } else { - return (java.lang.String) ref; - } + @java.lang.Override + public final boolean isInitialized() { + return true; } - /** - * string constraint_value = 2; - * @return The bytes for constraintValue. - */ - public com.google.protobuf.ByteString - getConstraintValueBytes() { - java.lang.Object ref = constraintValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - constraintValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + context.ContextOuterClass.Constraint_SLA_Latency parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Latency) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } + return this; } + + private float e2ELatencyMs_ ; /** - * string constraint_value = 2; - * @param value The constraintValue to set. - * @return This builder for chaining. + * float e2e_latency_ms = 1; + * @return The e2eLatencyMs. */ - public Builder setConstraintValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - constraintValue_ = value; - onChanged(); - return this; + @java.lang.Override + public float getE2ELatencyMs() { + return e2ELatencyMs_; } /** - * string constraint_value = 2; + * float e2e_latency_ms = 1; + * @param value The e2eLatencyMs to set. * @return This builder for chaining. */ - public Builder clearConstraintValue() { + public Builder setE2ELatencyMs(float value) { - constraintValue_ = getDefaultInstance().getConstraintValue(); + e2ELatencyMs_ = value; onChanged(); return this; } /** - * string constraint_value = 2; - * @param value The bytes for constraintValue to set. + * float e2e_latency_ms = 1; * @return This builder for chaining. */ - public Builder setConstraintValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearE2ELatencyMs() { - constraintValue_ = value; + e2ELatencyMs_ = 0F; onChanged(); return this; } @@ -30970,89 +55925,76 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Constraint) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Latency) } - // @@protoc_insertion_point(class_scope:context.Constraint) - private static final context.ContextOuterClass.Constraint DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Latency) + private static final context.ContextOuterClass.Constraint_SLA_Latency DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Latency(); } - public static context.ContextOuterClass.Constraint getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Constraint parsePartialFrom( + public Constraint_SLA_Latency parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Constraint(input, extensionRegistry); + return new Constraint_SLA_Latency(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Constraint getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Latency getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionId) + public interface Constraint_SLA_CapacityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Capacity) com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - boolean hasConnectionUuid(); - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - context.ContextOuterClass.Uuid getConnectionUuid(); - /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ - context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder(); + float getCapacityGbps(); } /** - *
-   * ----- Connection ----------------------------------------------------------------------------------------------------
-   * 
- * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.Constraint_SLA_Capacity} */ - public static final class ConnectionId extends + public static final class Constraint_SLA_Capacity extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionId) - ConnectionIdOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Capacity) + Constraint_SLA_CapacityOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionId.newBuilder() to construct. - private ConnectionId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Capacity.newBuilder() to construct. + private Constraint_SLA_Capacity(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionId() { + private Constraint_SLA_Capacity() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionId(); + return new Constraint_SLA_Capacity(); } @java.lang.Override @@ -31060,7 +56002,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionId( + private Constraint_SLA_Capacity( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -31078,17 +56020,9 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (connectionUuid_ != null) { - subBuilder = connectionUuid_.toBuilder(); - } - connectionUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connectionUuid_); - connectionUuid_ = subBuilder.buildPartial(); - } + case 13: { + capacityGbps_ = input.readFloat(); break; } default: { @@ -31112,41 +56046,26 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.Constraint_SLA_Capacity.class, context.ContextOuterClass.Constraint_SLA_Capacity.Builder.class); } - public static final int CONNECTION_UUID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid connectionUuid_; - /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - @java.lang.Override - public boolean hasConnectionUuid() { - return connectionUuid_ != null; - } - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getConnectionUuid() { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } + public static final int CAPACITY_GBPS_FIELD_NUMBER = 1; + private float capacityGbps_; /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - return getConnectionUuid(); + public float getCapacityGbps() { + return capacityGbps_; } private byte memoizedIsInitialized = -1; @@ -31163,8 +56082,8 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionUuid_ != null) { - output.writeMessage(1, getConnectionUuid()); + if (capacityGbps_ != 0F) { + output.writeFloat(1, capacityGbps_); } unknownFields.writeTo(output); } @@ -31175,9 +56094,9 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionUuid_ != null) { + if (capacityGbps_ != 0F) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionUuid()); + .computeFloatSize(1, capacityGbps_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -31189,16 +56108,14 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionId)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Capacity)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionId other = (context.ContextOuterClass.ConnectionId) obj; + context.ContextOuterClass.Constraint_SLA_Capacity other = (context.ContextOuterClass.Constraint_SLA_Capacity) obj; - if (hasConnectionUuid() != other.hasConnectionUuid()) return false; - if (hasConnectionUuid()) { - if (!getConnectionUuid() - .equals(other.getConnectionUuid())) return false; - } + if (java.lang.Float.floatToIntBits(getCapacityGbps()) + != java.lang.Float.floatToIntBits( + other.getCapacityGbps())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -31210,78 +56127,77 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionUuid()) { - hash = (37 * hash) + CONNECTION_UUID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionUuid().hashCode(); - } + hash = (37 * hash) + CAPACITY_GBPS_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getCapacityGbps()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionId parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity 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 context.ContextOuterClass.ConnectionId parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Capacity parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity 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 context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionId parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Capacity parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -31294,7 +56210,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionId prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Capacity prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -31310,30 +56226,26 @@ public final class ContextOuterClass { return builder; } /** - *
-     * ----- Connection ----------------------------------------------------------------------------------------------------
-     * 
- * - * Protobuf type {@code context.ConnectionId} + * Protobuf type {@code context.Constraint_SLA_Capacity} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionId) - context.ContextOuterClass.ConnectionIdOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Capacity) + context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionId_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionId.class, context.ContextOuterClass.ConnectionId.Builder.class); + context.ContextOuterClass.Constraint_SLA_Capacity.class, context.ContextOuterClass.Constraint_SLA_Capacity.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionId.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Capacity.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -31351,29 +56263,25 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; - } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; - } + capacityGbps_ = 0F; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionId_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Capacity_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionId.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionId build() { - context.ContextOuterClass.ConnectionId result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Capacity build() { + context.ContextOuterClass.Constraint_SLA_Capacity result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -31381,13 +56289,9 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionId buildPartial() { - context.ContextOuterClass.ConnectionId result = new context.ContextOuterClass.ConnectionId(this); - if (connectionUuidBuilder_ == null) { - result.connectionUuid_ = connectionUuid_; - } else { - result.connectionUuid_ = connectionUuidBuilder_.build(); - } + public context.ContextOuterClass.Constraint_SLA_Capacity buildPartial() { + context.ContextOuterClass.Constraint_SLA_Capacity result = new context.ContextOuterClass.Constraint_SLA_Capacity(this); + result.capacityGbps_ = capacityGbps_; onBuilt(); return result; } @@ -31426,18 +56330,18 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionId) { - return mergeFrom((context.ContextOuterClass.ConnectionId)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Capacity) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Capacity)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionId other) { - if (other == context.ContextOuterClass.ConnectionId.getDefaultInstance()) return this; - if (other.hasConnectionUuid()) { - mergeConnectionUuid(other.getConnectionUuid()); + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Capacity other) { + if (other == context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance()) return this; + if (other.getCapacityGbps() != 0F) { + setCapacityGbps(other.getCapacityGbps()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -31454,11 +56358,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionId parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Capacity parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionId) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Capacity) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -31468,123 +56372,35 @@ public final class ContextOuterClass { return this; } - private context.ContextOuterClass.Uuid connectionUuid_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> connectionUuidBuilder_; - /** - * .context.Uuid connection_uuid = 1; - * @return Whether the connectionUuid field is set. - */ - public boolean hasConnectionUuid() { - return connectionUuidBuilder_ != null || connectionUuid_ != null; - } - /** - * .context.Uuid connection_uuid = 1; - * @return The connectionUuid. - */ - public context.ContextOuterClass.Uuid getConnectionUuid() { - if (connectionUuidBuilder_ == null) { - return connectionUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } else { - return connectionUuidBuilder_.getMessage(); - } - } - /** - * .context.Uuid connection_uuid = 1; - */ - public Builder setConnectionUuid(context.ContextOuterClass.Uuid value) { - if (connectionUuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connectionUuid_ = value; - onChanged(); - } else { - connectionUuidBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.Uuid connection_uuid = 1; - */ - public Builder setConnectionUuid( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (connectionUuidBuilder_ == null) { - connectionUuid_ = builderForValue.build(); - onChanged(); - } else { - connectionUuidBuilder_.setMessage(builderForValue.build()); - } - - return this; - } + private float capacityGbps_ ; /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return The capacityGbps. */ - public Builder mergeConnectionUuid(context.ContextOuterClass.Uuid value) { - if (connectionUuidBuilder_ == null) { - if (connectionUuid_ != null) { - connectionUuid_ = - context.ContextOuterClass.Uuid.newBuilder(connectionUuid_).mergeFrom(value).buildPartial(); - } else { - connectionUuid_ = value; - } - onChanged(); - } else { - connectionUuidBuilder_.mergeFrom(value); - } - - return this; + @java.lang.Override + public float getCapacityGbps() { + return capacityGbps_; } /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @param value The capacityGbps to set. + * @return This builder for chaining. */ - public Builder clearConnectionUuid() { - if (connectionUuidBuilder_ == null) { - connectionUuid_ = null; - onChanged(); - } else { - connectionUuid_ = null; - connectionUuidBuilder_ = null; - } - + public Builder setCapacityGbps(float value) { + + capacityGbps_ = value; + onChanged(); return this; } /** - * .context.Uuid connection_uuid = 1; + * float capacity_gbps = 1; + * @return This builder for chaining. */ - public context.ContextOuterClass.Uuid.Builder getConnectionUuidBuilder() { + public Builder clearCapacityGbps() { + capacityGbps_ = 0F; onChanged(); - return getConnectionUuidFieldBuilder().getBuilder(); - } - /** - * .context.Uuid connection_uuid = 1; - */ - public context.ContextOuterClass.UuidOrBuilder getConnectionUuidOrBuilder() { - if (connectionUuidBuilder_ != null) { - return connectionUuidBuilder_.getMessageOrBuilder(); - } else { - return connectionUuid_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : connectionUuid_; - } - } - /** - * .context.Uuid connection_uuid = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getConnectionUuidFieldBuilder() { - if (connectionUuidBuilder_ == null) { - connectionUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getConnectionUuid(), - getParentForChildren(), - isClean()); - connectionUuid_ = null; - } - return connectionUuidBuilder_; + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -31599,125 +56415,82 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionId) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Capacity) } - // @@protoc_insertion_point(class_scope:context.ConnectionId) - private static final context.ContextOuterClass.ConnectionId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Capacity) + private static final context.ContextOuterClass.Constraint_SLA_Capacity DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionId(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Capacity(); } - public static context.ContextOuterClass.ConnectionId getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionId parsePartialFrom( + public Constraint_SLA_Capacity parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionId(input, extensionRegistry); + return new Constraint_SLA_Capacity(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionId getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Capacity getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.Connection) + public interface Constraint_SLA_AvailabilityOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Availability) com.google.protobuf.MessageOrBuilder { /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - boolean hasConnectionId(); - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - context.ContextOuterClass.ConnectionId getConnectionId(); - /** - * .context.ConnectionId connection_id = 1; - */ - context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder(); - - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - boolean hasRelatedServiceId(); - /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. - */ - context.ContextOuterClass.ServiceId getRelatedServiceId(); - /** - * .context.ServiceId related_service_id = 2; + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ - context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder(); + int getNumDisjointPaths(); /** - * repeated .context.EndPointId path = 3; - */ - java.util.List - getPathList(); - /** - * repeated .context.EndPointId path = 3; - */ - context.ContextOuterClass.EndPointId getPath(int index); - /** - * repeated .context.EndPointId path = 3; - */ - int getPathCount(); - /** - * repeated .context.EndPointId path = 3; - */ - java.util.List - getPathOrBuilderList(); - /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return The allActive. */ - context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index); + boolean getAllActive(); } /** - * Protobuf type {@code context.Connection} + * Protobuf type {@code context.Constraint_SLA_Availability} */ - public static final class Connection extends + public static final class Constraint_SLA_Availability extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.Connection) - ConnectionOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Availability) + Constraint_SLA_AvailabilityOrBuilder { private static final long serialVersionUID = 0L; - // Use Connection.newBuilder() to construct. - private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Availability.newBuilder() to construct. + private Constraint_SLA_Availability(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Connection() { - path_ = java.util.Collections.emptyList(); + private Constraint_SLA_Availability() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new Connection(); + return new Constraint_SLA_Availability(); } @java.lang.Override @@ -31725,7 +56498,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private Connection( + private Constraint_SLA_Availability( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -31733,7 +56506,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -31744,39 +56516,14 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { - context.ContextOuterClass.ConnectionId.Builder subBuilder = null; - if (connectionId_ != null) { - subBuilder = connectionId_.toBuilder(); - } - connectionId_ = input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connectionId_); - connectionId_ = subBuilder.buildPartial(); - } + case 8: { + numDisjointPaths_ = input.readUInt32(); break; } - case 18: { - context.ContextOuterClass.ServiceId.Builder subBuilder = null; - if (relatedServiceId_ != null) { - subBuilder = relatedServiceId_.toBuilder(); - } - relatedServiceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(relatedServiceId_); - relatedServiceId_ = subBuilder.buildPartial(); - } + case 16: { - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - path_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - path_.add( - input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry)); + allActive_ = input.readBool(); break; } default: { @@ -31794,116 +56541,43 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - path_ = java.util.Collections.unmodifiableList(path_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); - } - - public static final int CONNECTION_ID_FIELD_NUMBER = 1; - private context.ContextOuterClass.ConnectionId connectionId_; - /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - @java.lang.Override - public boolean hasConnectionId() { - return connectionId_ != null; - } - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - @java.lang.Override - public context.ContextOuterClass.ConnectionId getConnectionId() { - return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } - /** - * .context.ConnectionId connection_id = 1; - */ - @java.lang.Override - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { - return getConnectionId(); + context.ContextOuterClass.Constraint_SLA_Availability.class, context.ContextOuterClass.Constraint_SLA_Availability.Builder.class); } - public static final int RELATED_SERVICE_ID_FIELD_NUMBER = 2; - private context.ContextOuterClass.ServiceId relatedServiceId_; - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - @java.lang.Override - public boolean hasRelatedServiceId() { - return relatedServiceId_ != null; - } + public static final int NUM_DISJOINT_PATHS_FIELD_NUMBER = 1; + private int numDisjointPaths_; /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ @java.lang.Override - public context.ContextOuterClass.ServiceId getRelatedServiceId() { - return relatedServiceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } - /** - * .context.ServiceId related_service_id = 2; - */ - @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder() { - return getRelatedServiceId(); + public int getNumDisjointPaths() { + return numDisjointPaths_; } - public static final int PATH_FIELD_NUMBER = 3; - private java.util.List path_; - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public java.util.List getPathList() { - return path_; - } + public static final int ALL_ACTIVE_FIELD_NUMBER = 2; + private boolean allActive_; /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return The allActive. */ @java.lang.Override - public java.util.List - getPathOrBuilderList() { - return path_; - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public int getPathCount() { - return path_.size(); - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public context.ContextOuterClass.EndPointId getPath(int index) { - return path_.get(index); - } - /** - * repeated .context.EndPointId path = 3; - */ - @java.lang.Override - public context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index) { - return path_.get(index); + public boolean getAllActive() { + return allActive_; } private byte memoizedIsInitialized = -1; @@ -31920,14 +56594,11 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (connectionId_ != null) { - output.writeMessage(1, getConnectionId()); + if (numDisjointPaths_ != 0) { + output.writeUInt32(1, numDisjointPaths_); } - if (relatedServiceId_ != null) { - output.writeMessage(2, getRelatedServiceId()); - } - for (int i = 0; i < path_.size(); i++) { - output.writeMessage(3, path_.get(i)); + if (allActive_ != false) { + output.writeBool(2, allActive_); } unknownFields.writeTo(output); } @@ -31938,17 +56609,13 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - if (connectionId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConnectionId()); - } - if (relatedServiceId_ != null) { + if (numDisjointPaths_ != 0) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getRelatedServiceId()); + .computeUInt32Size(1, numDisjointPaths_); } - for (int i = 0; i < path_.size(); i++) { + if (allActive_ != false) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, path_.get(i)); + .computeBoolSize(2, allActive_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -31960,23 +56627,15 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.Connection)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Availability)) { return super.equals(obj); } - context.ContextOuterClass.Connection other = (context.ContextOuterClass.Connection) obj; + context.ContextOuterClass.Constraint_SLA_Availability other = (context.ContextOuterClass.Constraint_SLA_Availability) obj; - if (hasConnectionId() != other.hasConnectionId()) return false; - if (hasConnectionId()) { - if (!getConnectionId() - .equals(other.getConnectionId())) return false; - } - if (hasRelatedServiceId() != other.hasRelatedServiceId()) return false; - if (hasRelatedServiceId()) { - if (!getRelatedServiceId() - .equals(other.getRelatedServiceId())) return false; - } - if (!getPathList() - .equals(other.getPathList())) return false; + if (getNumDisjointPaths() + != other.getNumDisjointPaths()) return false; + if (getAllActive() + != other.getAllActive()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -31988,86 +56647,79 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConnectionId()) { - hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionId().hashCode(); - } - if (hasRelatedServiceId()) { - hash = (37 * hash) + RELATED_SERVICE_ID_FIELD_NUMBER; - hash = (53 * hash) + getRelatedServiceId().hashCode(); - } - if (getPathCount() > 0) { - hash = (37 * hash) + PATH_FIELD_NUMBER; - hash = (53 * hash) + getPathList().hashCode(); - } + hash = (37 * hash) + NUM_DISJOINT_PATHS_FIELD_NUMBER; + hash = (53 * hash) + getNumDisjointPaths(); + hash = (37 * hash) + ALL_ACTIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getAllActive()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.Connection parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability 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 context.ContextOuterClass.Connection parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Availability parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability 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 context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.Connection parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Availability parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -32080,7 +56732,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.Connection prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Availability prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -32096,26 +56748,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.Connection} + * Protobuf type {@code context.Constraint_SLA_Availability} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.Connection) - context.ContextOuterClass.ConnectionOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Availability) + context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_Connection_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.Connection.class, context.ContextOuterClass.Connection.Builder.class); + context.ContextOuterClass.Constraint_SLA_Availability.class, context.ContextOuterClass.Constraint_SLA_Availability.Builder.class); } - // Construct using context.ContextOuterClass.Connection.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Availability.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -32128,47 +56780,32 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPathFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionIdBuilder_ == null) { - connectionId_ = null; - } else { - connectionId_ = null; - connectionIdBuilder_ = null; - } - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = null; - } else { - relatedServiceId_ = null; - relatedServiceIdBuilder_ = null; - } - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - pathBuilder_.clear(); - } + numDisjointPaths_ = 0; + + allActive_ = false; + return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_Connection_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Availability_descriptor; } @java.lang.Override - public context.ContextOuterClass.Connection getDefaultInstanceForType() { - return context.ContextOuterClass.Connection.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.Connection build() { - context.ContextOuterClass.Connection result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Availability build() { + context.ContextOuterClass.Constraint_SLA_Availability result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -32176,28 +56813,10 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.Connection buildPartial() { - context.ContextOuterClass.Connection result = new context.ContextOuterClass.Connection(this); - int from_bitField0_ = bitField0_; - if (connectionIdBuilder_ == null) { - result.connectionId_ = connectionId_; - } else { - result.connectionId_ = connectionIdBuilder_.build(); - } - if (relatedServiceIdBuilder_ == null) { - result.relatedServiceId_ = relatedServiceId_; - } else { - result.relatedServiceId_ = relatedServiceIdBuilder_.build(); - } - if (pathBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - path_ = java.util.Collections.unmodifiableList(path_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.path_ = path_; - } else { - result.path_ = pathBuilder_.build(); - } + public context.ContextOuterClass.Constraint_SLA_Availability buildPartial() { + context.ContextOuterClass.Constraint_SLA_Availability result = new context.ContextOuterClass.Constraint_SLA_Availability(this); + result.numDisjointPaths_ = numDisjointPaths_; + result.allActive_ = allActive_; onBuilt(); return result; } @@ -32236,47 +56855,21 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.Connection) { - return mergeFrom((context.ContextOuterClass.Connection)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Availability) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Availability)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.Connection other) { - if (other == context.ContextOuterClass.Connection.getDefaultInstance()) return this; - if (other.hasConnectionId()) { - mergeConnectionId(other.getConnectionId()); - } - if (other.hasRelatedServiceId()) { - mergeRelatedServiceId(other.getRelatedServiceId()); + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Availability other) { + if (other == context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance()) return this; + if (other.getNumDisjointPaths() != 0) { + setNumDisjointPaths(other.getNumDisjointPaths()); } - if (pathBuilder_ == null) { - if (!other.path_.isEmpty()) { - if (path_.isEmpty()) { - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePathIsMutable(); - path_.addAll(other.path_); - } - onChanged(); - } - } else { - if (!other.path_.isEmpty()) { - if (pathBuilder_.isEmpty()) { - pathBuilder_.dispose(); - pathBuilder_ = null; - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - pathBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPathFieldBuilder() : null; - } else { - pathBuilder_.addAllMessages(other.path_); - } - } + if (other.getAllActive() != false) { + setAllActive(other.getAllActive()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -32293,11 +56886,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.Connection parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Availability parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.Connection) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Availability) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -32306,485 +56899,68 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private context.ContextOuterClass.ConnectionId connectionId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdBuilder_; - /** - * .context.ConnectionId connection_id = 1; - * @return Whether the connectionId field is set. - */ - public boolean hasConnectionId() { - return connectionIdBuilder_ != null || connectionId_ != null; - } - /** - * .context.ConnectionId connection_id = 1; - * @return The connectionId. - */ - public context.ContextOuterClass.ConnectionId getConnectionId() { - if (connectionIdBuilder_ == null) { - return connectionId_ == null ? context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } else { - return connectionIdBuilder_.getMessage(); - } - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder setConnectionId(context.ContextOuterClass.ConnectionId value) { - if (connectionIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connectionId_ = value; - onChanged(); - } else { - connectionIdBuilder_.setMessage(value); - } - - return this; - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder setConnectionId( - context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdBuilder_ == null) { - connectionId_ = builderForValue.build(); - onChanged(); - } else { - connectionIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.ConnectionId connection_id = 1; - */ - public Builder mergeConnectionId(context.ContextOuterClass.ConnectionId value) { - if (connectionIdBuilder_ == null) { - if (connectionId_ != null) { - connectionId_ = - context.ContextOuterClass.ConnectionId.newBuilder(connectionId_).mergeFrom(value).buildPartial(); - } else { - connectionId_ = value; - } - onChanged(); - } else { - connectionIdBuilder_.mergeFrom(value); - } - return this; - } + private int numDisjointPaths_ ; /** - * .context.ConnectionId connection_id = 1; + * uint32 num_disjoint_paths = 1; + * @return The numDisjointPaths. */ - public Builder clearConnectionId() { - if (connectionIdBuilder_ == null) { - connectionId_ = null; - onChanged(); - } else { - connectionId_ = null; - connectionIdBuilder_ = null; - } - - return this; + @java.lang.Override + public int getNumDisjointPaths() { + return numDisjointPaths_; } /** - * .context.ConnectionId connection_id = 1; + * uint32 num_disjoint_paths = 1; + * @param value The numDisjointPaths to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ConnectionId.Builder getConnectionIdBuilder() { + public Builder setNumDisjointPaths(int value) { + numDisjointPaths_ = value; onChanged(); - return getConnectionIdFieldBuilder().getBuilder(); - } - /** - * .context.ConnectionId connection_id = 1; - */ - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdOrBuilder() { - if (connectionIdBuilder_ != null) { - return connectionIdBuilder_.getMessageOrBuilder(); - } else { - return connectionId_ == null ? - context.ContextOuterClass.ConnectionId.getDefaultInstance() : connectionId_; - } - } - /** - * .context.ConnectionId connection_id = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> - getConnectionIdFieldBuilder() { - if (connectionIdBuilder_ == null) { - connectionIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( - getConnectionId(), - getParentForChildren(), - isClean()); - connectionId_ = null; - } - return connectionIdBuilder_; - } - - private context.ContextOuterClass.ServiceId relatedServiceId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> relatedServiceIdBuilder_; - /** - * .context.ServiceId related_service_id = 2; - * @return Whether the relatedServiceId field is set. - */ - public boolean hasRelatedServiceId() { - return relatedServiceIdBuilder_ != null || relatedServiceId_ != null; - } - /** - * .context.ServiceId related_service_id = 2; - * @return The relatedServiceId. - */ - public context.ContextOuterClass.ServiceId getRelatedServiceId() { - if (relatedServiceIdBuilder_ == null) { - return relatedServiceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } else { - return relatedServiceIdBuilder_.getMessage(); - } - } - /** - * .context.ServiceId related_service_id = 2; - */ - public Builder setRelatedServiceId(context.ContextOuterClass.ServiceId value) { - if (relatedServiceIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - relatedServiceId_ = value; - onChanged(); - } else { - relatedServiceIdBuilder_.setMessage(value); - } - return this; } /** - * .context.ServiceId related_service_id = 2; + * uint32 num_disjoint_paths = 1; + * @return This builder for chaining. */ - public Builder setRelatedServiceId( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = builderForValue.build(); - onChanged(); - } else { - relatedServiceIdBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearNumDisjointPaths() { + + numDisjointPaths_ = 0; + onChanged(); return this; } - /** - * .context.ServiceId related_service_id = 2; - */ - public Builder mergeRelatedServiceId(context.ContextOuterClass.ServiceId value) { - if (relatedServiceIdBuilder_ == null) { - if (relatedServiceId_ != null) { - relatedServiceId_ = - context.ContextOuterClass.ServiceId.newBuilder(relatedServiceId_).mergeFrom(value).buildPartial(); - } else { - relatedServiceId_ = value; - } - onChanged(); - } else { - relatedServiceIdBuilder_.mergeFrom(value); - } - return this; - } + private boolean allActive_ ; /** - * .context.ServiceId related_service_id = 2; + * bool all_active = 2; + * @return The allActive. */ - public Builder clearRelatedServiceId() { - if (relatedServiceIdBuilder_ == null) { - relatedServiceId_ = null; - onChanged(); - } else { - relatedServiceId_ = null; - relatedServiceIdBuilder_ = null; - } - - return this; + @java.lang.Override + public boolean getAllActive() { + return allActive_; } /** - * .context.ServiceId related_service_id = 2; + * bool all_active = 2; + * @param value The allActive to set. + * @return This builder for chaining. */ - public context.ContextOuterClass.ServiceId.Builder getRelatedServiceIdBuilder() { + public Builder setAllActive(boolean value) { + allActive_ = value; onChanged(); - return getRelatedServiceIdFieldBuilder().getBuilder(); - } - /** - * .context.ServiceId related_service_id = 2; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getRelatedServiceIdOrBuilder() { - if (relatedServiceIdBuilder_ != null) { - return relatedServiceIdBuilder_.getMessageOrBuilder(); - } else { - return relatedServiceId_ == null ? - context.ContextOuterClass.ServiceId.getDefaultInstance() : relatedServiceId_; - } - } - /** - * .context.ServiceId related_service_id = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getRelatedServiceIdFieldBuilder() { - if (relatedServiceIdBuilder_ == null) { - relatedServiceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - getRelatedServiceId(), - getParentForChildren(), - isClean()); - relatedServiceId_ = null; - } - return relatedServiceIdBuilder_; - } - - private java.util.List path_ = - java.util.Collections.emptyList(); - private void ensurePathIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - path_ = new java.util.ArrayList(path_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> pathBuilder_; - - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List getPathList() { - if (pathBuilder_ == null) { - return java.util.Collections.unmodifiableList(path_); - } else { - return pathBuilder_.getMessageList(); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public int getPathCount() { - if (pathBuilder_ == null) { - return path_.size(); - } else { - return pathBuilder_.getCount(); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId getPath(int index) { - if (pathBuilder_ == null) { - return path_.get(index); - } else { - return pathBuilder_.getMessage(index); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder setPath( - int index, context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.set(index, value); - onChanged(); - } else { - pathBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder setPath( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.set(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath(context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(value); - onChanged(); - } else { - pathBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - int index, context.ContextOuterClass.EndPointId value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(index, value); - onChanged(); - } else { - pathBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addPath( - int index, context.ContextOuterClass.EndPointId.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; - */ - public Builder addAllPath( - java.lang.Iterable values) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, path_); - onChanged(); - } else { - pathBuilder_.addAllMessages(values); - } return this; } /** - * repeated .context.EndPointId path = 3; - */ - public Builder clearPath() { - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - pathBuilder_.clear(); - } - return this; - } - /** - * repeated .context.EndPointId path = 3; + * bool all_active = 2; + * @return This builder for chaining. */ - public Builder removePath(int index) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.remove(index); - onChanged(); - } else { - pathBuilder_.remove(index); - } + public Builder clearAllActive() { + + allActive_ = false; + onChanged(); return this; } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder getPathBuilder( - int index) { - return getPathFieldBuilder().getBuilder(index); - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointIdOrBuilder getPathOrBuilder( - int index) { - if (pathBuilder_ == null) { - return path_.get(index); } else { - return pathBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List - getPathOrBuilderList() { - if (pathBuilder_ != null) { - return pathBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(path_); - } - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder addPathBuilder() { - return getPathFieldBuilder().addBuilder( - context.ContextOuterClass.EndPointId.getDefaultInstance()); - } - /** - * repeated .context.EndPointId path = 3; - */ - public context.ContextOuterClass.EndPointId.Builder addPathBuilder( - int index) { - return getPathFieldBuilder().addBuilder( - index, context.ContextOuterClass.EndPointId.getDefaultInstance()); - } - /** - * repeated .context.EndPointId path = 3; - */ - public java.util.List - getPathBuilderList() { - return getPathFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> - getPathFieldBuilder() { - if (pathBuilder_ == null) { - pathBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( - path_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - path_ = null; - } - return pathBuilder_; - } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -32798,95 +56974,100 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.Connection) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Availability) } - // @@protoc_insertion_point(class_scope:context.Connection) - private static final context.ContextOuterClass.Connection DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Availability) + private static final context.ContextOuterClass.Constraint_SLA_Availability DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.Connection(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Availability(); } - public static context.ContextOuterClass.Connection getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public Connection parsePartialFrom( + public Constraint_SLA_Availability parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Connection(input, extensionRegistry); + return new Constraint_SLA_Availability(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.Connection getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Availability getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionIdListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionIdList) + public interface Constraint_SLA_Isolation_levelOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint_SLA_Isolation_level) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ - java.util.List - getConnectionIdsList(); + java.util.List getIsolationLevelList(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ - context.ContextOuterClass.ConnectionId getConnectionIds(int index); + int getIsolationLevelCount(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ - int getConnectionIdsCount(); + context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ - java.util.List - getConnectionIdsOrBuilderList(); + java.util.List + getIsolationLevelValueList(); /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ - context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index); + int getIsolationLevelValue(int index); } /** - * Protobuf type {@code context.ConnectionIdList} + * Protobuf type {@code context.Constraint_SLA_Isolation_level} */ - public static final class ConnectionIdList extends + public static final class Constraint_SLA_Isolation_level extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionIdList) - ConnectionIdListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint_SLA_Isolation_level) + Constraint_SLA_Isolation_levelOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionIdList.newBuilder() to construct. - private ConnectionIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint_SLA_Isolation_level.newBuilder() to construct. + private Constraint_SLA_Isolation_level(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionIdList() { - connectionIds_ = java.util.Collections.emptyList(); + private Constraint_SLA_Isolation_level() { + isolationLevel_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionIdList(); + return new Constraint_SLA_Isolation_level(); } @java.lang.Override @@ -32894,7 +57075,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionIdList( + private Constraint_SLA_Isolation_level( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -32913,13 +57094,27 @@ public final class ContextOuterClass { case 0: done = true; break; - case 10: { + case 8: { + int rawValue = input.readEnum(); if (!((mutable_bitField0_ & 0x00000001) != 0)) { - connectionIds_ = new java.util.ArrayList(); + isolationLevel_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - connectionIds_.add( - input.readMessage(context.ContextOuterClass.ConnectionId.parser(), extensionRegistry)); + isolationLevel_.add(rawValue); + break; + } + case 10: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + isolationLevel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + isolationLevel_.add(rawValue); + } + input.popLimit(oldLimit); break; } default: { @@ -32938,7 +57133,7 @@ public final class ContextOuterClass { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); + isolationLevel_ = java.util.Collections.unmodifiableList(isolationLevel_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -32946,56 +57141,74 @@ public final class ContextOuterClass { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); + context.ContextOuterClass.Constraint_SLA_Isolation_level.class, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder.class); } - public static final int CONNECTION_IDS_FIELD_NUMBER = 1; - private java.util.List connectionIds_; + public static final int ISOLATION_LEVEL_FIELD_NUMBER = 1; + private java.util.List isolationLevel_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum> isolationLevel_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>() { + public context.ContextOuterClass.IsolationLevelEnum convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + context.ContextOuterClass.IsolationLevelEnum result = context.ContextOuterClass.IsolationLevelEnum.valueOf(from); + return result == null ? context.ContextOuterClass.IsolationLevelEnum.UNRECOGNIZED : result; + } + }; /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ @java.lang.Override - public java.util.List getConnectionIdsList() { - return connectionIds_; + public java.util.List getIsolationLevelList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>(isolationLevel_, isolationLevel_converter_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ @java.lang.Override - public java.util.List - getConnectionIdsOrBuilderList() { - return connectionIds_; + public int getIsolationLevelCount() { + return isolationLevel_.size(); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ @java.lang.Override - public int getConnectionIdsCount() { - return connectionIds_.size(); + public context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index) { + return isolationLevel_converter_.convert(isolationLevel_.get(index)); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ @java.lang.Override - public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { - return connectionIds_.get(index); + public java.util.List + getIsolationLevelValueList() { + return isolationLevel_; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ @java.lang.Override - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index) { - return connectionIds_.get(index); + public int getIsolationLevelValue(int index) { + return isolationLevel_.get(index); } + private int isolationLevelMemoizedSerializedSize; private byte memoizedIsInitialized = -1; @java.lang.Override @@ -33011,8 +57224,13 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < connectionIds_.size(); i++) { - output.writeMessage(1, connectionIds_.get(i)); + getSerializedSize(); + if (getIsolationLevelList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(isolationLevelMemoizedSerializedSize); + } + for (int i = 0; i < isolationLevel_.size(); i++) { + output.writeEnumNoTag(isolationLevel_.get(i)); } unknownFields.writeTo(output); } @@ -33023,9 +57241,17 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < connectionIds_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, connectionIds_.get(i)); + { + int dataSize = 0; + for (int i = 0; i < isolationLevel_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(isolationLevel_.get(i)); + } + size += dataSize; + if (!getIsolationLevelList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }isolationLevelMemoizedSerializedSize = dataSize; } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -33037,13 +57263,12 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionIdList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint_SLA_Isolation_level)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionIdList other = (context.ContextOuterClass.ConnectionIdList) obj; + context.ContextOuterClass.Constraint_SLA_Isolation_level other = (context.ContextOuterClass.Constraint_SLA_Isolation_level) obj; - if (!getConnectionIdsList() - .equals(other.getConnectionIdsList())) return false; + if (!isolationLevel_.equals(other.isolationLevel_)) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -33055,78 +57280,78 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConnectionIdsCount() > 0) { - hash = (37 * hash) + CONNECTION_IDS_FIELD_NUMBER; - hash = (53 * hash) + getConnectionIdsList().hashCode(); + if (getIsolationLevelCount() > 0) { + hash = (37 * hash) + ISOLATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + isolationLevel_.hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionIdList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level 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 context.ContextOuterClass.ConnectionIdList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level 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 context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionIdList parseFrom( + public static context.ContextOuterClass.Constraint_SLA_Isolation_level parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -33139,7 +57364,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionIdList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint_SLA_Isolation_level prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -33155,26 +57380,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConnectionIdList} + * Protobuf type {@code context.Constraint_SLA_Isolation_level} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionIdList) - context.ContextOuterClass.ConnectionIdListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint_SLA_Isolation_level) + context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionIdList.class, context.ContextOuterClass.ConnectionIdList.Builder.class); + context.ContextOuterClass.Constraint_SLA_Isolation_level.class, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionIdList.newBuilder() + // Construct using context.ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -33187,35 +57412,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConnectionIdsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionIdsBuilder_ == null) { - connectionIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - connectionIdsBuilder_.clear(); - } + isolationLevel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionIdList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_SLA_Isolation_level_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionIdList.getDefaultInstance(); + public context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList build() { - context.ContextOuterClass.ConnectionIdList result = buildPartial(); + public context.ContextOuterClass.Constraint_SLA_Isolation_level build() { + context.ContextOuterClass.Constraint_SLA_Isolation_level result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -33223,18 +57443,14 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList buildPartial() { - context.ContextOuterClass.ConnectionIdList result = new context.ContextOuterClass.ConnectionIdList(this); + public context.ContextOuterClass.Constraint_SLA_Isolation_level buildPartial() { + context.ContextOuterClass.Constraint_SLA_Isolation_level result = new context.ContextOuterClass.Constraint_SLA_Isolation_level(this); int from_bitField0_ = bitField0_; - if (connectionIdsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - connectionIds_ = java.util.Collections.unmodifiableList(connectionIds_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.connectionIds_ = connectionIds_; - } else { - result.connectionIds_ = connectionIdsBuilder_.build(); + if (((bitField0_ & 0x00000001) != 0)) { + isolationLevel_ = java.util.Collections.unmodifiableList(isolationLevel_); + bitField0_ = (bitField0_ & ~0x00000001); } + result.isolationLevel_ = isolationLevel_; onBuilt(); return result; } @@ -33273,41 +57489,25 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionIdList) { - return mergeFrom((context.ContextOuterClass.ConnectionIdList)other); + if (other instanceof context.ContextOuterClass.Constraint_SLA_Isolation_level) { + return mergeFrom((context.ContextOuterClass.Constraint_SLA_Isolation_level)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionIdList other) { - if (other == context.ContextOuterClass.ConnectionIdList.getDefaultInstance()) return this; - if (connectionIdsBuilder_ == null) { - if (!other.connectionIds_.isEmpty()) { - if (connectionIds_.isEmpty()) { - connectionIds_ = other.connectionIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConnectionIdsIsMutable(); - connectionIds_.addAll(other.connectionIds_); - } - onChanged(); - } - } else { - if (!other.connectionIds_.isEmpty()) { - if (connectionIdsBuilder_.isEmpty()) { - connectionIdsBuilder_.dispose(); - connectionIdsBuilder_ = null; - connectionIds_ = other.connectionIds_; - bitField0_ = (bitField0_ & ~0x00000001); - connectionIdsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConnectionIdsFieldBuilder() : null; - } else { - connectionIdsBuilder_.addAllMessages(other.connectionIds_); - } + public Builder mergeFrom(context.ContextOuterClass.Constraint_SLA_Isolation_level other) { + if (other == context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance()) return this; + if (!other.isolationLevel_.isEmpty()) { + if (isolationLevel_.isEmpty()) { + isolationLevel_ = other.isolationLevel_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIsolationLevelIsMutable(); + isolationLevel_.addAll(other.isolationLevel_); } + onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -33324,11 +57524,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionIdList parsedMessage = null; + context.ContextOuterClass.Constraint_SLA_Isolation_level parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionIdList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint_SLA_Isolation_level) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -33339,244 +57539,144 @@ public final class ContextOuterClass { } private int bitField0_; - private java.util.List connectionIds_ = + private java.util.List isolationLevel_ = java.util.Collections.emptyList(); - private void ensureConnectionIdsIsMutable() { + private void ensureIsolationLevelIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - connectionIds_ = new java.util.ArrayList(connectionIds_); + isolationLevel_ = new java.util.ArrayList(isolationLevel_); bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> connectionIdsBuilder_; - - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public java.util.List getConnectionIdsList() { - if (connectionIdsBuilder_ == null) { - return java.util.Collections.unmodifiableList(connectionIds_); - } else { - return connectionIdsBuilder_.getMessageList(); } } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the isolationLevel. */ - public int getConnectionIdsCount() { - if (connectionIdsBuilder_ == null) { - return connectionIds_.size(); - } else { - return connectionIdsBuilder_.getCount(); - } + public java.util.List getIsolationLevelList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, context.ContextOuterClass.IsolationLevelEnum>(isolationLevel_, isolationLevel_converter_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return The count of isolationLevel. */ - public context.ContextOuterClass.ConnectionId getConnectionIds(int index) { - if (connectionIdsBuilder_ == null) { - return connectionIds_.get(index); - } else { - return connectionIdsBuilder_.getMessage(index); - } + public int getIsolationLevelCount() { + return isolationLevel_.size(); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the element to return. + * @return The isolationLevel at the given index. */ - public Builder setConnectionIds( - int index, context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.set(index, value); - onChanged(); - } else { - connectionIdsBuilder_.setMessage(index, value); - } - return this; + public context.ContextOuterClass.IsolationLevelEnum getIsolationLevel(int index) { + return isolationLevel_converter_.convert(isolationLevel_.get(index)); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index to set the value at. + * @param value The isolationLevel to set. + * @return This builder for chaining. */ - public Builder setConnectionIds( - int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.set(index, builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.setMessage(index, builderForValue.build()); + public Builder setIsolationLevel( + int index, context.ContextOuterClass.IsolationLevelEnum value) { + if (value == null) { + throw new NullPointerException(); } + ensureIsolationLevelIsMutable(); + isolationLevel_.set(index, value.getNumber()); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param value The isolationLevel to add. + * @return This builder for chaining. */ - public Builder addConnectionIds(context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.add(value); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(value); + public Builder addIsolationLevel(context.ContextOuterClass.IsolationLevelEnum value) { + if (value == null) { + throw new NullPointerException(); } + ensureIsolationLevelIsMutable(); + isolationLevel_.add(value.getNumber()); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param values The isolationLevel to add. + * @return This builder for chaining. */ - public Builder addConnectionIds( - int index, context.ContextOuterClass.ConnectionId value) { - if (connectionIdsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionIdsIsMutable(); - connectionIds_.add(index, value); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(index, value); + public Builder addAllIsolationLevel( + java.lang.Iterable values) { + ensureIsolationLevelIsMutable(); + for (context.ContextOuterClass.IsolationLevelEnum value : values) { + isolationLevel_.add(value.getNumber()); } + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return This builder for chaining. */ - public Builder addConnectionIds( - context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.add(builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(builderForValue.build()); - } + public Builder clearIsolationLevel() { + isolationLevel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @return A list containing the enum numeric values on the wire for isolationLevel. */ - public Builder addConnectionIds( - int index, context.ContextOuterClass.ConnectionId.Builder builderForValue) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.add(index, builderForValue.build()); - onChanged(); - } else { - connectionIdsBuilder_.addMessage(index, builderForValue.build()); - } - return this; + public java.util.List + getIsolationLevelValueList() { + return java.util.Collections.unmodifiableList(isolationLevel_); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. */ - public Builder addAllConnectionIds( - java.lang.Iterable values) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, connectionIds_); - onChanged(); - } else { - connectionIdsBuilder_.addAllMessages(values); - } - return this; + public int getIsolationLevelValue(int index) { + return isolationLevel_.get(index); } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of isolationLevel at the given index. + * @return This builder for chaining. */ - public Builder clearConnectionIds() { - if (connectionIdsBuilder_ == null) { - connectionIds_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - connectionIdsBuilder_.clear(); - } + public Builder setIsolationLevelValue( + int index, int value) { + ensureIsolationLevelIsMutable(); + isolationLevel_.set(index, value); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param value The enum numeric value on the wire for isolationLevel to add. + * @return This builder for chaining. */ - public Builder removeConnectionIds(int index) { - if (connectionIdsBuilder_ == null) { - ensureConnectionIdsIsMutable(); - connectionIds_.remove(index); - onChanged(); - } else { - connectionIdsBuilder_.remove(index); - } + public Builder addIsolationLevelValue(int value) { + ensureIsolationLevelIsMutable(); + isolationLevel_.add(value); + onChanged(); return this; } /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder getConnectionIdsBuilder( - int index) { - return getConnectionIdsFieldBuilder().getBuilder(index); - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionIdOrBuilder getConnectionIdsOrBuilder( - int index) { - if (connectionIdsBuilder_ == null) { - return connectionIds_.get(index); } else { - return connectionIdsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public java.util.List - getConnectionIdsOrBuilderList() { - if (connectionIdsBuilder_ != null) { - return connectionIdsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(connectionIds_); - } - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder() { - return getConnectionIdsFieldBuilder().addBuilder( - context.ContextOuterClass.ConnectionId.getDefaultInstance()); - } - /** - * repeated .context.ConnectionId connection_ids = 1; - */ - public context.ContextOuterClass.ConnectionId.Builder addConnectionIdsBuilder( - int index) { - return getConnectionIdsFieldBuilder().addBuilder( - index, context.ContextOuterClass.ConnectionId.getDefaultInstance()); - } - /** - * repeated .context.ConnectionId connection_ids = 1; + * repeated .context.IsolationLevelEnum isolation_level = 1; + * @param values The enum numeric values on the wire for isolationLevel to add. + * @return This builder for chaining. */ - public java.util.List - getConnectionIdsBuilderList() { - return getConnectionIdsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder> - getConnectionIdsFieldBuilder() { - if (connectionIdsBuilder_ == null) { - connectionIdsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ConnectionId, context.ContextOuterClass.ConnectionId.Builder, context.ContextOuterClass.ConnectionIdOrBuilder>( - connectionIds_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - connectionIds_ = null; + public Builder addAllIsolationLevelValue( + java.lang.Iterable values) { + ensureIsolationLevelIsMutable(); + for (int value : values) { + isolationLevel_.add(value); } - return connectionIdsBuilder_; + onChanged(); + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -33591,95 +57691,192 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionIdList) + // @@protoc_insertion_point(builder_scope:context.Constraint_SLA_Isolation_level) } - // @@protoc_insertion_point(class_scope:context.ConnectionIdList) - private static final context.ContextOuterClass.ConnectionIdList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint_SLA_Isolation_level) + private static final context.ContextOuterClass.Constraint_SLA_Isolation_level DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionIdList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint_SLA_Isolation_level(); } - public static context.ContextOuterClass.ConnectionIdList getDefaultInstance() { + public static context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionIdList parsePartialFrom( + public Constraint_SLA_Isolation_level parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionIdList(input, extensionRegistry); + return new Constraint_SLA_Isolation_level(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionIdList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint_SLA_Isolation_level getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface ConnectionListOrBuilder extends - // @@protoc_insertion_point(interface_extends:context.ConnectionList) + public interface ConstraintOrBuilder extends + // @@protoc_insertion_point(interface_extends:context.Constraint) com.google.protobuf.MessageOrBuilder { /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. */ - java.util.List - getConnectionsList(); + boolean hasCustom(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; + * @return The custom. */ - context.ContextOuterClass.Connection getConnections(int index); + context.ContextOuterClass.Constraint_Custom getCustom(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Custom custom = 1; */ - int getConnectionsCount(); + context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder(); + /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. */ - java.util.List - getConnectionsOrBuilderList(); + boolean hasSchedule(); /** - * repeated .context.Connection connections = 1; + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. */ - context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index); + context.ContextOuterClass.Constraint_Schedule getSchedule(); + /** + * .context.Constraint_Schedule schedule = 2; + */ + context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder(); + + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + boolean hasEndpointLocation(); + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation(); + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder(); + + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + boolean hasEndpointPriority(); + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority(); + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder(); + + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + boolean hasSlaCapacity(); + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity(); + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder(); + + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + boolean hasSlaLatency(); + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency(); + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder(); + + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ + boolean hasSlaAvailability(); + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. + */ + context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability(); + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder(); + + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. + */ + boolean hasSlaIsolation(); + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. + */ + context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation(); + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + */ + context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder(); + + public context.ContextOuterClass.Constraint.ConstraintCase getConstraintCase(); } /** - * Protobuf type {@code context.ConnectionList} + * Protobuf type {@code context.Constraint} */ - public static final class ConnectionList extends + public static final class Constraint extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:context.ConnectionList) - ConnectionListOrBuilder { + // @@protoc_insertion_point(message_implements:context.Constraint) + ConstraintOrBuilder { private static final long serialVersionUID = 0L; - // Use ConnectionList.newBuilder() to construct. - private ConnectionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use Constraint.newBuilder() to construct. + private Constraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private ConnectionList() { - connections_ = java.util.Collections.emptyList(); + private Constraint() { } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new ConnectionList(); + return new Constraint(); } @java.lang.Override @@ -33687,7 +57884,7 @@ public final class ContextOuterClass { getUnknownFields() { return this.unknownFields; } - private ConnectionList( + private Constraint( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -33695,7 +57892,6 @@ public final class ContextOuterClass { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -33707,12 +57903,115 @@ public final class ContextOuterClass { done = true; break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; + context.ContextOuterClass.Constraint_Custom.Builder subBuilder = null; + if (constraintCase_ == 1) { + subBuilder = ((context.ContextOuterClass.Constraint_Custom) constraint_).toBuilder(); } - connections_.add( - input.readMessage(context.ContextOuterClass.Connection.parser(), extensionRegistry)); + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_Custom.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_Custom) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 1; + break; + } + case 18: { + context.ContextOuterClass.Constraint_Schedule.Builder subBuilder = null; + if (constraintCase_ == 2) { + subBuilder = ((context.ContextOuterClass.Constraint_Schedule) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_Schedule.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_Schedule) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 2; + break; + } + case 26: { + context.ContextOuterClass.Constraint_EndPointLocation.Builder subBuilder = null; + if (constraintCase_ == 3) { + subBuilder = ((context.ContextOuterClass.Constraint_EndPointLocation) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_EndPointLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 3; + break; + } + case 34: { + context.ContextOuterClass.Constraint_EndPointPriority.Builder subBuilder = null; + if (constraintCase_ == 4) { + subBuilder = ((context.ContextOuterClass.Constraint_EndPointPriority) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_EndPointPriority.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 4; + break; + } + case 42: { + context.ContextOuterClass.Constraint_SLA_Capacity.Builder subBuilder = null; + if (constraintCase_ == 5) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Capacity.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 5; + break; + } + case 50: { + context.ContextOuterClass.Constraint_SLA_Latency.Builder subBuilder = null; + if (constraintCase_ == 6) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Latency) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Latency.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 6; + break; + } + case 58: { + context.ContextOuterClass.Constraint_SLA_Availability.Builder subBuilder = null; + if (constraintCase_ == 7) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Availability) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Availability.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 7; + break; + } + case 66: { + context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder subBuilder = null; + if (constraintCase_ == 8) { + subBuilder = ((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_).toBuilder(); + } + constraint_ = + input.readMessage(context.ContextOuterClass.Constraint_SLA_Isolation_level.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); + constraint_ = subBuilder.buildPartial(); + } + constraintCase_ = 8; break; } default: { @@ -33730,64 +58029,322 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); + } + + private int constraintCase_ = 0; + private java.lang.Object constraint_; + public enum ConstraintCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CUSTOM(1), + SCHEDULE(2), + ENDPOINT_LOCATION(3), + ENDPOINT_PRIORITY(4), + SLA_CAPACITY(5), + SLA_LATENCY(6), + SLA_AVAILABILITY(7), + SLA_ISOLATION(8), + CONSTRAINT_NOT_SET(0); + private final int value; + private ConstraintCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConstraintCase valueOf(int value) { + return forNumber(value); + } + + public static ConstraintCase forNumber(int value) { + switch (value) { + case 1: return CUSTOM; + case 2: return SCHEDULE; + case 3: return ENDPOINT_LOCATION; + case 4: return ENDPOINT_PRIORITY; + case 5: return SLA_CAPACITY; + case 6: return SLA_LATENCY; + case 7: return SLA_AVAILABILITY; + case 8: return SLA_ISOLATION; + case 0: return CONSTRAINT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ConstraintCase + getConstraintCase() { + return ConstraintCase.forNumber( + constraintCase_); + } + + public static final int CUSTOM_FIELD_NUMBER = 1; + /** + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return constraintCase_ == 1; + } + /** + * .context.Constraint_Custom custom = 1; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Custom getCustom() { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + /** + * .context.Constraint_Custom custom = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder() { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + + public static final int SCHEDULE_FIELD_NUMBER = 2; + /** + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return constraintCase_ == 2; + } + /** + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Schedule getSchedule() { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder() { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + + public static final int ENDPOINT_LOCATION_FIELD_NUMBER = 3; + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + @java.lang.Override + public boolean hasEndpointLocation() { + return constraintCase_ == 3; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation() { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder() { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + + public static final int ENDPOINT_PRIORITY_FIELD_NUMBER = 4; + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + @java.lang.Override + public boolean hasEndpointPriority() { + return constraintCase_ == 4; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority() { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder() { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + + public static final int SLA_CAPACITY_FIELD_NUMBER = 5; + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + @java.lang.Override + public boolean hasSlaCapacity() { + return constraintCase_ == 5; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity() { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder() { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + + public static final int SLA_LATENCY_FIELD_NUMBER = 6; + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + @java.lang.Override + public boolean hasSlaLatency() { + return constraintCase_ == 6; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency() { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder() { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } + public static final int SLA_AVAILABILITY_FIELD_NUMBER = 7; + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); + public boolean hasSlaAvailability() { + return constraintCase_ == 7; } - - public static final int CONNECTIONS_FIELD_NUMBER = 1; - private java.util.List connections_; /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. */ @java.lang.Override - public java.util.List getConnectionsList() { - return connections_; + public context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability() { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ @java.lang.Override - public java.util.List - getConnectionsOrBuilderList() { - return connections_; + public context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder() { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } + + public static final int SLA_ISOLATION_FIELD_NUMBER = 8; /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. */ @java.lang.Override - public int getConnectionsCount() { - return connections_.size(); + public boolean hasSlaIsolation() { + return constraintCase_ == 8; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. */ @java.lang.Override - public context.ContextOuterClass.Connection getConnections(int index) { - return connections_.get(index); + public context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation() { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ @java.lang.Override - public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index) { - return connections_.get(index); + public context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder() { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -33804,8 +58361,29 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < connections_.size(); i++) { - output.writeMessage(1, connections_.get(i)); + if (constraintCase_ == 1) { + output.writeMessage(1, (context.ContextOuterClass.Constraint_Custom) constraint_); + } + if (constraintCase_ == 2) { + output.writeMessage(2, (context.ContextOuterClass.Constraint_Schedule) constraint_); + } + if (constraintCase_ == 3) { + output.writeMessage(3, (context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + } + if (constraintCase_ == 4) { + output.writeMessage(4, (context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + } + if (constraintCase_ == 5) { + output.writeMessage(5, (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + } + if (constraintCase_ == 6) { + output.writeMessage(6, (context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + } + if (constraintCase_ == 7) { + output.writeMessage(7, (context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + } + if (constraintCase_ == 8) { + output.writeMessage(8, (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); } unknownFields.writeTo(output); } @@ -33816,9 +58394,37 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - for (int i = 0; i < connections_.size(); i++) { + if (constraintCase_ == 1) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, connections_.get(i)); + .computeMessageSize(1, (context.ContextOuterClass.Constraint_Custom) constraint_); + } + if (constraintCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (context.ContextOuterClass.Constraint_Schedule) constraint_); + } + if (constraintCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (context.ContextOuterClass.Constraint_EndPointLocation) constraint_); + } + if (constraintCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (context.ContextOuterClass.Constraint_EndPointPriority) constraint_); + } + if (constraintCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_); + } + if (constraintCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, (context.ContextOuterClass.Constraint_SLA_Latency) constraint_); + } + if (constraintCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, (context.ContextOuterClass.Constraint_SLA_Availability) constraint_); + } + if (constraintCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -33830,13 +58436,48 @@ public final class ContextOuterClass { if (obj == this) { return true; } - if (!(obj instanceof context.ContextOuterClass.ConnectionList)) { + if (!(obj instanceof context.ContextOuterClass.Constraint)) { return super.equals(obj); } - context.ContextOuterClass.ConnectionList other = (context.ContextOuterClass.ConnectionList) obj; + context.ContextOuterClass.Constraint other = (context.ContextOuterClass.Constraint) obj; - if (!getConnectionsList() - .equals(other.getConnectionsList())) return false; + if (!getConstraintCase().equals(other.getConstraintCase())) return false; + switch (constraintCase_) { + case 1: + if (!getCustom() + .equals(other.getCustom())) return false; + break; + case 2: + if (!getSchedule() + .equals(other.getSchedule())) return false; + break; + case 3: + if (!getEndpointLocation() + .equals(other.getEndpointLocation())) return false; + break; + case 4: + if (!getEndpointPriority() + .equals(other.getEndpointPriority())) return false; + break; + case 5: + if (!getSlaCapacity() + .equals(other.getSlaCapacity())) return false; + break; + case 6: + if (!getSlaLatency() + .equals(other.getSlaLatency())) return false; + break; + case 7: + if (!getSlaAvailability() + .equals(other.getSlaAvailability())) return false; + break; + case 8: + if (!getSlaIsolation() + .equals(other.getSlaIsolation())) return false; + break; + case 0: + default: + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -33848,78 +58489,110 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getConnectionsCount() > 0) { - hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; - hash = (53 * hash) + getConnectionsList().hashCode(); + switch (constraintCase_) { + case 1: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 2: + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().hashCode(); + break; + case 3: + hash = (37 * hash) + ENDPOINT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getEndpointLocation().hashCode(); + break; + case 4: + hash = (37 * hash) + ENDPOINT_PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getEndpointPriority().hashCode(); + break; + case 5: + hash = (37 * hash) + SLA_CAPACITY_FIELD_NUMBER; + hash = (53 * hash) + getSlaCapacity().hashCode(); + break; + case 6: + hash = (37 * hash) + SLA_LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getSlaLatency().hashCode(); + break; + case 7: + hash = (37 * hash) + SLA_AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + getSlaAvailability().hashCode(); + break; + case 8: + hash = (37 * hash) + SLA_ISOLATION_FIELD_NUMBER; + hash = (53 * hash) + getSlaIsolation().hashCode(); + break; + case 0: + default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom(byte[] data) + public static context.ContextOuterClass.Constraint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static context.ContextOuterClass.ConnectionList parseFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint 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 context.ContextOuterClass.ConnectionList parseDelimitedFrom(java.io.InputStream input) + public static context.ContextOuterClass.Constraint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseDelimitedFrom( + public static context.ContextOuterClass.Constraint 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 context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static context.ContextOuterClass.ConnectionList parseFrom( + public static context.ContextOuterClass.Constraint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -33932,7 +58605,7 @@ public final class ContextOuterClass { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(context.ContextOuterClass.ConnectionList prototype) { + public static Builder newBuilder(context.ContextOuterClass.Constraint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -33948,26 +58621,26 @@ public final class ContextOuterClass { return builder; } /** - * Protobuf type {@code context.ConnectionList} + * Protobuf type {@code context.Constraint} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:context.ConnectionList) - context.ContextOuterClass.ConnectionListOrBuilder { + // @@protoc_insertion_point(builder_implements:context.Constraint) + context.ContextOuterClass.ConstraintOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return context.ContextOuterClass.internal_static_context_ConnectionList_fieldAccessorTable + return context.ContextOuterClass.internal_static_context_Constraint_fieldAccessorTable .ensureFieldAccessorsInitialized( - context.ContextOuterClass.ConnectionList.class, context.ContextOuterClass.ConnectionList.Builder.class); + context.ContextOuterClass.Constraint.class, context.ContextOuterClass.Constraint.Builder.class); } - // Construct using context.ContextOuterClass.ConnectionList.newBuilder() + // Construct using context.ContextOuterClass.Constraint.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -33980,35 +58653,30 @@ public final class ContextOuterClass { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getConnectionsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - connectionsBuilder_.clear(); - } + constraintCase_ = 0; + constraint_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return context.ContextOuterClass.internal_static_context_ConnectionList_descriptor; + return context.ContextOuterClass.internal_static_context_Constraint_descriptor; } @java.lang.Override - public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { - return context.ContextOuterClass.ConnectionList.getDefaultInstance(); + public context.ContextOuterClass.Constraint getDefaultInstanceForType() { + return context.ContextOuterClass.Constraint.getDefaultInstance(); } @java.lang.Override - public context.ContextOuterClass.ConnectionList build() { - context.ContextOuterClass.ConnectionList result = buildPartial(); + public context.ContextOuterClass.Constraint build() { + context.ContextOuterClass.Constraint result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -34016,18 +58684,65 @@ public final class ContextOuterClass { } @java.lang.Override - public context.ContextOuterClass.ConnectionList buildPartial() { - context.ContextOuterClass.ConnectionList result = new context.ContextOuterClass.ConnectionList(this); - int from_bitField0_ = bitField0_; - if (connectionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - bitField0_ = (bitField0_ & ~0x00000001); + public context.ContextOuterClass.Constraint buildPartial() { + context.ContextOuterClass.Constraint result = new context.ContextOuterClass.Constraint(this); + if (constraintCase_ == 1) { + if (customBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = customBuilder_.build(); + } + } + if (constraintCase_ == 2) { + if (scheduleBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = scheduleBuilder_.build(); + } + } + if (constraintCase_ == 3) { + if (endpointLocationBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = endpointLocationBuilder_.build(); + } + } + if (constraintCase_ == 4) { + if (endpointPriorityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = endpointPriorityBuilder_.build(); + } + } + if (constraintCase_ == 5) { + if (slaCapacityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaCapacityBuilder_.build(); + } + } + if (constraintCase_ == 6) { + if (slaLatencyBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaLatencyBuilder_.build(); + } + } + if (constraintCase_ == 7) { + if (slaAvailabilityBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaAvailabilityBuilder_.build(); + } + } + if (constraintCase_ == 8) { + if (slaIsolationBuilder_ == null) { + result.constraint_ = constraint_; + } else { + result.constraint_ = slaIsolationBuilder_.build(); } - result.connections_ = connections_; - } else { - result.connections_ = connectionsBuilder_.build(); } + result.constraintCase_ = constraintCase_; onBuilt(); return result; } @@ -34066,40 +58781,51 @@ public final class ContextOuterClass { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof context.ContextOuterClass.ConnectionList) { - return mergeFrom((context.ContextOuterClass.ConnectionList)other); + if (other instanceof context.ContextOuterClass.Constraint) { + return mergeFrom((context.ContextOuterClass.Constraint)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(context.ContextOuterClass.ConnectionList other) { - if (other == context.ContextOuterClass.ConnectionList.getDefaultInstance()) return this; - if (connectionsBuilder_ == null) { - if (!other.connections_.isEmpty()) { - if (connections_.isEmpty()) { - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConnectionsIsMutable(); - connections_.addAll(other.connections_); - } - onChanged(); + public Builder mergeFrom(context.ContextOuterClass.Constraint other) { + if (other == context.ContextOuterClass.Constraint.getDefaultInstance()) return this; + switch (other.getConstraintCase()) { + case CUSTOM: { + mergeCustom(other.getCustom()); + break; } - } else { - if (!other.connections_.isEmpty()) { - if (connectionsBuilder_.isEmpty()) { - connectionsBuilder_.dispose(); - connectionsBuilder_ = null; - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - connectionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getConnectionsFieldBuilder() : null; - } else { - connectionsBuilder_.addAllMessages(other.connections_); - } + case SCHEDULE: { + mergeSchedule(other.getSchedule()); + break; + } + case ENDPOINT_LOCATION: { + mergeEndpointLocation(other.getEndpointLocation()); + break; + } + case ENDPOINT_PRIORITY: { + mergeEndpointPriority(other.getEndpointPriority()); + break; + } + case SLA_CAPACITY: { + mergeSlaCapacity(other.getSlaCapacity()); + break; + } + case SLA_LATENCY: { + mergeSlaLatency(other.getSlaLatency()); + break; + } + case SLA_AVAILABILITY: { + mergeSlaAvailability(other.getSlaAvailability()); + break; + } + case SLA_ISOLATION: { + mergeSlaIsolation(other.getSlaIsolation()); + break; + } + case CONSTRAINT_NOT_SET: { + break; } } this.mergeUnknownFields(other.unknownFields); @@ -34117,11 +58843,11 @@ public final class ContextOuterClass { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - context.ContextOuterClass.ConnectionList parsedMessage = null; + context.ContextOuterClass.Constraint parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (context.ContextOuterClass.ConnectionList) e.getUnfinishedMessage(); + parsedMessage = (context.ContextOuterClass.Constraint) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -34130,246 +58856,1148 @@ public final class ContextOuterClass { } return this; } - private int bitField0_; - - private java.util.List connections_ = - java.util.Collections.emptyList(); - private void ensureConnectionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - connections_ = new java.util.ArrayList(connections_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> connectionsBuilder_; - + private int constraintCase_ = 0; + private java.lang.Object constraint_; + public ConstraintCase + getConstraintCase() { + return ConstraintCase.forNumber( + constraintCase_); + } + + public Builder clearConstraint() { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder> customBuilder_; + /** + * .context.Constraint_Custom custom = 1; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return constraintCase_ == 1; + } + /** + * .context.Constraint_Custom custom = 1; + * @return The custom. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Custom getCustom() { + if (customBuilder_ == null) { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } else { + if (constraintCase_ == 1) { + return customBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder setCustom(context.ContextOuterClass.Constraint_Custom value) { + if (customBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + customBuilder_.setMessage(value); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder setCustom( + context.ContextOuterClass.Constraint_Custom.Builder builderForValue) { + if (customBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + customBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder mergeCustom(context.ContextOuterClass.Constraint_Custom value) { + if (customBuilder_ == null) { + if (constraintCase_ == 1 && + constraint_ != context.ContextOuterClass.Constraint_Custom.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_Custom.newBuilder((context.ContextOuterClass.Constraint_Custom) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 1) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); + } + constraintCase_ = 1; + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public Builder clearCustom() { + if (customBuilder_ == null) { + if (constraintCase_ == 1) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 1) { + constraintCase_ = 0; + constraint_ = null; + } + customBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_Custom custom = 1; + */ + public context.ContextOuterClass.Constraint_Custom.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_Custom custom = 1; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_CustomOrBuilder getCustomOrBuilder() { + if ((constraintCase_ == 1) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 1) { + return (context.ContextOuterClass.Constraint_Custom) constraint_; + } + return context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + } + /** + * .context.Constraint_Custom custom = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(constraintCase_ == 1)) { + constraint_ = context.ContextOuterClass.Constraint_Custom.getDefaultInstance(); + } + customBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Custom, context.ContextOuterClass.Constraint_Custom.Builder, context.ContextOuterClass.Constraint_CustomOrBuilder>( + (context.ContextOuterClass.Constraint_Custom) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 1; + onChanged();; + return customBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder> scheduleBuilder_; + /** + * .context.Constraint_Schedule schedule = 2; + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return constraintCase_ == 2; + } + /** + * .context.Constraint_Schedule schedule = 2; + * @return The schedule. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_Schedule getSchedule() { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } else { + if (constraintCase_ == 2) { + return scheduleBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder setSchedule(context.ContextOuterClass.Constraint_Schedule value) { + if (scheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + scheduleBuilder_.setMessage(value); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder setSchedule( + context.ContextOuterClass.Constraint_Schedule.Builder builderForValue) { + if (scheduleBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + scheduleBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder mergeSchedule(context.ContextOuterClass.Constraint_Schedule value) { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2 && + constraint_ != context.ContextOuterClass.Constraint_Schedule.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_Schedule.newBuilder((context.ContextOuterClass.Constraint_Schedule) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 2) { + scheduleBuilder_.mergeFrom(value); + } + scheduleBuilder_.setMessage(value); + } + constraintCase_ = 2; + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public Builder clearSchedule() { + if (scheduleBuilder_ == null) { + if (constraintCase_ == 2) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 2) { + constraintCase_ = 0; + constraint_ = null; + } + scheduleBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + public context.ContextOuterClass.Constraint_Schedule.Builder getScheduleBuilder() { + return getScheduleFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_ScheduleOrBuilder getScheduleOrBuilder() { + if ((constraintCase_ == 2) && (scheduleBuilder_ != null)) { + return scheduleBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 2) { + return (context.ContextOuterClass.Constraint_Schedule) constraint_; + } + return context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + } + /** + * .context.Constraint_Schedule schedule = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder> + getScheduleFieldBuilder() { + if (scheduleBuilder_ == null) { + if (!(constraintCase_ == 2)) { + constraint_ = context.ContextOuterClass.Constraint_Schedule.getDefaultInstance(); + } + scheduleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_Schedule, context.ContextOuterClass.Constraint_Schedule.Builder, context.ContextOuterClass.Constraint_ScheduleOrBuilder>( + (context.ContextOuterClass.Constraint_Schedule) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 2; + onChanged();; + return scheduleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder> endpointLocationBuilder_; + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return Whether the endpointLocation field is set. + */ + @java.lang.Override + public boolean hasEndpointLocation() { + return constraintCase_ == 3; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + * @return The endpointLocation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocation getEndpointLocation() { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } else { + if (constraintCase_ == 3) { + return endpointLocationBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder setEndpointLocation(context.ContextOuterClass.Constraint_EndPointLocation value) { + if (endpointLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + endpointLocationBuilder_.setMessage(value); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder setEndpointLocation( + context.ContextOuterClass.Constraint_EndPointLocation.Builder builderForValue) { + if (endpointLocationBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + endpointLocationBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder mergeEndpointLocation(context.ContextOuterClass.Constraint_EndPointLocation value) { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3 && + constraint_ != context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_EndPointLocation.newBuilder((context.ContextOuterClass.Constraint_EndPointLocation) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 3) { + endpointLocationBuilder_.mergeFrom(value); + } + endpointLocationBuilder_.setMessage(value); + } + constraintCase_ = 3; + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public Builder clearEndpointLocation() { + if (endpointLocationBuilder_ == null) { + if (constraintCase_ == 3) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 3) { + constraintCase_ = 0; + constraint_ = null; + } + endpointLocationBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + public context.ContextOuterClass.Constraint_EndPointLocation.Builder getEndpointLocationBuilder() { + return getEndpointLocationFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointLocationOrBuilder getEndpointLocationOrBuilder() { + if ((constraintCase_ == 3) && (endpointLocationBuilder_ != null)) { + return endpointLocationBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 3) { + return (context.ContextOuterClass.Constraint_EndPointLocation) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointLocation endpoint_location = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder> + getEndpointLocationFieldBuilder() { + if (endpointLocationBuilder_ == null) { + if (!(constraintCase_ == 3)) { + constraint_ = context.ContextOuterClass.Constraint_EndPointLocation.getDefaultInstance(); + } + endpointLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointLocation, context.ContextOuterClass.Constraint_EndPointLocation.Builder, context.ContextOuterClass.Constraint_EndPointLocationOrBuilder>( + (context.ContextOuterClass.Constraint_EndPointLocation) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 3; + onChanged();; + return endpointLocationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder> endpointPriorityBuilder_; + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return Whether the endpointPriority field is set. + */ + @java.lang.Override + public boolean hasEndpointPriority() { + return constraintCase_ == 4; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + * @return The endpointPriority. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriority getEndpointPriority() { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } else { + if (constraintCase_ == 4) { + return endpointPriorityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder setEndpointPriority(context.ContextOuterClass.Constraint_EndPointPriority value) { + if (endpointPriorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + endpointPriorityBuilder_.setMessage(value); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder setEndpointPriority( + context.ContextOuterClass.Constraint_EndPointPriority.Builder builderForValue) { + if (endpointPriorityBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + endpointPriorityBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder mergeEndpointPriority(context.ContextOuterClass.Constraint_EndPointPriority value) { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4 && + constraint_ != context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_EndPointPriority.newBuilder((context.ContextOuterClass.Constraint_EndPointPriority) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 4) { + endpointPriorityBuilder_.mergeFrom(value); + } + endpointPriorityBuilder_.setMessage(value); + } + constraintCase_ = 4; + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public Builder clearEndpointPriority() { + if (endpointPriorityBuilder_ == null) { + if (constraintCase_ == 4) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 4) { + constraintCase_ = 0; + constraint_ = null; + } + endpointPriorityBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + public context.ContextOuterClass.Constraint_EndPointPriority.Builder getEndpointPriorityBuilder() { + return getEndpointPriorityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder getEndpointPriorityOrBuilder() { + if ((constraintCase_ == 4) && (endpointPriorityBuilder_ != null)) { + return endpointPriorityBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 4) { + return (context.ContextOuterClass.Constraint_EndPointPriority) constraint_; + } + return context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + } + /** + * .context.Constraint_EndPointPriority endpoint_priority = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder> + getEndpointPriorityFieldBuilder() { + if (endpointPriorityBuilder_ == null) { + if (!(constraintCase_ == 4)) { + constraint_ = context.ContextOuterClass.Constraint_EndPointPriority.getDefaultInstance(); + } + endpointPriorityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_EndPointPriority, context.ContextOuterClass.Constraint_EndPointPriority.Builder, context.ContextOuterClass.Constraint_EndPointPriorityOrBuilder>( + (context.ContextOuterClass.Constraint_EndPointPriority) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 4; + onChanged();; + return endpointPriorityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder> slaCapacityBuilder_; + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return Whether the slaCapacity field is set. + */ + @java.lang.Override + public boolean hasSlaCapacity() { + return constraintCase_ == 5; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + * @return The slaCapacity. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Capacity getSlaCapacity() { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } else { + if (constraintCase_ == 5) { + return slaCapacityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder setSlaCapacity(context.ContextOuterClass.Constraint_SLA_Capacity value) { + if (slaCapacityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + onChanged(); + } else { + slaCapacityBuilder_.setMessage(value); + } + constraintCase_ = 5; + return this; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder setSlaCapacity( + context.ContextOuterClass.Constraint_SLA_Capacity.Builder builderForValue) { + if (slaCapacityBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + slaCapacityBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 5; + return this; + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + public Builder mergeSlaCapacity(context.ContextOuterClass.Constraint_SLA_Capacity value) { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Capacity.newBuilder((context.ContextOuterClass.Constraint_SLA_Capacity) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 5) { + slaCapacityBuilder_.mergeFrom(value); + } + slaCapacityBuilder_.setMessage(value); + } + constraintCase_ = 5; + return this; + } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public java.util.List getConnectionsList() { - if (connectionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(connections_); + public Builder clearSlaCapacity() { + if (slaCapacityBuilder_ == null) { + if (constraintCase_ == 5) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - return connectionsBuilder_.getMessageList(); + if (constraintCase_ == 5) { + constraintCase_ = 0; + constraint_ = null; + } + slaCapacityBuilder_.clear(); } + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public int getConnectionsCount() { - if (connectionsBuilder_ == null) { - return connections_.size(); + public context.ContextOuterClass.Constraint_SLA_Capacity.Builder getSlaCapacityBuilder() { + return getSlaCapacityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Capacity sla_capacity = 5; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder getSlaCapacityOrBuilder() { + if ((constraintCase_ == 5) && (slaCapacityBuilder_ != null)) { + return slaCapacityBuilder_.getMessageOrBuilder(); } else { - return connectionsBuilder_.getCount(); + if (constraintCase_ == 5) { + return (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Capacity sla_capacity = 5; */ - public context.ContextOuterClass.Connection getConnections(int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder> + getSlaCapacityFieldBuilder() { + if (slaCapacityBuilder_ == null) { + if (!(constraintCase_ == 5)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Capacity.getDefaultInstance(); + } + slaCapacityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Capacity, context.ContextOuterClass.Constraint_SLA_Capacity.Builder, context.ContextOuterClass.Constraint_SLA_CapacityOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Capacity) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 5; + onChanged();; + return slaCapacityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder> slaLatencyBuilder_; + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return Whether the slaLatency field is set. + */ + @java.lang.Override + public boolean hasSlaLatency() { + return constraintCase_ == 6; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + * @return The slaLatency. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Latency getSlaLatency() { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } else { - return connectionsBuilder_.getMessage(index); + if (constraintCase_ == 6) { + return slaLatencyBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder setConnections( - int index, context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { + public Builder setSlaLatency(context.ContextOuterClass.Constraint_SLA_Latency value) { + if (slaLatencyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectionsIsMutable(); - connections_.set(index, value); + constraint_ = value; onChanged(); } else { - connectionsBuilder_.setMessage(index, value); + slaLatencyBuilder_.setMessage(value); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder setConnections( - int index, context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.set(index, builderForValue.build()); + public Builder setSlaLatency( + context.ContextOuterClass.Constraint_SLA_Latency.Builder builderForValue) { + if (slaLatencyBuilder_ == null) { + constraint_ = builderForValue.build(); onChanged(); } else { - connectionsBuilder_.setMessage(index, builderForValue.build()); + slaLatencyBuilder_.setMessage(builderForValue.build()); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder addConnections(context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeSlaLatency(context.ContextOuterClass.Constraint_SLA_Latency value) { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Latency.newBuilder((context.ContextOuterClass.Constraint_SLA_Latency) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; } - ensureConnectionsIsMutable(); - connections_.add(value); onChanged(); } else { - connectionsBuilder_.addMessage(value); + if (constraintCase_ == 6) { + slaLatencyBuilder_.mergeFrom(value); + } + slaLatencyBuilder_.setMessage(value); } + constraintCase_ = 6; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Latency sla_latency = 6; */ - public Builder addConnections( - int index, context.ContextOuterClass.Connection value) { - if (connectionsBuilder_ == null) { + public Builder clearSlaLatency() { + if (slaLatencyBuilder_ == null) { + if (constraintCase_ == 6) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } + } else { + if (constraintCase_ == 6) { + constraintCase_ = 0; + constraint_ = null; + } + slaLatencyBuilder_.clear(); + } + return this; + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + public context.ContextOuterClass.Constraint_SLA_Latency.Builder getSlaLatencyBuilder() { + return getSlaLatencyFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder getSlaLatencyOrBuilder() { + if ((constraintCase_ == 6) && (slaLatencyBuilder_ != null)) { + return slaLatencyBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 6) { + return (context.ContextOuterClass.Constraint_SLA_Latency) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Latency sla_latency = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder> + getSlaLatencyFieldBuilder() { + if (slaLatencyBuilder_ == null) { + if (!(constraintCase_ == 6)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Latency.getDefaultInstance(); + } + slaLatencyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Latency, context.ContextOuterClass.Constraint_SLA_Latency.Builder, context.ContextOuterClass.Constraint_SLA_LatencyOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Latency) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 6; + onChanged();; + return slaLatencyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder> slaAvailabilityBuilder_; + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return Whether the slaAvailability field is set. + */ + @java.lang.Override + public boolean hasSlaAvailability() { + return constraintCase_ == 7; + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + * @return The slaAvailability. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Availability getSlaAvailability() { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } else { + if (constraintCase_ == 7) { + return slaAvailabilityBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + public Builder setSlaAvailability(context.ContextOuterClass.Constraint_SLA_Availability value) { + if (slaAvailabilityBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureConnectionsIsMutable(); - connections_.add(index, value); + constraint_ = value; onChanged(); } else { - connectionsBuilder_.addMessage(index, value); + slaAvailabilityBuilder_.setMessage(value); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addConnections( - context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(builderForValue.build()); + public Builder setSlaAvailability( + context.ContextOuterClass.Constraint_SLA_Availability.Builder builderForValue) { + if (slaAvailabilityBuilder_ == null) { + constraint_ = builderForValue.build(); onChanged(); } else { - connectionsBuilder_.addMessage(builderForValue.build()); + slaAvailabilityBuilder_.setMessage(builderForValue.build()); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addConnections( - int index, context.ContextOuterClass.Connection.Builder builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(index, builderForValue.build()); + public Builder mergeSlaAvailability(context.ContextOuterClass.Constraint_SLA_Availability value) { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Availability.newBuilder((context.ContextOuterClass.Constraint_SLA_Availability) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } onChanged(); } else { - connectionsBuilder_.addMessage(index, builderForValue.build()); + if (constraintCase_ == 7) { + slaAvailabilityBuilder_.mergeFrom(value); + } + slaAvailabilityBuilder_.setMessage(value); } + constraintCase_ = 7; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder addAllConnections( - java.lang.Iterable values) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, connections_); - onChanged(); + public Builder clearSlaAvailability() { + if (slaAvailabilityBuilder_ == null) { + if (constraintCase_ == 7) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - connectionsBuilder_.addAllMessages(values); + if (constraintCase_ == 7) { + constraintCase_ = 0; + constraint_ = null; + } + slaAvailabilityBuilder_.clear(); } return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder clearConnections() { - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + public context.ContextOuterClass.Constraint_SLA_Availability.Builder getSlaAvailabilityBuilder() { + return getSlaAvailabilityFieldBuilder().getBuilder(); + } + /** + * .context.Constraint_SLA_Availability sla_availability = 7; + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder getSlaAvailabilityOrBuilder() { + if ((constraintCase_ == 7) && (slaAvailabilityBuilder_ != null)) { + return slaAvailabilityBuilder_.getMessageOrBuilder(); } else { - connectionsBuilder_.clear(); + if (constraintCase_ == 7) { + return (context.ContextOuterClass.Constraint_SLA_Availability) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); } - return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Availability sla_availability = 7; */ - public Builder removeConnections(int index) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.remove(index); + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder> + getSlaAvailabilityFieldBuilder() { + if (slaAvailabilityBuilder_ == null) { + if (!(constraintCase_ == 7)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Availability.getDefaultInstance(); + } + slaAvailabilityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Availability, context.ContextOuterClass.Constraint_SLA_Availability.Builder, context.ContextOuterClass.Constraint_SLA_AvailabilityOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Availability) constraint_, + getParentForChildren(), + isClean()); + constraint_ = null; + } + constraintCase_ = 7; + onChanged();; + return slaAvailabilityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder> slaIsolationBuilder_; + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return Whether the slaIsolation field is set. + */ + @java.lang.Override + public boolean hasSlaIsolation() { + return constraintCase_ == 8; + } + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + * @return The slaIsolation. + */ + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Isolation_level getSlaIsolation() { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } else { + if (constraintCase_ == 8) { + return slaIsolationBuilder_.getMessage(); + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } + } + /** + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; + */ + public Builder setSlaIsolation(context.ContextOuterClass.Constraint_SLA_Isolation_level value) { + if (slaIsolationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; onChanged(); } else { - connectionsBuilder_.remove(index); + slaIsolationBuilder_.setMessage(value); } + constraintCase_ = 8; return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder getConnectionsBuilder( - int index) { - return getConnectionsFieldBuilder().getBuilder(index); + public Builder setSlaIsolation( + context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder builderForValue) { + if (slaIsolationBuilder_ == null) { + constraint_ = builderForValue.build(); + onChanged(); + } else { + slaIsolationBuilder_.setMessage(builderForValue.build()); + } + constraintCase_ = 8; + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.ConnectionOrBuilder getConnectionsOrBuilder( - int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); } else { - return connectionsBuilder_.getMessageOrBuilder(index); + public Builder mergeSlaIsolation(context.ContextOuterClass.Constraint_SLA_Isolation_level value) { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8 && + constraint_ != context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance()) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Isolation_level.newBuilder((context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_) + .mergeFrom(value).buildPartial(); + } else { + constraint_ = value; + } + onChanged(); + } else { + if (constraintCase_ == 8) { + slaIsolationBuilder_.mergeFrom(value); + } + slaIsolationBuilder_.setMessage(value); } + constraintCase_ = 8; + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public java.util.List - getConnectionsOrBuilderList() { - if (connectionsBuilder_ != null) { - return connectionsBuilder_.getMessageOrBuilderList(); + public Builder clearSlaIsolation() { + if (slaIsolationBuilder_ == null) { + if (constraintCase_ == 8) { + constraintCase_ = 0; + constraint_ = null; + onChanged(); + } } else { - return java.util.Collections.unmodifiableList(connections_); + if (constraintCase_ == 8) { + constraintCase_ = 0; + constraint_ = null; + } + slaIsolationBuilder_.clear(); } + return this; } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder addConnectionsBuilder() { - return getConnectionsFieldBuilder().addBuilder( - context.ContextOuterClass.Connection.getDefaultInstance()); + public context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder getSlaIsolationBuilder() { + return getSlaIsolationFieldBuilder().getBuilder(); } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public context.ContextOuterClass.Connection.Builder addConnectionsBuilder( - int index) { - return getConnectionsFieldBuilder().addBuilder( - index, context.ContextOuterClass.Connection.getDefaultInstance()); + @java.lang.Override + public context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder getSlaIsolationOrBuilder() { + if ((constraintCase_ == 8) && (slaIsolationBuilder_ != null)) { + return slaIsolationBuilder_.getMessageOrBuilder(); + } else { + if (constraintCase_ == 8) { + return (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_; + } + return context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } } /** - * repeated .context.Connection connections = 1; + * .context.Constraint_SLA_Isolation_level sla_isolation = 8; */ - public java.util.List - getConnectionsBuilderList() { - return getConnectionsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder> - getConnectionsFieldBuilder() { - if (connectionsBuilder_ == null) { - connectionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Connection, context.ContextOuterClass.Connection.Builder, context.ContextOuterClass.ConnectionOrBuilder>( - connections_, - ((bitField0_ & 0x00000001) != 0), + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder> + getSlaIsolationFieldBuilder() { + if (slaIsolationBuilder_ == null) { + if (!(constraintCase_ == 8)) { + constraint_ = context.ContextOuterClass.Constraint_SLA_Isolation_level.getDefaultInstance(); + } + slaIsolationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Constraint_SLA_Isolation_level, context.ContextOuterClass.Constraint_SLA_Isolation_level.Builder, context.ContextOuterClass.Constraint_SLA_Isolation_levelOrBuilder>( + (context.ContextOuterClass.Constraint_SLA_Isolation_level) constraint_, getParentForChildren(), isClean()); - connections_ = null; + constraint_ = null; } - return connectionsBuilder_; + constraintCase_ = 8; + onChanged();; + return slaIsolationBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -34384,41 +60012,41 @@ public final class ContextOuterClass { } - // @@protoc_insertion_point(builder_scope:context.ConnectionList) + // @@protoc_insertion_point(builder_scope:context.Constraint) } - // @@protoc_insertion_point(class_scope:context.ConnectionList) - private static final context.ContextOuterClass.ConnectionList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:context.Constraint) + private static final context.ContextOuterClass.Constraint DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new context.ContextOuterClass.ConnectionList(); + DEFAULT_INSTANCE = new context.ContextOuterClass.Constraint(); } - public static context.ContextOuterClass.ConnectionList getDefaultInstance() { + public static context.ContextOuterClass.Constraint getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public ConnectionList parsePartialFrom( + public Constraint parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionList(input, extensionRegistry); + return new Constraint(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public context.ContextOuterClass.ConnectionList getDefaultInstanceForType() { + public context.ContextOuterClass.Constraint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -35975,6 +61603,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Uuid_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Timestamp_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Timestamp_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Event_descriptor; private static final @@ -36121,30 +61754,75 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ServiceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_EndPointId_descriptor; + internal_static_context_SliceId_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_EndPointId_fieldAccessorTable; + internal_static_context_SliceId_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_EndPoint_descriptor; + internal_static_context_Slice_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_EndPoint_fieldAccessorTable; + internal_static_context_Slice_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_ConfigRule_descriptor; + internal_static_context_SliceOwner_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_ConfigRule_fieldAccessorTable; + internal_static_context_SliceOwner_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_context_Constraint_descriptor; + internal_static_context_SliceStatus_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_context_Constraint_fieldAccessorTable; + internal_static_context_SliceStatus_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceConfig_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceConfig_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceIdList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceIdList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_SliceEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_SliceEvent_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_ConnectionId_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ConnectionId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L0_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L0_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L2_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L2_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L3_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L3_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_L4_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_L4_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionSettings_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionSettings_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_Connection_descriptor; private static final @@ -36160,6 +61838,91 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_ConnectionList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConnectionEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConnectionEvent_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_EndPointId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_EndPointId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_EndPoint_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_EndPoint_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_Custom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_Custom_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_ACL_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_ACL_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_ConfigRule_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_ConfigRule_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_Custom_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_Custom_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_Schedule_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_Schedule_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_GPS_Position_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_GPS_Position_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Location_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Location_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_EndPointLocation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_EndPointLocation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_EndPointPriority_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_EndPointPriority_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Latency_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Latency_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Capacity_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Availability_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Availability_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_SLA_Isolation_level_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Constraint_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Constraint_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_TeraFlowController_descriptor; private static final @@ -36179,160 +61942,275 @@ public final class ContextOuterClass { descriptor; static { java.lang.String[] descriptorData = { - "\n\rcontext.proto\022\007context\"\007\n\005Empty\"\024\n\004Uui" + - "d\022\014\n\004uuid\030\001 \001(\t\"F\n\005Event\022\021\n\ttimestamp\030\001 " + - "\001(\001\022*\n\nevent_type\030\002 \001(\0162\026.context.EventT" + - "ypeEnum\"0\n\tContextId\022#\n\014context_uuid\030\001 \001" + - "(\0132\r.context.Uuid\"\266\001\n\007Context\022&\n\ncontext" + - "_id\030\001 \001(\0132\022.context.ContextId\022)\n\014topolog" + - "y_ids\030\002 \003(\0132\023.context.TopologyId\022\'\n\013serv" + - "ice_ids\030\003 \003(\0132\022.context.ServiceId\022/\n\ncon" + - "troller\030\004 \001(\0132\033.context.TeraFlowControll" + - "er\"8\n\rContextIdList\022\'\n\013context_ids\030\001 \003(\013" + - "2\022.context.ContextId\"1\n\013ContextList\022\"\n\010c" + - "ontexts\030\001 \003(\0132\020.context.Context\"U\n\014Conte" + - "xtEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022&" + - "\n\ncontext_id\030\002 \001(\0132\022.context.ContextId\"Z" + - "\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132\022.conte" + - "xt.ContextId\022$\n\rtopology_uuid\030\002 \001(\0132\r.co" + - "ntext.Uuid\"~\n\010Topology\022(\n\013topology_id\030\001 " + - "\001(\0132\023.context.TopologyId\022%\n\ndevice_ids\030\002" + - " \003(\0132\021.context.DeviceId\022!\n\010link_ids\030\003 \003(" + - "\0132\017.context.LinkId\";\n\016TopologyIdList\022)\n\014" + - "topology_ids\030\001 \003(\0132\023.context.TopologyId\"" + - "5\n\014TopologyList\022%\n\ntopologies\030\001 \003(\0132\021.co" + - "ntext.Topology\"X\n\rTopologyEvent\022\035\n\005event" + - "\030\001 \001(\0132\016.context.Event\022(\n\013topology_id\030\002 " + - "\001(\0132\023.context.TopologyId\".\n\010DeviceId\022\"\n\013" + - "device_uuid\030\001 \001(\0132\r.context.Uuid\"\232\002\n\006Dev" + - "ice\022$\n\tdevice_id\030\001 \001(\0132\021.context.DeviceI" + - "d\022\023\n\013device_type\030\002 \001(\t\022,\n\rdevice_config\030" + - "\003 \001(\0132\025.context.DeviceConfig\022G\n\031device_o" + - "perational_status\030\004 \001(\0162$.context.Device" + - "OperationalStatusEnum\0221\n\016device_drivers\030" + - "\005 \003(\0162\031.context.DeviceDriverEnum\022+\n\020devi" + - "ce_endpoints\030\006 \003(\0132\021.context.EndPoint\"9\n" + - "\014DeviceConfig\022)\n\014config_rules\030\001 \003(\0132\023.co" + - "ntext.ConfigRule\"5\n\014DeviceIdList\022%\n\ndevi" + - "ce_ids\030\001 \003(\0132\021.context.DeviceId\".\n\nDevic" + - "eList\022 \n\007devices\030\001 \003(\0132\017.context.Device\"" + - "R\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016.context." + - "Event\022$\n\tdevice_id\030\002 \001(\0132\021.context.Devic" + - "eId\"*\n\006LinkId\022 \n\tlink_uuid\030\001 \001(\0132\r.conte" + - "xt.Uuid\"X\n\004Link\022 \n\007link_id\030\001 \001(\0132\017.conte" + - "xt.LinkId\022.\n\021link_endpoint_ids\030\002 \003(\0132\023.c" + - "ontext.EndPointId\"/\n\nLinkIdList\022!\n\010link_" + - "ids\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034" + - "\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEven" + - "t\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link" + - "_id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022" + - "&\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022" + - "#\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\246\002\n" + - "\007Service\022&\n\nservice_id\030\001 \001(\0132\022.context.S" + - "erviceId\022.\n\014service_type\030\002 \001(\0162\030.context" + - ".ServiceTypeEnum\0221\n\024service_endpoint_ids" + - "\030\003 \003(\0132\023.context.EndPointId\0220\n\023service_c" + - "onstraints\030\004 \003(\0132\023.context.Constraint\022.\n" + - "\016service_status\030\005 \001(\0132\026.context.ServiceS" + - "tatus\022.\n\016service_config\030\006 \001(\0132\026.context." + - "ServiceConfig\"C\n\rServiceStatus\0222\n\016servic" + - "e_status\030\001 \001(\0162\032.context.ServiceStatusEn" + - "um\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003(" + - "\0132\023.context.ConfigRule\"8\n\rServiceIdList\022" + - "\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceId" + - "\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.cont" + - "ext.Service\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001" + - "(\0132\016.context.Event\022&\n\nservice_id\030\002 \001(\0132\022" + - ".context.ServiceId\"\202\001\n\nEndPointId\022(\n\013top" + - "ology_id\030\001 \001(\0132\023.context.TopologyId\022$\n\td" + - "evice_id\030\002 \001(\0132\021.context.DeviceId\022$\n\rend" + - "point_uuid\030\003 \001(\0132\r.context.Uuid\"K\n\010EndPo" + - "int\022(\n\013endpoint_id\030\001 \001(\0132\023.context.EndPo" + - "intId\022\025\n\rendpoint_type\030\002 \001(\t\"e\n\nConfigRu" + - "le\022)\n\006action\030\001 \001(\0162\031.context.ConfigActio" + - "nEnum\022\024\n\014resource_key\030\002 \001(\t\022\026\n\016resource_" + - "value\030\003 \001(\t\"?\n\nConstraint\022\027\n\017constraint_" + - "type\030\001 \001(\t\022\030\n\020constraint_value\030\002 \001(\t\"6\n\014" + - "ConnectionId\022&\n\017connection_uuid\030\001 \001(\0132\r." + - "context.Uuid\"\215\001\n\nConnection\022,\n\rconnectio" + - "n_id\030\001 \001(\0132\025.context.ConnectionId\022.\n\022rel" + - "ated_service_id\030\002 \001(\0132\022.context.ServiceI" + - "d\022!\n\004path\030\003 \003(\0132\023.context.EndPointId\"A\n\020" + - "ConnectionIdList\022-\n\016connection_ids\030\001 \003(\013" + - "2\025.context.ConnectionId\":\n\016ConnectionLis" + - "t\022(\n\013connections\030\001 \003(\0132\023.context.Connect" + - "ion\"^\n\022TeraFlowController\022&\n\ncontext_id\030" + - "\001 \001(\0132\022.context.ContextId\022\022\n\nip_address\030" + - "\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024AuthenticationRes" + - "ult\022&\n\ncontext_id\030\001 \001(\0132\022.context.Contex" + - "tId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEventTypeE" + - "num\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVENTTYP" + - "E_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n\020EVEN" + - "TTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum\022\032\n\026D" + - "EVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDRIVER_" + - "OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSPORT_A" + - "PI\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICEDRIVE" + - "R_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICEDRIVE" + - "R_ONF_TR_352\020\005*\217\001\n\033DeviceOperationalStat" + - "usEnum\022%\n!DEVICEOPERATIONALSTATUS_UNDEFI" + - "NED\020\000\022$\n DEVICEOPERATIONALSTATUS_DISABLE" + - "D\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENABLED\020\002" + - "*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE_UNKN" + - "OWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERVICETY" + - "PE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNECTIVI" + - "TY_SERVICE\020\003*\210\001\n\021ServiceStatusEnum\022\033\n\027SE" + - "RVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATUS" + - "_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022!\n\035" + - "SERVICESTATUS_PENDING_REMOVAL\020\003*]\n\020Confi" + - "gActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022" + - "\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_DE" + - "LETE\020\0022\245\r\n\016ContextService\022:\n\016ListContext" + - "Ids\022\016.context.Empty\032\026.context.ContextIdL" + - "ist\"\000\0226\n\014ListContexts\022\016.context.Empty\032\024." + - "context.ContextList\"\000\0224\n\nGetContext\022\022.co" + - "ntext.ContextId\032\020.context.Context\"\000\0224\n\nS" + - "etContext\022\020.context.Context\032\022.context.Co" + - "ntextId\"\000\0225\n\rRemoveContext\022\022.context.Con" + - "textId\032\016.context.Empty\"\000\022=\n\020GetContextEv" + - "ents\022\016.context.Empty\032\025.context.ContextEv" + - "ent\"\0000\001\022@\n\017ListTopologyIds\022\022.context.Con" + - "textId\032\027.context.TopologyIdList\"\000\022=\n\016Lis" + - "tTopologies\022\022.context.ContextId\032\025.contex" + - "t.TopologyList\"\000\0227\n\013GetTopology\022\023.contex" + - "t.TopologyId\032\021.context.Topology\"\000\0227\n\013Set" + - "Topology\022\021.context.Topology\032\023.context.To" + - "pologyId\"\000\0227\n\016RemoveTopology\022\023.context.T" + - "opologyId\032\016.context.Empty\"\000\022?\n\021GetTopolo" + - "gyEvents\022\016.context.Empty\032\026.context.Topol" + - "ogyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.context." + - "Empty\032\025.context.DeviceIdList\"\000\0224\n\013ListDe" + - "vices\022\016.context.Empty\032\023.context.DeviceLi" + - "st\"\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.c" + - "ontext.Device\"\000\0221\n\tSetDevice\022\017.context.D" + - "evice\032\021.context.DeviceId\"\000\0223\n\014RemoveDevi" + - "ce\022\021.context.DeviceId\032\016.context.Empty\"\000\022" + - ";\n\017GetDeviceEvents\022\016.context.Empty\032\024.con" + - "text.DeviceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.co" + - "ntext.Empty\032\023.context.LinkIdList\"\000\0220\n\tLi" + - "stLinks\022\016.context.Empty\032\021.context.LinkLi" + - "st\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.conte" + - "xt.Link\"\000\022+\n\007SetLink\022\r.context.Link\032\017.co" + - "ntext.LinkId\"\000\022/\n\nRemoveLink\022\017.context.L" + - "inkId\032\016.context.Empty\"\000\0227\n\rGetLinkEvents" + - "\022\016.context.Empty\032\022.context.LinkEvent\"\0000\001" + - "\022>\n\016ListServiceIds\022\022.context.ContextId\032\026" + - ".context.ServiceIdList\"\000\022:\n\014ListServices" + - "\022\022.context.ContextId\032\024.context.ServiceLi" + - "st\"\000\0224\n\nGetService\022\022.context.ServiceId\032\020" + - ".context.Service\"\000\0224\n\nSetService\022\020.conte" + - "xt.Service\032\022.context.ServiceId\"\000\0225\n\rRemo" + - "veService\022\022.context.ServiceId\032\016.context." + - "Empty\"\000\022=\n\020GetServiceEvents\022\016.context.Em" + - "pty\032\025.context.ServiceEvent\"\0000\001b\006proto3" + "\n\rcontext.proto\022\007context\032\tacl.proto\032\026kpi" + + "_sample_types.proto\"\007\n\005Empty\"\024\n\004Uuid\022\014\n\004" + + "uuid\030\001 \001(\t\"\036\n\tTimestamp\022\021\n\ttimestamp\030\001 \001" + + "(\001\"Z\n\005Event\022%\n\ttimestamp\030\001 \001(\0132\022.context" + + ".Timestamp\022*\n\nevent_type\030\002 \001(\0162\026.context" + + ".EventTypeEnum\"0\n\tContextId\022#\n\014context_u" + + "uid\030\001 \001(\0132\r.context.Uuid\"\266\001\n\007Context\022&\n\n" + + "context_id\030\001 \001(\0132\022.context.ContextId\022)\n\014" + + "topology_ids\030\002 \003(\0132\023.context.TopologyId\022" + + "\'\n\013service_ids\030\003 \003(\0132\022.context.ServiceId" + + "\022/\n\ncontroller\030\004 \001(\0132\033.context.TeraFlowC" + + "ontroller\"8\n\rContextIdList\022\'\n\013context_id" + + "s\030\001 \003(\0132\022.context.ContextId\"1\n\013ContextLi" + + "st\022\"\n\010contexts\030\001 \003(\0132\020.context.Context\"U" + + "\n\014ContextEvent\022\035\n\005event\030\001 \001(\0132\016.context." + + "Event\022&\n\ncontext_id\030\002 \001(\0132\022.context.Cont" + + "extId\"Z\n\nTopologyId\022&\n\ncontext_id\030\001 \001(\0132" + + "\022.context.ContextId\022$\n\rtopology_uuid\030\002 \001" + + "(\0132\r.context.Uuid\"~\n\010Topology\022(\n\013topolog" + + "y_id\030\001 \001(\0132\023.context.TopologyId\022%\n\ndevic" + + "e_ids\030\002 \003(\0132\021.context.DeviceId\022!\n\010link_i" + + "ds\030\003 \003(\0132\017.context.LinkId\";\n\016TopologyIdL" + + "ist\022)\n\014topology_ids\030\001 \003(\0132\023.context.Topo" + + "logyId\"5\n\014TopologyList\022%\n\ntopologies\030\001 \003" + + "(\0132\021.context.Topology\"X\n\rTopologyEvent\022\035" + + "\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013topolog" + + "y_id\030\002 \001(\0132\023.context.TopologyId\".\n\010Devic" + + "eId\022\"\n\013device_uuid\030\001 \001(\0132\r.context.Uuid\"" + + "\232\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.context." + + "DeviceId\022\023\n\013device_type\030\002 \001(\t\022,\n\rdevice_" + + "config\030\003 \001(\0132\025.context.DeviceConfig\022G\n\031d" + + "evice_operational_status\030\004 \001(\0162$.context" + + ".DeviceOperationalStatusEnum\0221\n\016device_d" + + "rivers\030\005 \003(\0162\031.context.DeviceDriverEnum\022" + + "+\n\020device_endpoints\030\006 \003(\0132\021.context.EndP" + + "oint\"9\n\014DeviceConfig\022)\n\014config_rules\030\001 \003" + + "(\0132\023.context.ConfigRule\"5\n\014DeviceIdList\022" + + "%\n\ndevice_ids\030\001 \003(\0132\021.context.DeviceId\"." + + "\n\nDeviceList\022 \n\007devices\030\001 \003(\0132\017.context." + + "Device\"R\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016.c" + + "ontext.Event\022$\n\tdevice_id\030\002 \001(\0132\021.contex" + + "t.DeviceId\"*\n\006LinkId\022 \n\tlink_uuid\030\001 \001(\0132" + + "\r.context.Uuid\"X\n\004Link\022 \n\007link_id\030\001 \001(\0132" + + "\017.context.LinkId\022.\n\021link_endpoint_ids\030\002 " + + "\003(\0132\023.context.EndPointId\"/\n\nLinkIdList\022!" + + "\n\010link_ids\030\001 \003(\0132\017.context.LinkId\"(\n\010Lin" + + "kList\022\034\n\005links\030\001 \003(\0132\r.context.Link\"L\n\tL" + + "inkEvent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022" + + " \n\007link_id\030\002 \001(\0132\017.context.LinkId\"X\n\tSer" + + "viceId\022&\n\ncontext_id\030\001 \001(\0132\022.context.Con" + + "textId\022#\n\014service_uuid\030\002 \001(\0132\r.context.U" + + "uid\"\315\002\n\007Service\022&\n\nservice_id\030\001 \001(\0132\022.co" + + "ntext.ServiceId\022.\n\014service_type\030\002 \001(\0162\030." + + "context.ServiceTypeEnum\0221\n\024service_endpo" + + "int_ids\030\003 \003(\0132\023.context.EndPointId\0220\n\023se" + + "rvice_constraints\030\004 \003(\0132\023.context.Constr" + + "aint\022.\n\016service_status\030\005 \001(\0132\026.context.S" + + "erviceStatus\022.\n\016service_config\030\006 \001(\0132\026.c" + + "ontext.ServiceConfig\022%\n\ttimestamp\030\007 \001(\0132" + + "\022.context.Timestamp\"C\n\rServiceStatus\0222\n\016" + + "service_status\030\001 \001(\0162\032.context.ServiceSt" + + "atusEnum\":\n\rServiceConfig\022)\n\014config_rule" + + "s\030\001 \003(\0132\023.context.ConfigRule\"8\n\rServiceI" + + "dList\022\'\n\013service_ids\030\001 \003(\0132\022.context.Ser" + + "viceId\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132" + + "\020.context.Service\"U\n\014ServiceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002" + + " \001(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\nc" + + "ontext_id\030\001 \001(\0132\022.context.ContextId\022!\n\ns" + + "lice_uuid\030\002 \001(\0132\r.context.Uuid\"\222\003\n\005Slice" + + "\022\"\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022/\n\022" + + "slice_endpoint_ids\030\002 \003(\0132\023.context.EndPo" + + "intId\022.\n\021slice_constraints\030\003 \003(\0132\023.conte" + + "xt.Constraint\022-\n\021slice_service_ids\030\004 \003(\013" + + "2\022.context.ServiceId\022,\n\022slice_subslice_i" + + "ds\030\005 \003(\0132\020.context.SliceId\022*\n\014slice_stat" + + "us\030\006 \001(\0132\024.context.SliceStatus\022*\n\014slice_" + + "config\030\007 \001(\0132\024.context.SliceConfig\022(\n\013sl" + + "ice_owner\030\010 \001(\0132\023.context.SliceOwner\022%\n\t" + + "timestamp\030\t \001(\0132\022.context.Timestamp\"E\n\nS" + + "liceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context." + + "Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStatu" + + "s\022.\n\014slice_status\030\001 \001(\0162\030.context.SliceS" + + "tatusEnum\"8\n\013SliceConfig\022)\n\014config_rules" + + "\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdLi" + + "st\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId\"" + + "+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context.S" + + "lice\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132\016.cont" + + "ext.Event\022\"\n\010slice_id\030\002 \001(\0132\020.context.Sl" + + "iceId\"6\n\014ConnectionId\022&\n\017connection_uuid" + + "\030\001 \001(\0132\r.context.Uuid\"2\n\025ConnectionSetti" + + "ngs_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"\236\001\n\025Co" + + "nnectionSettings_L2\022\027\n\017src_mac_address\030\001" + + " \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\nether_t" + + "ype\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls_label" + + "\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r\"t\n\025Co" + + "nnectionSettings_L3\022\026\n\016src_ip_address\030\001 " + + "\001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dscp\030\003 \001(" + + "\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[\n\025Conn" + + "ectionSettings_L4\022\020\n\010src_port\030\001 \001(\r\022\020\n\010d" + + "st_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013\n\003ttl\030" + + "\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0\030\001 \001(\013" + + "2\036.context.ConnectionSettings_L0\022*\n\002l2\030\002" + + " \001(\0132\036.context.ConnectionSettings_L2\022*\n\002" + + "l3\030\003 \001(\0132\036.context.ConnectionSettings_L3" + + "\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionSetting" + + "s_L4\"\363\001\n\nConnection\022,\n\rconnection_id\030\001 \001" + + "(\0132\025.context.ConnectionId\022&\n\nservice_id\030" + + "\002 \001(\0132\022.context.ServiceId\0223\n\026path_hops_e" + + "ndpoint_ids\030\003 \003(\0132\023.context.EndPointId\022+" + + "\n\017sub_service_ids\030\004 \003(\0132\022.context.Servic" + + "eId\022-\n\010settings\030\005 \001(\0132\033.context.Connecti" + + "onSettings\"A\n\020ConnectionIdList\022-\n\016connec" + + "tion_ids\030\001 \003(\0132\025.context.ConnectionId\":\n" + + "\016ConnectionList\022(\n\013connections\030\001 \003(\0132\023.c" + + "ontext.Connection\"^\n\017ConnectionEvent\022\035\n\005" + + "event\030\001 \001(\0132\016.context.Event\022,\n\rconnectio" + + "n_id\030\002 \001(\0132\025.context.ConnectionId\"\202\001\n\nEn" + + "dPointId\022(\n\013topology_id\030\001 \001(\0132\023.context." + + "TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.context." + + "DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r.contex" + + "t.Uuid\"\264\001\n\010EndPoint\022(\n\013endpoint_id\030\001 \001(\013" + + "2\023.context.EndPointId\022\025\n\rendpoint_type\030\002" + + " \001(\t\0229\n\020kpi_sample_types\030\003 \003(\0162\037.kpi_sam" + + "ple_types.KpiSampleType\022,\n\021endpoint_loca" + + "tion\030\004 \001(\0132\021.context.Location\"A\n\021ConfigR" + + "ule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016reso" + + "urce_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013en" + + "dpoint_id\030\001 \001(\0132\023.context.EndPointId\022!\n\010" + + "rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConf" + + "igRule\022)\n\006action\030\001 \001(\0162\031.context.ConfigA" + + "ctionEnum\022,\n\006custom\030\002 \001(\0132\032.context.Conf" + + "igRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.C" + + "onfigRule_ACLH\000B\r\n\013config_rule\"F\n\021Constr" + + "aint_Custom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020" + + "constraint_value\030\002 \001(\t\"E\n\023Constraint_Sch" + + "edule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rdurati" + + "on_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitud" + + "e\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020" + + "\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025" + + ".context.GPS_PositionH\000B\n\n\010location\"l\n\033C" + + "onstraint_EndPointLocation\022(\n\013endpoint_i" + + "d\030\001 \001(\0132\023.context.EndPointId\022#\n\010location" + + "\030\002 \001(\0132\021.context.Location\"Y\n\033Constraint_" + + "EndPointPriority\022(\n\013endpoint_id\030\001 \001(\0132\023." + + "context.EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026" + + "Constraint_SLA_Latency\022\026\n\016e2e_latency_ms" + + "\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025\n\rcap" + + "acity_gbps\030\001 \001(\002\"M\n\033Constraint_SLA_Avail" + + "ability\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\na" + + "ll_active\030\002 \001(\010\"V\n\036Constraint_SLA_Isolat" + + "ion_level\0224\n\017isolation_level\030\001 \003(\0162\033.con" + + "text.IsolationLevelEnum\"\366\003\n\nConstraint\022," + + "\n\006custom\030\001 \001(\0132\032.context.Constraint_Cust" + + "omH\000\0220\n\010schedule\030\002 \001(\0132\034.context.Constra" + + "int_ScheduleH\000\022A\n\021endpoint_location\030\003 \001(" + + "\0132$.context.Constraint_EndPointLocationH" + + "\000\022A\n\021endpoint_priority\030\004 \001(\0132$.context.C" + + "onstraint_EndPointPriorityH\000\0228\n\014sla_capa" + + "city\030\005 \001(\0132 .context.Constraint_SLA_Capa" + + "cityH\000\0226\n\013sla_latency\030\006 \001(\0132\037.context.Co" + + "nstraint_SLA_LatencyH\000\022@\n\020sla_availabili" + + "ty\030\007 \001(\0132$.context.Constraint_SLA_Availa" + + "bilityH\000\022@\n\rsla_isolation\030\010 \001(\0132\'.contex" + + "t.Constraint_SLA_Isolation_levelH\000B\014\n\nco" + + "nstraint\"^\n\022TeraFlowController\022&\n\ncontex" + + "t_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_add" + + "ress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticati" + + "onResult\022&\n\ncontext_id\030\001 \001(\0132\022.context.C" + + "ontextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEvent" + + "TypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EVE" + + "NTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024\n" + + "\020EVENTTYPE_REMOVE\020\003*\305\001\n\020DeviceDriverEnum" + + "\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICEDR" + + "IVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANSP" + + "ORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVICE" + + "DRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVICE" + + "DRIVER_ONF_TR_352\020\005*\217\001\n\033DeviceOperationa" + + "lStatusEnum\022%\n!DEVICEOPERATIONALSTATUS_U" + + "NDEFINED\020\000\022$\n DEVICEOPERATIONALSTATUS_DI" + + "SABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS_ENAB" + + "LED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVICETYPE" + + "_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n\020SERV" + + "ICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_CONNE" + + "CTIVITY_SERVICE\020\003*\250\001\n\021ServiceStatusEnum\022" + + "\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICES" + + "TATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020" + + "\002\022!\n\035SERVICESTATUS_PENDING_REMOVAL\020\003\022\036\n\032" + + "SERVICESTATUS_SLA_VIOLATED\020\004*\251\001\n\017SliceSt" + + "atusEnum\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023S" + + "LICESTATUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT" + + "\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATU" + + "S_DEINIT\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005" + + "*]\n\020ConfigActionEnum\022\032\n\026CONFIGACTION_UND" + + "EFINED\020\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIG" + + "ACTION_DELETE\020\002*\203\002\n\022IsolationLevelEnum\022\020" + + "\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICAL_ISOLATION\020\001" + + "\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021PROCESS_ISOLA" + + "TION\020\003\022\035\n\031PHYSICAL_MEMORY_ISOLATION\020\004\022\036\n" + + "\032PHYSICAL_NETWORK_ISOLATION\020\005\022\036\n\032VIRTUAL" + + "_RESOURCE_ISOLATION\020\006\022\037\n\033NETWORK_FUNCTIO" + + "NS_ISOLATION\020\007\022\025\n\021SERVICE_ISOLATION\020\0102\357\022" + + "\n\016ContextService\022:\n\016ListContextIds\022\016.con" + + "text.Empty\032\026.context.ContextIdList\"\000\0226\n\014" + + "ListContexts\022\016.context.Empty\032\024.context.C" + + "ontextList\"\000\0224\n\nGetContext\022\022.context.Con" + + "textId\032\020.context.Context\"\000\0224\n\nSetContext" + + "\022\020.context.Context\032\022.context.ContextId\"\000" + + "\0225\n\rRemoveContext\022\022.context.ContextId\032\016." + + "context.Empty\"\000\022=\n\020GetContextEvents\022\016.co" + + "ntext.Empty\032\025.context.ContextEvent\"\0000\001\022@" + + "\n\017ListTopologyIds\022\022.context.ContextId\032\027." + + "context.TopologyIdList\"\000\022=\n\016ListTopologi" + + "es\022\022.context.ContextId\032\025.context.Topolog" + + "yList\"\000\0227\n\013GetTopology\022\023.context.Topolog" + + "yId\032\021.context.Topology\"\000\0227\n\013SetTopology\022" + + "\021.context.Topology\032\023.context.TopologyId\"" + + "\000\0227\n\016RemoveTopology\022\023.context.TopologyId" + + "\032\016.context.Empty\"\000\022?\n\021GetTopologyEvents\022" + + "\016.context.Empty\032\026.context.TopologyEvent\"" + + "\0000\001\0228\n\rListDeviceIds\022\016.context.Empty\032\025.c" + + "ontext.DeviceIdList\"\000\0224\n\013ListDevices\022\016.c" + + "ontext.Empty\032\023.context.DeviceList\"\000\0221\n\tG" + + "etDevice\022\021.context.DeviceId\032\017.context.De" + + "vice\"\000\0221\n\tSetDevice\022\017.context.Device\032\021.c" + + "ontext.DeviceId\"\000\0223\n\014RemoveDevice\022\021.cont" + + "ext.DeviceId\032\016.context.Empty\"\000\022;\n\017GetDev" + + "iceEvents\022\016.context.Empty\032\024.context.Devi" + + "ceEvent\"\0000\001\0224\n\013ListLinkIds\022\016.context.Emp" + + "ty\032\023.context.LinkIdList\"\000\0220\n\tListLinks\022\016" + + ".context.Empty\032\021.context.LinkList\"\000\022+\n\007G" + + "etLink\022\017.context.LinkId\032\r.context.Link\"\000" + + "\022+\n\007SetLink\022\r.context.Link\032\017.context.Lin" + + "kId\"\000\022/\n\nRemoveLink\022\017.context.LinkId\032\016.c" + + "ontext.Empty\"\000\0227\n\rGetLinkEvents\022\016.contex" + + "t.Empty\032\022.context.LinkEvent\"\0000\001\022>\n\016ListS" + + "erviceIds\022\022.context.ContextId\032\026.context." + + "ServiceIdList\"\000\022:\n\014ListServices\022\022.contex" + + "t.ContextId\032\024.context.ServiceList\"\000\0224\n\nG" + + "etService\022\022.context.ServiceId\032\020.context." + + "Service\"\000\0224\n\nSetService\022\020.context.Servic" + + "e\032\022.context.ServiceId\"\000\0225\n\rRemoveService" + + "\022\022.context.ServiceId\032\016.context.Empty\"\000\022=" + + "\n\020GetServiceEvents\022\016.context.Empty\032\025.con" + + "text.ServiceEvent\"\0000\001\022:\n\014ListSliceIds\022\022." + + "context.ContextId\032\024.context.SliceIdList\"" + + "\000\0226\n\nListSlices\022\022.context.ContextId\032\022.co" + + "ntext.SliceList\"\000\022.\n\010GetSlice\022\020.context." + + "SliceId\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016." + + "context.Slice\032\020.context.SliceId\"\000\0221\n\013Rem" + + "oveSlice\022\020.context.SliceId\032\016.context.Emp" + + "ty\"\000\0229\n\016GetSliceEvents\022\016.context.Empty\032\023" + + ".context.SliceEvent\"\0000\001\022D\n\021ListConnectio" + + "nIds\022\022.context.ServiceId\032\031.context.Conne" + + "ctionIdList\"\000\022@\n\017ListConnections\022\022.conte" + + "xt.ServiceId\032\027.context.ConnectionList\"\000\022" + + "=\n\rGetConnection\022\025.context.ConnectionId\032" + + "\023.context.Connection\"\000\022=\n\rSetConnection\022" + + "\023.context.Connection\032\025.context.Connectio" + + "nId\"\000\022;\n\020RemoveConnection\022\025.context.Conn" + + "ectionId\032\016.context.Empty\"\000\022C\n\023GetConnect" + + "ionEvents\022\016.context.Empty\032\030.context.Conn" + + "ectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + acl.Acl.getDescriptor(), + kpi_sample_types.KpiSampleTypes.getDescriptor(), }); internal_static_context_Empty_descriptor = getDescriptor().getMessageTypes().get(0); @@ -36346,240 +62224,404 @@ public final class ContextOuterClass { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Uuid_descriptor, new java.lang.String[] { "Uuid", }); - internal_static_context_Event_descriptor = + internal_static_context_Timestamp_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_context_Timestamp_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Timestamp_descriptor, + new java.lang.String[] { "Timestamp", }); + internal_static_context_Event_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_context_Event_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Event_descriptor, new java.lang.String[] { "Timestamp", "EventType", }); internal_static_context_ContextId_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_context_ContextId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextId_descriptor, new java.lang.String[] { "ContextUuid", }); internal_static_context_Context_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_context_Context_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Context_descriptor, new java.lang.String[] { "ContextId", "TopologyIds", "ServiceIds", "Controller", }); internal_static_context_ContextIdList_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_context_ContextIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextIdList_descriptor, new java.lang.String[] { "ContextIds", }); internal_static_context_ContextList_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_context_ContextList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextList_descriptor, new java.lang.String[] { "Contexts", }); internal_static_context_ContextEvent_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_context_ContextEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ContextEvent_descriptor, new java.lang.String[] { "Event", "ContextId", }); internal_static_context_TopologyId_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_context_TopologyId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyId_descriptor, new java.lang.String[] { "ContextId", "TopologyUuid", }); internal_static_context_Topology_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_context_Topology_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Topology_descriptor, new java.lang.String[] { "TopologyId", "DeviceIds", "LinkIds", }); internal_static_context_TopologyIdList_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_context_TopologyIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyIdList_descriptor, new java.lang.String[] { "TopologyIds", }); internal_static_context_TopologyList_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_context_TopologyList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyList_descriptor, new java.lang.String[] { "Topologies", }); internal_static_context_TopologyEvent_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_context_TopologyEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TopologyEvent_descriptor, new java.lang.String[] { "Event", "TopologyId", }); internal_static_context_DeviceId_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_context_DeviceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceId_descriptor, new java.lang.String[] { "DeviceUuid", }); internal_static_context_Device_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, new java.lang.String[] { "DeviceId", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", }); internal_static_context_DeviceConfig_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_context_DeviceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_DeviceIdList_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(17); internal_static_context_DeviceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceIdList_descriptor, new java.lang.String[] { "DeviceIds", }); internal_static_context_DeviceList_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceList_descriptor, new java.lang.String[] { "Devices", }); internal_static_context_DeviceEvent_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(19); internal_static_context_DeviceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_DeviceEvent_descriptor, new java.lang.String[] { "Event", "DeviceId", }); internal_static_context_LinkId_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(20); internal_static_context_LinkId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkId_descriptor, new java.lang.String[] { "LinkUuid", }); internal_static_context_Link_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(21); internal_static_context_Link_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Link_descriptor, new java.lang.String[] { "LinkId", "LinkEndpointIds", }); internal_static_context_LinkIdList_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(22); internal_static_context_LinkIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkIdList_descriptor, new java.lang.String[] { "LinkIds", }); internal_static_context_LinkList_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(23); internal_static_context_LinkList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkList_descriptor, new java.lang.String[] { "Links", }); internal_static_context_LinkEvent_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(24); internal_static_context_LinkEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_LinkEvent_descriptor, new java.lang.String[] { "Event", "LinkId", }); internal_static_context_ServiceId_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(25); internal_static_context_ServiceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceId_descriptor, new java.lang.String[] { "ContextId", "ServiceUuid", }); internal_static_context_Service_descriptor = - getDescriptor().getMessageTypes().get(25); + getDescriptor().getMessageTypes().get(26); internal_static_context_Service_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Service_descriptor, - new java.lang.String[] { "ServiceId", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", }); + new java.lang.String[] { "ServiceId", "ServiceType", "ServiceEndpointIds", "ServiceConstraints", "ServiceStatus", "ServiceConfig", "Timestamp", }); internal_static_context_ServiceStatus_descriptor = - getDescriptor().getMessageTypes().get(26); + getDescriptor().getMessageTypes().get(27); internal_static_context_ServiceStatus_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceStatus_descriptor, new java.lang.String[] { "ServiceStatus", }); internal_static_context_ServiceConfig_descriptor = - getDescriptor().getMessageTypes().get(27); + getDescriptor().getMessageTypes().get(28); internal_static_context_ServiceConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceConfig_descriptor, new java.lang.String[] { "ConfigRules", }); internal_static_context_ServiceIdList_descriptor = - getDescriptor().getMessageTypes().get(28); + getDescriptor().getMessageTypes().get(29); internal_static_context_ServiceIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceIdList_descriptor, new java.lang.String[] { "ServiceIds", }); internal_static_context_ServiceList_descriptor = - getDescriptor().getMessageTypes().get(29); + getDescriptor().getMessageTypes().get(30); internal_static_context_ServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceList_descriptor, new java.lang.String[] { "Services", }); internal_static_context_ServiceEvent_descriptor = - getDescriptor().getMessageTypes().get(30); + getDescriptor().getMessageTypes().get(31); internal_static_context_ServiceEvent_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ServiceEvent_descriptor, new java.lang.String[] { "Event", "ServiceId", }); - internal_static_context_EndPointId_descriptor = - getDescriptor().getMessageTypes().get(31); - internal_static_context_EndPointId_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_EndPointId_descriptor, - new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); - internal_static_context_EndPoint_descriptor = + internal_static_context_SliceId_descriptor = getDescriptor().getMessageTypes().get(32); - internal_static_context_EndPoint_fieldAccessorTable = new + internal_static_context_SliceId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_EndPoint_descriptor, - new java.lang.String[] { "EndpointId", "EndpointType", }); - internal_static_context_ConfigRule_descriptor = + internal_static_context_SliceId_descriptor, + new java.lang.String[] { "ContextId", "SliceUuid", }); + internal_static_context_Slice_descriptor = getDescriptor().getMessageTypes().get(33); - internal_static_context_ConfigRule_fieldAccessorTable = new + internal_static_context_Slice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_ConfigRule_descriptor, - new java.lang.String[] { "Action", "ResourceKey", "ResourceValue", }); - internal_static_context_Constraint_descriptor = + internal_static_context_Slice_descriptor, + new java.lang.String[] { "SliceId", "SliceEndpointIds", "SliceConstraints", "SliceServiceIds", "SliceSubsliceIds", "SliceStatus", "SliceConfig", "SliceOwner", "Timestamp", }); + internal_static_context_SliceOwner_descriptor = getDescriptor().getMessageTypes().get(34); - internal_static_context_Constraint_fieldAccessorTable = new + internal_static_context_SliceOwner_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_context_Constraint_descriptor, - new java.lang.String[] { "ConstraintType", "ConstraintValue", }); - internal_static_context_ConnectionId_descriptor = + internal_static_context_SliceOwner_descriptor, + new java.lang.String[] { "OwnerUuid", "OwnerString", }); + internal_static_context_SliceStatus_descriptor = getDescriptor().getMessageTypes().get(35); + internal_static_context_SliceStatus_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceStatus_descriptor, + new java.lang.String[] { "SliceStatus", }); + internal_static_context_SliceConfig_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_context_SliceConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceConfig_descriptor, + new java.lang.String[] { "ConfigRules", }); + internal_static_context_SliceIdList_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_context_SliceIdList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceIdList_descriptor, + new java.lang.String[] { "SliceIds", }); + internal_static_context_SliceList_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_context_SliceList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceList_descriptor, + new java.lang.String[] { "Slices", }); + internal_static_context_SliceEvent_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_context_SliceEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_SliceEvent_descriptor, + new java.lang.String[] { "Event", "SliceId", }); + internal_static_context_ConnectionId_descriptor = + getDescriptor().getMessageTypes().get(40); internal_static_context_ConnectionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionId_descriptor, new java.lang.String[] { "ConnectionUuid", }); + internal_static_context_ConnectionSettings_L0_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_context_ConnectionSettings_L0_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L0_descriptor, + new java.lang.String[] { "LspSymbolicName", }); + internal_static_context_ConnectionSettings_L2_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_context_ConnectionSettings_L2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L2_descriptor, + new java.lang.String[] { "SrcMacAddress", "DstMacAddress", "EtherType", "VlanId", "MplsLabel", "MplsTrafficClass", }); + internal_static_context_ConnectionSettings_L3_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_context_ConnectionSettings_L3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L3_descriptor, + new java.lang.String[] { "SrcIpAddress", "DstIpAddress", "Dscp", "Protocol", "Ttl", }); + internal_static_context_ConnectionSettings_L4_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_context_ConnectionSettings_L4_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_L4_descriptor, + new java.lang.String[] { "SrcPort", "DstPort", "TcpFlags", "Ttl", }); + internal_static_context_ConnectionSettings_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_context_ConnectionSettings_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionSettings_descriptor, + new java.lang.String[] { "L0", "L2", "L3", "L4", }); internal_static_context_Connection_descriptor = - getDescriptor().getMessageTypes().get(36); + getDescriptor().getMessageTypes().get(46); internal_static_context_Connection_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Connection_descriptor, - new java.lang.String[] { "ConnectionId", "RelatedServiceId", "Path", }); + new java.lang.String[] { "ConnectionId", "ServiceId", "PathHopsEndpointIds", "SubServiceIds", "Settings", }); internal_static_context_ConnectionIdList_descriptor = - getDescriptor().getMessageTypes().get(37); + getDescriptor().getMessageTypes().get(47); internal_static_context_ConnectionIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionIdList_descriptor, new java.lang.String[] { "ConnectionIds", }); internal_static_context_ConnectionList_descriptor = - getDescriptor().getMessageTypes().get(38); + getDescriptor().getMessageTypes().get(48); internal_static_context_ConnectionList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_ConnectionList_descriptor, new java.lang.String[] { "Connections", }); + internal_static_context_ConnectionEvent_descriptor = + getDescriptor().getMessageTypes().get(49); + internal_static_context_ConnectionEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConnectionEvent_descriptor, + new java.lang.String[] { "Event", "ConnectionId", }); + internal_static_context_EndPointId_descriptor = + getDescriptor().getMessageTypes().get(50); + internal_static_context_EndPointId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_EndPointId_descriptor, + new java.lang.String[] { "TopologyId", "DeviceId", "EndpointUuid", }); + internal_static_context_EndPoint_descriptor = + getDescriptor().getMessageTypes().get(51); + internal_static_context_EndPoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_EndPoint_descriptor, + new java.lang.String[] { "EndpointId", "EndpointType", "KpiSampleTypes", "EndpointLocation", }); + internal_static_context_ConfigRule_Custom_descriptor = + getDescriptor().getMessageTypes().get(52); + internal_static_context_ConfigRule_Custom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_Custom_descriptor, + new java.lang.String[] { "ResourceKey", "ResourceValue", }); + internal_static_context_ConfigRule_ACL_descriptor = + getDescriptor().getMessageTypes().get(53); + internal_static_context_ConfigRule_ACL_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_ACL_descriptor, + new java.lang.String[] { "EndpointId", "RuleSet", }); + internal_static_context_ConfigRule_descriptor = + getDescriptor().getMessageTypes().get(54); + internal_static_context_ConfigRule_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_ConfigRule_descriptor, + new java.lang.String[] { "Action", "Custom", "Acl", "ConfigRule", }); + internal_static_context_Constraint_Custom_descriptor = + getDescriptor().getMessageTypes().get(55); + internal_static_context_Constraint_Custom_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_Custom_descriptor, + new java.lang.String[] { "ConstraintType", "ConstraintValue", }); + internal_static_context_Constraint_Schedule_descriptor = + getDescriptor().getMessageTypes().get(56); + internal_static_context_Constraint_Schedule_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_Schedule_descriptor, + new java.lang.String[] { "StartTimestamp", "DurationDays", }); + internal_static_context_GPS_Position_descriptor = + getDescriptor().getMessageTypes().get(57); + internal_static_context_GPS_Position_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_GPS_Position_descriptor, + new java.lang.String[] { "Latitude", "Longitude", }); + internal_static_context_Location_descriptor = + getDescriptor().getMessageTypes().get(58); + internal_static_context_Location_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Location_descriptor, + new java.lang.String[] { "Region", "GpsPosition", "Location", }); + internal_static_context_Constraint_EndPointLocation_descriptor = + getDescriptor().getMessageTypes().get(59); + internal_static_context_Constraint_EndPointLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_EndPointLocation_descriptor, + new java.lang.String[] { "EndpointId", "Location", }); + internal_static_context_Constraint_EndPointPriority_descriptor = + getDescriptor().getMessageTypes().get(60); + internal_static_context_Constraint_EndPointPriority_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_EndPointPriority_descriptor, + new java.lang.String[] { "EndpointId", "Priority", }); + internal_static_context_Constraint_SLA_Latency_descriptor = + getDescriptor().getMessageTypes().get(61); + internal_static_context_Constraint_SLA_Latency_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Latency_descriptor, + new java.lang.String[] { "E2ELatencyMs", }); + internal_static_context_Constraint_SLA_Capacity_descriptor = + getDescriptor().getMessageTypes().get(62); + internal_static_context_Constraint_SLA_Capacity_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Capacity_descriptor, + new java.lang.String[] { "CapacityGbps", }); + internal_static_context_Constraint_SLA_Availability_descriptor = + getDescriptor().getMessageTypes().get(63); + internal_static_context_Constraint_SLA_Availability_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Availability_descriptor, + new java.lang.String[] { "NumDisjointPaths", "AllActive", }); + internal_static_context_Constraint_SLA_Isolation_level_descriptor = + getDescriptor().getMessageTypes().get(64); + internal_static_context_Constraint_SLA_Isolation_level_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_SLA_Isolation_level_descriptor, + new java.lang.String[] { "IsolationLevel", }); + internal_static_context_Constraint_descriptor = + getDescriptor().getMessageTypes().get(65); + internal_static_context_Constraint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Constraint_descriptor, + new java.lang.String[] { "Custom", "Schedule", "EndpointLocation", "EndpointPriority", "SlaCapacity", "SlaLatency", "SlaAvailability", "SlaIsolation", "Constraint", }); internal_static_context_TeraFlowController_descriptor = - getDescriptor().getMessageTypes().get(39); + getDescriptor().getMessageTypes().get(66); internal_static_context_TeraFlowController_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_TeraFlowController_descriptor, new java.lang.String[] { "ContextId", "IpAddress", "Port", }); internal_static_context_AuthenticationResult_descriptor = - getDescriptor().getMessageTypes().get(40); + getDescriptor().getMessageTypes().get(67); internal_static_context_AuthenticationResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_AuthenticationResult_descriptor, new java.lang.String[] { "ContextId", "Authenticated", }); + acl.Acl.getDescriptor(); + kpi_sample_types.KpiSampleTypes.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/policy/target/generated-sources/grpc/context/ContextService.java b/src/policy/target/generated-sources/grpc/context/ContextService.java index 8e5095d25896abc5ff37b7a5e7d4ac7f97825dc6..d54c56057ca53e40071490d3b9aa313a13a77665 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextService.java +++ b/src/policy/target/generated-sources/grpc/context/ContextService.java @@ -58,6 +58,26 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Uni removeService(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request); + + io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request); + + io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request); + + io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request); + + io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request); + + io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request); + + io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request); + + io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request); + io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request); @@ -69,6 +89,10 @@ public interface ContextService extends MutinyService { io.smallrye.mutiny.Multi getServiceEvents(context.ContextOuterClass.Empty request); + io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request); + } \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java b/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java index fbecd5d2f3cdf04e9f47693a4aeea37753855cdf..f552294b8e6d645af41cc30632ae0432504bbc67 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceBean.java @@ -215,6 +215,86 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } + @Override + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSliceIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + try { + return delegate.listSlices(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.getSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + try { + return delegate.setSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + try { + return delegate.removeSlice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + try { + return delegate.listConnectionIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + try { + return delegate.listConnections(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + try { + return delegate.getConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + try { + return delegate.setConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + try { + return delegate.removeConnection(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } @Override public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { @@ -261,4 +341,22 @@ public class ContextServiceBean extends MutinyContextServiceGrpc.ContextServiceI } } + @Override + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getSliceEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + try { + return delegate.getConnectionEvents(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + } \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java b/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java index 6e815b940e668e33bf936d7d9de0930d086ff9a3..c6493bd4d381967238e5eb87dd717f679d028526 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceClient.java @@ -120,6 +120,46 @@ public class ContextServiceClient implements ContextService, MutinyClient removeService(context.ContextOuterClass.ServiceId request) { return stub.removeService(request); } + @Override + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + return stub.listSliceIds(request); + } + @Override + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + return stub.listSlices(request); + } + @Override + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + return stub.getSlice(request); + } + @Override + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + return stub.setSlice(request); + } + @Override + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + return stub.removeSlice(request); + } + @Override + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + return stub.listConnectionIds(request); + } + @Override + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + return stub.listConnections(request); + } + @Override + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + return stub.getConnection(request); + } + @Override + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + return stub.setConnection(request); + } + @Override + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + return stub.removeConnection(request); + } @Override public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { @@ -146,4 +186,14 @@ public class ContextServiceClient implements ContextService, MutinyClient getSliceEvents(context.ContextOuterClass.Empty request) { + return stub.getSliceEvents(request); + } + + @Override + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + return stub.getConnectionEvents(request); + } + } \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java index 03f2a66f6f09ed54eb1c359a356ba5240b184166..be720c127439e50f68c2518332f85f750d6579ee 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/context/ContextServiceGrpc.java @@ -944,6 +944,378 @@ public final class ContextServiceGrpc { return getGetServiceEventsMethod; } + private static volatile io.grpc.MethodDescriptor getListSliceIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSliceIds", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListSliceIdsMethod() { + io.grpc.MethodDescriptor getListSliceIdsMethod; + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSliceIdsMethod = ContextServiceGrpc.getListSliceIdsMethod) == null) { + ContextServiceGrpc.getListSliceIdsMethod = getListSliceIdsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSliceIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSliceIds")) + .build(); + } + } + } + return getListSliceIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListSlicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSlices", + requestType = context.ContextOuterClass.ContextId.class, + responseType = context.ContextOuterClass.SliceList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListSlicesMethod() { + io.grpc.MethodDescriptor getListSlicesMethod; + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListSlicesMethod = ContextServiceGrpc.getListSlicesMethod) == null) { + ContextServiceGrpc.getListSlicesMethod = getListSlicesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSlices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ContextId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListSlices")) + .build(); + } + } + } + return getListSlicesMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Slice.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSliceMethod() { + io.grpc.MethodDescriptor getGetSliceMethod; + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceMethod = ContextServiceGrpc.getGetSliceMethod) == null) { + ContextServiceGrpc.getGetSliceMethod = getGetSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSlice")) + .build(); + } + } + } + return getGetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getSetSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetSlice", + requestType = context.ContextOuterClass.Slice.class, + responseType = context.ContextOuterClass.SliceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetSliceMethod() { + io.grpc.MethodDescriptor getSetSliceMethod; + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetSliceMethod = ContextServiceGrpc.getSetSliceMethod) == null) { + ContextServiceGrpc.getSetSliceMethod = getSetSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Slice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetSlice")) + .build(); + } + } + } + return getSetSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getRemoveSliceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveSlice", + requestType = context.ContextOuterClass.SliceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRemoveSliceMethod() { + io.grpc.MethodDescriptor getRemoveSliceMethod; + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveSliceMethod = ContextServiceGrpc.getRemoveSliceMethod) == null) { + ContextServiceGrpc.getRemoveSliceMethod = getRemoveSliceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveSlice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveSlice")) + .build(); + } + } + } + return getRemoveSliceMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSliceEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSliceEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.SliceEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetSliceEventsMethod() { + io.grpc.MethodDescriptor getGetSliceEventsMethod; + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetSliceEventsMethod = ContextServiceGrpc.getGetSliceEventsMethod) == null) { + ContextServiceGrpc.getGetSliceEventsMethod = getGetSliceEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSliceEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.SliceEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetSliceEvents")) + .build(); + } + } + } + return getGetSliceEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListConnectionIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnectionIds", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.ConnectionIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListConnectionIdsMethod() { + io.grpc.MethodDescriptor getListConnectionIdsMethod; + if ((getListConnectionIdsMethod = ContextServiceGrpc.getListConnectionIdsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListConnectionIdsMethod = ContextServiceGrpc.getListConnectionIdsMethod) == null) { + ContextServiceGrpc.getListConnectionIdsMethod = getListConnectionIdsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnectionIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListConnectionIds")) + .build(); + } + } + } + return getListConnectionIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConnections", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.ConnectionList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListConnectionsMethod() { + io.grpc.MethodDescriptor getListConnectionsMethod; + if ((getListConnectionsMethod = ContextServiceGrpc.getListConnectionsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getListConnectionsMethod = ContextServiceGrpc.getListConnectionsMethod) == null) { + ContextServiceGrpc.getListConnectionsMethod = getListConnectionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionList.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("ListConnections")) + .build(); + } + } + } + return getListConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnection", + requestType = context.ContextOuterClass.ConnectionId.class, + responseType = context.ContextOuterClass.Connection.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetConnectionMethod() { + io.grpc.MethodDescriptor getGetConnectionMethod; + if ((getGetConnectionMethod = ContextServiceGrpc.getGetConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetConnectionMethod = ContextServiceGrpc.getGetConnectionMethod) == null) { + ContextServiceGrpc.getGetConnectionMethod = getGetConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Connection.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetConnection")) + .build(); + } + } + } + return getGetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getSetConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetConnection", + requestType = context.ContextOuterClass.Connection.class, + responseType = context.ContextOuterClass.ConnectionId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetConnectionMethod() { + io.grpc.MethodDescriptor getSetConnectionMethod; + if ((getSetConnectionMethod = ContextServiceGrpc.getSetConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getSetConnectionMethod = ContextServiceGrpc.getSetConnectionMethod) == null) { + ContextServiceGrpc.getSetConnectionMethod = getSetConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Connection.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("SetConnection")) + .build(); + } + } + } + return getSetConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getRemoveConnectionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemoveConnection", + requestType = context.ContextOuterClass.ConnectionId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRemoveConnectionMethod() { + io.grpc.MethodDescriptor getRemoveConnectionMethod; + if ((getRemoveConnectionMethod = ContextServiceGrpc.getRemoveConnectionMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getRemoveConnectionMethod = ContextServiceGrpc.getRemoveConnectionMethod) == null) { + ContextServiceGrpc.getRemoveConnectionMethod = getRemoveConnectionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemoveConnection")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("RemoveConnection")) + .build(); + } + } + } + return getRemoveConnectionMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetConnectionEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConnectionEvents", + requestType = context.ContextOuterClass.Empty.class, + responseType = context.ContextOuterClass.ConnectionEvent.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetConnectionEventsMethod() { + io.grpc.MethodDescriptor getGetConnectionEventsMethod; + if ((getGetConnectionEventsMethod = ContextServiceGrpc.getGetConnectionEventsMethod) == null) { + synchronized (ContextServiceGrpc.class) { + if ((getGetConnectionEventsMethod = ContextServiceGrpc.getGetConnectionEventsMethod) == null) { + ContextServiceGrpc.getGetConnectionEventsMethod = getGetConnectionEventsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnectionEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ConnectionEvent.getDefaultInstance())) + .setSchemaDescriptor(new ContextServiceMethodDescriptorSupplier("GetConnectionEvents")) + .build(); + } + } + } + return getGetConnectionEventsMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -1202,6 +1574,90 @@ public final class ContextServiceGrpc { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetServiceEventsMethod(), responseObserver); } + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSliceIdsMethod(), responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSlicesMethod(), responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceMethod(), responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetSliceMethod(), responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveSliceMethod(), responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSliceEventsMethod(), responseObserver); + } + + /** + */ + public void listConnectionIds(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListConnectionIdsMethod(), responseObserver); + } + + /** + */ + public void listConnections(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListConnectionsMethod(), responseObserver); + } + + /** + */ + public void getConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetConnectionMethod(), responseObserver); + } + + /** + */ + public void setConnection(context.ContextOuterClass.Connection request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetConnectionMethod(), responseObserver); + } + + /** + */ + public void removeConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemoveConnectionMethod(), responseObserver); + } + + /** + */ + public void getConnectionEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetConnectionEventsMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -1414,6 +1870,90 @@ public final class ContextServiceGrpc { context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS))) + .addMethod( + getListSliceIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS))) + .addMethod( + getListSlicesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES))) + .addMethod( + getGetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE))) + .addMethod( + getSetSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE))) + .addMethod( + getRemoveSliceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE))) + .addMethod( + getGetSliceEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS))) + .addMethod( + getListConnectionIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionIdList>( + this, METHODID_LIST_CONNECTION_IDS))) + .addMethod( + getListConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionList>( + this, METHODID_LIST_CONNECTIONS))) + .addMethod( + getGetConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Connection>( + this, METHODID_GET_CONNECTION))) + .addMethod( + getSetConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Connection, + context.ContextOuterClass.ConnectionId>( + this, METHODID_SET_CONNECTION))) + .addMethod( + getRemoveConnectionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_CONNECTION))) + .addMethod( + getGetConnectionEventsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.ConnectionEvent>( + this, METHODID_GET_CONNECTION_EVENTS))) .build(); } } @@ -1671,6 +2211,102 @@ public final class ContextServiceGrpc { io.grpc.stub.ClientCalls.asyncServerStreamingCall( getChannel().newCall(getGetServiceEventsMethod(), getCallOptions()), request, responseObserver); } + + /** + */ + public void listSliceIds(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listSlices(context.ContextOuterClass.ContextId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setSlice(context.ContextOuterClass.Slice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeSlice(context.ContextOuterClass.SliceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSliceEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetSliceEventsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listConnectionIds(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConnectionIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listConnections(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setConnection(context.ContextOuterClass.Connection request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removeConnection(context.ContextOuterClass.ConnectionId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemoveConnectionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getConnectionEvents(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetConnectionEventsMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -1901,6 +2537,92 @@ public final class ContextServiceGrpc { return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getGetServiceEventsMethod(), getCallOptions(), request); } + + /** + */ + public context.ContextOuterClass.SliceIdList listSliceIds(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSliceIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceList listSlices(context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSlicesMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Slice getSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.SliceId setSlice(context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetSliceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeSlice(context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveSliceMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getSliceEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetSliceEventsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionIdList listConnectionIds(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConnectionIdsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionList listConnections(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConnectionsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Connection getConnection(context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ConnectionId setConnection(context.ContextOuterClass.Connection request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removeConnection(context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemoveConnectionMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getConnectionEvents( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetConnectionEventsMethod(), getCallOptions(), request); + } } /** @@ -2116,6 +2838,86 @@ public final class ContextServiceGrpc { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getRemoveServiceMethod(), getCallOptions()), request); } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listSliceIds( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSliceIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listSlices( + context.ContextOuterClass.ContextId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSlicesMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture setSlice( + context.ContextOuterClass.Slice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture removeSlice( + context.ContextOuterClass.SliceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveSliceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listConnectionIds( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConnectionIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listConnections( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getConnection( + context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture setConnection( + context.ContextOuterClass.Connection request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetConnectionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture removeConnection( + context.ContextOuterClass.ConnectionId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemoveConnectionMethod(), getCallOptions()), request); + } } private static final int METHODID_LIST_CONTEXT_IDS = 0; @@ -2148,6 +2950,18 @@ public final class ContextServiceGrpc { private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2286,6 +3100,54 @@ public final class ContextServiceGrpc { serviceImpl.getServiceEvents((context.ContextOuterClass.Empty) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LIST_SLICE_IDS: + serviceImpl.listSliceIds((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SLICES: + serviceImpl.listSlices((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SLICE: + serviceImpl.getSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_SLICE: + serviceImpl.setSlice((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_SLICE: + serviceImpl.removeSlice((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SLICE_EVENTS: + serviceImpl.getSliceEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CONNECTION_IDS: + serviceImpl.listConnectionIds((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CONNECTIONS: + serviceImpl.listConnections((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONNECTION: + serviceImpl.getConnection((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_CONNECTION: + serviceImpl.setConnection((context.ContextOuterClass.Connection) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_CONNECTION: + serviceImpl.removeConnection((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONNECTION_EVENTS: + serviceImpl.getConnectionEvents((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2377,6 +3239,18 @@ public final class ContextServiceGrpc { .addMethod(getSetServiceMethod()) .addMethod(getRemoveServiceMethod()) .addMethod(getGetServiceEventsMethod()) + .addMethod(getListSliceIdsMethod()) + .addMethod(getListSlicesMethod()) + .addMethod(getGetSliceMethod()) + .addMethod(getSetSliceMethod()) + .addMethod(getRemoveSliceMethod()) + .addMethod(getGetSliceEventsMethod()) + .addMethod(getListConnectionIdsMethod()) + .addMethod(getListConnectionsMethod()) + .addMethod(getGetConnectionMethod()) + .addMethod(getSetConnectionMethod()) + .addMethod(getRemoveConnectionMethod()) + .addMethod(getGetConnectionEventsMethod()) .build(); } } diff --git a/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java index 7642fdfd5c6d203fe0e0b042ca06448477b05bad..9f71b53786e40922546dc59cfd4328040a40bd7c 100644 --- a/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java @@ -161,6 +161,56 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSliceIds); + } + + + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listSlices); + } + + + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSlice); + } + + + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setSlice); + } + + + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeSlice); + } + + + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnectionIds); + } + + + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listConnections); + } + + + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getConnection); + } + + + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setConnection); + } + + + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removeConnection); + } + + public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getContextEvents); } @@ -185,6 +235,16 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getServiceEvents); } + + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getSliceEvents); + } + + + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getConnectionEvents); + } + } @@ -328,6 +388,56 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M } + public io.smallrye.mutiny.Uni listSliceIds(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listSlices(context.ContextOuterClass.ContextId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni setSlice(context.ContextOuterClass.Slice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni removeSlice(context.ContextOuterClass.SliceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listConnectionIds(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listConnections(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getConnection(context.ContextOuterClass.ConnectionId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni setConnection(context.ContextOuterClass.Connection request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni removeConnection(context.ContextOuterClass.ConnectionId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + public io.smallrye.mutiny.Multi getContextEvents(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @@ -352,6 +462,16 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } + + public io.smallrye.mutiny.Multi getSliceEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi getConnectionEvents(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -564,6 +684,90 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M context.ContextOuterClass.Empty, context.ContextOuterClass.ServiceEvent>( this, METHODID_GET_SERVICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSliceIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceIdList>( + this, METHODID_LIST_SLICE_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListSlicesMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ContextId, + context.ContextOuterClass.SliceList>( + this, METHODID_LIST_SLICES, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Slice>( + this, METHODID_GET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getSetSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Slice, + context.ContextOuterClass.SliceId>( + this, METHODID_SET_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveSliceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.SliceId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_SLICE, compression))) + .addMethod( + context.ContextServiceGrpc.getGetSliceEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.SliceEvent>( + this, METHODID_GET_SLICE_EVENTS, compression))) + .addMethod( + context.ContextServiceGrpc.getListConnectionIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionIdList>( + this, METHODID_LIST_CONNECTION_IDS, compression))) + .addMethod( + context.ContextServiceGrpc.getListConnectionsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.ConnectionList>( + this, METHODID_LIST_CONNECTIONS, compression))) + .addMethod( + context.ContextServiceGrpc.getGetConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Connection>( + this, METHODID_GET_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getSetConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Connection, + context.ContextOuterClass.ConnectionId>( + this, METHODID_SET_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getRemoveConnectionMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ConnectionId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_CONNECTION, compression))) + .addMethod( + context.ContextServiceGrpc.getGetConnectionEventsMethod(), + asyncServerStreamingCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + context.ContextOuterClass.ConnectionEvent>( + this, METHODID_GET_CONNECTION_EVENTS, compression))) .build(); } } @@ -598,6 +802,18 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M private static final int METHODID_SET_SERVICE = 27; private static final int METHODID_REMOVE_SERVICE = 28; private static final int METHODID_GET_SERVICE_EVENTS = 29; + private static final int METHODID_LIST_SLICE_IDS = 30; + private static final int METHODID_LIST_SLICES = 31; + private static final int METHODID_GET_SLICE = 32; + private static final int METHODID_SET_SLICE = 33; + private static final int METHODID_REMOVE_SLICE = 34; + private static final int METHODID_GET_SLICE_EVENTS = 35; + private static final int METHODID_LIST_CONNECTION_IDS = 36; + private static final int METHODID_LIST_CONNECTIONS = 37; + private static final int METHODID_GET_CONNECTION = 38; + private static final int METHODID_SET_CONNECTION = 39; + private static final int METHODID_REMOVE_CONNECTION = 40; + private static final int METHODID_GET_CONNECTION_EVENTS = 41; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -798,6 +1014,78 @@ public final class MutinyContextServiceGrpc implements io.quarkus.grpc.runtime.M compression, serviceImpl::getServiceEvents); break; + case METHODID_LIST_SLICE_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listSliceIds); + break; + case METHODID_LIST_SLICES: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ContextId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listSlices); + break; + case METHODID_GET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSlice); + break; + case METHODID_SET_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Slice) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::setSlice); + break; + case METHODID_REMOVE_SLICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.SliceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::removeSlice); + break; + case METHODID_GET_SLICE_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSliceEvents); + break; + case METHODID_LIST_CONNECTION_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listConnectionIds); + break; + case METHODID_LIST_CONNECTIONS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listConnections); + break; + case METHODID_GET_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getConnection); + break; + case METHODID_SET_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Connection) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::setConnection); + break; + case METHODID_REMOVE_CONNECTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ConnectionId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::removeConnection); + break; + case METHODID_GET_CONNECTION_EVENTS: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getConnectionEvents); + break; default: throw new java.lang.AssertionError(); } diff --git a/src/policy/target/generated-sources/grpc/context_policy/ContextPolicy.java b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicy.java new file mode 100644 index 0000000000000000000000000000000000000000..455aef779d7a0c29a4654b895e6c9652ca416e14 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicy.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: context_policy.proto + +package context_policy; + +public final class ContextPolicy { + private ContextPolicy() {} + 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 static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024context_policy.proto\022\016context_policy\032\r" + + "context.proto\032\014policy.proto2\324\002\n\024ContextP" + + "olicyService\022?\n\021ListPolicyRuleIds\022\016.cont" + + "ext.Empty\032\030.policy.PolicyRuleIdList\"\000\022;\n" + + "\017ListPolicyRules\022\016.context.Empty\032\026.polic" + + "y.PolicyRuleList\"\000\022@\n\rGetPolicyRule\022\024.po" + + "licy.PolicyRuleId\032\027.policy.PolicyRuleBas" + + "ic\"\000\022@\n\rSetPolicyRule\022\027.policy.PolicyRul" + + "eBasic\032\024.policy.PolicyRuleId\"\000\022:\n\020Remove" + + "PolicyRule\022\024.policy.PolicyRuleId\032\016.conte" + + "xt.Empty\"\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + policy.Policy.getDescriptor(), + }); + context.ContextOuterClass.getDescriptor(); + policy.Policy.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyService.java b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyService.java new file mode 100644 index 0000000000000000000000000000000000000000..7ace0b9dcf220b80359a47781c1f8cdc1d9984ea --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyService.java @@ -0,0 +1,24 @@ +package context_policy; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: context_policy.proto") +public interface ContextPolicyService extends MutinyService { + + + io.smallrye.mutiny.Uni listPolicyRuleIds(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni listPolicyRules(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni getPolicyRule(policy.Policy.PolicyRuleId request); + + io.smallrye.mutiny.Uni setPolicyRule(policy.Policy.PolicyRuleBasic request); + + io.smallrye.mutiny.Uni removePolicyRule(policy.Policy.PolicyRuleId request); + + + + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceBean.java b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..a08761c67c484d5b35d22253364ccaf6beaa266c --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceBean.java @@ -0,0 +1,59 @@ +package context_policy; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: context_policy.proto") +public class ContextPolicyServiceBean extends MutinyContextPolicyServiceGrpc.ContextPolicyServiceImplBase implements BindableService, MutinyBean { + + private final ContextPolicyService delegate; + + ContextPolicyServiceBean(@GrpcService ContextPolicyService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni listPolicyRuleIds(context.ContextOuterClass.Empty request) { + try { + return delegate.listPolicyRuleIds(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni listPolicyRules(context.ContextOuterClass.Empty request) { + try { + return delegate.listPolicyRules(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getPolicyRule(policy.Policy.PolicyRuleId request) { + try { + return delegate.getPolicyRule(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni setPolicyRule(policy.Policy.PolicyRuleBasic request) { + try { + return delegate.setPolicyRule(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni removePolicyRule(policy.Policy.PolicyRuleId request) { + try { + return delegate.removePolicyRule(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceClient.java b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..98e57eeff41027e644057dced751b78837fd5fe3 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceClient.java @@ -0,0 +1,44 @@ +package context_policy; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: context_policy.proto") +public class ContextPolicyServiceClient implements ContextPolicyService, MutinyClient { + + private final MutinyContextPolicyServiceGrpc.MutinyContextPolicyServiceStub stub; + + public ContextPolicyServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyContextPolicyServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyContextPolicyServiceGrpc.MutinyContextPolicyServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni listPolicyRuleIds(context.ContextOuterClass.Empty request) { + return stub.listPolicyRuleIds(request); + } + @Override + public io.smallrye.mutiny.Uni listPolicyRules(context.ContextOuterClass.Empty request) { + return stub.listPolicyRules(request); + } + @Override + public io.smallrye.mutiny.Uni getPolicyRule(policy.Policy.PolicyRuleId request) { + return stub.getPolicyRule(request); + } + @Override + public io.smallrye.mutiny.Uni setPolicyRule(policy.Policy.PolicyRuleBasic request) { + return stub.setPolicyRule(request); + } + @Override + public io.smallrye.mutiny.Uni removePolicyRule(policy.Policy.PolicyRuleId request) { + return stub.removePolicyRule(request); + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..fa859ecff706640410d852ec129c359cb38be990 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/ContextPolicyServiceGrpc.java @@ -0,0 +1,586 @@ +package context_policy; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * created as a separate service to prevent import-loops in context and policy
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: context_policy.proto") +public final class ContextPolicyServiceGrpc { + + private ContextPolicyServiceGrpc() {} + + public static final String SERVICE_NAME = "context_policy.ContextPolicyService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getListPolicyRuleIdsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPolicyRuleIds", + requestType = context.ContextOuterClass.Empty.class, + responseType = policy.Policy.PolicyRuleIdList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListPolicyRuleIdsMethod() { + io.grpc.MethodDescriptor getListPolicyRuleIdsMethod; + if ((getListPolicyRuleIdsMethod = ContextPolicyServiceGrpc.getListPolicyRuleIdsMethod) == null) { + synchronized (ContextPolicyServiceGrpc.class) { + if ((getListPolicyRuleIdsMethod = ContextPolicyServiceGrpc.getListPolicyRuleIdsMethod) == null) { + ContextPolicyServiceGrpc.getListPolicyRuleIdsMethod = getListPolicyRuleIdsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicyRuleIds")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleIdList.getDefaultInstance())) + .setSchemaDescriptor(new ContextPolicyServiceMethodDescriptorSupplier("ListPolicyRuleIds")) + .build(); + } + } + } + return getListPolicyRuleIdsMethod; + } + + private static volatile io.grpc.MethodDescriptor getListPolicyRulesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPolicyRules", + requestType = context.ContextOuterClass.Empty.class, + responseType = policy.Policy.PolicyRuleList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListPolicyRulesMethod() { + io.grpc.MethodDescriptor getListPolicyRulesMethod; + if ((getListPolicyRulesMethod = ContextPolicyServiceGrpc.getListPolicyRulesMethod) == null) { + synchronized (ContextPolicyServiceGrpc.class) { + if ((getListPolicyRulesMethod = ContextPolicyServiceGrpc.getListPolicyRulesMethod) == null) { + ContextPolicyServiceGrpc.getListPolicyRulesMethod = getListPolicyRulesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicyRules")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleList.getDefaultInstance())) + .setSchemaDescriptor(new ContextPolicyServiceMethodDescriptorSupplier("ListPolicyRules")) + .build(); + } + } + } + return getListPolicyRulesMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetPolicyRuleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPolicyRule", + requestType = policy.Policy.PolicyRuleId.class, + responseType = policy.Policy.PolicyRuleBasic.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetPolicyRuleMethod() { + io.grpc.MethodDescriptor getGetPolicyRuleMethod; + if ((getGetPolicyRuleMethod = ContextPolicyServiceGrpc.getGetPolicyRuleMethod) == null) { + synchronized (ContextPolicyServiceGrpc.class) { + if ((getGetPolicyRuleMethod = ContextPolicyServiceGrpc.getGetPolicyRuleMethod) == null) { + ContextPolicyServiceGrpc.getGetPolicyRuleMethod = getGetPolicyRuleMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyRule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleBasic.getDefaultInstance())) + .setSchemaDescriptor(new ContextPolicyServiceMethodDescriptorSupplier("GetPolicyRule")) + .build(); + } + } + } + return getGetPolicyRuleMethod; + } + + private static volatile io.grpc.MethodDescriptor getSetPolicyRuleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetPolicyRule", + requestType = policy.Policy.PolicyRuleBasic.class, + responseType = policy.Policy.PolicyRuleId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSetPolicyRuleMethod() { + io.grpc.MethodDescriptor getSetPolicyRuleMethod; + if ((getSetPolicyRuleMethod = ContextPolicyServiceGrpc.getSetPolicyRuleMethod) == null) { + synchronized (ContextPolicyServiceGrpc.class) { + if ((getSetPolicyRuleMethod = ContextPolicyServiceGrpc.getSetPolicyRuleMethod) == null) { + ContextPolicyServiceGrpc.getSetPolicyRuleMethod = getSetPolicyRuleMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetPolicyRule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleBasic.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleId.getDefaultInstance())) + .setSchemaDescriptor(new ContextPolicyServiceMethodDescriptorSupplier("SetPolicyRule")) + .build(); + } + } + } + return getSetPolicyRuleMethod; + } + + private static volatile io.grpc.MethodDescriptor getRemovePolicyRuleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RemovePolicyRule", + requestType = policy.Policy.PolicyRuleId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRemovePolicyRuleMethod() { + io.grpc.MethodDescriptor getRemovePolicyRuleMethod; + if ((getRemovePolicyRuleMethod = ContextPolicyServiceGrpc.getRemovePolicyRuleMethod) == null) { + synchronized (ContextPolicyServiceGrpc.class) { + if ((getRemovePolicyRuleMethod = ContextPolicyServiceGrpc.getRemovePolicyRuleMethod) == null) { + ContextPolicyServiceGrpc.getRemovePolicyRuleMethod = getRemovePolicyRuleMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RemovePolicyRule")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ContextPolicyServiceMethodDescriptorSupplier("RemovePolicyRule")) + .build(); + } + } + } + return getRemovePolicyRuleMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ContextPolicyServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ContextPolicyServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceStub(channel, callOptions); + } + }; + return ContextPolicyServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ContextPolicyServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ContextPolicyServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceBlockingStub(channel, callOptions); + } + }; + return ContextPolicyServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ContextPolicyServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ContextPolicyServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceFutureStub(channel, callOptions); + } + }; + return ContextPolicyServiceFutureStub.newStub(factory, channel); + } + + /** + *
+   * created as a separate service to prevent import-loops in context and policy
+   * 
+ */ + public static abstract class ContextPolicyServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void listPolicyRuleIds(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPolicyRuleIdsMethod(), responseObserver); + } + + /** + */ + public void listPolicyRules(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPolicyRulesMethod(), responseObserver); + } + + /** + */ + public void getPolicyRule(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyRuleMethod(), responseObserver); + } + + /** + */ + public void setPolicyRule(policy.Policy.PolicyRuleBasic request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetPolicyRuleMethod(), responseObserver); + } + + /** + */ + public void removePolicyRule(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRemovePolicyRuleMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListPolicyRuleIdsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + policy.Policy.PolicyRuleIdList>( + this, METHODID_LIST_POLICY_RULE_IDS))) + .addMethod( + getListPolicyRulesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + policy.Policy.PolicyRuleList>( + this, METHODID_LIST_POLICY_RULES))) + .addMethod( + getGetPolicyRuleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleBasic>( + this, METHODID_GET_POLICY_RULE))) + .addMethod( + getSetPolicyRuleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleBasic, + policy.Policy.PolicyRuleId>( + this, METHODID_SET_POLICY_RULE))) + .addMethod( + getRemovePolicyRuleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_POLICY_RULE))) + .build(); + } + } + + /** + *
+   * created as a separate service to prevent import-loops in context and policy
+   * 
+ */ + public static final class ContextPolicyServiceStub extends io.grpc.stub.AbstractAsyncStub { + private ContextPolicyServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContextPolicyServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceStub(channel, callOptions); + } + + /** + */ + public void listPolicyRuleIds(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPolicyRuleIdsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void listPolicyRules(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPolicyRulesMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getPolicyRule(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPolicyRuleMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void setPolicyRule(policy.Policy.PolicyRuleBasic request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetPolicyRuleMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void removePolicyRule(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRemovePolicyRuleMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * created as a separate service to prevent import-loops in context and policy
+   * 
+ */ + public static final class ContextPolicyServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private ContextPolicyServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContextPolicyServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceBlockingStub(channel, callOptions); + } + + /** + */ + public policy.Policy.PolicyRuleIdList listPolicyRuleIds(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPolicyRuleIdsMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleList listPolicyRules(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPolicyRulesMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleBasic getPolicyRule(policy.Policy.PolicyRuleId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyRuleMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleId setPolicyRule(policy.Policy.PolicyRuleBasic request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetPolicyRuleMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty removePolicyRule(policy.Policy.PolicyRuleId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRemovePolicyRuleMethod(), getCallOptions(), request); + } + } + + /** + *
+   * created as a separate service to prevent import-loops in context and policy
+   * 
+ */ + public static final class ContextPolicyServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private ContextPolicyServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContextPolicyServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContextPolicyServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listPolicyRuleIds( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPolicyRuleIdsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture listPolicyRules( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPolicyRulesMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getPolicyRule( + policy.Policy.PolicyRuleId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPolicyRuleMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture setPolicyRule( + policy.Policy.PolicyRuleBasic request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetPolicyRuleMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture removePolicyRule( + policy.Policy.PolicyRuleId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRemovePolicyRuleMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_POLICY_RULE_IDS = 0; + private static final int METHODID_LIST_POLICY_RULES = 1; + private static final int METHODID_GET_POLICY_RULE = 2; + private static final int METHODID_SET_POLICY_RULE = 3; + private static final int METHODID_REMOVE_POLICY_RULE = 4; + + 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 ContextPolicyServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ContextPolicyServiceImplBase 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_POLICY_RULE_IDS: + serviceImpl.listPolicyRuleIds((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_POLICY_RULES: + serviceImpl.listPolicyRules((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_POLICY_RULE: + serviceImpl.getPolicyRule((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_POLICY_RULE: + serviceImpl.setPolicyRule((policy.Policy.PolicyRuleBasic) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REMOVE_POLICY_RULE: + serviceImpl.removePolicyRule((policy.Policy.PolicyRuleId) 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 ContextPolicyServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ContextPolicyServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return context_policy.ContextPolicy.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ContextPolicyService"); + } + } + + private static final class ContextPolicyServiceFileDescriptorSupplier + extends ContextPolicyServiceBaseDescriptorSupplier { + ContextPolicyServiceFileDescriptorSupplier() {} + } + + private static final class ContextPolicyServiceMethodDescriptorSupplier + extends ContextPolicyServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ContextPolicyServiceMethodDescriptorSupplier(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 (ContextPolicyServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ContextPolicyServiceFileDescriptorSupplier()) + .addMethod(getListPolicyRuleIdsMethod()) + .addMethod(getListPolicyRulesMethod()) + .addMethod(getGetPolicyRuleMethod()) + .addMethod(getSetPolicyRuleMethod()) + .addMethod(getRemovePolicyRuleMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/policy/target/generated-sources/grpc/context_policy/MutinyContextPolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/context_policy/MutinyContextPolicyServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..d9ff3b64cb48b70406954b72ace59035283ba701 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/context_policy/MutinyContextPolicyServiceGrpc.java @@ -0,0 +1,224 @@ +package context_policy; + +import static context_policy.ContextPolicyServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: context_policy.proto") +public final class MutinyContextPolicyServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyContextPolicyServiceGrpc() {} + + public static MutinyContextPolicyServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyContextPolicyServiceStub(channel); + } + + /** + *
+     *  created as a separate service to prevent import-loops in context and policy
+     * 
+ */ + public static final class MutinyContextPolicyServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub { + private ContextPolicyServiceGrpc.ContextPolicyServiceStub delegateStub; + + private MutinyContextPolicyServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = ContextPolicyServiceGrpc.newStub(channel); + } + + private MutinyContextPolicyServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = ContextPolicyServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyContextPolicyServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyContextPolicyServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni listPolicyRuleIds(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listPolicyRuleIds); + } + + + public io.smallrye.mutiny.Uni listPolicyRules(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::listPolicyRules); + } + + + public io.smallrye.mutiny.Uni getPolicyRule(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyRule); + } + + + public io.smallrye.mutiny.Uni setPolicyRule(policy.Policy.PolicyRuleBasic request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::setPolicyRule); + } + + + public io.smallrye.mutiny.Uni removePolicyRule(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::removePolicyRule); + } + + } + + /** + *
+     *  created as a separate service to prevent import-loops in context and policy
+     * 
+ */ + public static abstract class ContextPolicyServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public ContextPolicyServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni listPolicyRuleIds(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni listPolicyRules(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getPolicyRule(policy.Policy.PolicyRuleId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni setPolicyRule(policy.Policy.PolicyRuleBasic request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni removePolicyRule(policy.Policy.PolicyRuleId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + context_policy.ContextPolicyServiceGrpc.getListPolicyRuleIdsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + policy.Policy.PolicyRuleIdList>( + this, METHODID_LIST_POLICY_RULE_IDS, compression))) + .addMethod( + context_policy.ContextPolicyServiceGrpc.getListPolicyRulesMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + policy.Policy.PolicyRuleList>( + this, METHODID_LIST_POLICY_RULES, compression))) + .addMethod( + context_policy.ContextPolicyServiceGrpc.getGetPolicyRuleMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleBasic>( + this, METHODID_GET_POLICY_RULE, compression))) + .addMethod( + context_policy.ContextPolicyServiceGrpc.getSetPolicyRuleMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleBasic, + policy.Policy.PolicyRuleId>( + this, METHODID_SET_POLICY_RULE, compression))) + .addMethod( + context_policy.ContextPolicyServiceGrpc.getRemovePolicyRuleMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleId, + context.ContextOuterClass.Empty>( + this, METHODID_REMOVE_POLICY_RULE, compression))) + .build(); + } + } + + private static final int METHODID_LIST_POLICY_RULE_IDS = 0; + private static final int METHODID_LIST_POLICY_RULES = 1; + private static final int METHODID_GET_POLICY_RULE = 2; + private static final int METHODID_SET_POLICY_RULE = 3; + private static final int METHODID_REMOVE_POLICY_RULE = 4; + + 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 ContextPolicyServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(ContextPolicyServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_POLICY_RULE_IDS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listPolicyRuleIds); + break; + case METHODID_LIST_POLICY_RULES: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::listPolicyRules); + break; + case METHODID_GET_POLICY_RULE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getPolicyRule); + break; + case METHODID_SET_POLICY_RULE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleBasic) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::setPolicyRule); + break; + case METHODID_REMOVE_POLICY_RULE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::removePolicyRule); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke(io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java new file mode 100644 index 0000000000000000000000000000000000000000..67e1ec736f9d83cbf95b419e9e61e92e82e73b88 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java @@ -0,0 +1,176 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: kpi_sample_types.proto + +package kpi_sample_types; + +public final class KpiSampleTypes { + private KpiSampleTypes() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code kpi_sample_types.KpiSampleType} + */ + public enum KpiSampleType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * KPISAMPLETYPE_UNKNOWN = 0; + */ + KPISAMPLETYPE_UNKNOWN(0), + /** + * KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; + */ + KPISAMPLETYPE_PACKETS_TRANSMITTED(101), + /** + * KPISAMPLETYPE_PACKETS_RECEIVED = 102; + */ + KPISAMPLETYPE_PACKETS_RECEIVED(102), + /** + * KPISAMPLETYPE_BYTES_TRANSMITTED = 201; + */ + KPISAMPLETYPE_BYTES_TRANSMITTED(201), + /** + * KPISAMPLETYPE_BYTES_RECEIVED = 202; + */ + KPISAMPLETYPE_BYTES_RECEIVED(202), + UNRECOGNIZED(-1), + ; + + /** + * KPISAMPLETYPE_UNKNOWN = 0; + */ + public static final int KPISAMPLETYPE_UNKNOWN_VALUE = 0; + /** + * KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; + */ + public static final int KPISAMPLETYPE_PACKETS_TRANSMITTED_VALUE = 101; + /** + * KPISAMPLETYPE_PACKETS_RECEIVED = 102; + */ + public static final int KPISAMPLETYPE_PACKETS_RECEIVED_VALUE = 102; + /** + * KPISAMPLETYPE_BYTES_TRANSMITTED = 201; + */ + public static final int KPISAMPLETYPE_BYTES_TRANSMITTED_VALUE = 201; + /** + * KPISAMPLETYPE_BYTES_RECEIVED = 202; + */ + public static final int KPISAMPLETYPE_BYTES_RECEIVED_VALUE = 202; + + + 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 KpiSampleType 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 KpiSampleType forNumber(int value) { + switch (value) { + case 0: return KPISAMPLETYPE_UNKNOWN; + case 101: return KPISAMPLETYPE_PACKETS_TRANSMITTED; + case 102: return KPISAMPLETYPE_PACKETS_RECEIVED; + case 201: return KPISAMPLETYPE_BYTES_TRANSMITTED; + case 202: return KPISAMPLETYPE_BYTES_RECEIVED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + KpiSampleType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public KpiSampleType findValueByNumber(int number) { + return KpiSampleType.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 kpi_sample_types.KpiSampleTypes.getDescriptor().getEnumTypes().get(0); + } + + private static final KpiSampleType[] VALUES = values(); + + public static KpiSampleType 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 KpiSampleType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:kpi_sample_types.KpiSampleType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026kpi_sample_types.proto\022\020kpi_sample_typ" + + "es*\276\001\n\rKpiSampleType\022\031\n\025KPISAMPLETYPE_UN" + + "KNOWN\020\000\022%\n!KPISAMPLETYPE_PACKETS_TRANSMI" + + "TTED\020e\022\"\n\036KPISAMPLETYPE_PACKETS_RECEIVED" + + "\020f\022$\n\037KPISAMPLETYPE_BYTES_TRANSMITTED\020\311\001" + + "\022!\n\034KPISAMPLETYPE_BYTES_RECEIVED\020\312\001b\006pro" + + "to3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java new file mode 100644 index 0000000000000000000000000000000000000000..5d63d4aa45e578957a7a3414c33491cebe98acbe --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/Monitoring.java @@ -0,0 +1,20152 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitoring.proto + +package monitoring; + +public final class Monitoring { + private Monitoring() {} + 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 KpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 3; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 4; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 5; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 6; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiDescriptor} + */ + public static final class KpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiDescriptor) + KpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiDescriptor.newBuilder() to construct. + private KpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiDescriptor() { + kpiDescription_ = ""; + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiDescriptor( + 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(); + + kpiDescription_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 26: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 2; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 3; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 4; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(2, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(3, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(4, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(5, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(6, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kpiDescription_); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSliceId()); + } + 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 monitoring.Monitoring.KpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiDescriptor other = (monitoring.Monitoring.KpiDescriptor) obj; + + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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 monitoring.Monitoring.KpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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 monitoring.Monitoring.KpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptor 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(monitoring.Monitoring.KpiDescriptor 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 monitoring.KpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiDescriptor) + monitoring.Monitoring.KpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptor.class, monitoring.Monitoring.KpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiDescriptor.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(); + kpiDescription_ = ""; + + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.KpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor build() { + monitoring.Monitoring.KpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor buildPartial() { + monitoring.Monitoring.KpiDescriptor result = new monitoring.Monitoring.KpiDescriptor(this); + result.kpiDescription_ = kpiDescription_; + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.KpiDescriptor) { + return mergeFrom((monitoring.Monitoring.KpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiDescriptor other) { + if (other == monitoring.Monitoring.KpiDescriptor.getDefaultInstance()) return this; + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.KpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 1; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 2; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 3; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 3; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 3; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 3; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 4; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 4; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 4; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 5; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 5; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 5; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 5; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 6; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 6; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 6; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 6; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.KpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) + private static final monitoring.Monitoring.KpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiDescriptor(); + } + + public static monitoring.Monitoring.KpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiDescriptor(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 monitoring.Monitoring.KpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BundleKpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.BundleKpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + java.util.List + getKpiIdListList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + monitoring.Monitoring.KpiId getKpiIdList(int index); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + int getKpiIdListCount(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + java.util.List + getKpiIdListOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 4; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 5; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 6; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 7; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.BundleKpiDescriptor} + */ + public static final class BundleKpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.BundleKpiDescriptor) + BundleKpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use BundleKpiDescriptor.newBuilder() to construct. + private BundleKpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BundleKpiDescriptor() { + kpiDescription_ = ""; + kpiIdList_ = java.util.Collections.emptyList(); + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BundleKpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BundleKpiDescriptor( + 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(); + + kpiDescription_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiIdList_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 24: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 34: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.BundleKpiDescriptor.class, monitoring.Monitoring.BundleKpiDescriptor.Builder.class); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_ID_LIST_FIELD_NUMBER = 2; + private java.util.List kpiIdList_; + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public java.util.List getKpiIdListList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public java.util.List + getKpiIdListOrBuilderList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public int getKpiIdListCount() { + return kpiIdList_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + return kpiIdList_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + return kpiIdList_.get(index); + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 3; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 4; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 4; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 7; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 7; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + output.writeMessage(2, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(3, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(4, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(5, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(6, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(7, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSliceId()); + } + 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 monitoring.Monitoring.BundleKpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.BundleKpiDescriptor other = (monitoring.Monitoring.BundleKpiDescriptor) obj; + + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (!getKpiIdListList() + .equals(other.getKpiIdListList())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + if (getKpiIdListCount() > 0) { + hash = (37 * hash) + KPI_ID_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdListList().hashCode(); + } + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.BundleKpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.Monitoring.BundleKpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.Monitoring.BundleKpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.BundleKpiDescriptor 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(monitoring.Monitoring.BundleKpiDescriptor 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 monitoring.BundleKpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.BundleKpiDescriptor) + monitoring.Monitoring.BundleKpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.BundleKpiDescriptor.class, monitoring.Monitoring.BundleKpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.BundleKpiDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + kpiDescription_ = ""; + + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdListBuilder_.clear(); + } + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_BundleKpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor build() { + monitoring.Monitoring.BundleKpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.BundleKpiDescriptor buildPartial() { + monitoring.Monitoring.BundleKpiDescriptor result = new monitoring.Monitoring.BundleKpiDescriptor(this); + int from_bitField0_ = bitField0_; + result.kpiDescription_ = kpiDescription_; + if (kpiIdListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiIdList_ = kpiIdList_; + } else { + result.kpiIdList_ = kpiIdListBuilder_.build(); + } + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.BundleKpiDescriptor) { + return mergeFrom((monitoring.Monitoring.BundleKpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.BundleKpiDescriptor other) { + if (other == monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance()) return this; + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (kpiIdListBuilder_ == null) { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdList_.isEmpty()) { + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdListIsMutable(); + kpiIdList_.addAll(other.kpiIdList_); + } + onChanged(); + } + } else { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdListBuilder_.isEmpty()) { + kpiIdListBuilder_.dispose(); + kpiIdListBuilder_ = null; + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdListFieldBuilder() : null; + } else { + kpiIdListBuilder_.addAllMessages(other.kpiIdList_); + } + } + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.BundleKpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.BundleKpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 1; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 1; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 1; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 1; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private java.util.List kpiIdList_ = + java.util.Collections.emptyList(); + private void ensureKpiIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(kpiIdList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdListBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List getKpiIdListList() { + if (kpiIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiIdList_); + } else { + return kpiIdListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public int getKpiIdListCount() { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.size(); + } else { + return kpiIdListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); + } else { + return kpiIdListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, value); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList(monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder addAllKpiIdList( + java.lang.Iterable values) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiIdList_); + onChanged(); + } else { + kpiIdListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder clearKpiIdList() { + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public Builder removeKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.remove(index); + onChanged(); + } else { + kpiIdListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); } else { + return kpiIdListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List + getKpiIdListOrBuilderList() { + if (kpiIdListBuilder_ != null) { + return kpiIdListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiIdList_); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder() { + return getKpiIdListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 2; + */ + public java.util.List + getKpiIdListBuilderList() { + return getKpiIdListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdListFieldBuilder() { + if (kpiIdListBuilder_ == null) { + kpiIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiIdList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiIdList_ = null; + } + return kpiIdListBuilder_; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 3; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 4; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 4; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 4; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 4; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 5; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 5; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 5; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 6; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 6; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 6; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 6; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 7; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 7; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 7; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 7; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.BundleKpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.BundleKpiDescriptor) + private static final monitoring.Monitoring.BundleKpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.BundleKpiDescriptor(); + } + + public static monitoring.Monitoring.BundleKpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BundleKpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BundleKpiDescriptor(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 monitoring.Monitoring.BundleKpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EditedKpiDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.EditedKpiDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + java.lang.String getKpiDescription(); + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + com.google.protobuf.ByteString + getKpiDescriptionBytes(); + + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + java.util.List + getKpiIdListList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + monitoring.Monitoring.KpiId getKpiIdList(int index); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + int getKpiIdListCount(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + java.util.List + getKpiIdListOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index); + + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + int getKpiSampleTypeValue(); + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType(); + + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + boolean hasDeviceId(); + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + context.ContextOuterClass.DeviceId getDeviceId(); + /** + * .context.DeviceId device_id = 5; + */ + context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder(); + + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + boolean hasEndpointId(); + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + context.ContextOuterClass.EndPointId getEndpointId(); + /** + * .context.EndPointId endpoint_id = 6; + */ + context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder(); + + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + * .context.ServiceId service_id = 7; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + boolean hasSliceId(); + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + context.ContextOuterClass.SliceId getSliceId(); + /** + * .context.SliceId slice_id = 8; + */ + context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.EditedKpiDescriptor} + */ + public static final class EditedKpiDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.EditedKpiDescriptor) + EditedKpiDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use EditedKpiDescriptor.newBuilder() to construct. + private EditedKpiDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EditedKpiDescriptor() { + kpiDescription_ = ""; + kpiIdList_ = java.util.Collections.emptyList(); + kpiSampleType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EditedKpiDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EditedKpiDescriptor( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + kpiDescription_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiIdList_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 32: { + int rawValue = input.readEnum(); + + kpiSampleType_ = rawValue; + break; + } + case 42: { + context.ContextOuterClass.DeviceId.Builder subBuilder = null; + if (deviceId_ != null) { + subBuilder = deviceId_.toBuilder(); + } + deviceId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deviceId_); + deviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + context.ContextOuterClass.EndPointId.Builder subBuilder = null; + if (endpointId_ != null) { + subBuilder = endpointId_.toBuilder(); + } + endpointId_ = input.readMessage(context.ContextOuterClass.EndPointId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpointId_); + endpointId_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + context.ContextOuterClass.SliceId.Builder subBuilder = null; + if (sliceId_ != null) { + subBuilder = sliceId_.toBuilder(); + } + sliceId_ = input.readMessage(context.ContextOuterClass.SliceId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sliceId_); + sliceId_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.EditedKpiDescriptor.class, monitoring.Monitoring.EditedKpiDescriptor.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int KPI_DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object kpiDescription_; + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + @java.lang.Override + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + 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(); + kpiDescription_ = s; + return s; + } + } + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_ID_LIST_FIELD_NUMBER = 3; + private java.util.List kpiIdList_; + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public java.util.List getKpiIdListList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public java.util.List + getKpiIdListOrBuilderList() { + return kpiIdList_; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public int getKpiIdListCount() { + return kpiIdList_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + return kpiIdList_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + return kpiIdList_.get(index); + } + + public static final int KPI_SAMPLE_TYPE_FIELD_NUMBER = 4; + private int kpiSampleType_; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + @java.lang.Override public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + + public static final int DEVICE_ID_FIELD_NUMBER = 5; + private context.ContextOuterClass.DeviceId deviceId_; + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + @java.lang.Override + public boolean hasDeviceId() { + return deviceId_ != null; + } + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceId() { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + /** + * .context.DeviceId device_id = 5; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + return getDeviceId(); + } + + public static final int ENDPOINT_ID_FIELD_NUMBER = 6; + private context.ContextOuterClass.EndPointId endpointId_; + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + @java.lang.Override + public boolean hasEndpointId() { + return endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + @java.lang.Override + public context.ContextOuterClass.EndPointId getEndpointId() { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + @java.lang.Override + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + return getEndpointId(); + } + + public static final int SERVICE_ID_FIELD_NUMBER = 7; + private context.ContextOuterClass.ServiceId serviceId_; + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + @java.lang.Override + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + * .context.ServiceId service_id = 7; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int SLICE_ID_FIELD_NUMBER = 8; + private context.ContextOuterClass.SliceId sliceId_; + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + @java.lang.Override + public boolean hasSliceId() { + return sliceId_ != null; + } + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + @java.lang.Override + public context.ContextOuterClass.SliceId getSliceId() { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + /** + * .context.SliceId slice_id = 8; + */ + @java.lang.Override + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + return getSliceId(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (!getKpiDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + output.writeMessage(3, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + output.writeEnum(4, kpiSampleType_); + } + if (deviceId_ != null) { + output.writeMessage(5, getDeviceId()); + } + if (endpointId_ != null) { + output.writeMessage(6, getEndpointId()); + } + if (serviceId_ != null) { + output.writeMessage(7, getServiceId()); + } + if (sliceId_ != null) { + output.writeMessage(8, getSliceId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (!getKpiDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kpiDescription_); + } + for (int i = 0; i < kpiIdList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, kpiIdList_.get(i)); + } + if (kpiSampleType_ != kpi_sample_types.KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kpiSampleType_); + } + if (deviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getDeviceId()); + } + if (endpointId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getEndpointId()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getServiceId()); + } + if (sliceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getSliceId()); + } + 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 monitoring.Monitoring.EditedKpiDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.EditedKpiDescriptor other = (monitoring.Monitoring.EditedKpiDescriptor) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!getKpiDescription() + .equals(other.getKpiDescription())) return false; + if (!getKpiIdListList() + .equals(other.getKpiIdListList())) return false; + if (kpiSampleType_ != other.kpiSampleType_) return false; + if (hasDeviceId() != other.hasDeviceId()) return false; + if (hasDeviceId()) { + if (!getDeviceId() + .equals(other.getDeviceId())) return false; + } + if (hasEndpointId() != other.hasEndpointId()) return false; + if (hasEndpointId()) { + if (!getEndpointId() + .equals(other.getEndpointId())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; + } + if (hasSliceId() != other.hasSliceId()) return false; + if (hasSliceId()) { + if (!getSliceId() + .equals(other.getSliceId())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + KPI_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescription().hashCode(); + if (getKpiIdListCount() > 0) { + hash = (37 * hash) + KPI_ID_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdListList().hashCode(); + } + hash = (37 * hash) + KPI_SAMPLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + kpiSampleType_; + if (hasDeviceId()) { + hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDeviceId().hashCode(); + } + if (hasEndpointId()) { + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (hasSliceId()) { + hash = (37 * hash) + SLICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getSliceId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.EditedKpiDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.Monitoring.EditedKpiDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.Monitoring.EditedKpiDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.EditedKpiDescriptor 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(monitoring.Monitoring.EditedKpiDescriptor 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 monitoring.EditedKpiDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.EditedKpiDescriptor) + monitoring.Monitoring.EditedKpiDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.EditedKpiDescriptor.class, monitoring.Monitoring.EditedKpiDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.EditedKpiDescriptor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + kpiDescription_ = ""; + + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdListBuilder_.clear(); + } + kpiSampleType_ = 0; + + if (deviceIdBuilder_ == null) { + deviceId_ = null; + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + if (endpointIdBuilder_ == null) { + endpointId_ = null; + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (sliceIdBuilder_ == null) { + sliceId_ = null; + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_EditedKpiDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor build() { + monitoring.Monitoring.EditedKpiDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.EditedKpiDescriptor buildPartial() { + monitoring.Monitoring.EditedKpiDescriptor result = new monitoring.Monitoring.EditedKpiDescriptor(this); + int from_bitField0_ = bitField0_; + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.kpiDescription_ = kpiDescription_; + if (kpiIdListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = java.util.Collections.unmodifiableList(kpiIdList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiIdList_ = kpiIdList_; + } else { + result.kpiIdList_ = kpiIdListBuilder_.build(); + } + result.kpiSampleType_ = kpiSampleType_; + if (deviceIdBuilder_ == null) { + result.deviceId_ = deviceId_; + } else { + result.deviceId_ = deviceIdBuilder_.build(); + } + if (endpointIdBuilder_ == null) { + result.endpointId_ = endpointId_; + } else { + result.endpointId_ = endpointIdBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (sliceIdBuilder_ == null) { + result.sliceId_ = sliceId_; + } else { + result.sliceId_ = sliceIdBuilder_.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 monitoring.Monitoring.EditedKpiDescriptor) { + return mergeFrom((monitoring.Monitoring.EditedKpiDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.EditedKpiDescriptor other) { + if (other == monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (!other.getKpiDescription().isEmpty()) { + kpiDescription_ = other.kpiDescription_; + onChanged(); + } + if (kpiIdListBuilder_ == null) { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdList_.isEmpty()) { + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdListIsMutable(); + kpiIdList_.addAll(other.kpiIdList_); + } + onChanged(); + } + } else { + if (!other.kpiIdList_.isEmpty()) { + if (kpiIdListBuilder_.isEmpty()) { + kpiIdListBuilder_.dispose(); + kpiIdListBuilder_ = null; + kpiIdList_ = other.kpiIdList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdListFieldBuilder() : null; + } else { + kpiIdListBuilder_.addAllMessages(other.kpiIdList_); + } + } + } + if (other.kpiSampleType_ != 0) { + setKpiSampleTypeValue(other.getKpiSampleTypeValue()); + } + if (other.hasDeviceId()) { + mergeDeviceId(other.getDeviceId()); + } + if (other.hasEndpointId()) { + mergeEndpointId(other.getEndpointId()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (other.hasSliceId()) { + mergeSliceId(other.getSliceId()); + } + 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 { + monitoring.Monitoring.EditedKpiDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.EditedKpiDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private java.lang.Object kpiDescription_ = ""; + /** + * string kpi_description = 2; + * @return The kpiDescription. + */ + public java.lang.String getKpiDescription() { + java.lang.Object ref = kpiDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kpiDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string kpi_description = 2; + * @return The bytes for kpiDescription. + */ + public com.google.protobuf.ByteString + getKpiDescriptionBytes() { + java.lang.Object ref = kpiDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kpiDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string kpi_description = 2; + * @param value The kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiDescription_ = value; + onChanged(); + return this; + } + /** + * string kpi_description = 2; + * @return This builder for chaining. + */ + public Builder clearKpiDescription() { + + kpiDescription_ = getDefaultInstance().getKpiDescription(); + onChanged(); + return this; + } + /** + * string kpi_description = 2; + * @param value The bytes for kpiDescription to set. + * @return This builder for chaining. + */ + public Builder setKpiDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kpiDescription_ = value; + onChanged(); + return this; + } + + private java.util.List kpiIdList_ = + java.util.Collections.emptyList(); + private void ensureKpiIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiIdList_ = new java.util.ArrayList(kpiIdList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdListBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List getKpiIdListList() { + if (kpiIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiIdList_); + } else { + return kpiIdListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public int getKpiIdListCount() { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.size(); + } else { + return kpiIdListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId getKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); + } else { + return kpiIdListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, value); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder setKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList(monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, value); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addKpiIdList( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder addAllKpiIdList( + java.lang.Iterable values) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiIdList_); + onChanged(); + } else { + kpiIdListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder clearKpiIdList() { + if (kpiIdListBuilder_ == null) { + kpiIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public Builder removeKpiIdList(int index) { + if (kpiIdListBuilder_ == null) { + ensureKpiIdListIsMutable(); + kpiIdList_.remove(index); + onChanged(); + } else { + kpiIdListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdListOrBuilder( + int index) { + if (kpiIdListBuilder_ == null) { + return kpiIdList_.get(index); } else { + return kpiIdListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List + getKpiIdListOrBuilderList() { + if (kpiIdListBuilder_ != null) { + return kpiIdListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiIdList_); + } + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder() { + return getKpiIdListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdListBuilder( + int index) { + return getKpiIdListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id_list = 3; + */ + public java.util.List + getKpiIdListBuilderList() { + return getKpiIdListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdListFieldBuilder() { + if (kpiIdListBuilder_ == null) { + kpiIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiIdList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiIdList_ = null; + } + return kpiIdListBuilder_; + } + + private int kpiSampleType_ = 0; + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The enum numeric value on the wire for kpiSampleType. + */ + @java.lang.Override public int getKpiSampleTypeValue() { + return kpiSampleType_; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @param value The enum numeric value on the wire for kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleTypeValue(int value) { + + kpiSampleType_ = value; + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return The kpiSampleType. + */ + @java.lang.Override + public kpi_sample_types.KpiSampleTypes.KpiSampleType getKpiSampleType() { + @SuppressWarnings("deprecation") + kpi_sample_types.KpiSampleTypes.KpiSampleType result = kpi_sample_types.KpiSampleTypes.KpiSampleType.valueOf(kpiSampleType_); + return result == null ? kpi_sample_types.KpiSampleTypes.KpiSampleType.UNRECOGNIZED : result; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @param value The kpiSampleType to set. + * @return This builder for chaining. + */ + public Builder setKpiSampleType(kpi_sample_types.KpiSampleTypes.KpiSampleType value) { + if (value == null) { + throw new NullPointerException(); + } + + kpiSampleType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .kpi_sample_types.KpiSampleType kpi_sample_type = 4; + * @return This builder for chaining. + */ + public Builder clearKpiSampleType() { + + kpiSampleType_ = 0; + onChanged(); + return this; + } + + private context.ContextOuterClass.DeviceId deviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceIdBuilder_; + /** + * .context.DeviceId device_id = 5; + * @return Whether the deviceId field is set. + */ + public boolean hasDeviceId() { + return deviceIdBuilder_ != null || deviceId_ != null; + } + /** + * .context.DeviceId device_id = 5; + * @return The deviceId. + */ + public context.ContextOuterClass.DeviceId getDeviceId() { + if (deviceIdBuilder_ == null) { + return deviceId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } else { + return deviceIdBuilder_.getMessage(); + } + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder setDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deviceId_ = value; + onChanged(); + } else { + deviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder setDeviceId( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceIdBuilder_ == null) { + deviceId_ = builderForValue.build(); + onChanged(); + } else { + deviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder mergeDeviceId(context.ContextOuterClass.DeviceId value) { + if (deviceIdBuilder_ == null) { + if (deviceId_ != null) { + deviceId_ = + context.ContextOuterClass.DeviceId.newBuilder(deviceId_).mergeFrom(value).buildPartial(); + } else { + deviceId_ = value; + } + onChanged(); + } else { + deviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public Builder clearDeviceId() { + if (deviceIdBuilder_ == null) { + deviceId_ = null; + onChanged(); + } else { + deviceId_ = null; + deviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.DeviceId device_id = 5; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceIdBuilder() { + + onChanged(); + return getDeviceIdFieldBuilder().getBuilder(); + } + /** + * .context.DeviceId device_id = 5; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceIdOrBuilder() { + if (deviceIdBuilder_ != null) { + return deviceIdBuilder_.getMessageOrBuilder(); + } else { + return deviceId_ == null ? + context.ContextOuterClass.DeviceId.getDefaultInstance() : deviceId_; + } + } + /** + * .context.DeviceId device_id = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceIdFieldBuilder() { + if (deviceIdBuilder_ == null) { + deviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + getDeviceId(), + getParentForChildren(), + isClean()); + deviceId_ = null; + } + return deviceIdBuilder_; + } + + private context.ContextOuterClass.EndPointId endpointId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> endpointIdBuilder_; + /** + * .context.EndPointId endpoint_id = 6; + * @return Whether the endpointId field is set. + */ + public boolean hasEndpointId() { + return endpointIdBuilder_ != null || endpointId_ != null; + } + /** + * .context.EndPointId endpoint_id = 6; + * @return The endpointId. + */ + public context.ContextOuterClass.EndPointId getEndpointId() { + if (endpointIdBuilder_ == null) { + return endpointId_ == null ? context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } else { + return endpointIdBuilder_.getMessage(); + } + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder setEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpointId_ = value; + onChanged(); + } else { + endpointIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder setEndpointId( + context.ContextOuterClass.EndPointId.Builder builderForValue) { + if (endpointIdBuilder_ == null) { + endpointId_ = builderForValue.build(); + onChanged(); + } else { + endpointIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder mergeEndpointId(context.ContextOuterClass.EndPointId value) { + if (endpointIdBuilder_ == null) { + if (endpointId_ != null) { + endpointId_ = + context.ContextOuterClass.EndPointId.newBuilder(endpointId_).mergeFrom(value).buildPartial(); + } else { + endpointId_ = value; + } + onChanged(); + } else { + endpointIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public Builder clearEndpointId() { + if (endpointIdBuilder_ == null) { + endpointId_ = null; + onChanged(); + } else { + endpointId_ = null; + endpointIdBuilder_ = null; + } + + return this; + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public context.ContextOuterClass.EndPointId.Builder getEndpointIdBuilder() { + + onChanged(); + return getEndpointIdFieldBuilder().getBuilder(); + } + /** + * .context.EndPointId endpoint_id = 6; + */ + public context.ContextOuterClass.EndPointIdOrBuilder getEndpointIdOrBuilder() { + if (endpointIdBuilder_ != null) { + return endpointIdBuilder_.getMessageOrBuilder(); + } else { + return endpointId_ == null ? + context.ContextOuterClass.EndPointId.getDefaultInstance() : endpointId_; + } + } + /** + * .context.EndPointId endpoint_id = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder> + getEndpointIdFieldBuilder() { + if (endpointIdBuilder_ == null) { + endpointIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.EndPointId, context.ContextOuterClass.EndPointId.Builder, context.ContextOuterClass.EndPointIdOrBuilder>( + getEndpointId(), + getParentForChildren(), + isClean()); + endpointId_ = null; + } + return endpointIdBuilder_; + } + + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + * .context.ServiceId service_id = 7; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; + } + /** + * .context.ServiceId service_id = 7; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + + return this; + } + /** + * .context.ServiceId service_id = 7; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); + } + /** + * .context.ServiceId service_id = 7; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + } + /** + * .context.ServiceId service_id = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; + } + + private context.ContextOuterClass.SliceId sliceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> sliceIdBuilder_; + /** + * .context.SliceId slice_id = 8; + * @return Whether the sliceId field is set. + */ + public boolean hasSliceId() { + return sliceIdBuilder_ != null || sliceId_ != null; + } + /** + * .context.SliceId slice_id = 8; + * @return The sliceId. + */ + public context.ContextOuterClass.SliceId getSliceId() { + if (sliceIdBuilder_ == null) { + return sliceId_ == null ? context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } else { + return sliceIdBuilder_.getMessage(); + } + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder setSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sliceId_ = value; + onChanged(); + } else { + sliceIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder setSliceId( + context.ContextOuterClass.SliceId.Builder builderForValue) { + if (sliceIdBuilder_ == null) { + sliceId_ = builderForValue.build(); + onChanged(); + } else { + sliceIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder mergeSliceId(context.ContextOuterClass.SliceId value) { + if (sliceIdBuilder_ == null) { + if (sliceId_ != null) { + sliceId_ = + context.ContextOuterClass.SliceId.newBuilder(sliceId_).mergeFrom(value).buildPartial(); + } else { + sliceId_ = value; + } + onChanged(); + } else { + sliceIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public Builder clearSliceId() { + if (sliceIdBuilder_ == null) { + sliceId_ = null; + onChanged(); + } else { + sliceId_ = null; + sliceIdBuilder_ = null; + } + + return this; + } + /** + * .context.SliceId slice_id = 8; + */ + public context.ContextOuterClass.SliceId.Builder getSliceIdBuilder() { + + onChanged(); + return getSliceIdFieldBuilder().getBuilder(); + } + /** + * .context.SliceId slice_id = 8; + */ + public context.ContextOuterClass.SliceIdOrBuilder getSliceIdOrBuilder() { + if (sliceIdBuilder_ != null) { + return sliceIdBuilder_.getMessageOrBuilder(); + } else { + return sliceId_ == null ? + context.ContextOuterClass.SliceId.getDefaultInstance() : sliceId_; + } + } + /** + * .context.SliceId slice_id = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder> + getSliceIdFieldBuilder() { + if (sliceIdBuilder_ == null) { + sliceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.SliceId, context.ContextOuterClass.SliceId.Builder, context.ContextOuterClass.SliceIdOrBuilder>( + getSliceId(), + getParentForChildren(), + isClean()); + sliceId_ = null; + } + return sliceIdBuilder_; + } + @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:monitoring.EditedKpiDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.EditedKpiDescriptor) + private static final monitoring.Monitoring.EditedKpiDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.EditedKpiDescriptor(); + } + + public static monitoring.Monitoring.EditedKpiDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EditedKpiDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EditedKpiDescriptor(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 monitoring.Monitoring.EditedKpiDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface MonitorKpiRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.MonitorKpiRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + float getMonitoringWindowS(); + + /** + *
+     * Pending add field to reflect Available Device Protocols
+     * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + float getSamplingRateS(); + } + /** + * Protobuf type {@code monitoring.MonitorKpiRequest} + */ + public static final class MonitorKpiRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.MonitorKpiRequest) + MonitorKpiRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MonitorKpiRequest.newBuilder() to construct. + private MonitorKpiRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MonitorKpiRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MonitorKpiRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MonitorKpiRequest( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + monitoringWindowS_ = input.readFloat(); + break; + } + case 29: { + + samplingRateS_ = input.readFloat(); + 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 monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int MONITORING_WINDOW_S_FIELD_NUMBER = 2; + private float monitoringWindowS_; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + + public static final int SAMPLING_RATE_S_FIELD_NUMBER = 3; + private float samplingRateS_; + /** + *
+     * Pending add field to reflect Available Device Protocols
+     * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (monitoringWindowS_ != 0F) { + output.writeFloat(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + output.writeFloat(3, samplingRateS_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (monitoringWindowS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingRateS_); + } + 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 monitoring.Monitoring.MonitorKpiRequest)) { + return super.equals(obj); + } + monitoring.Monitoring.MonitorKpiRequest other = (monitoring.Monitoring.MonitorKpiRequest) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (java.lang.Float.floatToIntBits(getMonitoringWindowS()) + != java.lang.Float.floatToIntBits( + other.getMonitoringWindowS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingRateS()) + != java.lang.Float.floatToIntBits( + other.getSamplingRateS())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + MONITORING_WINDOW_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMonitoringWindowS()); + hash = (37 * hash) + SAMPLING_RATE_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingRateS()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.MonitorKpiRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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 monitoring.Monitoring.MonitorKpiRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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 monitoring.Monitoring.MonitorKpiRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.MonitorKpiRequest 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(monitoring.Monitoring.MonitorKpiRequest 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 monitoring.MonitorKpiRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.MonitorKpiRequest) + monitoring.Monitoring.MonitorKpiRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.MonitorKpiRequest.class, monitoring.Monitoring.MonitorKpiRequest.Builder.class); + } + + // Construct using monitoring.Monitoring.MonitorKpiRequest.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + monitoringWindowS_ = 0F; + + samplingRateS_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_MonitorKpiRequest_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest build() { + monitoring.Monitoring.MonitorKpiRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.MonitorKpiRequest buildPartial() { + monitoring.Monitoring.MonitorKpiRequest result = new monitoring.Monitoring.MonitorKpiRequest(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.monitoringWindowS_ = monitoringWindowS_; + result.samplingRateS_ = samplingRateS_; + 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 monitoring.Monitoring.MonitorKpiRequest) { + return mergeFrom((monitoring.Monitoring.MonitorKpiRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.MonitorKpiRequest other) { + if (other == monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.getMonitoringWindowS() != 0F) { + setMonitoringWindowS(other.getMonitoringWindowS()); + } + if (other.getSamplingRateS() != 0F) { + setSamplingRateS(other.getSamplingRateS()); + } + 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 { + monitoring.Monitoring.MonitorKpiRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.MonitorKpiRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float monitoringWindowS_ ; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + /** + * float monitoring_window_s = 2; + * @param value The monitoringWindowS to set. + * @return This builder for chaining. + */ + public Builder setMonitoringWindowS(float value) { + + monitoringWindowS_ = value; + onChanged(); + return this; + } + /** + * float monitoring_window_s = 2; + * @return This builder for chaining. + */ + public Builder clearMonitoringWindowS() { + + monitoringWindowS_ = 0F; + onChanged(); + return this; + } + + private float samplingRateS_ ; + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @param value The samplingRateS to set. + * @return This builder for chaining. + */ + public Builder setSamplingRateS(float value) { + + samplingRateS_ = value; + onChanged(); + return this; + } + /** + *
+       * Pending add field to reflect Available Device Protocols
+       * 
+ * + * float sampling_rate_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingRateS() { + + samplingRateS_ = 0F; + 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:monitoring.MonitorKpiRequest) + } + + // @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) + private static final monitoring.Monitoring.MonitorKpiRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.MonitorKpiRequest(); + } + + public static monitoring.Monitoring.MonitorKpiRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MonitorKpiRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MonitorKpiRequest(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 monitoring.Monitoring.MonitorKpiRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiQueryOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiQuery) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + java.util.List + getKpiIdList(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiId getKpiId(int index); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + int getKpiIdCount(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + java.util.List + getKpiIdOrBuilderList(); + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index); + + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + float getMonitoringWindowS(); + + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + float getSamplingRateS(); + + /** + *
+     * used when you want something like "get the last N many samples
+     * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + int getLastNSamples(); + + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The startDate. + */ + java.lang.String getStartDate(); + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString + getStartDateBytes(); + + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The endDate. + */ + java.lang.String getEndDate(); + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString + getEndDateBytes(); + } + /** + * Protobuf type {@code monitoring.KpiQuery} + */ + public static final class KpiQuery extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiQuery) + KpiQueryOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiQuery.newBuilder() to construct. + private KpiQuery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiQuery() { + kpiId_ = java.util.Collections.emptyList(); + startDate_ = ""; + endDate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiQuery(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiQuery( + 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)) { + kpiId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiId_.add( + input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry)); + break; + } + case 21: { + + monitoringWindowS_ = input.readFloat(); + break; + } + case 29: { + + samplingRateS_ = input.readFloat(); + break; + } + case 32: { + + lastNSamples_ = input.readUInt32(); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + startDate_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + endDate_ = 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)) { + kpiId_ = java.util.Collections.unmodifiableList(kpiId_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiQuery.class, monitoring.Monitoring.KpiQuery.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private java.util.List kpiId_; + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public java.util.List getKpiIdList() { + return kpiId_; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public java.util.List + getKpiIdOrBuilderList() { + return kpiId_; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public int getKpiIdCount() { + return kpiId_.size(); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId(int index) { + return kpiId_.get(index); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index) { + return kpiId_.get(index); + } + + public static final int MONITORING_WINDOW_S_FIELD_NUMBER = 2; + private float monitoringWindowS_; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + + public static final int SAMPLING_RATE_S_FIELD_NUMBER = 3; + private float samplingRateS_; + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + + public static final int LAST_N_SAMPLES_FIELD_NUMBER = 4; + private int lastNSamples_; + /** + *
+     * used when you want something like "get the last N many samples
+     * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + @java.lang.Override + public int getLastNSamples() { + return lastNSamples_; + } + + public static final int START_DATE_FIELD_NUMBER = 5; + private volatile java.lang.Object startDate_; + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + 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(); + startDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 6; + private volatile java.lang.Object endDate_; + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + 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(); + endDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = 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 { + for (int i = 0; i < kpiId_.size(); i++) { + output.writeMessage(1, kpiId_.get(i)); + } + if (monitoringWindowS_ != 0F) { + output.writeFloat(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + output.writeFloat(3, samplingRateS_); + } + if (lastNSamples_ != 0) { + output.writeUInt32(4, lastNSamples_); + } + if (!getStartDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, endDate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < kpiId_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiId_.get(i)); + } + if (monitoringWindowS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, monitoringWindowS_); + } + if (samplingRateS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingRateS_); + } + if (lastNSamples_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(4, lastNSamples_); + } + if (!getStartDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, endDate_); + } + 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 monitoring.Monitoring.KpiQuery)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiQuery other = (monitoring.Monitoring.KpiQuery) obj; + + if (!getKpiIdList() + .equals(other.getKpiIdList())) return false; + if (java.lang.Float.floatToIntBits(getMonitoringWindowS()) + != java.lang.Float.floatToIntBits( + other.getMonitoringWindowS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingRateS()) + != java.lang.Float.floatToIntBits( + other.getSamplingRateS())) return false; + if (getLastNSamples() + != other.getLastNSamples()) return false; + if (!getStartDate() + .equals(other.getStartDate())) return false; + if (!getEndDate() + .equals(other.getEndDate())) 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 (getKpiIdCount() > 0) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiIdList().hashCode(); + } + hash = (37 * hash) + MONITORING_WINDOW_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getMonitoringWindowS()); + hash = (37 * hash) + SAMPLING_RATE_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingRateS()); + hash = (37 * hash) + LAST_N_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getLastNSamples(); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiQuery parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiQuery parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiQuery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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 monitoring.Monitoring.KpiQuery parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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 monitoring.Monitoring.KpiQuery parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiQuery 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(monitoring.Monitoring.KpiQuery 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 monitoring.KpiQuery} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiQuery) + monitoring.Monitoring.KpiQueryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiQuery.class, monitoring.Monitoring.KpiQuery.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiQuery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiIdFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiIdBuilder_ == null) { + kpiId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiIdBuilder_.clear(); + } + monitoringWindowS_ = 0F; + + samplingRateS_ = 0F; + + lastNSamples_ = 0; + + startDate_ = ""; + + endDate_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiQuery_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery getDefaultInstanceForType() { + return monitoring.Monitoring.KpiQuery.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery build() { + monitoring.Monitoring.KpiQuery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiQuery buildPartial() { + monitoring.Monitoring.KpiQuery result = new monitoring.Monitoring.KpiQuery(this); + int from_bitField0_ = bitField0_; + if (kpiIdBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiId_ = java.util.Collections.unmodifiableList(kpiId_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.monitoringWindowS_ = monitoringWindowS_; + result.samplingRateS_ = samplingRateS_; + result.lastNSamples_ = lastNSamples_; + result.startDate_ = startDate_; + result.endDate_ = endDate_; + 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 monitoring.Monitoring.KpiQuery) { + return mergeFrom((monitoring.Monitoring.KpiQuery)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiQuery other) { + if (other == monitoring.Monitoring.KpiQuery.getDefaultInstance()) return this; + if (kpiIdBuilder_ == null) { + if (!other.kpiId_.isEmpty()) { + if (kpiId_.isEmpty()) { + kpiId_ = other.kpiId_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiIdIsMutable(); + kpiId_.addAll(other.kpiId_); + } + onChanged(); + } + } else { + if (!other.kpiId_.isEmpty()) { + if (kpiIdBuilder_.isEmpty()) { + kpiIdBuilder_.dispose(); + kpiIdBuilder_ = null; + kpiId_ = other.kpiId_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiIdBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiIdFieldBuilder() : null; + } else { + kpiIdBuilder_.addAllMessages(other.kpiId_); + } + } + } + if (other.getMonitoringWindowS() != 0F) { + setMonitoringWindowS(other.getMonitoringWindowS()); + } + if (other.getSamplingRateS() != 0F) { + setSamplingRateS(other.getSamplingRateS()); + } + if (other.getLastNSamples() != 0) { + setLastNSamples(other.getLastNSamples()); + } + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + 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 { + monitoring.Monitoring.KpiQuery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiQuery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiId_ = + java.util.Collections.emptyList(); + private void ensureKpiIdIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiId_ = new java.util.ArrayList(kpiId_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List getKpiIdList() { + if (kpiIdBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiId_); + } else { + return kpiIdBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public int getKpiIdCount() { + if (kpiIdBuilder_ == null) { + return kpiId_.size(); + } else { + return kpiIdBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId getKpiId(int index) { + if (kpiIdBuilder_ == null) { + return kpiId_.get(index); + } else { + return kpiIdBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.set(index, value); + onChanged(); + } else { + kpiIdBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.add(value); + onChanged(); + } else { + kpiIdBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + int index, monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiIdIsMutable(); + kpiId_.add(index, value); + onChanged(); + } else { + kpiIdBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.add(builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addKpiId( + int index, monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiIdBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder addAllKpiId( + java.lang.Iterable values) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiId_); + onChanged(); + } else { + kpiIdBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiIdBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public Builder removeKpiId(int index) { + if (kpiIdBuilder_ == null) { + ensureKpiIdIsMutable(); + kpiId_.remove(index); + onChanged(); + } else { + kpiIdBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder( + int index) { + return getKpiIdFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder( + int index) { + if (kpiIdBuilder_ == null) { + return kpiId_.get(index); } else { + return kpiIdBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List + getKpiIdOrBuilderList() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiId_); + } + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdBuilder() { + return getKpiIdFieldBuilder().addBuilder( + monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder addKpiIdBuilder( + int index) { + return getKpiIdFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiId.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiId kpi_id = 1; + */ + public java.util.List + getKpiIdBuilderList() { + return getKpiIdFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + kpiId_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float monitoringWindowS_ ; + /** + * float monitoring_window_s = 2; + * @return The monitoringWindowS. + */ + @java.lang.Override + public float getMonitoringWindowS() { + return monitoringWindowS_; + } + /** + * float monitoring_window_s = 2; + * @param value The monitoringWindowS to set. + * @return This builder for chaining. + */ + public Builder setMonitoringWindowS(float value) { + + monitoringWindowS_ = value; + onChanged(); + return this; + } + /** + * float monitoring_window_s = 2; + * @return This builder for chaining. + */ + public Builder clearMonitoringWindowS() { + + monitoringWindowS_ = 0F; + onChanged(); + return this; + } + + private float samplingRateS_ ; + /** + * float sampling_rate_s = 3; + * @return The samplingRateS. + */ + @java.lang.Override + public float getSamplingRateS() { + return samplingRateS_; + } + /** + * float sampling_rate_s = 3; + * @param value The samplingRateS to set. + * @return This builder for chaining. + */ + public Builder setSamplingRateS(float value) { + + samplingRateS_ = value; + onChanged(); + return this; + } + /** + * float sampling_rate_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingRateS() { + + samplingRateS_ = 0F; + onChanged(); + return this; + } + + private int lastNSamples_ ; + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @return The lastNSamples. + */ + @java.lang.Override + public int getLastNSamples() { + return lastNSamples_; + } + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @param value The lastNSamples to set. + * @return This builder for chaining. + */ + public Builder setLastNSamples(int value) { + + lastNSamples_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the last N many samples
+       * 
+ * + * uint32 last_n_samples = 4; + * @return This builder for chaining. + */ + public Builder clearLastNSamples() { + + lastNSamples_ = 0; + onChanged(); + return this; + } + + private java.lang.Object startDate_ = ""; + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @return This builder for chaining. + */ + public Builder clearStartDate() { + + startDate_ = getDefaultInstance().getStartDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 5; + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startDate_ = value; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @return This builder for chaining. + */ + public Builder clearEndDate() { + + endDate_ = getDefaultInstance().getEndDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 6; + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endDate_ = 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:monitoring.KpiQuery) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiQuery) + private static final monitoring.Monitoring.KpiQuery DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiQuery(); + } + + public static monitoring.Monitoring.KpiQuery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiQuery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiQuery(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 monitoring.Monitoring.KpiQuery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiId) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + context.ContextOuterClass.Uuid getKpiId(); + /** + * .context.Uuid kpi_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiId} + */ + public static final class KpiId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiId) + KpiIdOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiId.newBuilder() to construct. + private KpiId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiId() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiId(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiId( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid kpiId_; + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getKpiId() { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + /** + * .context.Uuid kpi_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + 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 monitoring.Monitoring.KpiId)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiId other = (monitoring.Monitoring.KpiId) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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 monitoring.Monitoring.KpiId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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 monitoring.Monitoring.KpiId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiId 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(monitoring.Monitoring.KpiId 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 monitoring.KpiId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiId) + monitoring.Monitoring.KpiIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiId.class, monitoring.Monitoring.KpiId.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiId.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiId_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return monitoring.Monitoring.KpiId.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiId build() { + monitoring.Monitoring.KpiId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiId buildPartial() { + monitoring.Monitoring.KpiId result = new monitoring.Monitoring.KpiId(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.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 monitoring.Monitoring.KpiId) { + return mergeFrom((monitoring.Monitoring.KpiId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiId other) { + if (other == monitoring.Monitoring.KpiId.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + 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 { + monitoring.Monitoring.KpiId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> kpiIdBuilder_; + /** + * .context.Uuid kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .context.Uuid kpi_id = 1; + * @return The kpiId. + */ + public context.ContextOuterClass.Uuid getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder setKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder setKpiId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder mergeKpiId(context.ContextOuterClass.Uuid value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + context.ContextOuterClass.Uuid.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid kpi_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid kpi_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : kpiId_; + } + } + /** + * .context.Uuid kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + @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:monitoring.KpiId) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiId) + private static final monitoring.Monitoring.KpiId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiId(); + } + + public static monitoring.Monitoring.KpiId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiId(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 monitoring.Monitoring.KpiId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.Kpi) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * string timestamp = 2; + * @return The timestamp. + */ + java.lang.String getTimestamp(); + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + com.google.protobuf.ByteString + getTimestampBytes(); + + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.Kpi} + */ + public static final class Kpi extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.Kpi) + KpiOrBuilder { + private static final long serialVersionUID = 0L; + // Use Kpi.newBuilder() to construct. + private Kpi(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Kpi() { + timestamp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Kpi(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Kpi( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + timestamp_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = 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 monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private volatile java.lang.Object timestamp_; + /** + * string timestamp = 2; + * @return The timestamp. + */ + @java.lang.Override + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + 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(); + timestamp_ = s; + return s; + } + } + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_VALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, timestamp_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (!getTimestampBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, timestamp_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + 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 monitoring.Monitoring.Kpi)) { + return super.equals(obj); + } + monitoring.Monitoring.Kpi other = (monitoring.Monitoring.Kpi) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + if (hasKpiValue()) { + hash = (37 * hash) + KPI_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.Kpi parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.Kpi parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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 monitoring.Monitoring.Kpi parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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 monitoring.Monitoring.Kpi parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.Kpi 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(monitoring.Monitoring.Kpi 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 monitoring.Kpi} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.Kpi) + monitoring.Monitoring.KpiOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.Kpi.class, monitoring.Monitoring.Kpi.Builder.class); + } + + // Construct using monitoring.Monitoring.Kpi.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + timestamp_ = ""; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_Kpi_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return monitoring.Monitoring.Kpi.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.Kpi build() { + monitoring.Monitoring.Kpi result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.Kpi buildPartial() { + monitoring.Monitoring.Kpi result = new monitoring.Monitoring.Kpi(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.timestamp_ = timestamp_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.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 monitoring.Monitoring.Kpi) { + return mergeFrom((monitoring.Monitoring.Kpi)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.Kpi other) { + if (other == monitoring.Monitoring.Kpi.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (!other.getTimestamp().isEmpty()) { + timestamp_ = other.timestamp_; + onChanged(); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + 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 { + monitoring.Monitoring.Kpi parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.Kpi) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private java.lang.Object timestamp_ = ""; + /** + * string timestamp = 2; + * @return The timestamp. + */ + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string timestamp = 2; + * @return The bytes for timestamp. + */ + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string timestamp = 2; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timestamp_ = value; + onChanged(); + return this; + } + /** + * string timestamp = 2; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = getDefaultInstance().getTimestamp(); + onChanged(); + return this; + } + /** + * string timestamp = 2; + * @param value The bytes for timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestampBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timestamp_ = value; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @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:monitoring.Kpi) + } + + // @@protoc_insertion_point(class_scope:monitoring.Kpi) + private static final monitoring.Monitoring.Kpi DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.Kpi(); + } + + public static monitoring.Monitoring.Kpi getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Kpi parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Kpi(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 monitoring.Monitoring.Kpi getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiValueRangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiValueRange) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + boolean hasKpiMinValue(); + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + monitoring.Monitoring.KpiValue getKpiMinValue(); + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder(); + + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + boolean hasKpiMaxValue(); + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + monitoring.Monitoring.KpiValue getKpiMaxValue(); + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.KpiValueRange} + */ + public static final class KpiValueRange extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiValueRange) + KpiValueRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiValueRange.newBuilder() to construct. + private KpiValueRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiValueRange() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiValueRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiValueRange( + 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: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiMinValue_ != null) { + subBuilder = kpiMinValue_.toBuilder(); + } + kpiMinValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiMinValue_); + kpiMinValue_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiMaxValue_ != null) { + subBuilder = kpiMaxValue_.toBuilder(); + } + kpiMaxValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiMaxValue_); + kpiMaxValue_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValueRange.class, monitoring.Monitoring.KpiValueRange.Builder.class); + } + + public static final int KPIMINVALUE_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiValue kpiMinValue_; + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + @java.lang.Override + public boolean hasKpiMinValue() { + return kpiMinValue_ != null; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiMinValue() { + return kpiMinValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder() { + return getKpiMinValue(); + } + + public static final int KPIMAXVALUE_FIELD_NUMBER = 2; + private monitoring.Monitoring.KpiValue kpiMaxValue_; + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + @java.lang.Override + public boolean hasKpiMaxValue() { + return kpiMaxValue_ != null; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiMaxValue() { + return kpiMaxValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder() { + return getKpiMaxValue(); + } + + 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 (kpiMinValue_ != null) { + output.writeMessage(1, getKpiMinValue()); + } + if (kpiMaxValue_ != null) { + output.writeMessage(2, getKpiMaxValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiMinValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiMinValue()); + } + if (kpiMaxValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getKpiMaxValue()); + } + 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 monitoring.Monitoring.KpiValueRange)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiValueRange other = (monitoring.Monitoring.KpiValueRange) obj; + + if (hasKpiMinValue() != other.hasKpiMinValue()) return false; + if (hasKpiMinValue()) { + if (!getKpiMinValue() + .equals(other.getKpiMinValue())) return false; + } + if (hasKpiMaxValue() != other.hasKpiMaxValue()) return false; + if (hasKpiMaxValue()) { + if (!getKpiMaxValue() + .equals(other.getKpiMaxValue())) 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 (hasKpiMinValue()) { + hash = (37 * hash) + KPIMINVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiMinValue().hashCode(); + } + if (hasKpiMaxValue()) { + hash = (37 * hash) + KPIMAXVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiMaxValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiValueRange parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValueRange parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValueRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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 monitoring.Monitoring.KpiValueRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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 monitoring.Monitoring.KpiValueRange parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValueRange 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(monitoring.Monitoring.KpiValueRange 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 monitoring.KpiValueRange} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiValueRange) + monitoring.Monitoring.KpiValueRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValueRange.class, monitoring.Monitoring.KpiValueRange.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiValueRange.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 (kpiMinValueBuilder_ == null) { + kpiMinValue_ = null; + } else { + kpiMinValue_ = null; + kpiMinValueBuilder_ = null; + } + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = null; + } else { + kpiMaxValue_ = null; + kpiMaxValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiValueRange_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange getDefaultInstanceForType() { + return monitoring.Monitoring.KpiValueRange.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange build() { + monitoring.Monitoring.KpiValueRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValueRange buildPartial() { + monitoring.Monitoring.KpiValueRange result = new monitoring.Monitoring.KpiValueRange(this); + if (kpiMinValueBuilder_ == null) { + result.kpiMinValue_ = kpiMinValue_; + } else { + result.kpiMinValue_ = kpiMinValueBuilder_.build(); + } + if (kpiMaxValueBuilder_ == null) { + result.kpiMaxValue_ = kpiMaxValue_; + } else { + result.kpiMaxValue_ = kpiMaxValueBuilder_.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 monitoring.Monitoring.KpiValueRange) { + return mergeFrom((monitoring.Monitoring.KpiValueRange)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiValueRange other) { + if (other == monitoring.Monitoring.KpiValueRange.getDefaultInstance()) return this; + if (other.hasKpiMinValue()) { + mergeKpiMinValue(other.getKpiMinValue()); + } + if (other.hasKpiMaxValue()) { + mergeKpiMaxValue(other.getKpiMaxValue()); + } + 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 { + monitoring.Monitoring.KpiValueRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiValueRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiValue kpiMinValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiMinValueBuilder_; + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return Whether the kpiMinValue field is set. + */ + public boolean hasKpiMinValue() { + return kpiMinValueBuilder_ != null || kpiMinValue_ != null; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + * @return The kpiMinValue. + */ + public monitoring.Monitoring.KpiValue getKpiMinValue() { + if (kpiMinValueBuilder_ == null) { + return kpiMinValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } else { + return kpiMinValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder setKpiMinValue(monitoring.Monitoring.KpiValue value) { + if (kpiMinValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiMinValue_ = value; + onChanged(); + } else { + kpiMinValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder setKpiMinValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiMinValueBuilder_ == null) { + kpiMinValue_ = builderForValue.build(); + onChanged(); + } else { + kpiMinValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder mergeKpiMinValue(monitoring.Monitoring.KpiValue value) { + if (kpiMinValueBuilder_ == null) { + if (kpiMinValue_ != null) { + kpiMinValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiMinValue_).mergeFrom(value).buildPartial(); + } else { + kpiMinValue_ = value; + } + onChanged(); + } else { + kpiMinValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public Builder clearKpiMinValue() { + if (kpiMinValueBuilder_ == null) { + kpiMinValue_ = null; + onChanged(); + } else { + kpiMinValue_ = null; + kpiMinValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiMinValueBuilder() { + + onChanged(); + return getKpiMinValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiMinValueOrBuilder() { + if (kpiMinValueBuilder_ != null) { + return kpiMinValueBuilder_.getMessageOrBuilder(); + } else { + return kpiMinValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMinValue_; + } + } + /** + * .monitoring.KpiValue kpiMinValue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiMinValueFieldBuilder() { + if (kpiMinValueBuilder_ == null) { + kpiMinValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiMinValue(), + getParentForChildren(), + isClean()); + kpiMinValue_ = null; + } + return kpiMinValueBuilder_; + } + + private monitoring.Monitoring.KpiValue kpiMaxValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiMaxValueBuilder_; + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return Whether the kpiMaxValue field is set. + */ + public boolean hasKpiMaxValue() { + return kpiMaxValueBuilder_ != null || kpiMaxValue_ != null; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + * @return The kpiMaxValue. + */ + public monitoring.Monitoring.KpiValue getKpiMaxValue() { + if (kpiMaxValueBuilder_ == null) { + return kpiMaxValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } else { + return kpiMaxValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder setKpiMaxValue(monitoring.Monitoring.KpiValue value) { + if (kpiMaxValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiMaxValue_ = value; + onChanged(); + } else { + kpiMaxValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder setKpiMaxValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = builderForValue.build(); + onChanged(); + } else { + kpiMaxValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder mergeKpiMaxValue(monitoring.Monitoring.KpiValue value) { + if (kpiMaxValueBuilder_ == null) { + if (kpiMaxValue_ != null) { + kpiMaxValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiMaxValue_).mergeFrom(value).buildPartial(); + } else { + kpiMaxValue_ = value; + } + onChanged(); + } else { + kpiMaxValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public Builder clearKpiMaxValue() { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValue_ = null; + onChanged(); + } else { + kpiMaxValue_ = null; + kpiMaxValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiMaxValueBuilder() { + + onChanged(); + return getKpiMaxValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiMaxValueOrBuilder() { + if (kpiMaxValueBuilder_ != null) { + return kpiMaxValueBuilder_.getMessageOrBuilder(); + } else { + return kpiMaxValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiMaxValue_; + } + } + /** + * .monitoring.KpiValue kpiMaxValue = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiMaxValueFieldBuilder() { + if (kpiMaxValueBuilder_ == null) { + kpiMaxValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiMaxValue(), + getParentForChildren(), + isClean()); + kpiMaxValue_ = null; + } + return kpiMaxValueBuilder_; + } + @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:monitoring.KpiValueRange) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiValueRange) + private static final monitoring.Monitoring.KpiValueRange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiValueRange(); + } + + public static monitoring.Monitoring.KpiValueRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiValueRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiValueRange(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 monitoring.Monitoring.KpiValueRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiValue) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + boolean hasIntVal(); + /** + * uint32 intVal = 1; + * @return The intVal. + */ + int getIntVal(); + + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + boolean hasFloatVal(); + /** + * float floatVal = 2; + * @return The floatVal. + */ + float getFloatVal(); + + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + boolean hasStringVal(); + /** + * string stringVal = 3; + * @return The stringVal. + */ + java.lang.String getStringVal(); + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + com.google.protobuf.ByteString + getStringValBytes(); + + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + boolean hasBoolVal(); + /** + * bool boolVal = 4; + * @return The boolVal. + */ + boolean getBoolVal(); + + public monitoring.Monitoring.KpiValue.ValueCase getValueCase(); + } + /** + * Protobuf type {@code monitoring.KpiValue} + */ + public static final class KpiValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiValue) + KpiValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiValue.newBuilder() to construct. + private KpiValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiValue() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiValue( + 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: { + valueCase_ = 1; + value_ = input.readUInt32(); + break; + } + case 21: { + valueCase_ = 2; + value_ = input.readFloat(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 3; + value_ = s; + break; + } + case 32: { + valueCase_ = 4; + value_ = 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 monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INTVAL(1), + FLOATVAL(2), + STRINGVAL(3), + BOOLVAL(4), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 1: return INTVAL; + case 2: return FLOATVAL; + case 3: return STRINGVAL; + case 4: return BOOLVAL; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int INTVAL_FIELD_NUMBER = 1; + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + @java.lang.Override + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * uint32 intVal = 1; + * @return The intVal. + */ + @java.lang.Override + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + + public static final int FLOATVAL_FIELD_NUMBER = 2; + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + @java.lang.Override + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * float floatVal = 2; + * @return The floatVal. + */ + @java.lang.Override + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + + public static final int STRINGVAL_FIELD_NUMBER = 3; + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * string stringVal = 3; + * @return The stringVal. + */ + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + 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(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } + } + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOLVAL_FIELD_NUMBER = 4; + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + @java.lang.Override + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * bool boolVal = 4; + * @return The boolVal. + */ + @java.lang.Override + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + + 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 (valueCase_ == 1) { + output.writeUInt32( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + output.writeFloat( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + if (valueCase_ == 4) { + output.writeBool( + 4, (boolean)((java.lang.Boolean) value_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valueCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size( + 1, (int)((java.lang.Integer) value_)); + } + if (valueCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize( + 2, (float)((java.lang.Float) value_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize( + 4, (boolean)((java.lang.Boolean) 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 monitoring.Monitoring.KpiValue)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiValue other = (monitoring.Monitoring.KpiValue) obj; + + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 1: + if (getIntVal() + != other.getIntVal()) return false; + break; + case 2: + if (java.lang.Float.floatToIntBits(getFloatVal()) + != java.lang.Float.floatToIntBits( + other.getFloatVal())) return false; + break; + case 3: + if (!getStringVal() + .equals(other.getStringVal())) return false; + break; + case 4: + if (getBoolVal() + != other.getBoolVal()) return false; + break; + case 0: + default: + } + 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(); + switch (valueCase_) { + case 1: + hash = (37 * hash) + INTVAL_FIELD_NUMBER; + hash = (53 * hash) + getIntVal(); + break; + case 2: + hash = (37 * hash) + FLOATVAL_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getFloatVal()); + break; + case 3: + hash = (37 * hash) + STRINGVAL_FIELD_NUMBER; + hash = (53 * hash) + getStringVal().hashCode(); + break; + case 4: + hash = (37 * hash) + BOOLVAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolVal()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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 monitoring.Monitoring.KpiValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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 monitoring.Monitoring.KpiValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiValue 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(monitoring.Monitoring.KpiValue 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 monitoring.KpiValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiValue) + monitoring.Monitoring.KpiValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiValue.class, monitoring.Monitoring.KpiValue.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiValue.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(); + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiValue_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return monitoring.Monitoring.KpiValue.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue build() { + monitoring.Monitoring.KpiValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiValue buildPartial() { + monitoring.Monitoring.KpiValue result = new monitoring.Monitoring.KpiValue(this); + if (valueCase_ == 1) { + result.value_ = value_; + } + if (valueCase_ == 2) { + result.value_ = value_; + } + if (valueCase_ == 3) { + result.value_ = value_; + } + if (valueCase_ == 4) { + result.value_ = value_; + } + result.valueCase_ = valueCase_; + 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 monitoring.Monitoring.KpiValue) { + return mergeFrom((monitoring.Monitoring.KpiValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiValue other) { + if (other == monitoring.Monitoring.KpiValue.getDefaultInstance()) return this; + switch (other.getValueCase()) { + case INTVAL: { + setIntVal(other.getIntVal()); + break; + } + case FLOATVAL: { + setFloatVal(other.getFloatVal()); + break; + } + case STRINGVAL: { + valueCase_ = 3; + value_ = other.value_; + onChanged(); + break; + } + case BOOLVAL: { + setBoolVal(other.getBoolVal()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + 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 { + monitoring.Monitoring.KpiValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + + /** + * uint32 intVal = 1; + * @return Whether the intVal field is set. + */ + public boolean hasIntVal() { + return valueCase_ == 1; + } + /** + * uint32 intVal = 1; + * @return The intVal. + */ + public int getIntVal() { + if (valueCase_ == 1) { + return (java.lang.Integer) value_; + } + return 0; + } + /** + * uint32 intVal = 1; + * @param value The intVal to set. + * @return This builder for chaining. + */ + public Builder setIntVal(int value) { + valueCase_ = 1; + value_ = value; + onChanged(); + return this; + } + /** + * uint32 intVal = 1; + * @return This builder for chaining. + */ + public Builder clearIntVal() { + if (valueCase_ == 1) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * float floatVal = 2; + * @return Whether the floatVal field is set. + */ + public boolean hasFloatVal() { + return valueCase_ == 2; + } + /** + * float floatVal = 2; + * @return The floatVal. + */ + public float getFloatVal() { + if (valueCase_ == 2) { + return (java.lang.Float) value_; + } + return 0F; + } + /** + * float floatVal = 2; + * @param value The floatVal to set. + * @return This builder for chaining. + */ + public Builder setFloatVal(float value) { + valueCase_ = 2; + value_ = value; + onChanged(); + return this; + } + /** + * float floatVal = 2; + * @return This builder for chaining. + */ + public Builder clearFloatVal() { + if (valueCase_ == 2) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + + /** + * string stringVal = 3; + * @return Whether the stringVal field is set. + */ + @java.lang.Override + public boolean hasStringVal() { + return valueCase_ == 3; + } + /** + * string stringVal = 3; + * @return The stringVal. + */ + @java.lang.Override + public java.lang.String getStringVal() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string stringVal = 3; + * @return The bytes for stringVal. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stringVal = 3; + * @param value The stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringVal( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * string stringVal = 3; + * @return This builder for chaining. + */ + public Builder clearStringVal() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string stringVal = 3; + * @param value The bytes for stringVal to set. + * @return This builder for chaining. + */ + public Builder setStringValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * bool boolVal = 4; + * @return Whether the boolVal field is set. + */ + public boolean hasBoolVal() { + return valueCase_ == 4; + } + /** + * bool boolVal = 4; + * @return The boolVal. + */ + public boolean getBoolVal() { + if (valueCase_ == 4) { + return (java.lang.Boolean) value_; + } + return false; + } + /** + * bool boolVal = 4; + * @param value The boolVal to set. + * @return This builder for chaining. + */ + public Builder setBoolVal(boolean value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * bool boolVal = 4; + * @return This builder for chaining. + */ + public Builder clearBoolVal() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + 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:monitoring.KpiValue) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiValue) + private static final monitoring.Monitoring.KpiValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiValue(); + } + + public static monitoring.Monitoring.KpiValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiValue(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 monitoring.Monitoring.KpiValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + java.util.List + getKpiListList(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + monitoring.Monitoring.Kpi getKpiList(int index); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + int getKpiListCount(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + java.util.List + getKpiListOrBuilderList(); + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.KpiList} + */ + public static final class KpiList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiList) + KpiListOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiList.newBuilder() to construct. + private KpiList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiList() { + kpiList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiList( + 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)) { + kpiList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiList_.add( + input.readMessage(monitoring.Monitoring.Kpi.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)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + public static final int KPI_LIST_FIELD_NUMBER = 1; + private java.util.List kpiList_; + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public java.util.List getKpiListList() { + return kpiList_; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public java.util.List + getKpiListOrBuilderList() { + return kpiList_; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public int getKpiListCount() { + return kpiList_.size(); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.Kpi getKpiList(int index) { + return kpiList_.get(index); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + return kpiList_.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 < kpiList_.size(); i++) { + output.writeMessage(1, kpiList_.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 < kpiList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiList_.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 monitoring.Monitoring.KpiList)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiList other = (monitoring.Monitoring.KpiList) obj; + + if (!getKpiListList() + .equals(other.getKpiListList())) 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 (getKpiListCount() > 0) { + hash = (37 * hash) + KPI_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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 monitoring.Monitoring.KpiList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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 monitoring.Monitoring.KpiList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiList 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(monitoring.Monitoring.KpiList 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 monitoring.KpiList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiList) + monitoring.Monitoring.KpiListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiList.class, monitoring.Monitoring.KpiList.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return monitoring.Monitoring.KpiList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiList build() { + monitoring.Monitoring.KpiList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiList buildPartial() { + monitoring.Monitoring.KpiList result = new monitoring.Monitoring.KpiList(this); + int from_bitField0_ = bitField0_; + if (kpiListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiList_ = kpiList_; + } else { + result.kpiList_ = kpiListBuilder_.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 monitoring.Monitoring.KpiList) { + return mergeFrom((monitoring.Monitoring.KpiList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiList other) { + if (other == monitoring.Monitoring.KpiList.getDefaultInstance()) return this; + if (kpiListBuilder_ == null) { + if (!other.kpiList_.isEmpty()) { + if (kpiList_.isEmpty()) { + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiListIsMutable(); + kpiList_.addAll(other.kpiList_); + } + onChanged(); + } + } else { + if (!other.kpiList_.isEmpty()) { + if (kpiListBuilder_.isEmpty()) { + kpiListBuilder_.dispose(); + kpiListBuilder_ = null; + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiListFieldBuilder() : null; + } else { + kpiListBuilder_.addAllMessages(other.kpiList_); + } + } + } + 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 { + monitoring.Monitoring.KpiList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiList_ = + java.util.Collections.emptyList(); + private void ensureKpiListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(kpiList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> kpiListBuilder_; + + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List getKpiListList() { + if (kpiListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiList_); + } else { + return kpiListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public int getKpiListCount() { + if (kpiListBuilder_ == null) { + return kpiList_.size(); + } else { + return kpiListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi getKpiList(int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); + } else { + return kpiListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.set(index, value); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList(monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(value); + onChanged(); + } else { + kpiListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(index, value); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.Kpi.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder addAllKpiList( + java.lang.Iterable values) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiList_); + onChanged(); + } else { + kpiListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder clearKpiList() { + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public Builder removeKpiList(int index) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.remove(index); + onChanged(); + } else { + kpiListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder getKpiListBuilder( + int index) { + return getKpiListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.KpiOrBuilder getKpiListOrBuilder( + int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); } else { + return kpiListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List + getKpiListOrBuilderList() { + if (kpiListBuilder_ != null) { + return kpiListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiList_); + } + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder() { + return getKpiListFieldBuilder().addBuilder( + monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public monitoring.Monitoring.Kpi.Builder addKpiListBuilder( + int index) { + return getKpiListFieldBuilder().addBuilder( + index, monitoring.Monitoring.Kpi.getDefaultInstance()); + } + /** + * repeated .monitoring.Kpi kpi_list = 1; + */ + public java.util.List + getKpiListBuilderList() { + return getKpiListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder> + getKpiListFieldBuilder() { + if (kpiListBuilder_ == null) { + kpiListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.Kpi, monitoring.Monitoring.Kpi.Builder, monitoring.Monitoring.KpiOrBuilder>( + kpiList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiList_ = null; + } + return kpiListBuilder_; + } + @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:monitoring.KpiList) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiList) + private static final monitoring.Monitoring.KpiList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiList(); + } + + public static monitoring.Monitoring.KpiList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiList(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 monitoring.Monitoring.KpiList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface KpiDescriptorListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.KpiDescriptorList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + java.util.List + getKpiDescriptorListList(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + int getKpiDescriptorListCount(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + java.util.List + getKpiDescriptorListOrBuilderList(); + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.KpiDescriptorList} + */ + public static final class KpiDescriptorList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.KpiDescriptorList) + KpiDescriptorListOrBuilder { + private static final long serialVersionUID = 0L; + // Use KpiDescriptorList.newBuilder() to construct. + private KpiDescriptorList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KpiDescriptorList() { + kpiDescriptorList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new KpiDescriptorList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KpiDescriptorList( + 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)) { + kpiDescriptorList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiDescriptorList_.add( + input.readMessage(monitoring.Monitoring.KpiDescriptor.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)) { + kpiDescriptorList_ = java.util.Collections.unmodifiableList(kpiDescriptorList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptorList.class, monitoring.Monitoring.KpiDescriptorList.Builder.class); + } + + public static final int KPI_DESCRIPTOR_LIST_FIELD_NUMBER = 1; + private java.util.List kpiDescriptorList_; + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public java.util.List getKpiDescriptorListList() { + return kpiDescriptorList_; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public java.util.List + getKpiDescriptorListOrBuilderList() { + return kpiDescriptorList_; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public int getKpiDescriptorListCount() { + return kpiDescriptorList_.size(); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index) { + return kpiDescriptorList_.get(index); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index) { + return kpiDescriptorList_.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 < kpiDescriptorList_.size(); i++) { + output.writeMessage(1, kpiDescriptorList_.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 < kpiDescriptorList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, kpiDescriptorList_.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 monitoring.Monitoring.KpiDescriptorList)) { + return super.equals(obj); + } + monitoring.Monitoring.KpiDescriptorList other = (monitoring.Monitoring.KpiDescriptorList) obj; + + if (!getKpiDescriptorListList() + .equals(other.getKpiDescriptorListList())) 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 (getKpiDescriptorListCount() > 0) { + hash = (37 * hash) + KPI_DESCRIPTOR_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiDescriptorListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.KpiDescriptorList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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 monitoring.Monitoring.KpiDescriptorList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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 monitoring.Monitoring.KpiDescriptorList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.KpiDescriptorList 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(monitoring.Monitoring.KpiDescriptorList 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 monitoring.KpiDescriptorList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.KpiDescriptorList) + monitoring.Monitoring.KpiDescriptorListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.KpiDescriptorList.class, monitoring.Monitoring.KpiDescriptorList.Builder.class); + } + + // Construct using monitoring.Monitoring.KpiDescriptorList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiDescriptorListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiDescriptorListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_KpiDescriptorList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList getDefaultInstanceForType() { + return monitoring.Monitoring.KpiDescriptorList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList build() { + monitoring.Monitoring.KpiDescriptorList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.KpiDescriptorList buildPartial() { + monitoring.Monitoring.KpiDescriptorList result = new monitoring.Monitoring.KpiDescriptorList(this); + int from_bitField0_ = bitField0_; + if (kpiDescriptorListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiDescriptorList_ = java.util.Collections.unmodifiableList(kpiDescriptorList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiDescriptorList_ = kpiDescriptorList_; + } else { + result.kpiDescriptorList_ = kpiDescriptorListBuilder_.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 monitoring.Monitoring.KpiDescriptorList) { + return mergeFrom((monitoring.Monitoring.KpiDescriptorList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.KpiDescriptorList other) { + if (other == monitoring.Monitoring.KpiDescriptorList.getDefaultInstance()) return this; + if (kpiDescriptorListBuilder_ == null) { + if (!other.kpiDescriptorList_.isEmpty()) { + if (kpiDescriptorList_.isEmpty()) { + kpiDescriptorList_ = other.kpiDescriptorList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.addAll(other.kpiDescriptorList_); + } + onChanged(); + } + } else { + if (!other.kpiDescriptorList_.isEmpty()) { + if (kpiDescriptorListBuilder_.isEmpty()) { + kpiDescriptorListBuilder_.dispose(); + kpiDescriptorListBuilder_ = null; + kpiDescriptorList_ = other.kpiDescriptorList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiDescriptorListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiDescriptorListFieldBuilder() : null; + } else { + kpiDescriptorListBuilder_.addAllMessages(other.kpiDescriptorList_); + } + } + } + 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 { + monitoring.Monitoring.KpiDescriptorList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.KpiDescriptorList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List kpiDescriptorList_ = + java.util.Collections.emptyList(); + private void ensureKpiDescriptorListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiDescriptorList_ = new java.util.ArrayList(kpiDescriptorList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> kpiDescriptorListBuilder_; + + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List getKpiDescriptorListList() { + if (kpiDescriptorListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiDescriptorList_); + } else { + return kpiDescriptorListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public int getKpiDescriptorListCount() { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.size(); + } else { + return kpiDescriptorListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptorList(int index) { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.get(index); + } else { + return kpiDescriptorListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder setKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.set(index, value); + onChanged(); + } else { + kpiDescriptorListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder setKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList(monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(value); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor value) { + if (kpiDescriptorListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(index, value); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addKpiDescriptorList( + int index, monitoring.Monitoring.KpiDescriptor.Builder builderForValue) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiDescriptorListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder addAllKpiDescriptorList( + java.lang.Iterable values) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiDescriptorList_); + onChanged(); + } else { + kpiDescriptorListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder clearKpiDescriptorList() { + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiDescriptorListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public Builder removeKpiDescriptorList(int index) { + if (kpiDescriptorListBuilder_ == null) { + ensureKpiDescriptorListIsMutable(); + kpiDescriptorList_.remove(index); + onChanged(); + } else { + kpiDescriptorListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder getKpiDescriptorListBuilder( + int index) { + return getKpiDescriptorListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptorOrBuilder getKpiDescriptorListOrBuilder( + int index) { + if (kpiDescriptorListBuilder_ == null) { + return kpiDescriptorList_.get(index); } else { + return kpiDescriptorListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List + getKpiDescriptorListOrBuilderList() { + if (kpiDescriptorListBuilder_ != null) { + return kpiDescriptorListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiDescriptorList_); + } + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder addKpiDescriptorListBuilder() { + return getKpiDescriptorListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public monitoring.Monitoring.KpiDescriptor.Builder addKpiDescriptorListBuilder( + int index) { + return getKpiDescriptorListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiDescriptor.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiDescriptor kpi_descriptor_list = 1; + */ + public java.util.List + getKpiDescriptorListBuilderList() { + return getKpiDescriptorListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder> + getKpiDescriptorListFieldBuilder() { + if (kpiDescriptorListBuilder_ == null) { + kpiDescriptorListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiDescriptor, monitoring.Monitoring.KpiDescriptor.Builder, monitoring.Monitoring.KpiDescriptorOrBuilder>( + kpiDescriptorList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiDescriptorList_ = null; + } + return kpiDescriptorListBuilder_; + } + @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:monitoring.KpiDescriptorList) + } + + // @@protoc_insertion_point(class_scope:monitoring.KpiDescriptorList) + private static final monitoring.Monitoring.KpiDescriptorList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.KpiDescriptorList(); + } + + public static monitoring.Monitoring.KpiDescriptorList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KpiDescriptorList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KpiDescriptorList(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 monitoring.Monitoring.KpiDescriptorList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + float getSamplingDurationS(); + + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + float getSamplingIntervalS(); + + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The startDate. + */ + java.lang.String getStartDate(); + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + com.google.protobuf.ByteString + getStartDateBytes(); + + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The endDate. + */ + java.lang.String getEndDate(); + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + com.google.protobuf.ByteString + getEndDateBytes(); + } + /** + * Protobuf type {@code monitoring.SubsDescriptor} + */ + public static final class SubsDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsDescriptor) + SubsDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsDescriptor.newBuilder() to construct. + private SubsDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsDescriptor() { + startDate_ = ""; + endDate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsDescriptor( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + samplingDurationS_ = input.readFloat(); + break; + } + case 29: { + + samplingIntervalS_ = input.readFloat(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + startDate_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + endDate_ = 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 monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsDescriptor.class, monitoring.Monitoring.SubsDescriptor.Builder.class); + } + + public static final int KPI_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int SAMPLING_DURATION_S_FIELD_NUMBER = 2; + private float samplingDurationS_; + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + + public static final int SAMPLING_INTERVAL_S_FIELD_NUMBER = 3; + private float samplingIntervalS_; + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + + public static final int START_DATE_FIELD_NUMBER = 4; + private volatile java.lang.Object startDate_; + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The startDate. + */ + @java.lang.Override + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + 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(); + startDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples since X date/time"
+     * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int END_DATE_FIELD_NUMBER = 5; + private volatile java.lang.Object endDate_; + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The endDate. + */ + @java.lang.Override + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + 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(); + endDate_ = s; + return s; + } + } + /** + *
+     * used when you want something like "get the samples until X date/time"
+     * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + output.writeFloat(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + output.writeFloat(3, samplingIntervalS_); + } + if (!getStartDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, endDate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (samplingDurationS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, samplingDurationS_); + } + if (samplingIntervalS_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, samplingIntervalS_); + } + if (!getStartDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, startDate_); + } + if (!getEndDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, endDate_); + } + 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 monitoring.Monitoring.SubsDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsDescriptor other = (monitoring.Monitoring.SubsDescriptor) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (java.lang.Float.floatToIntBits(getSamplingDurationS()) + != java.lang.Float.floatToIntBits( + other.getSamplingDurationS())) return false; + if (java.lang.Float.floatToIntBits(getSamplingIntervalS()) + != java.lang.Float.floatToIntBits( + other.getSamplingIntervalS())) return false; + if (!getStartDate() + .equals(other.getStartDate())) return false; + if (!getEndDate() + .equals(other.getEndDate())) 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 (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + SAMPLING_DURATION_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingDurationS()); + hash = (37 * hash) + SAMPLING_INTERVAL_S_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getSamplingIntervalS()); + hash = (37 * hash) + START_DATE_FIELD_NUMBER; + hash = (53 * hash) + getStartDate().hashCode(); + hash = (37 * hash) + END_DATE_FIELD_NUMBER; + hash = (53 * hash) + getEndDate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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 monitoring.Monitoring.SubsDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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 monitoring.Monitoring.SubsDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsDescriptor 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(monitoring.Monitoring.SubsDescriptor 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 monitoring.SubsDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsDescriptor) + monitoring.Monitoring.SubsDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsDescriptor.class, monitoring.Monitoring.SubsDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsDescriptor.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + samplingDurationS_ = 0F; + + samplingIntervalS_ = 0F; + + startDate_ = ""; + + endDate_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.SubsDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor build() { + monitoring.Monitoring.SubsDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsDescriptor buildPartial() { + monitoring.Monitoring.SubsDescriptor result = new monitoring.Monitoring.SubsDescriptor(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.samplingDurationS_ = samplingDurationS_; + result.samplingIntervalS_ = samplingIntervalS_; + result.startDate_ = startDate_; + result.endDate_ = endDate_; + 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 monitoring.Monitoring.SubsDescriptor) { + return mergeFrom((monitoring.Monitoring.SubsDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsDescriptor other) { + if (other == monitoring.Monitoring.SubsDescriptor.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.getSamplingDurationS() != 0F) { + setSamplingDurationS(other.getSamplingDurationS()); + } + if (other.getSamplingIntervalS() != 0F) { + setSamplingIntervalS(other.getSamplingIntervalS()); + } + if (!other.getStartDate().isEmpty()) { + startDate_ = other.startDate_; + onChanged(); + } + if (!other.getEndDate().isEmpty()) { + endDate_ = other.endDate_; + 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 { + monitoring.Monitoring.SubsDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private float samplingDurationS_ ; + /** + * float sampling_duration_s = 2; + * @return The samplingDurationS. + */ + @java.lang.Override + public float getSamplingDurationS() { + return samplingDurationS_; + } + /** + * float sampling_duration_s = 2; + * @param value The samplingDurationS to set. + * @return This builder for chaining. + */ + public Builder setSamplingDurationS(float value) { + + samplingDurationS_ = value; + onChanged(); + return this; + } + /** + * float sampling_duration_s = 2; + * @return This builder for chaining. + */ + public Builder clearSamplingDurationS() { + + samplingDurationS_ = 0F; + onChanged(); + return this; + } + + private float samplingIntervalS_ ; + /** + * float sampling_interval_s = 3; + * @return The samplingIntervalS. + */ + @java.lang.Override + public float getSamplingIntervalS() { + return samplingIntervalS_; + } + /** + * float sampling_interval_s = 3; + * @param value The samplingIntervalS to set. + * @return This builder for chaining. + */ + public Builder setSamplingIntervalS(float value) { + + samplingIntervalS_ = value; + onChanged(); + return this; + } + /** + * float sampling_interval_s = 3; + * @return This builder for chaining. + */ + public Builder clearSamplingIntervalS() { + + samplingIntervalS_ = 0F; + onChanged(); + return this; + } + + private java.lang.Object startDate_ = ""; + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return The startDate. + */ + public java.lang.String getStartDate() { + java.lang.Object ref = startDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return The bytes for startDate. + */ + public com.google.protobuf.ByteString + getStartDateBytes() { + java.lang.Object ref = startDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @param value The startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @return This builder for chaining. + */ + public Builder clearStartDate() { + + startDate_ = getDefaultInstance().getStartDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples since X date/time"
+       * 
+ * + * string start_date = 4; + * @param value The bytes for startDate to set. + * @return This builder for chaining. + */ + public Builder setStartDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startDate_ = value; + onChanged(); + return this; + } + + private java.lang.Object endDate_ = ""; + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return The endDate. + */ + public java.lang.String getEndDate() { + java.lang.Object ref = endDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return The bytes for endDate. + */ + public com.google.protobuf.ByteString + getEndDateBytes() { + java.lang.Object ref = endDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + endDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @param value The endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endDate_ = value; + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @return This builder for chaining. + */ + public Builder clearEndDate() { + + endDate_ = getDefaultInstance().getEndDate(); + onChanged(); + return this; + } + /** + *
+       * used when you want something like "get the samples until X date/time"
+       * 
+ * + * string end_date = 5; + * @param value The bytes for endDate to set. + * @return This builder for chaining. + */ + public Builder setEndDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endDate_ = 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:monitoring.SubsDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsDescriptor) + private static final monitoring.Monitoring.SubsDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsDescriptor(); + } + + public static monitoring.Monitoring.SubsDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsDescriptor(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 monitoring.Monitoring.SubsDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubscriptionIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubscriptionID) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + boolean hasSubsId(); + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + context.ContextOuterClass.Uuid getSubsId(); + /** + * .context.Uuid subs_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.SubscriptionID} + */ + public static final class SubscriptionID extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubscriptionID) + SubscriptionIDOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscriptionID.newBuilder() to construct. + private SubscriptionID(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubscriptionID() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubscriptionID(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubscriptionID( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (subsId_ != null) { + subBuilder = subsId_.toBuilder(); + } + subsId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subsId_); + subsId_ = 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 monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubscriptionID.class, monitoring.Monitoring.SubscriptionID.Builder.class); + } + + public static final int SUBS_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid subsId_; + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + @java.lang.Override + public boolean hasSubsId() { + return subsId_ != null; + } + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getSubsId() { + return subsId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } + /** + * .context.Uuid subs_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder() { + return getSubsId(); + } + + 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 (subsId_ != null) { + output.writeMessage(1, getSubsId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subsId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSubsId()); + } + 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 monitoring.Monitoring.SubscriptionID)) { + return super.equals(obj); + } + monitoring.Monitoring.SubscriptionID other = (monitoring.Monitoring.SubscriptionID) obj; + + if (hasSubsId() != other.hasSubsId()) return false; + if (hasSubsId()) { + if (!getSubsId() + .equals(other.getSubsId())) 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 (hasSubsId()) { + hash = (37 * hash) + SUBS_ID_FIELD_NUMBER; + hash = (53 * hash) + getSubsId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubscriptionID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubscriptionID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubscriptionID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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 monitoring.Monitoring.SubscriptionID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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 monitoring.Monitoring.SubscriptionID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubscriptionID 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(monitoring.Monitoring.SubscriptionID 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 monitoring.SubscriptionID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubscriptionID) + monitoring.Monitoring.SubscriptionIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubscriptionID.class, monitoring.Monitoring.SubscriptionID.Builder.class); + } + + // Construct using monitoring.Monitoring.SubscriptionID.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 (subsIdBuilder_ == null) { + subsId_ = null; + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubscriptionID_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getDefaultInstanceForType() { + return monitoring.Monitoring.SubscriptionID.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID build() { + monitoring.Monitoring.SubscriptionID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubscriptionID buildPartial() { + monitoring.Monitoring.SubscriptionID result = new monitoring.Monitoring.SubscriptionID(this); + if (subsIdBuilder_ == null) { + result.subsId_ = subsId_; + } else { + result.subsId_ = subsIdBuilder_.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 monitoring.Monitoring.SubscriptionID) { + return mergeFrom((monitoring.Monitoring.SubscriptionID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubscriptionID other) { + if (other == monitoring.Monitoring.SubscriptionID.getDefaultInstance()) return this; + if (other.hasSubsId()) { + mergeSubsId(other.getSubsId()); + } + 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 { + monitoring.Monitoring.SubscriptionID parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubscriptionID) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid subsId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> subsIdBuilder_; + /** + * .context.Uuid subs_id = 1; + * @return Whether the subsId field is set. + */ + public boolean hasSubsId() { + return subsIdBuilder_ != null || subsId_ != null; + } + /** + * .context.Uuid subs_id = 1; + * @return The subsId. + */ + public context.ContextOuterClass.Uuid getSubsId() { + if (subsIdBuilder_ == null) { + return subsId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } else { + return subsIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder setSubsId(context.ContextOuterClass.Uuid value) { + if (subsIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subsId_ = value; + onChanged(); + } else { + subsIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder setSubsId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (subsIdBuilder_ == null) { + subsId_ = builderForValue.build(); + onChanged(); + } else { + subsIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder mergeSubsId(context.ContextOuterClass.Uuid value) { + if (subsIdBuilder_ == null) { + if (subsId_ != null) { + subsId_ = + context.ContextOuterClass.Uuid.newBuilder(subsId_).mergeFrom(value).buildPartial(); + } else { + subsId_ = value; + } + onChanged(); + } else { + subsIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public Builder clearSubsId() { + if (subsIdBuilder_ == null) { + subsId_ = null; + onChanged(); + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid subs_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getSubsIdBuilder() { + + onChanged(); + return getSubsIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid subs_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getSubsIdOrBuilder() { + if (subsIdBuilder_ != null) { + return subsIdBuilder_.getMessageOrBuilder(); + } else { + return subsId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : subsId_; + } + } + /** + * .context.Uuid subs_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getSubsIdFieldBuilder() { + if (subsIdBuilder_ == null) { + subsIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getSubsId(), + getParentForChildren(), + isClean()); + subsId_ = null; + } + return subsIdBuilder_; + } + @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:monitoring.SubscriptionID) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubscriptionID) + private static final monitoring.Monitoring.SubscriptionID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubscriptionID(); + } + + public static monitoring.Monitoring.SubscriptionID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscriptionID parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubscriptionID(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 monitoring.Monitoring.SubscriptionID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + boolean hasSubsId(); + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + monitoring.Monitoring.SubscriptionID getSubsId(); + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder(); + + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + java.util.List + getKpiListList(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + monitoring.Monitoring.KpiList getKpiList(int index); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + int getKpiListCount(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + java.util.List + getKpiListOrBuilderList(); + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.SubsResponse} + */ + public static final class SubsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsResponse) + SubsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsResponse.newBuilder() to construct. + private SubsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsResponse() { + kpiList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsResponse( + 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: { + monitoring.Monitoring.SubscriptionID.Builder subBuilder = null; + if (subsId_ != null) { + subBuilder = subsId_.toBuilder(); + } + subsId_ = input.readMessage(monitoring.Monitoring.SubscriptionID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(subsId_); + subsId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + kpiList_.add( + input.readMessage(monitoring.Monitoring.KpiList.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)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsResponse.class, monitoring.Monitoring.SubsResponse.Builder.class); + } + + public static final int SUBS_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.SubscriptionID subsId_; + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + @java.lang.Override + public boolean hasSubsId() { + return subsId_ != null; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getSubsId() { + return subsId_ == null ? monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder() { + return getSubsId(); + } + + public static final int KPI_LIST_FIELD_NUMBER = 2; + private java.util.List kpiList_; + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public java.util.List getKpiListList() { + return kpiList_; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public java.util.List + getKpiListOrBuilderList() { + return kpiList_; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public int getKpiListCount() { + return kpiList_.size(); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiList getKpiList(int index) { + return kpiList_.get(index); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + @java.lang.Override + public monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index) { + return kpiList_.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 (subsId_ != null) { + output.writeMessage(1, getSubsId()); + } + for (int i = 0; i < kpiList_.size(); i++) { + output.writeMessage(2, kpiList_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (subsId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSubsId()); + } + for (int i = 0; i < kpiList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, kpiList_.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 monitoring.Monitoring.SubsResponse)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsResponse other = (monitoring.Monitoring.SubsResponse) obj; + + if (hasSubsId() != other.hasSubsId()) return false; + if (hasSubsId()) { + if (!getSubsId() + .equals(other.getSubsId())) return false; + } + if (!getKpiListList() + .equals(other.getKpiListList())) 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 (hasSubsId()) { + hash = (37 * hash) + SUBS_ID_FIELD_NUMBER; + hash = (53 * hash) + getSubsId().hashCode(); + } + if (getKpiListCount() > 0) { + hash = (37 * hash) + KPI_LIST_FIELD_NUMBER; + hash = (53 * hash) + getKpiListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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 monitoring.Monitoring.SubsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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 monitoring.Monitoring.SubsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsResponse 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(monitoring.Monitoring.SubsResponse 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 monitoring.SubsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsResponse) + monitoring.Monitoring.SubsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsResponse.class, monitoring.Monitoring.SubsResponse.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getKpiListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (subsIdBuilder_ == null) { + subsId_ = null; + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + kpiListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsResponse_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse getDefaultInstanceForType() { + return monitoring.Monitoring.SubsResponse.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse build() { + monitoring.Monitoring.SubsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsResponse buildPartial() { + monitoring.Monitoring.SubsResponse result = new monitoring.Monitoring.SubsResponse(this); + int from_bitField0_ = bitField0_; + if (subsIdBuilder_ == null) { + result.subsId_ = subsId_; + } else { + result.subsId_ = subsIdBuilder_.build(); + } + if (kpiListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + kpiList_ = java.util.Collections.unmodifiableList(kpiList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.kpiList_ = kpiList_; + } else { + result.kpiList_ = kpiListBuilder_.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 monitoring.Monitoring.SubsResponse) { + return mergeFrom((monitoring.Monitoring.SubsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsResponse other) { + if (other == monitoring.Monitoring.SubsResponse.getDefaultInstance()) return this; + if (other.hasSubsId()) { + mergeSubsId(other.getSubsId()); + } + if (kpiListBuilder_ == null) { + if (!other.kpiList_.isEmpty()) { + if (kpiList_.isEmpty()) { + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKpiListIsMutable(); + kpiList_.addAll(other.kpiList_); + } + onChanged(); + } + } else { + if (!other.kpiList_.isEmpty()) { + if (kpiListBuilder_.isEmpty()) { + kpiListBuilder_.dispose(); + kpiListBuilder_ = null; + kpiList_ = other.kpiList_; + bitField0_ = (bitField0_ & ~0x00000001); + kpiListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getKpiListFieldBuilder() : null; + } else { + kpiListBuilder_.addAllMessages(other.kpiList_); + } + } + } + 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 { + monitoring.Monitoring.SubsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private monitoring.Monitoring.SubscriptionID subsId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> subsIdBuilder_; + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return Whether the subsId field is set. + */ + public boolean hasSubsId() { + return subsIdBuilder_ != null || subsId_ != null; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + * @return The subsId. + */ + public monitoring.Monitoring.SubscriptionID getSubsId() { + if (subsIdBuilder_ == null) { + return subsId_ == null ? monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } else { + return subsIdBuilder_.getMessage(); + } + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder setSubsId(monitoring.Monitoring.SubscriptionID value) { + if (subsIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + subsId_ = value; + onChanged(); + } else { + subsIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder setSubsId( + monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsIdBuilder_ == null) { + subsId_ = builderForValue.build(); + onChanged(); + } else { + subsIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder mergeSubsId(monitoring.Monitoring.SubscriptionID value) { + if (subsIdBuilder_ == null) { + if (subsId_ != null) { + subsId_ = + monitoring.Monitoring.SubscriptionID.newBuilder(subsId_).mergeFrom(value).buildPartial(); + } else { + subsId_ = value; + } + onChanged(); + } else { + subsIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public Builder clearSubsId() { + if (subsIdBuilder_ == null) { + subsId_ = null; + onChanged(); + } else { + subsId_ = null; + subsIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder getSubsIdBuilder() { + + onChanged(); + return getSubsIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsIdOrBuilder() { + if (subsIdBuilder_ != null) { + return subsIdBuilder_.getMessageOrBuilder(); + } else { + return subsId_ == null ? + monitoring.Monitoring.SubscriptionID.getDefaultInstance() : subsId_; + } + } + /** + * .monitoring.SubscriptionID subs_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> + getSubsIdFieldBuilder() { + if (subsIdBuilder_ == null) { + subsIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder>( + getSubsId(), + getParentForChildren(), + isClean()); + subsId_ = null; + } + return subsIdBuilder_; + } + + private java.util.List kpiList_ = + java.util.Collections.emptyList(); + private void ensureKpiListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + kpiList_ = new java.util.ArrayList(kpiList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder> kpiListBuilder_; + + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List getKpiListList() { + if (kpiListBuilder_ == null) { + return java.util.Collections.unmodifiableList(kpiList_); + } else { + return kpiListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public int getKpiListCount() { + if (kpiListBuilder_ == null) { + return kpiList_.size(); + } else { + return kpiListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList getKpiList(int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); + } else { + return kpiListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.set(index, value); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder setKpiList( + int index, monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.set(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList(monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(value); + onChanged(); + } else { + kpiListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.KpiList value) { + if (kpiListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKpiListIsMutable(); + kpiList_.add(index, value); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addKpiList( + int index, monitoring.Monitoring.KpiList.Builder builderForValue) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.add(index, builderForValue.build()); + onChanged(); + } else { + kpiListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder addAllKpiList( + java.lang.Iterable values) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, kpiList_); + onChanged(); + } else { + kpiListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder clearKpiList() { + if (kpiListBuilder_ == null) { + kpiList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + kpiListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public Builder removeKpiList(int index) { + if (kpiListBuilder_ == null) { + ensureKpiListIsMutable(); + kpiList_.remove(index); + onChanged(); + } else { + kpiListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder getKpiListBuilder( + int index) { + return getKpiListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiListOrBuilder getKpiListOrBuilder( + int index) { + if (kpiListBuilder_ == null) { + return kpiList_.get(index); } else { + return kpiListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List + getKpiListOrBuilderList() { + if (kpiListBuilder_ != null) { + return kpiListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(kpiList_); + } + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder addKpiListBuilder() { + return getKpiListFieldBuilder().addBuilder( + monitoring.Monitoring.KpiList.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public monitoring.Monitoring.KpiList.Builder addKpiListBuilder( + int index) { + return getKpiListFieldBuilder().addBuilder( + index, monitoring.Monitoring.KpiList.getDefaultInstance()); + } + /** + * repeated .monitoring.KpiList kpi_list = 2; + */ + public java.util.List + getKpiListBuilderList() { + return getKpiListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder> + getKpiListFieldBuilder() { + if (kpiListBuilder_ == null) { + kpiListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.KpiList, monitoring.Monitoring.KpiList.Builder, monitoring.Monitoring.KpiListOrBuilder>( + kpiList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + kpiList_ = null; + } + return kpiListBuilder_; + } + @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:monitoring.SubsResponse) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsResponse) + private static final monitoring.Monitoring.SubsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsResponse(); + } + + public static monitoring.Monitoring.SubsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsResponse(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 monitoring.Monitoring.SubsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubsIDListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.SubsIDList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + java.util.List + getSubsListList(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + monitoring.Monitoring.SubscriptionID getSubsList(int index); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + int getSubsListCount(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + java.util.List + getSubsListOrBuilderList(); + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.SubsIDList} + */ + public static final class SubsIDList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.SubsIDList) + SubsIDListOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsIDList.newBuilder() to construct. + private SubsIDList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubsIDList() { + subsList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubsIDList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubsIDList( + 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)) { + subsList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + subsList_.add( + input.readMessage(monitoring.Monitoring.SubscriptionID.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)) { + subsList_ = java.util.Collections.unmodifiableList(subsList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsIDList.class, monitoring.Monitoring.SubsIDList.Builder.class); + } + + public static final int SUBS_LIST_FIELD_NUMBER = 1; + private java.util.List subsList_; + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public java.util.List getSubsListList() { + return subsList_; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public java.util.List + getSubsListOrBuilderList() { + return subsList_; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public int getSubsListCount() { + return subsList_.size(); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionID getSubsList(int index) { + return subsList_.get(index); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index) { + return subsList_.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 < subsList_.size(); i++) { + output.writeMessage(1, subsList_.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 < subsList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, subsList_.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 monitoring.Monitoring.SubsIDList)) { + return super.equals(obj); + } + monitoring.Monitoring.SubsIDList other = (monitoring.Monitoring.SubsIDList) obj; + + if (!getSubsListList() + .equals(other.getSubsListList())) 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 (getSubsListCount() > 0) { + hash = (37 * hash) + SUBS_LIST_FIELD_NUMBER; + hash = (53 * hash) + getSubsListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.SubsIDList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.SubsIDList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.SubsIDList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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 monitoring.Monitoring.SubsIDList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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 monitoring.Monitoring.SubsIDList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.SubsIDList 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(monitoring.Monitoring.SubsIDList 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 monitoring.SubsIDList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.SubsIDList) + monitoring.Monitoring.SubsIDListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.SubsIDList.class, monitoring.Monitoring.SubsIDList.Builder.class); + } + + // Construct using monitoring.Monitoring.SubsIDList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSubsListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (subsListBuilder_ == null) { + subsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + subsListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_SubsIDList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList getDefaultInstanceForType() { + return monitoring.Monitoring.SubsIDList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList build() { + monitoring.Monitoring.SubsIDList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.SubsIDList buildPartial() { + monitoring.Monitoring.SubsIDList result = new monitoring.Monitoring.SubsIDList(this); + int from_bitField0_ = bitField0_; + if (subsListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + subsList_ = java.util.Collections.unmodifiableList(subsList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subsList_ = subsList_; + } else { + result.subsList_ = subsListBuilder_.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 monitoring.Monitoring.SubsIDList) { + return mergeFrom((monitoring.Monitoring.SubsIDList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.SubsIDList other) { + if (other == monitoring.Monitoring.SubsIDList.getDefaultInstance()) return this; + if (subsListBuilder_ == null) { + if (!other.subsList_.isEmpty()) { + if (subsList_.isEmpty()) { + subsList_ = other.subsList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubsListIsMutable(); + subsList_.addAll(other.subsList_); + } + onChanged(); + } + } else { + if (!other.subsList_.isEmpty()) { + if (subsListBuilder_.isEmpty()) { + subsListBuilder_.dispose(); + subsListBuilder_ = null; + subsList_ = other.subsList_; + bitField0_ = (bitField0_ & ~0x00000001); + subsListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSubsListFieldBuilder() : null; + } else { + subsListBuilder_.addAllMessages(other.subsList_); + } + } + } + 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 { + monitoring.Monitoring.SubsIDList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.SubsIDList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List subsList_ = + java.util.Collections.emptyList(); + private void ensureSubsListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + subsList_ = new java.util.ArrayList(subsList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> subsListBuilder_; + + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List getSubsListList() { + if (subsListBuilder_ == null) { + return java.util.Collections.unmodifiableList(subsList_); + } else { + return subsListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public int getSubsListCount() { + if (subsListBuilder_ == null) { + return subsList_.size(); + } else { + return subsListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID getSubsList(int index) { + if (subsListBuilder_ == null) { + return subsList_.get(index); + } else { + return subsListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder setSubsList( + int index, monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.set(index, value); + onChanged(); + } else { + subsListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder setSubsList( + int index, monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.set(index, builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList(monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.add(value); + onChanged(); + } else { + subsListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + int index, monitoring.Monitoring.SubscriptionID value) { + if (subsListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubsListIsMutable(); + subsList_.add(index, value); + onChanged(); + } else { + subsListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.add(builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addSubsList( + int index, monitoring.Monitoring.SubscriptionID.Builder builderForValue) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.add(index, builderForValue.build()); + onChanged(); + } else { + subsListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder addAllSubsList( + java.lang.Iterable values) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subsList_); + onChanged(); + } else { + subsListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder clearSubsList() { + if (subsListBuilder_ == null) { + subsList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subsListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public Builder removeSubsList(int index) { + if (subsListBuilder_ == null) { + ensureSubsListIsMutable(); + subsList_.remove(index); + onChanged(); + } else { + subsListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder getSubsListBuilder( + int index) { + return getSubsListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionIDOrBuilder getSubsListOrBuilder( + int index) { + if (subsListBuilder_ == null) { + return subsList_.get(index); } else { + return subsListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List + getSubsListOrBuilderList() { + if (subsListBuilder_ != null) { + return subsListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subsList_); + } + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder addSubsListBuilder() { + return getSubsListFieldBuilder().addBuilder( + monitoring.Monitoring.SubscriptionID.getDefaultInstance()); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public monitoring.Monitoring.SubscriptionID.Builder addSubsListBuilder( + int index) { + return getSubsListFieldBuilder().addBuilder( + index, monitoring.Monitoring.SubscriptionID.getDefaultInstance()); + } + /** + * repeated .monitoring.SubscriptionID subs_list = 1; + */ + public java.util.List + getSubsListBuilderList() { + return getSubsListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder> + getSubsListFieldBuilder() { + if (subsListBuilder_ == null) { + subsListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.SubscriptionID, monitoring.Monitoring.SubscriptionID.Builder, monitoring.Monitoring.SubscriptionIDOrBuilder>( + subsList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + subsList_ = null; + } + return subsListBuilder_; + } + @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:monitoring.SubsIDList) + } + + // @@protoc_insertion_point(class_scope:monitoring.SubsIDList) + private static final monitoring.Monitoring.SubsIDList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.SubsIDList(); + } + + public static monitoring.Monitoring.SubsIDList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubsIDList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubsIDList(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 monitoring.Monitoring.SubsIDList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmDescriptorOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmDescriptor) + com.google.protobuf.MessageOrBuilder { + + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + java.lang.String getAlarmDescription(); + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + com.google.protobuf.ByteString + getAlarmDescriptionBytes(); + + /** + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpi_id = 3; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + boolean hasKpiValueRange(); + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + monitoring.Monitoring.KpiValueRange getKpiValueRange(); + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder(); + + /** + * string timestamp = 5; + * @return The timestamp. + */ + java.lang.String getTimestamp(); + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + com.google.protobuf.ByteString + getTimestampBytes(); + } + /** + * Protobuf type {@code monitoring.AlarmDescriptor} + */ + public static final class AlarmDescriptor extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmDescriptor) + AlarmDescriptorOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmDescriptor.newBuilder() to construct. + private AlarmDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmDescriptor() { + alarmDescription_ = ""; + name_ = ""; + timestamp_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmDescriptor(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmDescriptor( + 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(); + + alarmDescription_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + monitoring.Monitoring.KpiValueRange.Builder subBuilder = null; + if (kpiValueRange_ != null) { + subBuilder = kpiValueRange_.toBuilder(); + } + kpiValueRange_ = input.readMessage(monitoring.Monitoring.KpiValueRange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValueRange_); + kpiValueRange_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + timestamp_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmDescriptor.class, monitoring.Monitoring.AlarmDescriptor.Builder.class); + } + + public static final int ALARM_DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object alarmDescription_; + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + @java.lang.Override + public java.lang.String getAlarmDescription() { + java.lang.Object ref = alarmDescription_; + 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(); + alarmDescription_ = s; + return s; + } + } + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAlarmDescriptionBytes() { + java.lang.Object ref = alarmDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alarmDescription_ = 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 KPI_ID_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int KPI_VALUE_RANGE_FIELD_NUMBER = 4; + private monitoring.Monitoring.KpiValueRange kpiValueRange_; + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + @java.lang.Override + public boolean hasKpiValueRange() { + return kpiValueRange_ != null; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueRange getKpiValueRange() { + return kpiValueRange_ == null ? monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder() { + return getKpiValueRange(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 5; + private volatile java.lang.Object timestamp_; + /** + * string timestamp = 5; + * @return The timestamp. + */ + @java.lang.Override + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + 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(); + timestamp_ = s; + return s; + } + } + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = 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 (!getAlarmDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, alarmDescription_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (kpiId_ != null) { + output.writeMessage(3, getKpiId()); + } + if (kpiValueRange_ != null) { + output.writeMessage(4, getKpiValueRange()); + } + if (!getTimestampBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, timestamp_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAlarmDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, alarmDescription_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiId()); + } + if (kpiValueRange_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getKpiValueRange()); + } + if (!getTimestampBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, timestamp_); + } + 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 monitoring.Monitoring.AlarmDescriptor)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmDescriptor other = (monitoring.Monitoring.AlarmDescriptor) obj; + + if (!getAlarmDescription() + .equals(other.getAlarmDescription())) return false; + if (!getName() + .equals(other.getName())) return false; + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (hasKpiValueRange() != other.hasKpiValueRange()) return false; + if (hasKpiValueRange()) { + if (!getKpiValueRange() + .equals(other.getKpiValueRange())) return false; + } + if (!getTimestamp() + .equals(other.getTimestamp())) 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) + ALARM_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getAlarmDescription().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasKpiId()) { + hash = (37 * hash) + KPI_ID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + if (hasKpiValueRange()) { + hash = (37 * hash) + KPI_VALUE_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValueRange().hashCode(); + } + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmDescriptor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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 monitoring.Monitoring.AlarmDescriptor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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 monitoring.Monitoring.AlarmDescriptor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmDescriptor 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(monitoring.Monitoring.AlarmDescriptor 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 monitoring.AlarmDescriptor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmDescriptor) + monitoring.Monitoring.AlarmDescriptorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmDescriptor.class, monitoring.Monitoring.AlarmDescriptor.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmDescriptor.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(); + alarmDescription_ = ""; + + name_ = ""; + + if (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = null; + } else { + kpiValueRange_ = null; + kpiValueRangeBuilder_ = null; + } + timestamp_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmDescriptor_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmDescriptor.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor build() { + monitoring.Monitoring.AlarmDescriptor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmDescriptor buildPartial() { + monitoring.Monitoring.AlarmDescriptor result = new monitoring.Monitoring.AlarmDescriptor(this); + result.alarmDescription_ = alarmDescription_; + result.name_ = name_; + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + if (kpiValueRangeBuilder_ == null) { + result.kpiValueRange_ = kpiValueRange_; + } else { + result.kpiValueRange_ = kpiValueRangeBuilder_.build(); + } + result.timestamp_ = timestamp_; + 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 monitoring.Monitoring.AlarmDescriptor) { + return mergeFrom((monitoring.Monitoring.AlarmDescriptor)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmDescriptor other) { + if (other == monitoring.Monitoring.AlarmDescriptor.getDefaultInstance()) return this; + if (!other.getAlarmDescription().isEmpty()) { + alarmDescription_ = other.alarmDescription_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.hasKpiValueRange()) { + mergeKpiValueRange(other.getKpiValueRange()); + } + if (!other.getTimestamp().isEmpty()) { + timestamp_ = other.timestamp_; + 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 { + monitoring.Monitoring.AlarmDescriptor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmDescriptor) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object alarmDescription_ = ""; + /** + * string alarm_description = 1; + * @return The alarmDescription. + */ + public java.lang.String getAlarmDescription() { + java.lang.Object ref = alarmDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alarmDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string alarm_description = 1; + * @return The bytes for alarmDescription. + */ + public com.google.protobuf.ByteString + getAlarmDescriptionBytes() { + java.lang.Object ref = alarmDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alarmDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string alarm_description = 1; + * @param value The alarmDescription to set. + * @return This builder for chaining. + */ + public Builder setAlarmDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + alarmDescription_ = value; + onChanged(); + return this; + } + /** + * string alarm_description = 1; + * @return This builder for chaining. + */ + public Builder clearAlarmDescription() { + + alarmDescription_ = getDefaultInstance().getAlarmDescription(); + onChanged(); + return this; + } + /** + * string alarm_description = 1; + * @param value The bytes for alarmDescription to set. + * @return This builder for chaining. + */ + public Builder setAlarmDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + alarmDescription_ = 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 monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpi_id = 3; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpi_id = 3; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpi_id = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private monitoring.Monitoring.KpiValueRange kpiValueRange_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder> kpiValueRangeBuilder_; + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return Whether the kpiValueRange field is set. + */ + public boolean hasKpiValueRange() { + return kpiValueRangeBuilder_ != null || kpiValueRange_ != null; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + * @return The kpiValueRange. + */ + public monitoring.Monitoring.KpiValueRange getKpiValueRange() { + if (kpiValueRangeBuilder_ == null) { + return kpiValueRange_ == null ? monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } else { + return kpiValueRangeBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder setKpiValueRange(monitoring.Monitoring.KpiValueRange value) { + if (kpiValueRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValueRange_ = value; + onChanged(); + } else { + kpiValueRangeBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder setKpiValueRange( + monitoring.Monitoring.KpiValueRange.Builder builderForValue) { + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = builderForValue.build(); + onChanged(); + } else { + kpiValueRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder mergeKpiValueRange(monitoring.Monitoring.KpiValueRange value) { + if (kpiValueRangeBuilder_ == null) { + if (kpiValueRange_ != null) { + kpiValueRange_ = + monitoring.Monitoring.KpiValueRange.newBuilder(kpiValueRange_).mergeFrom(value).buildPartial(); + } else { + kpiValueRange_ = value; + } + onChanged(); + } else { + kpiValueRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public Builder clearKpiValueRange() { + if (kpiValueRangeBuilder_ == null) { + kpiValueRange_ = null; + onChanged(); + } else { + kpiValueRange_ = null; + kpiValueRangeBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public monitoring.Monitoring.KpiValueRange.Builder getKpiValueRangeBuilder() { + + onChanged(); + return getKpiValueRangeFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + public monitoring.Monitoring.KpiValueRangeOrBuilder getKpiValueRangeOrBuilder() { + if (kpiValueRangeBuilder_ != null) { + return kpiValueRangeBuilder_.getMessageOrBuilder(); + } else { + return kpiValueRange_ == null ? + monitoring.Monitoring.KpiValueRange.getDefaultInstance() : kpiValueRange_; + } + } + /** + * .monitoring.KpiValueRange kpi_value_range = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder> + getKpiValueRangeFieldBuilder() { + if (kpiValueRangeBuilder_ == null) { + kpiValueRangeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValueRange, monitoring.Monitoring.KpiValueRange.Builder, monitoring.Monitoring.KpiValueRangeOrBuilder>( + getKpiValueRange(), + getParentForChildren(), + isClean()); + kpiValueRange_ = null; + } + return kpiValueRangeBuilder_; + } + + private java.lang.Object timestamp_ = ""; + /** + * string timestamp = 5; + * @return The timestamp. + */ + public java.lang.String getTimestamp() { + java.lang.Object ref = timestamp_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timestamp_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string timestamp = 5; + * @return The bytes for timestamp. + */ + public com.google.protobuf.ByteString + getTimestampBytes() { + java.lang.Object ref = timestamp_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + timestamp_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string timestamp = 5; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + timestamp_ = value; + onChanged(); + return this; + } + /** + * string timestamp = 5; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = getDefaultInstance().getTimestamp(); + onChanged(); + return this; + } + /** + * string timestamp = 5; + * @param value The bytes for timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestampBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + timestamp_ = 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:monitoring.AlarmDescriptor) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmDescriptor) + private static final monitoring.Monitoring.AlarmDescriptor DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmDescriptor(); + } + + public static monitoring.Monitoring.AlarmDescriptor getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmDescriptor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmDescriptor(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 monitoring.Monitoring.AlarmDescriptor getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmIDOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmID) + com.google.protobuf.MessageOrBuilder { + + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + boolean hasAlarmId(); + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + context.ContextOuterClass.Uuid getAlarmId(); + /** + * .context.Uuid alarm_id = 1; + */ + context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder(); + } + /** + * Protobuf type {@code monitoring.AlarmID} + */ + public static final class AlarmID extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmID) + AlarmIDOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmID.newBuilder() to construct. + private AlarmID(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmID() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmID(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmID( + 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: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (alarmId_ != null) { + subBuilder = alarmId_.toBuilder(); + } + alarmId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(alarmId_); + alarmId_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmID.class, monitoring.Monitoring.AlarmID.Builder.class); + } + + public static final int ALARM_ID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid alarmId_; + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + @java.lang.Override + public boolean hasAlarmId() { + return alarmId_ != null; + } + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + @java.lang.Override + public context.ContextOuterClass.Uuid getAlarmId() { + return alarmId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } + /** + * .context.Uuid alarm_id = 1; + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder() { + return getAlarmId(); + } + + 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 (alarmId_ != null) { + output.writeMessage(1, getAlarmId()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (alarmId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAlarmId()); + } + 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 monitoring.Monitoring.AlarmID)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmID other = (monitoring.Monitoring.AlarmID) obj; + + if (hasAlarmId() != other.hasAlarmId()) return false; + if (hasAlarmId()) { + if (!getAlarmId() + .equals(other.getAlarmId())) 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 (hasAlarmId()) { + hash = (37 * hash) + ALARM_ID_FIELD_NUMBER; + hash = (53 * hash) + getAlarmId().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmID parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmID parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmID parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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 monitoring.Monitoring.AlarmID parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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 monitoring.Monitoring.AlarmID parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmID 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(monitoring.Monitoring.AlarmID 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 monitoring.AlarmID} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmID) + monitoring.Monitoring.AlarmIDOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmID.class, monitoring.Monitoring.AlarmID.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmID.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 (alarmIdBuilder_ == null) { + alarmId_ = null; + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmID_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmID.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID build() { + monitoring.Monitoring.AlarmID result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmID buildPartial() { + monitoring.Monitoring.AlarmID result = new monitoring.Monitoring.AlarmID(this); + if (alarmIdBuilder_ == null) { + result.alarmId_ = alarmId_; + } else { + result.alarmId_ = alarmIdBuilder_.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 monitoring.Monitoring.AlarmID) { + return mergeFrom((monitoring.Monitoring.AlarmID)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmID other) { + if (other == monitoring.Monitoring.AlarmID.getDefaultInstance()) return this; + if (other.hasAlarmId()) { + mergeAlarmId(other.getAlarmId()); + } + 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 { + monitoring.Monitoring.AlarmID parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmID) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private context.ContextOuterClass.Uuid alarmId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> alarmIdBuilder_; + /** + * .context.Uuid alarm_id = 1; + * @return Whether the alarmId field is set. + */ + public boolean hasAlarmId() { + return alarmIdBuilder_ != null || alarmId_ != null; + } + /** + * .context.Uuid alarm_id = 1; + * @return The alarmId. + */ + public context.ContextOuterClass.Uuid getAlarmId() { + if (alarmIdBuilder_ == null) { + return alarmId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } else { + return alarmIdBuilder_.getMessage(); + } + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder setAlarmId(context.ContextOuterClass.Uuid value) { + if (alarmIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + alarmId_ = value; + onChanged(); + } else { + alarmIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder setAlarmId( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (alarmIdBuilder_ == null) { + alarmId_ = builderForValue.build(); + onChanged(); + } else { + alarmIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder mergeAlarmId(context.ContextOuterClass.Uuid value) { + if (alarmIdBuilder_ == null) { + if (alarmId_ != null) { + alarmId_ = + context.ContextOuterClass.Uuid.newBuilder(alarmId_).mergeFrom(value).buildPartial(); + } else { + alarmId_ = value; + } + onChanged(); + } else { + alarmIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public Builder clearAlarmId() { + if (alarmIdBuilder_ == null) { + alarmId_ = null; + onChanged(); + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + + return this; + } + /** + * .context.Uuid alarm_id = 1; + */ + public context.ContextOuterClass.Uuid.Builder getAlarmIdBuilder() { + + onChanged(); + return getAlarmIdFieldBuilder().getBuilder(); + } + /** + * .context.Uuid alarm_id = 1; + */ + public context.ContextOuterClass.UuidOrBuilder getAlarmIdOrBuilder() { + if (alarmIdBuilder_ != null) { + return alarmIdBuilder_.getMessageOrBuilder(); + } else { + return alarmId_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : alarmId_; + } + } + /** + * .context.Uuid alarm_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getAlarmIdFieldBuilder() { + if (alarmIdBuilder_ == null) { + alarmIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getAlarmId(), + getParentForChildren(), + isClean()); + alarmId_ = null; + } + return alarmIdBuilder_; + } + @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:monitoring.AlarmID) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmID) + private static final monitoring.Monitoring.AlarmID DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmID(); + } + + public static monitoring.Monitoring.AlarmID getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmID parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmID(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 monitoring.Monitoring.AlarmID getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + boolean hasAlarmId(); + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + monitoring.Monitoring.AlarmID getAlarmId(); + /** + * .monitoring.AlarmID alarm_id = 1; + */ + monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder(); + + /** + * string text = 2; + * @return The text. + */ + java.lang.String getText(); + /** + * string text = 2; + * @return The bytes for text. + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * .monitoring.KpiValue kpi_value = 3; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + * Protobuf type {@code monitoring.AlarmResponse} + */ + public static final class AlarmResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmResponse) + AlarmResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmResponse.newBuilder() to construct. + private AlarmResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmResponse() { + text_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmResponse( + 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: { + monitoring.Monitoring.AlarmID.Builder subBuilder = null; + if (alarmId_ != null) { + subBuilder = alarmId_.toBuilder(); + } + alarmId_ = input.readMessage(monitoring.Monitoring.AlarmID.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(alarmId_); + alarmId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + text_ = s; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = 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 monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmResponse.class, monitoring.Monitoring.AlarmResponse.Builder.class); + } + + public static final int ALARM_ID_FIELD_NUMBER = 1; + private monitoring.Monitoring.AlarmID alarmId_; + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + @java.lang.Override + public boolean hasAlarmId() { + return alarmId_ != null; + } + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + @java.lang.Override + public monitoring.Monitoring.AlarmID getAlarmId() { + return alarmId_ == null ? monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder() { + return getAlarmId(); + } + + public static final int TEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object text_; + /** + * string text = 2; + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + * string text = 2; + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KPI_VALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + 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 (alarmId_ != null) { + output.writeMessage(1, getAlarmId()); + } + if (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (alarmId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAlarmId()); + } + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + 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 monitoring.Monitoring.AlarmResponse)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmResponse other = (monitoring.Monitoring.AlarmResponse) obj; + + if (hasAlarmId() != other.hasAlarmId()) return false; + if (hasAlarmId()) { + if (!getAlarmId() + .equals(other.getAlarmId())) return false; + } + if (!getText() + .equals(other.getText())) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) 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 (hasAlarmId()) { + hash = (37 * hash) + ALARM_ID_FIELD_NUMBER; + hash = (53 * hash) + getAlarmId().hashCode(); + } + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + if (hasKpiValue()) { + hash = (37 * hash) + KPI_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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 monitoring.Monitoring.AlarmResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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 monitoring.Monitoring.AlarmResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmResponse 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(monitoring.Monitoring.AlarmResponse 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 monitoring.AlarmResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmResponse) + monitoring.Monitoring.AlarmResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmResponse.class, monitoring.Monitoring.AlarmResponse.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmResponse.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 (alarmIdBuilder_ == null) { + alarmId_ = null; + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + text_ = ""; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmResponse_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmResponse.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse build() { + monitoring.Monitoring.AlarmResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmResponse buildPartial() { + monitoring.Monitoring.AlarmResponse result = new monitoring.Monitoring.AlarmResponse(this); + if (alarmIdBuilder_ == null) { + result.alarmId_ = alarmId_; + } else { + result.alarmId_ = alarmIdBuilder_.build(); + } + result.text_ = text_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.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 monitoring.Monitoring.AlarmResponse) { + return mergeFrom((monitoring.Monitoring.AlarmResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmResponse other) { + if (other == monitoring.Monitoring.AlarmResponse.getDefaultInstance()) return this; + if (other.hasAlarmId()) { + mergeAlarmId(other.getAlarmId()); + } + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + 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 { + monitoring.Monitoring.AlarmResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.AlarmID alarmId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> alarmIdBuilder_; + /** + * .monitoring.AlarmID alarm_id = 1; + * @return Whether the alarmId field is set. + */ + public boolean hasAlarmId() { + return alarmIdBuilder_ != null || alarmId_ != null; + } + /** + * .monitoring.AlarmID alarm_id = 1; + * @return The alarmId. + */ + public monitoring.Monitoring.AlarmID getAlarmId() { + if (alarmIdBuilder_ == null) { + return alarmId_ == null ? monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } else { + return alarmIdBuilder_.getMessage(); + } + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder setAlarmId(monitoring.Monitoring.AlarmID value) { + if (alarmIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + alarmId_ = value; + onChanged(); + } else { + alarmIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder setAlarmId( + monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmIdBuilder_ == null) { + alarmId_ = builderForValue.build(); + onChanged(); + } else { + alarmIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder mergeAlarmId(monitoring.Monitoring.AlarmID value) { + if (alarmIdBuilder_ == null) { + if (alarmId_ != null) { + alarmId_ = + monitoring.Monitoring.AlarmID.newBuilder(alarmId_).mergeFrom(value).buildPartial(); + } else { + alarmId_ = value; + } + onChanged(); + } else { + alarmIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public Builder clearAlarmId() { + if (alarmIdBuilder_ == null) { + alarmId_ = null; + onChanged(); + } else { + alarmId_ = null; + alarmIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public monitoring.Monitoring.AlarmID.Builder getAlarmIdBuilder() { + + onChanged(); + return getAlarmIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmIdOrBuilder() { + if (alarmIdBuilder_ != null) { + return alarmIdBuilder_.getMessageOrBuilder(); + } else { + return alarmId_ == null ? + monitoring.Monitoring.AlarmID.getDefaultInstance() : alarmId_; + } + } + /** + * .monitoring.AlarmID alarm_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> + getAlarmIdFieldBuilder() { + if (alarmIdBuilder_ == null) { + alarmIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder>( + getAlarmId(), + getParentForChildren(), + isClean()); + alarmId_ = null; + } + return alarmIdBuilder_; + } + + private java.lang.Object text_ = ""; + /** + * string text = 2; + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string text = 2; + * @return The bytes for text. + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string text = 2; + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + * string text = 2; + * @return This builder for chaining. + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + * string text = 2; + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * .monitoring.KpiValue kpi_value = 3; + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpi_value = 3; + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * .monitoring.KpiValue kpi_value = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @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:monitoring.AlarmResponse) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmResponse) + private static final monitoring.Monitoring.AlarmResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmResponse(); + } + + public static monitoring.Monitoring.AlarmResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmResponse(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 monitoring.Monitoring.AlarmResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface AlarmIDListOrBuilder extends + // @@protoc_insertion_point(interface_extends:monitoring.AlarmIDList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + java.util.List + getAlarmListList(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + monitoring.Monitoring.AlarmID getAlarmList(int index); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + int getAlarmListCount(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + java.util.List + getAlarmListOrBuilderList(); + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index); + } + /** + * Protobuf type {@code monitoring.AlarmIDList} + */ + public static final class AlarmIDList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:monitoring.AlarmIDList) + AlarmIDListOrBuilder { + private static final long serialVersionUID = 0L; + // Use AlarmIDList.newBuilder() to construct. + private AlarmIDList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AlarmIDList() { + alarmList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new AlarmIDList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AlarmIDList( + 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)) { + alarmList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alarmList_.add( + input.readMessage(monitoring.Monitoring.AlarmID.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)) { + alarmList_ = java.util.Collections.unmodifiableList(alarmList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmIDList.class, monitoring.Monitoring.AlarmIDList.Builder.class); + } + + public static final int ALARM_LIST_FIELD_NUMBER = 1; + private java.util.List alarmList_; + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public java.util.List getAlarmListList() { + return alarmList_; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public java.util.List + getAlarmListOrBuilderList() { + return alarmList_; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public int getAlarmListCount() { + return alarmList_.size(); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmID getAlarmList(int index) { + return alarmList_.get(index); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + @java.lang.Override + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index) { + return alarmList_.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 < alarmList_.size(); i++) { + output.writeMessage(1, alarmList_.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 < alarmList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alarmList_.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 monitoring.Monitoring.AlarmIDList)) { + return super.equals(obj); + } + monitoring.Monitoring.AlarmIDList other = (monitoring.Monitoring.AlarmIDList) obj; + + if (!getAlarmListList() + .equals(other.getAlarmListList())) 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 (getAlarmListCount() > 0) { + hash = (37 * hash) + ALARM_LIST_FIELD_NUMBER; + hash = (53 * hash) + getAlarmListList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static monitoring.Monitoring.AlarmIDList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static monitoring.Monitoring.AlarmIDList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static monitoring.Monitoring.AlarmIDList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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 monitoring.Monitoring.AlarmIDList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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 monitoring.Monitoring.AlarmIDList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static monitoring.Monitoring.AlarmIDList 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(monitoring.Monitoring.AlarmIDList 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 monitoring.AlarmIDList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:monitoring.AlarmIDList) + monitoring.Monitoring.AlarmIDListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + monitoring.Monitoring.AlarmIDList.class, monitoring.Monitoring.AlarmIDList.Builder.class); + } + + // Construct using monitoring.Monitoring.AlarmIDList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlarmListFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alarmListBuilder_ == null) { + alarmList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alarmListBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return monitoring.Monitoring.internal_static_monitoring_AlarmIDList_descriptor; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList getDefaultInstanceForType() { + return monitoring.Monitoring.AlarmIDList.getDefaultInstance(); + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList build() { + monitoring.Monitoring.AlarmIDList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public monitoring.Monitoring.AlarmIDList buildPartial() { + monitoring.Monitoring.AlarmIDList result = new monitoring.Monitoring.AlarmIDList(this); + int from_bitField0_ = bitField0_; + if (alarmListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alarmList_ = java.util.Collections.unmodifiableList(alarmList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alarmList_ = alarmList_; + } else { + result.alarmList_ = alarmListBuilder_.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 monitoring.Monitoring.AlarmIDList) { + return mergeFrom((monitoring.Monitoring.AlarmIDList)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(monitoring.Monitoring.AlarmIDList other) { + if (other == monitoring.Monitoring.AlarmIDList.getDefaultInstance()) return this; + if (alarmListBuilder_ == null) { + if (!other.alarmList_.isEmpty()) { + if (alarmList_.isEmpty()) { + alarmList_ = other.alarmList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlarmListIsMutable(); + alarmList_.addAll(other.alarmList_); + } + onChanged(); + } + } else { + if (!other.alarmList_.isEmpty()) { + if (alarmListBuilder_.isEmpty()) { + alarmListBuilder_.dispose(); + alarmListBuilder_ = null; + alarmList_ = other.alarmList_; + bitField0_ = (bitField0_ & ~0x00000001); + alarmListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlarmListFieldBuilder() : null; + } else { + alarmListBuilder_.addAllMessages(other.alarmList_); + } + } + } + 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 { + monitoring.Monitoring.AlarmIDList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (monitoring.Monitoring.AlarmIDList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alarmList_ = + java.util.Collections.emptyList(); + private void ensureAlarmListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alarmList_ = new java.util.ArrayList(alarmList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> alarmListBuilder_; + + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List getAlarmListList() { + if (alarmListBuilder_ == null) { + return java.util.Collections.unmodifiableList(alarmList_); + } else { + return alarmListBuilder_.getMessageList(); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public int getAlarmListCount() { + if (alarmListBuilder_ == null) { + return alarmList_.size(); + } else { + return alarmListBuilder_.getCount(); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID getAlarmList(int index) { + if (alarmListBuilder_ == null) { + return alarmList_.get(index); + } else { + return alarmListBuilder_.getMessage(index); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder setAlarmList( + int index, monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.set(index, value); + onChanged(); + } else { + alarmListBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder setAlarmList( + int index, monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.set(index, builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList(monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.add(value); + onChanged(); + } else { + alarmListBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + int index, monitoring.Monitoring.AlarmID value) { + if (alarmListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlarmListIsMutable(); + alarmList_.add(index, value); + onChanged(); + } else { + alarmListBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.add(builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAlarmList( + int index, monitoring.Monitoring.AlarmID.Builder builderForValue) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.add(index, builderForValue.build()); + onChanged(); + } else { + alarmListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder addAllAlarmList( + java.lang.Iterable values) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alarmList_); + onChanged(); + } else { + alarmListBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder clearAlarmList() { + if (alarmListBuilder_ == null) { + alarmList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alarmListBuilder_.clear(); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public Builder removeAlarmList(int index) { + if (alarmListBuilder_ == null) { + ensureAlarmListIsMutable(); + alarmList_.remove(index); + onChanged(); + } else { + alarmListBuilder_.remove(index); + } + return this; + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder getAlarmListBuilder( + int index) { + return getAlarmListFieldBuilder().getBuilder(index); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmIDOrBuilder getAlarmListOrBuilder( + int index) { + if (alarmListBuilder_ == null) { + return alarmList_.get(index); } else { + return alarmListBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List + getAlarmListOrBuilderList() { + if (alarmListBuilder_ != null) { + return alarmListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alarmList_); + } + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder addAlarmListBuilder() { + return getAlarmListFieldBuilder().addBuilder( + monitoring.Monitoring.AlarmID.getDefaultInstance()); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public monitoring.Monitoring.AlarmID.Builder addAlarmListBuilder( + int index) { + return getAlarmListFieldBuilder().addBuilder( + index, monitoring.Monitoring.AlarmID.getDefaultInstance()); + } + /** + * repeated .monitoring.AlarmID alarm_list = 1; + */ + public java.util.List + getAlarmListBuilderList() { + return getAlarmListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder> + getAlarmListFieldBuilder() { + if (alarmListBuilder_ == null) { + alarmListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + monitoring.Monitoring.AlarmID, monitoring.Monitoring.AlarmID.Builder, monitoring.Monitoring.AlarmIDOrBuilder>( + alarmList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alarmList_ = null; + } + return alarmListBuilder_; + } + @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:monitoring.AlarmIDList) + } + + // @@protoc_insertion_point(class_scope:monitoring.AlarmIDList) + private static final monitoring.Monitoring.AlarmIDList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new monitoring.Monitoring.AlarmIDList(); + } + + public static monitoring.Monitoring.AlarmIDList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AlarmIDList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AlarmIDList(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 monitoring.Monitoring.AlarmIDList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_BundleKpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_EditedKpiDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_MonitorKpiRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiQuery_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiQuery_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiId_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiId_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_Kpi_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_Kpi_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiValueRange_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiValueRange_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiValue_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_KpiDescriptorList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_KpiDescriptorList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubscriptionID_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubscriptionID_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_SubsIDList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_SubsIDList_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmDescriptor_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmDescriptor_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmID_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmID_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_monitoring_AlarmIDList_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_monitoring_AlarmIDList_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\020monitoring.proto\022\nmonitoring\032\rcontext." + + "proto\032\026kpi_sample_types.proto\"\376\001\n\rKpiDes" + + "criptor\022\027\n\017kpi_description\030\001 \001(\t\0228\n\017kpi_" + + "sample_type\030\002 \001(\0162\037.kpi_sample_types.Kpi" + + "SampleType\022$\n\tdevice_id\030\003 \001(\0132\021.context." + + "DeviceId\022(\n\013endpoint_id\030\004 \001(\0132\023.context." + + "EndPointId\022&\n\nservice_id\030\005 \001(\0132\022.context" + + ".ServiceId\022\"\n\010slice_id\030\006 \001(\0132\020.context.S" + + "liceId\"\254\002\n\023BundleKpiDescriptor\022\027\n\017kpi_de" + + "scription\030\001 \001(\t\022&\n\013kpi_id_list\030\002 \003(\0132\021.m" + + "onitoring.KpiId\0228\n\017kpi_sample_type\030\003 \001(\016" + + "2\037.kpi_sample_types.KpiSampleType\022$\n\tdev" + + "ice_id\030\004 \001(\0132\021.context.DeviceId\022(\n\013endpo" + + "int_id\030\005 \001(\0132\023.context.EndPointId\022&\n\nser" + + "vice_id\030\006 \001(\0132\022.context.ServiceId\022\"\n\010sli" + + "ce_id\030\007 \001(\0132\020.context.SliceId\"\317\002\n\023Edited" + + "KpiDescriptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitori" + + "ng.KpiId\022\027\n\017kpi_description\030\002 \001(\t\022&\n\013kpi" + + "_id_list\030\003 \003(\0132\021.monitoring.KpiId\0228\n\017kpi" + + "_sample_type\030\004 \001(\0162\037.kpi_sample_types.Kp" + + "iSampleType\022$\n\tdevice_id\030\005 \001(\0132\021.context" + + ".DeviceId\022(\n\013endpoint_id\030\006 \001(\0132\023.context" + + ".EndPointId\022&\n\nservice_id\030\007 \001(\0132\022.contex" + + "t.ServiceId\022\"\n\010slice_id\030\010 \001(\0132\020.context." + + "SliceId\"l\n\021MonitorKpiRequest\022!\n\006kpi_id\030\001" + + " \001(\0132\021.monitoring.KpiId\022\033\n\023monitoring_wi" + + "ndow_s\030\002 \001(\002\022\027\n\017sampling_rate_s\030\003 \001(\002\"\241\001" + + "\n\010KpiQuery\022!\n\006kpi_id\030\001 \003(\0132\021.monitoring." + + "KpiId\022\033\n\023monitoring_window_s\030\002 \001(\002\022\027\n\017sa" + + "mpling_rate_s\030\003 \001(\002\022\026\n\016last_n_samples\030\004 " + + "\001(\r\022\022\n\nstart_date\030\005 \001(\t\022\020\n\010end_date\030\006 \001(" + + "\t\"&\n\005KpiId\022\035\n\006kpi_id\030\001 \001(\0132\r.context.Uui" + + "d\"d\n\003Kpi\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kp" + + "iId\022\021\n\ttimestamp\030\002 \001(\t\022\'\n\tkpi_value\030\003 \001(" + + "\0132\024.monitoring.KpiValue\"e\n\rKpiValueRange" + + "\022)\n\013kpiMinValue\030\001 \001(\0132\024.monitoring.KpiVa" + + "lue\022)\n\013kpiMaxValue\030\002 \001(\0132\024.monitoring.Kp" + + "iValue\"a\n\010KpiValue\022\020\n\006intVal\030\001 \001(\rH\000\022\022\n\010" + + "floatVal\030\002 \001(\002H\000\022\023\n\tstringVal\030\003 \001(\tH\000\022\021\n" + + "\007boolVal\030\004 \001(\010H\000B\007\n\005value\",\n\007KpiList\022!\n\010" + + "kpi_list\030\001 \003(\0132\017.monitoring.Kpi\"K\n\021KpiDe" + + "scriptorList\0226\n\023kpi_descriptor_list\030\001 \003(" + + "\0132\031.monitoring.KpiDescriptor\"\223\001\n\016SubsDes" + + "criptor\022!\n\006kpi_id\030\001 \001(\0132\021.monitoring.Kpi" + + "Id\022\033\n\023sampling_duration_s\030\002 \001(\002\022\033\n\023sampl" + + "ing_interval_s\030\003 \001(\002\022\022\n\nstart_date\030\004 \001(\t" + + "\022\020\n\010end_date\030\005 \001(\t\"0\n\016SubscriptionID\022\036\n\007" + + "subs_id\030\001 \001(\0132\r.context.Uuid\"b\n\014SubsResp" + + "onse\022+\n\007subs_id\030\001 \001(\0132\032.monitoring.Subsc" + + "riptionID\022%\n\010kpi_list\030\002 \003(\0132\023.monitoring" + + ".KpiList\";\n\nSubsIDList\022-\n\tsubs_list\030\001 \003(" + + "\0132\032.monitoring.SubscriptionID\"\244\001\n\017AlarmD" + + "escriptor\022\031\n\021alarm_description\030\001 \001(\t\022\014\n\004" + + "name\030\002 \001(\t\022!\n\006kpi_id\030\003 \001(\0132\021.monitoring." + + "KpiId\0222\n\017kpi_value_range\030\004 \001(\0132\031.monitor" + + "ing.KpiValueRange\022\021\n\ttimestamp\030\005 \001(\t\"*\n\007" + + "AlarmID\022\037\n\010alarm_id\030\001 \001(\0132\r.context.Uuid" + + "\"m\n\rAlarmResponse\022%\n\010alarm_id\030\001 \001(\0132\023.mo" + + "nitoring.AlarmID\022\014\n\004text\030\002 \001(\t\022\'\n\tkpi_va" + + "lue\030\003 \001(\0132\024.monitoring.KpiValue\"6\n\013Alarm" + + "IDList\022\'\n\nalarm_list\030\001 \003(\0132\023.monitoring." + + "AlarmID2\271\t\n\021MonitoringService\022;\n\tCreateK" + + "pi\022\031.monitoring.KpiDescriptor\032\021.monitori" + + "ng.KpiId\"\000\022F\n\021EditKpiDescriptor\022\037.monito" + + "ring.EditedKpiDescriptor\032\016.context.Empty" + + "\"\000\0220\n\tDeleteKpi\022\021.monitoring.KpiId\032\016.con" + + "text.Empty\"\000\022G\n\024GetKpiDescriptorList\022\016.c" + + "ontext.Empty\032\035.monitoring.KpiDescriptorL" + + "ist\"\000\022G\n\017CreateBundleKpi\022\037.monitoring.Bu" + + "ndleKpiDescriptor\032\021.monitoring.KpiId\"\000\022B" + + "\n\020GetKpiDescriptor\022\021.monitoring.KpiId\032\031." + + "monitoring.KpiDescriptor\"\000\022/\n\nIncludeKpi" + + "\022\017.monitoring.Kpi\032\016.context.Empty\"\000\022=\n\nM" + + "onitorKpi\022\035.monitoring.MonitorKpiRequest" + + "\032\016.context.Empty\"\000\022;\n\014QueryKpiData\022\024.mon" + + "itoring.KpiQuery\032\023.monitoring.KpiList\"\000\022" + + "C\n\014SubscribeKpi\022\032.monitoring.SubsDescrip" + + "tor\032\023.monitoring.KpiList\"\0000\001\022M\n\021GetSubsD" + + "escriptor\022\032.monitoring.SubscriptionID\032\032." + + "monitoring.SubsDescriptor\"\000\022<\n\020GetSubscr" + + "iptions\022\016.context.Empty\032\026.monitoring.Sub" + + "sIDList\"\000\022C\n\023EditKpiSubscription\022\032.monit" + + "oring.SubsDescriptor\032\016.context.Empty\"\000\022D" + + "\n\016CreateKpiAlarm\022\033.monitoring.AlarmDescr" + + "iptor\032\023.monitoring.AlarmID\"\000\022=\n\014EditKpiA" + + "larm\022\033.monitoring.AlarmDescriptor\032\016.cont" + + "ext.Empty\"\000\0226\n\tGetAlarms\022\016.context.Empty" + + "\032\027.monitoring.AlarmIDList\"\000\022H\n\022GetAlarmD" + + "escriptor\022\023.monitoring.AlarmID\032\033.monitor" + + "ing.AlarmDescriptor\"\000\022L\n\026GetAlarmRespons" + + "eStream\022\023.monitoring.AlarmID\032\031.monitorin" + + "g.AlarmResponse\"\0000\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + kpi_sample_types.KpiSampleTypes.getDescriptor(), + }); + internal_static_monitoring_KpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_monitoring_KpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiDescriptor_descriptor, + new java.lang.String[] { "KpiDescription", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_BundleKpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_monitoring_BundleKpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_BundleKpiDescriptor_descriptor, + new java.lang.String[] { "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_EditedKpiDescriptor_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_monitoring_EditedKpiDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_EditedKpiDescriptor_descriptor, + new java.lang.String[] { "KpiId", "KpiDescription", "KpiIdList", "KpiSampleType", "DeviceId", "EndpointId", "ServiceId", "SliceId", }); + internal_static_monitoring_MonitorKpiRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_monitoring_MonitorKpiRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_MonitorKpiRequest_descriptor, + new java.lang.String[] { "KpiId", "MonitoringWindowS", "SamplingRateS", }); + internal_static_monitoring_KpiQuery_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_monitoring_KpiQuery_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiQuery_descriptor, + new java.lang.String[] { "KpiId", "MonitoringWindowS", "SamplingRateS", "LastNSamples", "StartDate", "EndDate", }); + internal_static_monitoring_KpiId_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_monitoring_KpiId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiId_descriptor, + new java.lang.String[] { "KpiId", }); + internal_static_monitoring_Kpi_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_monitoring_Kpi_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_Kpi_descriptor, + new java.lang.String[] { "KpiId", "Timestamp", "KpiValue", }); + internal_static_monitoring_KpiValueRange_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_monitoring_KpiValueRange_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiValueRange_descriptor, + new java.lang.String[] { "KpiMinValue", "KpiMaxValue", }); + internal_static_monitoring_KpiValue_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_monitoring_KpiValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiValue_descriptor, + new java.lang.String[] { "IntVal", "FloatVal", "StringVal", "BoolVal", "Value", }); + internal_static_monitoring_KpiList_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_monitoring_KpiList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiList_descriptor, + new java.lang.String[] { "KpiList", }); + internal_static_monitoring_KpiDescriptorList_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_monitoring_KpiDescriptorList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_KpiDescriptorList_descriptor, + new java.lang.String[] { "KpiDescriptorList", }); + internal_static_monitoring_SubsDescriptor_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_monitoring_SubsDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsDescriptor_descriptor, + new java.lang.String[] { "KpiId", "SamplingDurationS", "SamplingIntervalS", "StartDate", "EndDate", }); + internal_static_monitoring_SubscriptionID_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_monitoring_SubscriptionID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubscriptionID_descriptor, + new java.lang.String[] { "SubsId", }); + internal_static_monitoring_SubsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_monitoring_SubsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsResponse_descriptor, + new java.lang.String[] { "SubsId", "KpiList", }); + internal_static_monitoring_SubsIDList_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_monitoring_SubsIDList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_SubsIDList_descriptor, + new java.lang.String[] { "SubsList", }); + internal_static_monitoring_AlarmDescriptor_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_monitoring_AlarmDescriptor_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmDescriptor_descriptor, + new java.lang.String[] { "AlarmDescription", "Name", "KpiId", "KpiValueRange", "Timestamp", }); + internal_static_monitoring_AlarmID_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_monitoring_AlarmID_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmID_descriptor, + new java.lang.String[] { "AlarmId", }); + internal_static_monitoring_AlarmResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_monitoring_AlarmResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmResponse_descriptor, + new java.lang.String[] { "AlarmId", "Text", "KpiValue", }); + internal_static_monitoring_AlarmIDList_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_monitoring_AlarmIDList_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_monitoring_AlarmIDList_descriptor, + new java.lang.String[] { "AlarmList", }); + context.ContextOuterClass.getDescriptor(); + kpi_sample_types.KpiSampleTypes.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java new file mode 100644 index 0000000000000000000000000000000000000000..f826e1167d1ed56567fc470ba70cc09003617eda --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringService.java @@ -0,0 +1,50 @@ +package monitoring; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public interface MonitoringService extends MutinyService { + + + io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request); + + io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request); + + io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request); + + io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request); + + io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request); + + io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request); + + io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request); + + io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request); + + io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request); + + io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request); + + io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request); + + io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request); + + io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request); + + io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request); + + + io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request); + + io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request); + + + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..c7f776e7bd0c56cabc7009e7b7bdb208669fb441 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java @@ -0,0 +1,165 @@ +package monitoring; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceBean extends MutinyMonitoringServiceGrpc.MonitoringServiceImplBase implements BindableService, MutinyBean { + + private final MonitoringService delegate; + + MonitoringServiceBean(@GrpcService MonitoringService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + try { + return delegate.createKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + try { + return delegate.editKpiDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + try { + return delegate.deleteKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + try { + return delegate.getKpiDescriptorList(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + try { + return delegate.createBundleKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + try { + return delegate.getKpiDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + try { + return delegate.includeKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + try { + return delegate.monitorKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + try { + return delegate.queryKpiData(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + try { + return delegate.getSubsDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + try { + return delegate.getSubscriptions(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + try { + return delegate.editKpiSubscription(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + try { + return delegate.createKpiAlarm(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + try { + return delegate.editKpiAlarm(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + try { + return delegate.getAlarms(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + try { + return delegate.getAlarmDescriptor(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + try { + return delegate.subscribeKpi(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + try { + return delegate.getAlarmResponseStream(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..35c98e8ff2c240e749e602c4d097c3bef81c8203 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java @@ -0,0 +1,98 @@ +package monitoring; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public class MonitoringServiceClient implements MonitoringService, MutinyClient { + + private final MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub stub; + + public MonitoringServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyMonitoringServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyMonitoringServiceGrpc.MutinyMonitoringServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + return stub.createKpi(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return stub.editKpiDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + return stub.deleteKpi(request); + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return stub.getKpiDescriptorList(request); + } + @Override + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return stub.createBundleKpi(request); + } + @Override + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return stub.getKpiDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + return stub.includeKpi(request); + } + @Override + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return stub.monitorKpi(request); + } + @Override + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + return stub.queryKpiData(request); + } + @Override + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return stub.getSubsDescriptor(request); + } + @Override + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + return stub.getSubscriptions(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return stub.editKpiSubscription(request); + } + @Override + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return stub.createKpiAlarm(request); + } + @Override + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return stub.editKpiAlarm(request); + } + @Override + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + return stub.getAlarms(request); + } + @Override + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return stub.getAlarmDescriptor(request); + } + + @Override + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + return stub.subscribeKpi(request); + } + + @Override + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + return stub.getAlarmResponseStream(request); + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..d4ae3510a2f622b195854e4c7d197b8e3ff4d5fd --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java @@ -0,0 +1,1519 @@ +package monitoring; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: monitoring.proto") +public final class MonitoringServiceGrpc { + + private MonitoringServiceGrpc() {} + + public static final String SERVICE_NAME = "monitoring.MonitoringService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateKpi", + requestType = monitoring.Monitoring.KpiDescriptor.class, + responseType = monitoring.Monitoring.KpiId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateKpiMethod() { + io.grpc.MethodDescriptor getCreateKpiMethod; + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateKpiMethod = MonitoringServiceGrpc.getCreateKpiMethod) == null) { + MonitoringServiceGrpc.getCreateKpiMethod = getCreateKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateKpi")) + .build(); + } + } + } + return getCreateKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiDescriptor", + requestType = monitoring.Monitoring.EditedKpiDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiDescriptorMethod() { + io.grpc.MethodDescriptor getEditKpiDescriptorMethod; + if ((getEditKpiDescriptorMethod = MonitoringServiceGrpc.getEditKpiDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiDescriptorMethod = MonitoringServiceGrpc.getEditKpiDescriptorMethod) == null) { + MonitoringServiceGrpc.getEditKpiDescriptorMethod = getEditKpiDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.EditedKpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiDescriptor")) + .build(); + } + } + } + return getEditKpiDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteKpi", + requestType = monitoring.Monitoring.KpiId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteKpiMethod() { + io.grpc.MethodDescriptor getDeleteKpiMethod; + if ((getDeleteKpiMethod = MonitoringServiceGrpc.getDeleteKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getDeleteKpiMethod = MonitoringServiceGrpc.getDeleteKpiMethod) == null) { + MonitoringServiceGrpc.getDeleteKpiMethod = getDeleteKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("DeleteKpi")) + .build(); + } + } + } + return getDeleteKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetKpiDescriptorListMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetKpiDescriptorList", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.KpiDescriptorList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetKpiDescriptorListMethod() { + io.grpc.MethodDescriptor getGetKpiDescriptorListMethod; + if ((getGetKpiDescriptorListMethod = MonitoringServiceGrpc.getGetKpiDescriptorListMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetKpiDescriptorListMethod = MonitoringServiceGrpc.getGetKpiDescriptorListMethod) == null) { + MonitoringServiceGrpc.getGetKpiDescriptorListMethod = getGetKpiDescriptorListMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetKpiDescriptorList")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptorList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetKpiDescriptorList")) + .build(); + } + } + } + return getGetKpiDescriptorListMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateBundleKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBundleKpi", + requestType = monitoring.Monitoring.BundleKpiDescriptor.class, + responseType = monitoring.Monitoring.KpiId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateBundleKpiMethod() { + io.grpc.MethodDescriptor getCreateBundleKpiMethod; + if ((getCreateBundleKpiMethod = MonitoringServiceGrpc.getCreateBundleKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateBundleKpiMethod = MonitoringServiceGrpc.getCreateBundleKpiMethod) == null) { + MonitoringServiceGrpc.getCreateBundleKpiMethod = getCreateBundleKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBundleKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.BundleKpiDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateBundleKpi")) + .build(); + } + } + } + return getCreateBundleKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetKpiDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetKpiDescriptor", + requestType = monitoring.Monitoring.KpiId.class, + responseType = monitoring.Monitoring.KpiDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetKpiDescriptorMethod() { + io.grpc.MethodDescriptor getGetKpiDescriptorMethod; + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetKpiDescriptorMethod = MonitoringServiceGrpc.getGetKpiDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetKpiDescriptorMethod = getGetKpiDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetKpiDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetKpiDescriptor")) + .build(); + } + } + } + return getGetKpiDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getIncludeKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "IncludeKpi", + requestType = monitoring.Monitoring.Kpi.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getIncludeKpiMethod() { + io.grpc.MethodDescriptor getIncludeKpiMethod; + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getIncludeKpiMethod = MonitoringServiceGrpc.getIncludeKpiMethod) == null) { + MonitoringServiceGrpc.getIncludeKpiMethod = getIncludeKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "IncludeKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.Kpi.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("IncludeKpi")) + .build(); + } + } + } + return getIncludeKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getMonitorKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MonitorKpi", + requestType = monitoring.Monitoring.MonitorKpiRequest.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getMonitorKpiMethod() { + io.grpc.MethodDescriptor getMonitorKpiMethod; + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getMonitorKpiMethod = MonitoringServiceGrpc.getMonitorKpiMethod) == null) { + MonitoringServiceGrpc.getMonitorKpiMethod = getMonitorKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MonitorKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.MonitorKpiRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("MonitorKpi")) + .build(); + } + } + } + return getMonitorKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getQueryKpiDataMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "QueryKpiData", + requestType = monitoring.Monitoring.KpiQuery.class, + responseType = monitoring.Monitoring.KpiList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getQueryKpiDataMethod() { + io.grpc.MethodDescriptor getQueryKpiDataMethod; + if ((getQueryKpiDataMethod = MonitoringServiceGrpc.getQueryKpiDataMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getQueryKpiDataMethod = MonitoringServiceGrpc.getQueryKpiDataMethod) == null) { + MonitoringServiceGrpc.getQueryKpiDataMethod = getQueryKpiDataMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryKpiData")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiQuery.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("QueryKpiData")) + .build(); + } + } + } + return getQueryKpiDataMethod; + } + + private static volatile io.grpc.MethodDescriptor getSubscribeKpiMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SubscribeKpi", + requestType = monitoring.Monitoring.SubsDescriptor.class, + responseType = monitoring.Monitoring.KpiList.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getSubscribeKpiMethod() { + io.grpc.MethodDescriptor getSubscribeKpiMethod; + if ((getSubscribeKpiMethod = MonitoringServiceGrpc.getSubscribeKpiMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getSubscribeKpiMethod = MonitoringServiceGrpc.getSubscribeKpiMethod) == null) { + MonitoringServiceGrpc.getSubscribeKpiMethod = getSubscribeKpiMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribeKpi")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.KpiList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("SubscribeKpi")) + .build(); + } + } + } + return getSubscribeKpiMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSubsDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSubsDescriptor", + requestType = monitoring.Monitoring.SubscriptionID.class, + responseType = monitoring.Monitoring.SubsDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSubsDescriptorMethod() { + io.grpc.MethodDescriptor getGetSubsDescriptorMethod; + if ((getGetSubsDescriptorMethod = MonitoringServiceGrpc.getGetSubsDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetSubsDescriptorMethod = MonitoringServiceGrpc.getGetSubsDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetSubsDescriptorMethod = getGetSubsDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubsDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubscriptionID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetSubsDescriptor")) + .build(); + } + } + } + return getGetSubsDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSubscriptions", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.SubsIDList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetSubscriptionsMethod() { + io.grpc.MethodDescriptor getGetSubscriptionsMethod; + if ((getGetSubscriptionsMethod = MonitoringServiceGrpc.getGetSubscriptionsMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetSubscriptionsMethod = MonitoringServiceGrpc.getGetSubscriptionsMethod) == null) { + MonitoringServiceGrpc.getGetSubscriptionsMethod = getGetSubscriptionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsIDList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetSubscriptions")) + .build(); + } + } + } + return getGetSubscriptionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiSubscriptionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiSubscription", + requestType = monitoring.Monitoring.SubsDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiSubscriptionMethod() { + io.grpc.MethodDescriptor getEditKpiSubscriptionMethod; + if ((getEditKpiSubscriptionMethod = MonitoringServiceGrpc.getEditKpiSubscriptionMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiSubscriptionMethod = MonitoringServiceGrpc.getEditKpiSubscriptionMethod) == null) { + MonitoringServiceGrpc.getEditKpiSubscriptionMethod = getEditKpiSubscriptionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.SubsDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiSubscription")) + .build(); + } + } + } + return getEditKpiSubscriptionMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateKpiAlarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateKpiAlarm", + requestType = monitoring.Monitoring.AlarmDescriptor.class, + responseType = monitoring.Monitoring.AlarmID.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateKpiAlarmMethod() { + io.grpc.MethodDescriptor getCreateKpiAlarmMethod; + if ((getCreateKpiAlarmMethod = MonitoringServiceGrpc.getCreateKpiAlarmMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getCreateKpiAlarmMethod = MonitoringServiceGrpc.getCreateKpiAlarmMethod) == null) { + MonitoringServiceGrpc.getCreateKpiAlarmMethod = getCreateKpiAlarmMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateKpiAlarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("CreateKpiAlarm")) + .build(); + } + } + } + return getCreateKpiAlarmMethod; + } + + private static volatile io.grpc.MethodDescriptor getEditKpiAlarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EditKpiAlarm", + requestType = monitoring.Monitoring.AlarmDescriptor.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getEditKpiAlarmMethod() { + io.grpc.MethodDescriptor getEditKpiAlarmMethod; + if ((getEditKpiAlarmMethod = MonitoringServiceGrpc.getEditKpiAlarmMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getEditKpiAlarmMethod = MonitoringServiceGrpc.getEditKpiAlarmMethod) == null) { + MonitoringServiceGrpc.getEditKpiAlarmMethod = getEditKpiAlarmMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EditKpiAlarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("EditKpiAlarm")) + .build(); + } + } + } + return getEditKpiAlarmMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarms", + requestType = context.ContextOuterClass.Empty.class, + responseType = monitoring.Monitoring.AlarmIDList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAlarmsMethod() { + io.grpc.MethodDescriptor getGetAlarmsMethod; + if ((getGetAlarmsMethod = MonitoringServiceGrpc.getGetAlarmsMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmsMethod = MonitoringServiceGrpc.getGetAlarmsMethod) == null) { + MonitoringServiceGrpc.getGetAlarmsMethod = getGetAlarmsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmIDList.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarms")) + .build(); + } + } + } + return getGetAlarmsMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmDescriptorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarmDescriptor", + requestType = monitoring.Monitoring.AlarmID.class, + responseType = monitoring.Monitoring.AlarmDescriptor.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetAlarmDescriptorMethod() { + io.grpc.MethodDescriptor getGetAlarmDescriptorMethod; + if ((getGetAlarmDescriptorMethod = MonitoringServiceGrpc.getGetAlarmDescriptorMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmDescriptorMethod = MonitoringServiceGrpc.getGetAlarmDescriptorMethod) == null) { + MonitoringServiceGrpc.getGetAlarmDescriptorMethod = getGetAlarmDescriptorMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarmDescriptor")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmDescriptor.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarmDescriptor")) + .build(); + } + } + } + return getGetAlarmDescriptorMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAlarmResponseStream", + requestType = monitoring.Monitoring.AlarmID.class, + responseType = monitoring.Monitoring.AlarmResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod() { + io.grpc.MethodDescriptor getGetAlarmResponseStreamMethod; + if ((getGetAlarmResponseStreamMethod = MonitoringServiceGrpc.getGetAlarmResponseStreamMethod) == null) { + synchronized (MonitoringServiceGrpc.class) { + if ((getGetAlarmResponseStreamMethod = MonitoringServiceGrpc.getGetAlarmResponseStreamMethod) == null) { + MonitoringServiceGrpc.getGetAlarmResponseStreamMethod = getGetAlarmResponseStreamMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAlarmResponseStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmID.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + monitoring.Monitoring.AlarmResponse.getDefaultInstance())) + .setSchemaDescriptor(new MonitoringServiceMethodDescriptorSupplier("GetAlarmResponseStream")) + .build(); + } + } + } + return getGetAlarmResponseStreamMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static MonitoringServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + }; + return MonitoringServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MonitoringServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + }; + return MonitoringServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static MonitoringServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MonitoringServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + }; + return MonitoringServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateKpiMethod(), responseObserver); + } + + /** + */ + public void editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiDescriptorMethod(), responseObserver); + } + + /** + */ + public void deleteKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteKpiMethod(), responseObserver); + } + + /** + */ + public void getKpiDescriptorList(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetKpiDescriptorListMethod(), responseObserver); + } + + /** + */ + public void createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateBundleKpiMethod(), responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetKpiDescriptorMethod(), responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getIncludeKpiMethod(), responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMonitorKpiMethod(), responseObserver); + } + + /** + */ + public void queryKpiData(monitoring.Monitoring.KpiQuery request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getQueryKpiDataMethod(), responseObserver); + } + + /** + */ + public void subscribeKpi(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSubscribeKpiMethod(), responseObserver); + } + + /** + */ + public void getSubsDescriptor(monitoring.Monitoring.SubscriptionID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSubsDescriptorMethod(), responseObserver); + } + + /** + */ + public void getSubscriptions(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSubscriptionsMethod(), responseObserver); + } + + /** + */ + public void editKpiSubscription(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiSubscriptionMethod(), responseObserver); + } + + /** + */ + public void createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateKpiAlarmMethod(), responseObserver); + } + + /** + */ + public void editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEditKpiAlarmMethod(), responseObserver); + } + + /** + */ + public void getAlarms(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmsMethod(), responseObserver); + } + + /** + */ + public void getAlarmDescriptor(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmDescriptorMethod(), responseObserver); + } + + /** + */ + public void getAlarmResponseStream(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAlarmResponseStreamMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI))) + .addMethod( + getEditKpiDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.EditedKpiDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_DESCRIPTOR))) + .addMethod( + getDeleteKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_KPI))) + .addMethod( + getGetKpiDescriptorListMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.KpiDescriptorList>( + this, METHODID_GET_KPI_DESCRIPTOR_LIST))) + .addMethod( + getCreateBundleKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.BundleKpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_BUNDLE_KPI))) + .addMethod( + getGetKpiDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR))) + .addMethod( + getIncludeKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI))) + .addMethod( + getMonitorKpiMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI))) + .addMethod( + getQueryKpiDataMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiQuery, + monitoring.Monitoring.KpiList>( + this, METHODID_QUERY_KPI_DATA))) + .addMethod( + getSubscribeKpiMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + monitoring.Monitoring.KpiList>( + this, METHODID_SUBSCRIBE_KPI))) + .addMethod( + getGetSubsDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubscriptionID, + monitoring.Monitoring.SubsDescriptor>( + this, METHODID_GET_SUBS_DESCRIPTOR))) + .addMethod( + getGetSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.SubsIDList>( + this, METHODID_GET_SUBSCRIPTIONS))) + .addMethod( + getEditKpiSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_SUBSCRIPTION))) + .addMethod( + getCreateKpiAlarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + monitoring.Monitoring.AlarmID>( + this, METHODID_CREATE_KPI_ALARM))) + .addMethod( + getEditKpiAlarmMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_ALARM))) + .addMethod( + getGetAlarmsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.AlarmIDList>( + this, METHODID_GET_ALARMS))) + .addMethod( + getGetAlarmDescriptorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmDescriptor>( + this, METHODID_GET_ALARM_DESCRIPTOR))) + .addMethod( + getGetAlarmResponseStreamMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmResponse>( + this, METHODID_GET_ALARM_RESPONSE_STREAM))) + .build(); + } + } + + /** + */ + public static final class MonitoringServiceStub extends io.grpc.stub.AbstractAsyncStub { + private MonitoringServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceStub(channel, callOptions); + } + + /** + */ + public void createKpi(monitoring.Monitoring.KpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteKpi(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getKpiDescriptorList(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetKpiDescriptorListMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBundleKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getKpiDescriptor(monitoring.Monitoring.KpiId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void includeKpi(monitoring.Monitoring.Kpi request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void monitorKpi(monitoring.Monitoring.MonitorKpiRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void queryKpiData(monitoring.Monitoring.KpiQuery request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getQueryKpiDataMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void subscribeKpi(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getSubscribeKpiMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSubsDescriptor(monitoring.Monitoring.SubscriptionID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSubsDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getSubscriptions(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSubscriptionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiSubscription(monitoring.Monitoring.SubsDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiSubscriptionMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateKpiAlarmMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEditKpiAlarmMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarms(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAlarmsMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarmDescriptor(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAlarmDescriptorMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getAlarmResponseStream(monitoring.Monitoring.AlarmID request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetAlarmResponseStreamMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class MonitoringServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private MonitoringServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceBlockingStub(channel, callOptions); + } + + /** + */ + public monitoring.Monitoring.KpiId createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateKpiMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty deleteKpi(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiDescriptorList getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetKpiDescriptorListMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiId createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBundleKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiDescriptor getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetKpiDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty includeKpi(monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getIncludeKpiMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMonitorKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.KpiList queryKpiData(monitoring.Monitoring.KpiQuery request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getQueryKpiDataMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator subscribeKpi( + monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getSubscribeKpiMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.SubsDescriptor getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSubsDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.SubsIDList getSubscriptions(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSubscriptionsMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiSubscriptionMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmID createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateKpiAlarmMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEditKpiAlarmMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmIDList getAlarms(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAlarmsMethod(), getCallOptions(), request); + } + + /** + */ + public monitoring.Monitoring.AlarmDescriptor getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAlarmDescriptorMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getAlarmResponseStream( + monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetAlarmResponseStreamMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class MonitoringServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private MonitoringServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MonitoringServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MonitoringServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createKpi( + monitoring.Monitoring.KpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiDescriptor( + monitoring.Monitoring.EditedKpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteKpi( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getKpiDescriptorList( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetKpiDescriptorListMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createBundleKpi( + monitoring.Monitoring.BundleKpiDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBundleKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getKpiDescriptor( + monitoring.Monitoring.KpiId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetKpiDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture includeKpi( + monitoring.Monitoring.Kpi request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getIncludeKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture monitorKpi( + monitoring.Monitoring.MonitorKpiRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMonitorKpiMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture queryKpiData( + monitoring.Monitoring.KpiQuery request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getQueryKpiDataMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSubsDescriptor( + monitoring.Monitoring.SubscriptionID request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSubsDescriptorMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getSubscriptions( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSubscriptionsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiSubscription( + monitoring.Monitoring.SubsDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiSubscriptionMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createKpiAlarm( + monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateKpiAlarmMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture editKpiAlarm( + monitoring.Monitoring.AlarmDescriptor request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEditKpiAlarmMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getAlarms( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAlarmsMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getAlarmDescriptor( + monitoring.Monitoring.AlarmID request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAlarmDescriptorMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_EDIT_KPI_DESCRIPTOR = 1; + private static final int METHODID_DELETE_KPI = 2; + private static final int METHODID_GET_KPI_DESCRIPTOR_LIST = 3; + private static final int METHODID_CREATE_BUNDLE_KPI = 4; + private static final int METHODID_GET_KPI_DESCRIPTOR = 5; + private static final int METHODID_INCLUDE_KPI = 6; + private static final int METHODID_MONITOR_KPI = 7; + private static final int METHODID_QUERY_KPI_DATA = 8; + private static final int METHODID_SUBSCRIBE_KPI = 9; + private static final int METHODID_GET_SUBS_DESCRIPTOR = 10; + private static final int METHODID_GET_SUBSCRIPTIONS = 11; + private static final int METHODID_EDIT_KPI_SUBSCRIPTION = 12; + private static final int METHODID_CREATE_KPI_ALARM = 13; + private static final int METHODID_EDIT_KPI_ALARM = 14; + private static final int METHODID_GET_ALARMS = 15; + private static final int METHODID_GET_ALARM_DESCRIPTOR = 16; + private static final int METHODID_GET_ALARM_RESPONSE_STREAM = 17; + + 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 MonitoringServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(MonitoringServiceImplBase 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_CREATE_KPI: + serviceImpl.createKpi((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_DESCRIPTOR: + serviceImpl.editKpiDescriptor((monitoring.Monitoring.EditedKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_KPI: + serviceImpl.deleteKpi((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_KPI_DESCRIPTOR_LIST: + serviceImpl.getKpiDescriptorList((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BUNDLE_KPI: + serviceImpl.createBundleKpi((monitoring.Monitoring.BundleKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_KPI_DESCRIPTOR: + serviceImpl.getKpiDescriptor((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INCLUDE_KPI: + serviceImpl.includeKpi((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MONITOR_KPI: + serviceImpl.monitorKpi((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_QUERY_KPI_DATA: + serviceImpl.queryKpiData((monitoring.Monitoring.KpiQuery) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SUBSCRIBE_KPI: + serviceImpl.subscribeKpi((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SUBS_DESCRIPTOR: + serviceImpl.getSubsDescriptor((monitoring.Monitoring.SubscriptionID) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SUBSCRIPTIONS: + serviceImpl.getSubscriptions((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_SUBSCRIPTION: + serviceImpl.editKpiSubscription((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_KPI_ALARM: + serviceImpl.createKpiAlarm((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EDIT_KPI_ALARM: + serviceImpl.editKpiAlarm((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARMS: + serviceImpl.getAlarms((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARM_DESCRIPTOR: + serviceImpl.getAlarmDescriptor((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ALARM_RESPONSE_STREAM: + serviceImpl.getAlarmResponseStream((monitoring.Monitoring.AlarmID) 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 MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MonitoringServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return monitoring.Monitoring.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MonitoringService"); + } + } + + private static final class MonitoringServiceFileDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier { + MonitoringServiceFileDescriptorSupplier() {} + } + + private static final class MonitoringServiceMethodDescriptorSupplier + extends MonitoringServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + MonitoringServiceMethodDescriptorSupplier(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 (MonitoringServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MonitoringServiceFileDescriptorSupplier()) + .addMethod(getCreateKpiMethod()) + .addMethod(getEditKpiDescriptorMethod()) + .addMethod(getDeleteKpiMethod()) + .addMethod(getGetKpiDescriptorListMethod()) + .addMethod(getCreateBundleKpiMethod()) + .addMethod(getGetKpiDescriptorMethod()) + .addMethod(getIncludeKpiMethod()) + .addMethod(getMonitorKpiMethod()) + .addMethod(getQueryKpiDataMethod()) + .addMethod(getSubscribeKpiMethod()) + .addMethod(getGetSubsDescriptorMethod()) + .addMethod(getGetSubscriptionsMethod()) + .addMethod(getEditKpiSubscriptionMethod()) + .addMethod(getCreateKpiAlarmMethod()) + .addMethod(getEditKpiAlarmMethod()) + .addMethod(getGetAlarmsMethod()) + .addMethod(getGetAlarmDescriptorMethod()) + .addMethod(getGetAlarmResponseStreamMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..46f442b743ee176a83a416fe13711beda6baf937 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java @@ -0,0 +1,528 @@ +package monitoring; + +import static monitoring.MonitoringServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: monitoring.proto") +public final class MutinyMonitoringServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyMonitoringServiceGrpc() {} + + public static MutinyMonitoringServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyMonitoringServiceStub(channel); + } + + + public static final class MutinyMonitoringServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub { + private MonitoringServiceGrpc.MonitoringServiceStub delegateStub; + + private MutinyMonitoringServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = MonitoringServiceGrpc.newStub(channel); + } + + private MutinyMonitoringServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = MonitoringServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyMonitoringServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyMonitoringServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createKpi); + } + + + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiDescriptor); + } + + + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::deleteKpi); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getKpiDescriptorList); + } + + + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createBundleKpi); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getKpiDescriptor); + } + + + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::includeKpi); + } + + + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::monitorKpi); + } + + + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::queryKpiData); + } + + + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSubsDescriptor); + } + + + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getSubscriptions); + } + + + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiSubscription); + } + + + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createKpiAlarm); + } + + + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::editKpiAlarm); + } + + + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getAlarms); + } + + + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getAlarmDescriptor); + } + + + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::subscribeKpi); + } + + + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::getAlarmResponseStream); + } + + } + + + public static abstract class MonitoringServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public MonitoringServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni createKpi(monitoring.Monitoring.KpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiDescriptor(monitoring.Monitoring.EditedKpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni deleteKpi(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptorList(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni createBundleKpi(monitoring.Monitoring.BundleKpiDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getKpiDescriptor(monitoring.Monitoring.KpiId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni includeKpi(monitoring.Monitoring.Kpi request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni monitorKpi(monitoring.Monitoring.MonitorKpiRequest request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni queryKpiData(monitoring.Monitoring.KpiQuery request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSubsDescriptor(monitoring.Monitoring.SubscriptionID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getSubscriptions(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiSubscription(monitoring.Monitoring.SubsDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni createKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni editKpiAlarm(monitoring.Monitoring.AlarmDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getAlarms(context.ContextOuterClass.Empty request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni getAlarmDescriptor(monitoring.Monitoring.AlarmID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi subscribeKpi(monitoring.Monitoring.SubsDescriptor request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi getAlarmResponseStream(monitoring.Monitoring.AlarmID request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.EditedKpiDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getDeleteKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetKpiDescriptorListMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.KpiDescriptorList>( + this, METHODID_GET_KPI_DESCRIPTOR_LIST, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateBundleKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.BundleKpiDescriptor, + monitoring.Monitoring.KpiId>( + this, METHODID_CREATE_BUNDLE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetKpiDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiId, + monitoring.Monitoring.KpiDescriptor>( + this, METHODID_GET_KPI_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getIncludeKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.Kpi, + context.ContextOuterClass.Empty>( + this, METHODID_INCLUDE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getMonitorKpiMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.MonitorKpiRequest, + context.ContextOuterClass.Empty>( + this, METHODID_MONITOR_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getQueryKpiDataMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.KpiQuery, + monitoring.Monitoring.KpiList>( + this, METHODID_QUERY_KPI_DATA, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getSubscribeKpiMethod(), + asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + monitoring.Monitoring.KpiList>( + this, METHODID_SUBSCRIBE_KPI, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetSubsDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubscriptionID, + monitoring.Monitoring.SubsDescriptor>( + this, METHODID_GET_SUBS_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetSubscriptionsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.SubsIDList>( + this, METHODID_GET_SUBSCRIPTIONS, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiSubscriptionMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.SubsDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_SUBSCRIPTION, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getCreateKpiAlarmMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + monitoring.Monitoring.AlarmID>( + this, METHODID_CREATE_KPI_ALARM, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getEditKpiAlarmMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmDescriptor, + context.ContextOuterClass.Empty>( + this, METHODID_EDIT_KPI_ALARM, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmsMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + monitoring.Monitoring.AlarmIDList>( + this, METHODID_GET_ALARMS, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmDescriptorMethod(), + asyncUnaryCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmDescriptor>( + this, METHODID_GET_ALARM_DESCRIPTOR, compression))) + .addMethod( + monitoring.MonitoringServiceGrpc.getGetAlarmResponseStreamMethod(), + asyncServerStreamingCall( + new MethodHandlers< + monitoring.Monitoring.AlarmID, + monitoring.Monitoring.AlarmResponse>( + this, METHODID_GET_ALARM_RESPONSE_STREAM, compression))) + .build(); + } + } + + private static final int METHODID_CREATE_KPI = 0; + private static final int METHODID_EDIT_KPI_DESCRIPTOR = 1; + private static final int METHODID_DELETE_KPI = 2; + private static final int METHODID_GET_KPI_DESCRIPTOR_LIST = 3; + private static final int METHODID_CREATE_BUNDLE_KPI = 4; + private static final int METHODID_GET_KPI_DESCRIPTOR = 5; + private static final int METHODID_INCLUDE_KPI = 6; + private static final int METHODID_MONITOR_KPI = 7; + private static final int METHODID_QUERY_KPI_DATA = 8; + private static final int METHODID_SUBSCRIBE_KPI = 9; + private static final int METHODID_GET_SUBS_DESCRIPTOR = 10; + private static final int METHODID_GET_SUBSCRIPTIONS = 11; + private static final int METHODID_EDIT_KPI_SUBSCRIPTION = 12; + private static final int METHODID_CREATE_KPI_ALARM = 13; + private static final int METHODID_EDIT_KPI_ALARM = 14; + private static final int METHODID_GET_ALARMS = 15; + private static final int METHODID_GET_ALARM_DESCRIPTOR = 16; + private static final int METHODID_GET_ALARM_RESPONSE_STREAM = 17; + + 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 MonitoringServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(MonitoringServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createKpi); + break; + case METHODID_EDIT_KPI_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.EditedKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiDescriptor); + break; + case METHODID_DELETE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::deleteKpi); + break; + case METHODID_GET_KPI_DESCRIPTOR_LIST: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getKpiDescriptorList); + break; + case METHODID_CREATE_BUNDLE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.BundleKpiDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createBundleKpi); + break; + case METHODID_GET_KPI_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getKpiDescriptor); + break; + case METHODID_INCLUDE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.Kpi) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::includeKpi); + break; + case METHODID_MONITOR_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.MonitorKpiRequest) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::monitorKpi); + break; + case METHODID_QUERY_KPI_DATA: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.KpiQuery) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::queryKpiData); + break; + case METHODID_SUBSCRIBE_KPI: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::subscribeKpi); + break; + case METHODID_GET_SUBS_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.SubscriptionID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSubsDescriptor); + break; + case METHODID_GET_SUBSCRIPTIONS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getSubscriptions); + break; + case METHODID_EDIT_KPI_SUBSCRIPTION: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.SubsDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiSubscription); + break; + case METHODID_CREATE_KPI_ALARM: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createKpiAlarm); + break; + case METHODID_EDIT_KPI_ALARM: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmDescriptor) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::editKpiAlarm); + break; + case METHODID_GET_ALARMS: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarms); + break; + case METHODID_GET_ALARM_DESCRIPTOR: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarmDescriptor); + break; + case METHODID_GET_ALARM_RESPONSE_STREAM: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((monitoring.Monitoring.AlarmID) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::getAlarmResponseStream); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke(io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java index bad12a99d34a314f9c097ee7fda4ba7219dbb984..b9d840730272b2d6185cb2eba0c93e8cf4d11e6c 100644 --- a/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/policy/MutinyPolicyServiceGrpc.java @@ -36,32 +36,42 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu } - public io.smallrye.mutiny.Uni policyAdd(policy.Policy.PolicyRule request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAdd); + public io.smallrye.mutiny.Uni policyAddService(policy.Policy.PolicyRuleService request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAddService); } - public io.smallrye.mutiny.Uni policyUpdate(policy.Policy.PolicyRule request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdate); + public io.smallrye.mutiny.Uni policyAddDevice(policy.Policy.PolicyRuleDevice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyAddDevice); } - public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyUpdateService(policy.Policy.PolicyRuleService request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdateService); + } + + + public io.smallrye.mutiny.Uni policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyUpdateDevice); + } + + + public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRuleId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::policyDelete); } - public io.smallrye.mutiny.Uni getPolicy(policy.Policy.PolicyRuleId request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicy); + public io.smallrye.mutiny.Uni getPolicyService(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyService); } - public io.smallrye.mutiny.Uni getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { - return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyByDeviceId); + public io.smallrye.mutiny.Uni getPolicyDevice(policy.Policy.PolicyRuleId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyDevice); } - public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::getPolicyByServiceId); } @@ -83,89 +93,115 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu - public io.smallrye.mutiny.Uni policyAdd(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyAddService(policy.Policy.PolicyRuleService request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni policyAddDevice(policy.Policy.PolicyRuleDevice request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni policyUpdateService(policy.Policy.PolicyRuleService request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni policyUpdate(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni getPolicy(policy.Policy.PolicyRuleId request) { + public io.smallrye.mutiny.Uni getPolicyService(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni getPolicyDevice(policy.Policy.PolicyRuleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - policy.PolicyServiceGrpc.getPolicyAddMethod(), + policy.PolicyServiceGrpc.getPolicyAddServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_ADD_SERVICE, compression))) + .addMethod( + policy.PolicyServiceGrpc.getPolicyAddDeviceMethod(), + asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_ADD_DEVICE, compression))) + .addMethod( + policy.PolicyServiceGrpc.getPolicyUpdateServiceMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_ADD, compression))) + this, METHODID_POLICY_UPDATE_SERVICE, compression))) .addMethod( - policy.PolicyServiceGrpc.getPolicyUpdateMethod(), + policy.PolicyServiceGrpc.getPolicyUpdateDeviceMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_UPDATE, compression))) + this, METHODID_POLICY_UPDATE_DEVICE, compression))) .addMethod( policy.PolicyServiceGrpc.getPolicyDeleteMethod(), asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState>( this, METHODID_POLICY_DELETE, compression))) .addMethod( - policy.PolicyServiceGrpc.getGetPolicyMethod(), + policy.PolicyServiceGrpc.getGetPolicyServiceMethod(), asyncUnaryCall( new MethodHandlers< policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule>( - this, METHODID_GET_POLICY, compression))) + policy.Policy.PolicyRuleService>( + this, METHODID_GET_POLICY_SERVICE, compression))) .addMethod( - policy.PolicyServiceGrpc.getGetPolicyByDeviceIdMethod(), + policy.PolicyServiceGrpc.getGetPolicyDeviceMethod(), asyncUnaryCall( new MethodHandlers< - context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList>( - this, METHODID_GET_POLICY_BY_DEVICE_ID, compression))) + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice>( + this, METHODID_GET_POLICY_DEVICE, compression))) .addMethod( policy.PolicyServiceGrpc.getGetPolicyByServiceIdMethod(), asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList>( + policy.Policy.PolicyRuleServiceList>( this, METHODID_GET_POLICY_BY_SERVICE_ID, compression))) .build(); } } - private static final int METHODID_POLICY_ADD = 0; - private static final int METHODID_POLICY_UPDATE = 1; - private static final int METHODID_POLICY_DELETE = 2; - private static final int METHODID_GET_POLICY = 3; - private static final int METHODID_GET_POLICY_BY_DEVICE_ID = 4; - private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 5; + private static final int METHODID_POLICY_ADD_SERVICE = 0; + private static final int METHODID_POLICY_ADD_DEVICE = 1; + private static final int METHODID_POLICY_UPDATE_SERVICE = 2; + private static final int METHODID_POLICY_UPDATE_DEVICE = 3; + private static final int METHODID_POLICY_DELETE = 4; + private static final int METHODID_GET_POLICY_SERVICE = 5; + private static final int METHODID_GET_POLICY_DEVICE = 6; + private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 7; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -186,39 +222,51 @@ public final class MutinyPolicyServiceGrpc implements io.quarkus.grpc.runtime.Mu @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { - case METHODID_POLICY_ADD: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleService) request, (io.grpc.stub.StreamObserver) responseObserver, compression, - serviceImpl::policyAdd); + serviceImpl::policyAddService); break; - case METHODID_POLICY_UPDATE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleDevice) request, (io.grpc.stub.StreamObserver) responseObserver, compression, - serviceImpl::policyUpdate); + serviceImpl::policyAddDevice); + break; + case METHODID_POLICY_UPDATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleService) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::policyUpdateService); + break; + case METHODID_POLICY_UPDATE_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleDevice) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::policyUpdateDevice); break; case METHODID_POLICY_DELETE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRule) request, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, (io.grpc.stub.StreamObserver) responseObserver, compression, serviceImpl::policyDelete); break; - case METHODID_GET_POLICY: + case METHODID_GET_POLICY_SERVICE: io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, - (io.grpc.stub.StreamObserver) responseObserver, + (io.grpc.stub.StreamObserver) responseObserver, compression, - serviceImpl::getPolicy); + serviceImpl::getPolicyService); break; - case METHODID_GET_POLICY_BY_DEVICE_ID: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver) responseObserver, + case METHODID_GET_POLICY_DEVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver, compression, - serviceImpl::getPolicyByDeviceId); + serviceImpl::getPolicyDevice); break; case METHODID_GET_POLICY_BY_SERVICE_ID: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, - (io.grpc.stub.StreamObserver) responseObserver, + (io.grpc.stub.StreamObserver) responseObserver, compression, serviceImpl::getPolicyByServiceId); break; diff --git a/src/policy/target/generated-sources/grpc/policy/Policy.java b/src/policy/target/generated-sources/grpc/policy/Policy.java index 8386be80944cbbbe49d8485a1abff74fdc112d30..08ce14adab068743fd26f031a82ec5fd56693c09 100644 --- a/src/policy/target/generated-sources/grpc/policy/Policy.java +++ b/src/policy/target/generated-sources/grpc/policy/Policy.java @@ -21,180 +21,183 @@ public final class Policy { implements com.google.protobuf.ProtocolMessageEnum { /** *
-     * Rule is currently inactive
+     * Undefined rule state
      * 
* - * POLICY_INACTIVE = 0; + * POLICY_UNDEFINED = 0; */ - POLICY_INACTIVE(0), + POLICY_UNDEFINED(0), /** *
-     * Rule installation planned
+     * Rule failed
      * 
* - * POLICY_PLANNED = 1; + * POLICY_FAILED = 1; */ - POLICY_PLANNED(1), + POLICY_FAILED(1), /** *
-     * Rule is currently active
+     * Rule is just inserted
      * 
* - * POLICY_ACTIVE = 2; + * POLICY_INSERTED = 2; */ - POLICY_ACTIVE(2), - UNRECOGNIZED(-1), - ; - + POLICY_INSERTED(2), /** *
-     * Rule is currently inactive
+     * Rule content is correct
      * 
* - * POLICY_INACTIVE = 0; + * POLICY_VALIDATED = 3; */ - public static final int POLICY_INACTIVE_VALUE = 0; + POLICY_VALIDATED(3), /** *
-     * Rule installation planned
+     * Rule subscribed to Monitoring
      * 
* - * POLICY_PLANNED = 1; + * POLICY_PROVISIONED = 4; */ - public static final int POLICY_PLANNED_VALUE = 1; + POLICY_PROVISIONED(4), /** *
-     * Rule is currently active
+     * Rule is currently active (alarm is just thrown by Monitoring)
      * 
* - * POLICY_ACTIVE = 2; + * POLICY_ACTIVE = 5; */ - public static final int POLICY_ACTIVE_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; - } - + POLICY_ACTIVE(5), /** - * @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. + *
+     * Rule action is successfully enforced
+     * 
+ * + * POLICY_ENFORCED = 6; */ - @java.lang.Deprecated - public static RuleState valueOf(int value) { - return forNumber(value); - } - + POLICY_ENFORCED(6), /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. + *
+     * The applied rule action did not work as expected
+     * 
+ * + * POLICY_INEFFECTIVE = 7; */ - public static RuleState forNumber(int value) { - switch (value) { - case 0: return POLICY_INACTIVE; - case 1: return POLICY_PLANNED; - case 2: return POLICY_ACTIVE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - RuleState> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RuleState findValueByNumber(int number) { - return RuleState.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 policy.Policy.getDescriptor().getEnumTypes().get(0); - } - - private static final RuleState[] VALUES = values(); - - public static RuleState 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 RuleState(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:policy.RuleState) - } - - /** - * Protobuf enum {@code policy.PolicyRuleType} - */ - public enum PolicyRuleType - implements com.google.protobuf.ProtocolMessageEnum { + POLICY_INEFFECTIVE(7), + /** + *
+     * The applied rule action did work as expected
+     * 
+ * + * POLICY_EFFECTIVE = 8; + */ + POLICY_EFFECTIVE(8), /** *
-     * Device-level
+     * Operator requires a policy to change
      * 
* - * POLICYTYPE_DEVICE = 0; + * POLICY_UPDATED = 9; */ - POLICYTYPE_DEVICE(0), + POLICY_UPDATED(9), /** *
-     * Network-wide
+     * Operator requires to remove a policy
      * 
* - * POLICYTYPE_NETWORK = 1; + * POLICY_REMOVED = 10; */ - POLICYTYPE_NETWORK(1), + POLICY_REMOVED(10), UNRECOGNIZED(-1), ; /** *
-     * Device-level
+     * Undefined rule state
+     * 
+ * + * POLICY_UNDEFINED = 0; + */ + public static final int POLICY_UNDEFINED_VALUE = 0; + /** + *
+     * Rule failed
+     * 
+ * + * POLICY_FAILED = 1; + */ + public static final int POLICY_FAILED_VALUE = 1; + /** + *
+     * Rule is just inserted
+     * 
+ * + * POLICY_INSERTED = 2; + */ + public static final int POLICY_INSERTED_VALUE = 2; + /** + *
+     * Rule content is correct
+     * 
+ * + * POLICY_VALIDATED = 3; + */ + public static final int POLICY_VALIDATED_VALUE = 3; + /** + *
+     * Rule subscribed to Monitoring
+     * 
+ * + * POLICY_PROVISIONED = 4; + */ + public static final int POLICY_PROVISIONED_VALUE = 4; + /** + *
+     * Rule is currently active (alarm is just thrown by Monitoring)
+     * 
+ * + * POLICY_ACTIVE = 5; + */ + public static final int POLICY_ACTIVE_VALUE = 5; + /** + *
+     * Rule action is successfully enforced
+     * 
+ * + * POLICY_ENFORCED = 6; + */ + public static final int POLICY_ENFORCED_VALUE = 6; + /** + *
+     * The applied rule action did not work as expected
+     * 
+ * + * POLICY_INEFFECTIVE = 7; + */ + public static final int POLICY_INEFFECTIVE_VALUE = 7; + /** + *
+     * The applied rule action did work as expected
+     * 
+ * + * POLICY_EFFECTIVE = 8; + */ + public static final int POLICY_EFFECTIVE_VALUE = 8; + /** + *
+     * Operator requires a policy to change
      * 
* - * POLICYTYPE_DEVICE = 0; + * POLICY_UPDATED = 9; */ - public static final int POLICYTYPE_DEVICE_VALUE = 0; + public static final int POLICY_UPDATED_VALUE = 9; /** *
-     * Network-wide
+     * Operator requires to remove a policy
      * 
* - * POLICYTYPE_NETWORK = 1; + * POLICY_REMOVED = 10; */ - public static final int POLICYTYPE_NETWORK_VALUE = 1; + public static final int POLICY_REMOVED_VALUE = 10; public final int getNumber() { @@ -211,7 +214,7 @@ public final class Policy { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static PolicyRuleType valueOf(int value) { + public static RuleState valueOf(int value) { return forNumber(value); } @@ -219,23 +222,32 @@ public final class Policy { * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ - public static PolicyRuleType forNumber(int value) { + public static RuleState forNumber(int value) { switch (value) { - case 0: return POLICYTYPE_DEVICE; - case 1: return POLICYTYPE_NETWORK; + case 0: return POLICY_UNDEFINED; + case 1: return POLICY_FAILED; + case 2: return POLICY_INSERTED; + case 3: return POLICY_VALIDATED; + case 4: return POLICY_PROVISIONED; + case 5: return POLICY_ACTIVE; + case 6: return POLICY_ENFORCED; + case 7: return POLICY_INEFFECTIVE; + case 8: return POLICY_EFFECTIVE; + case 9: return POLICY_UPDATED; + case 10: return POLICY_REMOVED; default: return null; } } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap< - PolicyRuleType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PolicyRuleType findValueByNumber(int number) { - return PolicyRuleType.forNumber(number); + RuleState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RuleState findValueByNumber(int number) { + return RuleState.forNumber(number); } }; @@ -253,12 +265,12 @@ public final class Policy { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return policy.Policy.getDescriptor().getEnumTypes().get(1); + return policy.Policy.getDescriptor().getEnumTypes().get(0); } - private static final PolicyRuleType[] VALUES = values(); + private static final RuleState[] VALUES = values(); - public static PolicyRuleType valueOf( + public static RuleState valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -272,11 +284,11 @@ public final class Policy { private final int value; - private PolicyRuleType(int value) { + private RuleState(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:policy.PolicyRuleType) + // @@protoc_insertion_point(enum_scope:policy.RuleState) } public interface PolicyRuleIdOrBuilder extends @@ -905,27 +917,12 @@ public final class Policy { com.google.protobuf.MessageOrBuilder { /** - * .context.Uuid policyRuleId = 1; - * @return Whether the policyRuleId field is set. - */ - boolean hasPolicyRuleId(); - /** - * .context.Uuid policyRuleId = 1; - * @return The policyRuleId. - */ - context.ContextOuterClass.Uuid getPolicyRuleId(); - /** - * .context.Uuid policyRuleId = 1; - */ - context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder(); - - /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return The enum numeric value on the wire for policyRuleState. */ int getPolicyRuleStateValue(); /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return The policyRuleState. */ policy.Policy.RuleState getPolicyRuleState(); @@ -976,20 +973,7 @@ public final class Policy { case 0: done = true; break; - case 10: { - context.ContextOuterClass.Uuid.Builder subBuilder = null; - if (policyRuleId_ != null) { - subBuilder = policyRuleId_.toBuilder(); - } - policyRuleId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policyRuleId_); - policyRuleId_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { + case 8: { int rawValue = input.readEnum(); policyRuleState_ = rawValue; @@ -1027,43 +1011,17 @@ public final class Policy { policy.Policy.PolicyRuleState.class, policy.Policy.PolicyRuleState.Builder.class); } - public static final int POLICYRULEID_FIELD_NUMBER = 1; - private context.ContextOuterClass.Uuid policyRuleId_; - /** - * .context.Uuid policyRuleId = 1; - * @return Whether the policyRuleId field is set. - */ - @java.lang.Override - public boolean hasPolicyRuleId() { - return policyRuleId_ != null; - } - /** - * .context.Uuid policyRuleId = 1; - * @return The policyRuleId. - */ - @java.lang.Override - public context.ContextOuterClass.Uuid getPolicyRuleId() { - return policyRuleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } - /** - * .context.Uuid policyRuleId = 1; - */ - @java.lang.Override - public context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder() { - return getPolicyRuleId(); - } - - public static final int POLICYRULESTATE_FIELD_NUMBER = 2; + public static final int POLICYRULESTATE_FIELD_NUMBER = 1; private int policyRuleState_; /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return The enum numeric value on the wire for policyRuleState. */ @java.lang.Override public int getPolicyRuleStateValue() { return policyRuleState_; } /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return The policyRuleState. */ @java.lang.Override public policy.Policy.RuleState getPolicyRuleState() { @@ -1086,11 +1044,8 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (policyRuleId_ != null) { - output.writeMessage(1, getPolicyRuleId()); - } - if (policyRuleState_ != policy.Policy.RuleState.POLICY_INACTIVE.getNumber()) { - output.writeEnum(2, policyRuleState_); + if (policyRuleState_ != policy.Policy.RuleState.POLICY_UNDEFINED.getNumber()) { + output.writeEnum(1, policyRuleState_); } unknownFields.writeTo(output); } @@ -1101,13 +1056,9 @@ public final class Policy { if (size != -1) return size; size = 0; - if (policyRuleId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolicyRuleId()); - } - if (policyRuleState_ != policy.Policy.RuleState.POLICY_INACTIVE.getNumber()) { + if (policyRuleState_ != policy.Policy.RuleState.POLICY_UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, policyRuleState_); + .computeEnumSize(1, policyRuleState_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -1124,11 +1075,6 @@ public final class Policy { } policy.Policy.PolicyRuleState other = (policy.Policy.PolicyRuleState) obj; - if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; - if (hasPolicyRuleId()) { - if (!getPolicyRuleId() - .equals(other.getPolicyRuleId())) return false; - } if (policyRuleState_ != other.policyRuleState_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -1141,10 +1087,6 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolicyRuleId()) { - hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleId().hashCode(); - } hash = (37 * hash) + POLICYRULESTATE_FIELD_NUMBER; hash = (53 * hash) + policyRuleState_; hash = (29 * hash) + unknownFields.hashCode(); @@ -1280,12 +1222,6 @@ public final class Policy { @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } policyRuleState_ = 0; return this; @@ -1314,11 +1250,6 @@ public final class Policy { @java.lang.Override public policy.Policy.PolicyRuleState buildPartial() { policy.Policy.PolicyRuleState result = new policy.Policy.PolicyRuleState(this); - if (policyRuleIdBuilder_ == null) { - result.policyRuleId_ = policyRuleId_; - } else { - result.policyRuleId_ = policyRuleIdBuilder_.build(); - } result.policyRuleState_ = policyRuleState_; onBuilt(); return result; @@ -1368,9 +1299,6 @@ public final class Policy { public Builder mergeFrom(policy.Policy.PolicyRuleState other) { if (other == policy.Policy.PolicyRuleState.getDefaultInstance()) return this; - if (other.hasPolicyRuleId()) { - mergePolicyRuleId(other.getPolicyRuleId()); - } if (other.policyRuleState_ != 0) { setPolicyRuleStateValue(other.getPolicyRuleStateValue()); } @@ -1403,146 +1331,27 @@ public final class Policy { return this; } - private context.ContextOuterClass.Uuid policyRuleId_; - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> policyRuleIdBuilder_; - /** - * .context.Uuid policyRuleId = 1; - * @return Whether the policyRuleId field is set. - */ - public boolean hasPolicyRuleId() { - return policyRuleIdBuilder_ != null || policyRuleId_ != null; - } + private int policyRuleState_ = 0; /** - * .context.Uuid policyRuleId = 1; - * @return The policyRuleId. + * .policy.RuleState policyRuleState = 1; + * @return The enum numeric value on the wire for policyRuleState. */ - public context.ContextOuterClass.Uuid getPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - return policyRuleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } else { - return policyRuleIdBuilder_.getMessage(); - } + @java.lang.Override public int getPolicyRuleStateValue() { + return policyRuleState_; } /** - * .context.Uuid policyRuleId = 1; + * .policy.RuleState policyRuleState = 1; + * @param value The enum numeric value on the wire for policyRuleState to set. + * @return This builder for chaining. */ - public Builder setPolicyRuleId(context.ContextOuterClass.Uuid value) { - if (policyRuleIdBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policyRuleId_ = value; - onChanged(); - } else { - policyRuleIdBuilder_.setMessage(value); - } - + public Builder setPolicyRuleStateValue(int value) { + + policyRuleState_ = value; + onChanged(); return this; } /** - * .context.Uuid policyRuleId = 1; - */ - public Builder setPolicyRuleId( - context.ContextOuterClass.Uuid.Builder builderForValue) { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = builderForValue.build(); - onChanged(); - } else { - policyRuleIdBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .context.Uuid policyRuleId = 1; - */ - public Builder mergePolicyRuleId(context.ContextOuterClass.Uuid value) { - if (policyRuleIdBuilder_ == null) { - if (policyRuleId_ != null) { - policyRuleId_ = - context.ContextOuterClass.Uuid.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); - } else { - policyRuleId_ = value; - } - onChanged(); - } else { - policyRuleIdBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .context.Uuid policyRuleId = 1; - */ - public Builder clearPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - onChanged(); - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } - - return this; - } - /** - * .context.Uuid policyRuleId = 1; - */ - public context.ContextOuterClass.Uuid.Builder getPolicyRuleIdBuilder() { - - onChanged(); - return getPolicyRuleIdFieldBuilder().getBuilder(); - } - /** - * .context.Uuid policyRuleId = 1; - */ - public context.ContextOuterClass.UuidOrBuilder getPolicyRuleIdOrBuilder() { - if (policyRuleIdBuilder_ != null) { - return policyRuleIdBuilder_.getMessageOrBuilder(); - } else { - return policyRuleId_ == null ? - context.ContextOuterClass.Uuid.getDefaultInstance() : policyRuleId_; - } - } - /** - * .context.Uuid policyRuleId = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> - getPolicyRuleIdFieldBuilder() { - if (policyRuleIdBuilder_ == null) { - policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( - getPolicyRuleId(), - getParentForChildren(), - isClean()); - policyRuleId_ = null; - } - return policyRuleIdBuilder_; - } - - private int policyRuleState_ = 0; - /** - * .policy.RuleState policyRuleState = 2; - * @return The enum numeric value on the wire for policyRuleState. - */ - @java.lang.Override public int getPolicyRuleStateValue() { - return policyRuleState_; - } - /** - * .policy.RuleState policyRuleState = 2; - * @param value The enum numeric value on the wire for policyRuleState to set. - * @return This builder for chaining. - */ - public Builder setPolicyRuleStateValue(int value) { - - policyRuleState_ = value; - onChanged(); - return this; - } - /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return The policyRuleState. */ @java.lang.Override @@ -1552,7 +1361,7 @@ public final class Policy { return result == null ? policy.Policy.RuleState.UNRECOGNIZED : result; } /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @param value The policyRuleState to set. * @return This builder for chaining. */ @@ -1566,7 +1375,7 @@ public final class Policy { return this; } /** - * .policy.RuleState policyRuleState = 2; + * .policy.RuleState policyRuleState = 1; * @return This builder for chaining. */ public Builder clearPolicyRuleState() { @@ -1628,43 +1437,192 @@ public final class Policy { } - public interface PolicyRuleVariableOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleVariable) + public interface PolicyRuleBasicOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleBasic) com.google.protobuf.MessageOrBuilder { /** - * string policyRuleVariable = 1; - * @return The policyRuleVariable. + * .policy.PolicyRuleId policyRuleId = 1; + * @return Whether the policyRuleId field is set. + */ + boolean hasPolicyRuleId(); + /** + * .policy.PolicyRuleId policyRuleId = 1; + * @return The policyRuleId. + */ + policy.Policy.PolicyRuleId getPolicyRuleId(); + /** + * .policy.PolicyRuleId policyRuleId = 1; + */ + policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder(); + + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return Whether the policyRuleState field is set. + */ + boolean hasPolicyRuleState(); + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return The policyRuleState. + */ + policy.Policy.PolicyRuleState getPolicyRuleState(); + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder(); + + /** + * uint32 priority = 3; + * @return The priority. + */ + int getPriority(); + + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + java.util.List + getConditionListList(); + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + policy.PolicyCondition.PolicyRuleCondition getConditionList(int index); + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + int getConditionListCount(); + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + java.util.List + getConditionListOrBuilderList(); + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index); + + /** + *
+     * Evaluation operator to be used
+     * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The enum numeric value on the wire for booleanOperator. + */ + int getBooleanOperatorValue(); + /** + *
+     * Evaluation operator to be used
+     * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The booleanOperator. + */ + policy.PolicyCondition.BooleanOperator getBooleanOperator(); + + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + java.util.List + getActionListList(); + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + policy.PolicyAction.PolicyRuleAction getActionList(int index); + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + int getActionListCount(); + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - java.lang.String getPolicyRuleVariable(); + java.util.List + getActionListOrBuilderList(); /** - * string policyRuleVariable = 1; - * @return The bytes for policyRuleVariable. + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - com.google.protobuf.ByteString - getPolicyRuleVariableBytes(); + policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index); } /** - * Protobuf type {@code policy.PolicyRuleVariable} + *
+   * Basic policy rule attributes
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleBasic} */ - public static final class PolicyRuleVariable extends + public static final class PolicyRuleBasic extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleVariable) - PolicyRuleVariableOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleBasic) + PolicyRuleBasicOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleVariable.newBuilder() to construct. - private PolicyRuleVariable(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use PolicyRuleBasic.newBuilder() to construct. + private PolicyRuleBasic(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private PolicyRuleVariable() { - policyRuleVariable_ = ""; + private PolicyRuleBasic() { + conditionList_ = java.util.Collections.emptyList(); + booleanOperator_ = 0; + actionList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleVariable(); + return new PolicyRuleBasic(); } @java.lang.Override @@ -1672,7 +1630,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleVariable( + private PolicyRuleBasic( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1680,6 +1638,7 @@ public final class Policy { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -1691,9 +1650,58 @@ public final class Policy { done = true; break; case 10: { - java.lang.String s = input.readStringRequireUtf8(); + policy.Policy.PolicyRuleId.Builder subBuilder = null; + if (policyRuleId_ != null) { + subBuilder = policyRuleId_.toBuilder(); + } + policyRuleId_ = input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleId_); + policyRuleId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + policy.Policy.PolicyRuleState.Builder subBuilder = null; + if (policyRuleState_ != null) { + subBuilder = policyRuleState_.toBuilder(); + } + policyRuleState_ = input.readMessage(policy.Policy.PolicyRuleState.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleState_); + policyRuleState_ = subBuilder.buildPartial(); + } - policyRuleVariable_ = s; + break; + } + case 24: { + + priority_ = input.readUInt32(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + conditionList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + conditionList_.add( + input.readMessage(policy.PolicyCondition.PolicyRuleCondition.parser(), extensionRegistry)); + break; + } + case 40: { + int rawValue = input.readEnum(); + + booleanOperator_ = rawValue; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + actionList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + actionList_.add( + input.readMessage(policy.PolicyAction.PolicyRuleAction.parser(), extensionRegistry)); break; } default: { @@ -1711,67 +1719,257 @@ public final class Policy { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + conditionList_ = java.util.Collections.unmodifiableList(conditionList_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + actionList_ = java.util.Collections.unmodifiableList(actionList_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleBasic_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleVariable.class, policy.Policy.PolicyRuleVariable.Builder.class); + policy.Policy.PolicyRuleBasic.class, policy.Policy.PolicyRuleBasic.Builder.class); } - public static final int POLICYRULEVARIABLE_FIELD_NUMBER = 1; - private volatile java.lang.Object policyRuleVariable_; + public static final int POLICYRULEID_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleId policyRuleId_; /** - * string policyRuleVariable = 1; - * @return The policyRuleVariable. + * .policy.PolicyRuleId policyRuleId = 1; + * @return Whether the policyRuleId field is set. */ @java.lang.Override - public java.lang.String getPolicyRuleVariable() { - java.lang.Object ref = policyRuleVariable_; - 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(); - policyRuleVariable_ = s; - return s; - } + public boolean hasPolicyRuleId() { + return policyRuleId_ != null; } /** - * string policyRuleVariable = 1; - * @return The bytes for policyRuleVariable. + * .policy.PolicyRuleId policyRuleId = 1; + * @return The policyRuleId. */ @java.lang.Override - public com.google.protobuf.ByteString - getPolicyRuleVariableBytes() { - java.lang.Object ref = policyRuleVariable_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleVariable_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public policy.Policy.PolicyRuleId getPolicyRuleId() { + return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; } - - private byte memoizedIsInitialized = -1; + /** + * .policy.PolicyRuleId policyRuleId = 1; + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { + return getPolicyRuleId(); + } + + public static final int POLICYRULESTATE_FIELD_NUMBER = 2; + private policy.Policy.PolicyRuleState policyRuleState_; + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return Whether the policyRuleState field is set. + */ + @java.lang.Override + public boolean hasPolicyRuleState() { + return policyRuleState_ != null; + } + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return The policyRuleState. + */ + @java.lang.Override + public policy.Policy.PolicyRuleState getPolicyRuleState() { + return policyRuleState_ == null ? policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } + /** + *
+     *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+     * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + @java.lang.Override + public policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder() { + return getPolicyRuleState(); + } + + public static final int PRIORITY_FIELD_NUMBER = 3; + private int priority_; + /** + * uint32 priority = 3; + * @return The priority. + */ + @java.lang.Override + public int getPriority() { + return priority_; + } + + public static final int CONDITIONLIST_FIELD_NUMBER = 4; + private java.util.List conditionList_; + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + @java.lang.Override + public java.util.List getConditionListList() { + return conditionList_; + } + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + @java.lang.Override + public java.util.List + getConditionListOrBuilderList() { + return conditionList_; + } + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + @java.lang.Override + public int getConditionListCount() { + return conditionList_.size(); + } + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition getConditionList(int index) { + return conditionList_.get(index); + } + /** + *
+     * Event-Condition-Action (ECA) model
+     * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + @java.lang.Override + public policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index) { + return conditionList_.get(index); + } + + public static final int BOOLEANOPERATOR_FIELD_NUMBER = 5; + private int booleanOperator_; + /** + *
+     * Evaluation operator to be used
+     * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The enum numeric value on the wire for booleanOperator. + */ + @java.lang.Override public int getBooleanOperatorValue() { + return booleanOperator_; + } + /** + *
+     * Evaluation operator to be used
+     * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The booleanOperator. + */ + @java.lang.Override public policy.PolicyCondition.BooleanOperator getBooleanOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.BooleanOperator result = policy.PolicyCondition.BooleanOperator.valueOf(booleanOperator_); + return result == null ? policy.PolicyCondition.BooleanOperator.UNRECOGNIZED : result; + } + + public static final int ACTIONLIST_FIELD_NUMBER = 6; + private java.util.List actionList_; + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + @java.lang.Override + public java.util.List getActionListList() { + return actionList_; + } + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + @java.lang.Override + public java.util.List + getActionListOrBuilderList() { + return actionList_; + } + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + @java.lang.Override + public int getActionListCount() { + return actionList_.size(); + } + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction getActionList(int index) { + return actionList_.get(index); + } + /** + *
+     * One or more actions should be applied
+     * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index) { + return actionList_.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; @@ -1780,8 +1978,23 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getPolicyRuleVariableBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyRuleVariable_); + if (policyRuleId_ != null) { + output.writeMessage(1, getPolicyRuleId()); + } + if (policyRuleState_ != null) { + output.writeMessage(2, getPolicyRuleState()); + } + if (priority_ != 0) { + output.writeUInt32(3, priority_); + } + for (int i = 0; i < conditionList_.size(); i++) { + output.writeMessage(4, conditionList_.get(i)); + } + if (booleanOperator_ != policy.PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED.getNumber()) { + output.writeEnum(5, booleanOperator_); + } + for (int i = 0; i < actionList_.size(); i++) { + output.writeMessage(6, actionList_.get(i)); } unknownFields.writeTo(output); } @@ -1792,8 +2005,29 @@ public final class Policy { if (size != -1) return size; size = 0; - if (!getPolicyRuleVariableBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyRuleVariable_); + if (policyRuleId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPolicyRuleId()); + } + if (policyRuleState_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getPolicyRuleState()); + } + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, priority_); + } + for (int i = 0; i < conditionList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, conditionList_.get(i)); + } + if (booleanOperator_ != policy.PolicyCondition.BooleanOperator.POLICYRULE_CONDITION_BOOLEAN_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, booleanOperator_); + } + for (int i = 0; i < actionList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, actionList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -1805,13 +2039,28 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleVariable)) { + if (!(obj instanceof policy.Policy.PolicyRuleBasic)) { return super.equals(obj); } - policy.Policy.PolicyRuleVariable other = (policy.Policy.PolicyRuleVariable) obj; + policy.Policy.PolicyRuleBasic other = (policy.Policy.PolicyRuleBasic) obj; - if (!getPolicyRuleVariable() - .equals(other.getPolicyRuleVariable())) return false; + if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; + if (hasPolicyRuleId()) { + if (!getPolicyRuleId() + .equals(other.getPolicyRuleId())) return false; + } + if (hasPolicyRuleState() != other.hasPolicyRuleState()) return false; + if (hasPolicyRuleState()) { + if (!getPolicyRuleState() + .equals(other.getPolicyRuleState())) return false; + } + if (getPriority() + != other.getPriority()) return false; + if (!getConditionListList() + .equals(other.getConditionListList())) return false; + if (booleanOperator_ != other.booleanOperator_) return false; + if (!getActionListList() + .equals(other.getActionListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1823,76 +2072,94 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + POLICYRULEVARIABLE_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleVariable().hashCode(); + if (hasPolicyRuleId()) { + hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleId().hashCode(); + } + if (hasPolicyRuleState()) { + hash = (37 * hash) + POLICYRULESTATE_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleState().hashCode(); + } + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); + if (getConditionListCount() > 0) { + hash = (37 * hash) + CONDITIONLIST_FIELD_NUMBER; + hash = (53 * hash) + getConditionListList().hashCode(); + } + hash = (37 * hash) + BOOLEANOPERATOR_FIELD_NUMBER; + hash = (53 * hash) + booleanOperator_; + if (getActionListCount() > 0) { + hash = (37 * hash) + ACTIONLIST_FIELD_NUMBER; + hash = (53 * hash) + getActionListList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom(byte[] data) + public static policy.Policy.PolicyRuleBasic parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleVariable parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleBasic parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic 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 policy.Policy.PolicyRuleVariable parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleBasic parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseDelimitedFrom( + public static policy.Policy.PolicyRuleBasic 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 policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleVariable parseFrom( + public static policy.Policy.PolicyRuleBasic parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1905,7 +2172,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleVariable prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleBasic prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1921,26 +2188,30 @@ public final class Policy { return builder; } /** - * Protobuf type {@code policy.PolicyRuleVariable} + *
+     * Basic policy rule attributes
+     * 
+ * + * Protobuf type {@code policy.PolicyRuleBasic} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleVariable) - policy.Policy.PolicyRuleVariableOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleBasic) + policy.Policy.PolicyRuleBasicOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleBasic_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleVariable.class, policy.Policy.PolicyRuleVariable.Builder.class); + policy.Policy.PolicyRuleBasic.class, policy.Policy.PolicyRuleBasic.Builder.class); } - // Construct using policy.Policy.PolicyRuleVariable.newBuilder() + // Construct using policy.Policy.PolicyRuleBasic.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1953,30 +2224,58 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getConditionListFieldBuilder(); + getActionListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - policyRuleVariable_ = ""; + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = null; + } else { + policyRuleId_ = null; + policyRuleIdBuilder_ = null; + } + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = null; + } else { + policyRuleState_ = null; + policyRuleStateBuilder_ = null; + } + priority_ = 0; + + if (conditionListBuilder_ == null) { + conditionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + conditionListBuilder_.clear(); + } + booleanOperator_ = 0; + if (actionListBuilder_ == null) { + actionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + actionListBuilder_.clear(); + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleVariable_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleBasic_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleVariable getDefaultInstanceForType() { - return policy.Policy.PolicyRuleVariable.getDefaultInstance(); + public policy.Policy.PolicyRuleBasic getDefaultInstanceForType() { + return policy.Policy.PolicyRuleBasic.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleVariable build() { - policy.Policy.PolicyRuleVariable result = buildPartial(); + public policy.Policy.PolicyRuleBasic build() { + policy.Policy.PolicyRuleBasic result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1984,9 +2283,39 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleVariable buildPartial() { - policy.Policy.PolicyRuleVariable result = new policy.Policy.PolicyRuleVariable(this); - result.policyRuleVariable_ = policyRuleVariable_; + public policy.Policy.PolicyRuleBasic buildPartial() { + policy.Policy.PolicyRuleBasic result = new policy.Policy.PolicyRuleBasic(this); + int from_bitField0_ = bitField0_; + if (policyRuleIdBuilder_ == null) { + result.policyRuleId_ = policyRuleId_; + } else { + result.policyRuleId_ = policyRuleIdBuilder_.build(); + } + if (policyRuleStateBuilder_ == null) { + result.policyRuleState_ = policyRuleState_; + } else { + result.policyRuleState_ = policyRuleStateBuilder_.build(); + } + result.priority_ = priority_; + if (conditionListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conditionList_ = java.util.Collections.unmodifiableList(conditionList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conditionList_ = conditionList_; + } else { + result.conditionList_ = conditionListBuilder_.build(); + } + result.booleanOperator_ = booleanOperator_; + if (actionListBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + actionList_ = java.util.Collections.unmodifiableList(actionList_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.actionList_ = actionList_; + } else { + result.actionList_ = actionListBuilder_.build(); + } onBuilt(); return result; } @@ -2025,19 +2354,79 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleVariable) { - return mergeFrom((policy.Policy.PolicyRuleVariable)other); + if (other instanceof policy.Policy.PolicyRuleBasic) { + return mergeFrom((policy.Policy.PolicyRuleBasic)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleVariable other) { - if (other == policy.Policy.PolicyRuleVariable.getDefaultInstance()) return this; - if (!other.getPolicyRuleVariable().isEmpty()) { - policyRuleVariable_ = other.policyRuleVariable_; - onChanged(); + public Builder mergeFrom(policy.Policy.PolicyRuleBasic other) { + if (other == policy.Policy.PolicyRuleBasic.getDefaultInstance()) return this; + if (other.hasPolicyRuleId()) { + mergePolicyRuleId(other.getPolicyRuleId()); + } + if (other.hasPolicyRuleState()) { + mergePolicyRuleState(other.getPolicyRuleState()); + } + if (other.getPriority() != 0) { + setPriority(other.getPriority()); + } + if (conditionListBuilder_ == null) { + if (!other.conditionList_.isEmpty()) { + if (conditionList_.isEmpty()) { + conditionList_ = other.conditionList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConditionListIsMutable(); + conditionList_.addAll(other.conditionList_); + } + onChanged(); + } + } else { + if (!other.conditionList_.isEmpty()) { + if (conditionListBuilder_.isEmpty()) { + conditionListBuilder_.dispose(); + conditionListBuilder_ = null; + conditionList_ = other.conditionList_; + bitField0_ = (bitField0_ & ~0x00000001); + conditionListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getConditionListFieldBuilder() : null; + } else { + conditionListBuilder_.addAllMessages(other.conditionList_); + } + } + } + if (other.booleanOperator_ != 0) { + setBooleanOperatorValue(other.getBooleanOperatorValue()); + } + if (actionListBuilder_ == null) { + if (!other.actionList_.isEmpty()) { + if (actionList_.isEmpty()) { + actionList_ = other.actionList_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureActionListIsMutable(); + actionList_.addAll(other.actionList_); + } + onChanged(); + } + } else { + if (!other.actionList_.isEmpty()) { + if (actionListBuilder_.isEmpty()) { + actionListBuilder_.dispose(); + actionListBuilder_ = null; + actionList_ = other.actionList_; + bitField0_ = (bitField0_ & ~0x00000002); + actionListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getActionListFieldBuilder() : null; + } else { + actionListBuilder_.addAllMessages(other.actionList_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -2054,11 +2443,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleVariable parsedMessage = null; + policy.Policy.PolicyRuleBasic parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleVariable) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleBasic) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2067,650 +2456,1010 @@ public final class Policy { } return this; } + private int bitField0_; - private java.lang.Object policyRuleVariable_ = ""; + private policy.Policy.PolicyRuleId policyRuleId_; + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdBuilder_; /** - * string policyRuleVariable = 1; - * @return The policyRuleVariable. + * .policy.PolicyRuleId policyRuleId = 1; + * @return Whether the policyRuleId field is set. + */ + public boolean hasPolicyRuleId() { + return policyRuleIdBuilder_ != null || policyRuleId_ != null; + } + /** + * .policy.PolicyRuleId policyRuleId = 1; + * @return The policyRuleId. */ - public java.lang.String getPolicyRuleVariable() { - java.lang.Object ref = policyRuleVariable_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleVariable_ = s; - return s; + public policy.Policy.PolicyRuleId getPolicyRuleId() { + if (policyRuleIdBuilder_ == null) { + return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; } else { - return (java.lang.String) ref; + return policyRuleIdBuilder_.getMessage(); } } /** - * string policyRuleVariable = 1; - * @return The bytes for policyRuleVariable. + * .policy.PolicyRuleId policyRuleId = 1; */ - public com.google.protobuf.ByteString - getPolicyRuleVariableBytes() { - java.lang.Object ref = policyRuleVariable_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleVariable_ = b; - return b; + public Builder setPolicyRuleId(policy.Policy.PolicyRuleId value) { + if (policyRuleIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyRuleId_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + policyRuleIdBuilder_.setMessage(value); } + + return this; } /** - * string policyRuleVariable = 1; - * @param value The policyRuleVariable to set. - * @return This builder for chaining. + * .policy.PolicyRuleId policyRuleId = 1; */ - public Builder setPolicyRuleVariable( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - policyRuleVariable_ = value; - onChanged(); + public Builder setPolicyRuleId( + policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = builderForValue.build(); + onChanged(); + } else { + policyRuleIdBuilder_.setMessage(builderForValue.build()); + } + return this; } /** - * string policyRuleVariable = 1; - * @return This builder for chaining. + * .policy.PolicyRuleId policyRuleId = 1; */ - public Builder clearPolicyRuleVariable() { - - policyRuleVariable_ = getDefaultInstance().getPolicyRuleVariable(); - onChanged(); + public Builder mergePolicyRuleId(policy.Policy.PolicyRuleId value) { + if (policyRuleIdBuilder_ == null) { + if (policyRuleId_ != null) { + policyRuleId_ = + policy.Policy.PolicyRuleId.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); + } else { + policyRuleId_ = value; + } + onChanged(); + } else { + policyRuleIdBuilder_.mergeFrom(value); + } + return this; } /** - * string policyRuleVariable = 1; - * @param value The bytes for policyRuleVariable to set. - * @return This builder for chaining. + * .policy.PolicyRuleId policyRuleId = 1; */ - public Builder setPolicyRuleVariableBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearPolicyRuleId() { + if (policyRuleIdBuilder_ == null) { + policyRuleId_ = null; + onChanged(); + } else { + policyRuleId_ = null; + policyRuleIdBuilder_ = null; + } + + return this; + } + /** + * .policy.PolicyRuleId policyRuleId = 1; + */ + public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdBuilder() { - policyRuleVariable_ = value; onChanged(); - return this; + return getPolicyRuleIdFieldBuilder().getBuilder(); } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * .policy.PolicyRuleId policyRuleId = 1; + */ + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { + if (policyRuleIdBuilder_ != null) { + return policyRuleIdBuilder_.getMessageOrBuilder(); + } else { + return policyRuleId_ == null ? + policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + } + } + /** + * .policy.PolicyRuleId policyRuleId = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdFieldBuilder() { + if (policyRuleIdBuilder_ == null) { + policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( + getPolicyRuleId(), + getParentForChildren(), + isClean()); + policyRuleId_ = null; + } + return policyRuleIdBuilder_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private policy.Policy.PolicyRuleState policyRuleState_; + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder> policyRuleStateBuilder_; + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return Whether the policyRuleState field is set. + */ + public boolean hasPolicyRuleState() { + return policyRuleStateBuilder_ != null || policyRuleState_ != null; + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + * @return The policyRuleState. + */ + public policy.Policy.PolicyRuleState getPolicyRuleState() { + if (policyRuleStateBuilder_ == null) { + return policyRuleState_ == null ? policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } else { + return policyRuleStateBuilder_.getMessage(); + } } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public Builder setPolicyRuleState(policy.Policy.PolicyRuleState value) { + if (policyRuleStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyRuleState_ = value; + onChanged(); + } else { + policyRuleStateBuilder_.setMessage(value); + } + return this; + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public Builder setPolicyRuleState( + policy.Policy.PolicyRuleState.Builder builderForValue) { + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = builderForValue.build(); + onChanged(); + } else { + policyRuleStateBuilder_.setMessage(builderForValue.build()); + } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleVariable) - } + return this; + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public Builder mergePolicyRuleState(policy.Policy.PolicyRuleState value) { + if (policyRuleStateBuilder_ == null) { + if (policyRuleState_ != null) { + policyRuleState_ = + policy.Policy.PolicyRuleState.newBuilder(policyRuleState_).mergeFrom(value).buildPartial(); + } else { + policyRuleState_ = value; + } + onChanged(); + } else { + policyRuleStateBuilder_.mergeFrom(value); + } - // @@protoc_insertion_point(class_scope:policy.PolicyRuleVariable) - private static final policy.Policy.PolicyRuleVariable DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleVariable(); - } + return this; + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public Builder clearPolicyRuleState() { + if (policyRuleStateBuilder_ == null) { + policyRuleState_ = null; + onChanged(); + } else { + policyRuleState_ = null; + policyRuleStateBuilder_ = null; + } - public static policy.Policy.PolicyRuleVariable getDefaultInstance() { - return DEFAULT_INSTANCE; - } + return this; + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public policy.Policy.PolicyRuleState.Builder getPolicyRuleStateBuilder() { + + onChanged(); + return getPolicyRuleStateFieldBuilder().getBuilder(); + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + public policy.Policy.PolicyRuleStateOrBuilder getPolicyRuleStateOrBuilder() { + if (policyRuleStateBuilder_ != null) { + return policyRuleStateBuilder_.getMessageOrBuilder(); + } else { + return policyRuleState_ == null ? + policy.Policy.PolicyRuleState.getDefaultInstance() : policyRuleState_; + } + } + /** + *
+       *policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.
+       * 
+ * + * .policy.PolicyRuleState policyRuleState = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder> + getPolicyRuleStateFieldBuilder() { + if (policyRuleStateBuilder_ == null) { + policyRuleStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleState, policy.Policy.PolicyRuleState.Builder, policy.Policy.PolicyRuleStateOrBuilder>( + getPolicyRuleState(), + getParentForChildren(), + isClean()); + policyRuleState_ = null; + } + return policyRuleStateBuilder_; + } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private int priority_ ; + /** + * uint32 priority = 3; + * @return The priority. + */ @java.lang.Override - public PolicyRuleVariable parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleVariable(input, extensionRegistry); + public int getPriority() { + return priority_; + } + /** + * uint32 priority = 3; + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(int value) { + + priority_ = value; + onChanged(); + return this; + } + /** + * uint32 priority = 3; + * @return This builder for chaining. + */ + public Builder clearPriority() { + + priority_ = 0; + onChanged(); + return this; } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleVariable getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleValue) - com.google.protobuf.MessageOrBuilder { - /** - * string policyRuleValue = 1; - * @return The policyRuleValue. - */ - java.lang.String getPolicyRuleValue(); - /** - * string policyRuleValue = 1; - * @return The bytes for policyRuleValue. - */ - com.google.protobuf.ByteString - getPolicyRuleValueBytes(); - } - /** - * Protobuf type {@code policy.PolicyRuleValue} - */ - public static final class PolicyRuleValue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleValue) - PolicyRuleValueOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRuleValue.newBuilder() to construct. - private PolicyRuleValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PolicyRuleValue() { - policyRuleValue_ = ""; - } + private java.util.List conditionList_ = + java.util.Collections.emptyList(); + private void ensureConditionListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conditionList_ = new java.util.ArrayList(conditionList_); + bitField0_ |= 0x00000001; + } + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRuleValue(); - } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder> conditionListBuilder_; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRuleValue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public java.util.List getConditionListList() { + if (conditionListBuilder_ == null) { + return java.util.Collections.unmodifiableList(conditionList_); + } else { + return conditionListBuilder_.getMessageList(); + } } - 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(); - - policyRuleValue_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public int getConditionListCount() { + if (conditionListBuilder_ == null) { + return conditionList_.size(); + } else { + return conditionListBuilder_.getCount(); + } + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public policy.PolicyCondition.PolicyRuleCondition getConditionList(int index) { + if (conditionListBuilder_ == null) { + return conditionList_.get(index); + } else { + return conditionListBuilder_.getMessage(index); + } + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder setConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureConditionListIsMutable(); + conditionList_.set(index, value); + onChanged(); + } else { + conditionListBuilder_.setMessage(index, value); } - } 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(); + return this; } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleValue.class, policy.Policy.PolicyRuleValue.Builder.class); - } - - public static final int POLICYRULEVALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object policyRuleValue_; - /** - * string policyRuleValue = 1; - * @return The policyRuleValue. - */ - @java.lang.Override - public java.lang.String getPolicyRuleValue() { - java.lang.Object ref = policyRuleValue_; - 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(); - policyRuleValue_ = s; - return s; + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder setConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.set(index, builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.setMessage(index, builderForValue.build()); + } + return this; } - } - /** - * string policyRuleValue = 1; - * @return The bytes for policyRuleValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPolicyRuleValueBytes() { - java.lang.Object ref = policyRuleValue_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleValue_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder addConditionList(policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionListIsMutable(); + conditionList_.add(value); + onChanged(); + } else { + conditionListBuilder_.addMessage(value); + } + return this; } - } - - 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 (!getPolicyRuleValueBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyRuleValue_); + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder addConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition value) { + if (conditionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConditionListIsMutable(); + conditionList_.add(index, value); + onChanged(); + } else { + conditionListBuilder_.addMessage(index, value); + } + return this; } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getPolicyRuleValueBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyRuleValue_); + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder addConditionList( + policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.add(builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.addMessage(builderForValue.build()); + } + return this; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder addConditionList( + int index, policy.PolicyCondition.PolicyRuleCondition.Builder builderForValue) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.add(index, builderForValue.build()); + onChanged(); + } else { + conditionListBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - if (!(obj instanceof policy.Policy.PolicyRuleValue)) { - return super.equals(obj); + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder addAllConditionList( + java.lang.Iterable values) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, conditionList_); + onChanged(); + } else { + conditionListBuilder_.addAllMessages(values); + } + return this; } - policy.Policy.PolicyRuleValue other = (policy.Policy.PolicyRuleValue) obj; - - if (!getPolicyRuleValue() - .equals(other.getPolicyRuleValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder clearConditionList() { + if (conditionListBuilder_ == null) { + conditionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conditionListBuilder_.clear(); + } + return this; + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public Builder removeConditionList(int index) { + if (conditionListBuilder_ == null) { + ensureConditionListIsMutable(); + conditionList_.remove(index); + onChanged(); + } else { + conditionListBuilder_.remove(index); + } + return this; + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public policy.PolicyCondition.PolicyRuleCondition.Builder getConditionListBuilder( + int index) { + return getConditionListFieldBuilder().getBuilder(index); + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public policy.PolicyCondition.PolicyRuleConditionOrBuilder getConditionListOrBuilder( + int index) { + if (conditionListBuilder_ == null) { + return conditionList_.get(index); } else { + return conditionListBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public java.util.List + getConditionListOrBuilderList() { + if (conditionListBuilder_ != null) { + return conditionListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conditionList_); + } + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public policy.PolicyCondition.PolicyRuleCondition.Builder addConditionListBuilder() { + return getConditionListFieldBuilder().addBuilder( + policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()); + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public policy.PolicyCondition.PolicyRuleCondition.Builder addConditionListBuilder( + int index) { + return getConditionListFieldBuilder().addBuilder( + index, policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()); + } + /** + *
+       * Event-Condition-Action (ECA) model
+       * 
+ * + * repeated .policy.PolicyRuleCondition conditionList = 4; + */ + public java.util.List + getConditionListBuilderList() { + return getConditionListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder> + getConditionListFieldBuilder() { + if (conditionListBuilder_ == null) { + conditionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyCondition.PolicyRuleCondition, policy.PolicyCondition.PolicyRuleCondition.Builder, policy.PolicyCondition.PolicyRuleConditionOrBuilder>( + conditionList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conditionList_ = null; + } + return conditionListBuilder_; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + POLICYRULEVALUE_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - public static policy.Policy.PolicyRuleValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue 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 policy.Policy.PolicyRuleValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue 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 policy.Policy.PolicyRuleValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleValue 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(policy.Policy.PolicyRuleValue 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 policy.PolicyRuleValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleValue) - policy.Policy.PolicyRuleValueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleValue.class, policy.Policy.PolicyRuleValue.Builder.class); - } - - // Construct using policy.Policy.PolicyRuleValue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } + private int booleanOperator_ = 0; + /** + *
+       * Evaluation operator to be used
+       * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The enum numeric value on the wire for booleanOperator. + */ + @java.lang.Override public int getBooleanOperatorValue() { + return booleanOperator_; } - @java.lang.Override - public Builder clear() { - super.clear(); - policyRuleValue_ = ""; - + /** + *
+       * Evaluation operator to be used
+       * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @param value The enum numeric value on the wire for booleanOperator to set. + * @return This builder for chaining. + */ + public Builder setBooleanOperatorValue(int value) { + + booleanOperator_ = value; + onChanged(); return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleValue_descriptor; - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue getDefaultInstanceForType() { - return policy.Policy.PolicyRuleValue.getDefaultInstance(); - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue build() { - policy.Policy.PolicyRuleValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public policy.Policy.PolicyRuleValue buildPartial() { - policy.Policy.PolicyRuleValue result = new policy.Policy.PolicyRuleValue(this); - result.policyRuleValue_ = policyRuleValue_; - 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); - } + /** + *
+       * Evaluation operator to be used
+       * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return The booleanOperator. + */ @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + public policy.PolicyCondition.BooleanOperator getBooleanOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.BooleanOperator result = policy.PolicyCondition.BooleanOperator.valueOf(booleanOperator_); + return result == null ? policy.PolicyCondition.BooleanOperator.UNRECOGNIZED : result; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleValue) { - return mergeFrom((policy.Policy.PolicyRuleValue)other); - } else { - super.mergeFrom(other); - return this; + /** + *
+       * Evaluation operator to be used
+       * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @param value The booleanOperator to set. + * @return This builder for chaining. + */ + public Builder setBooleanOperator(policy.PolicyCondition.BooleanOperator value) { + if (value == null) { + throw new NullPointerException(); } + + booleanOperator_ = value.getNumber(); + onChanged(); + return this; } - - public Builder mergeFrom(policy.Policy.PolicyRuleValue other) { - if (other == policy.Policy.PolicyRuleValue.getDefaultInstance()) return this; - if (!other.getPolicyRuleValue().isEmpty()) { - policyRuleValue_ = other.policyRuleValue_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); + /** + *
+       * Evaluation operator to be used
+       * 
+ * + * .policy.BooleanOperator booleanOperator = 5; + * @return This builder for chaining. + */ + public Builder clearBooleanOperator() { + + booleanOperator_ = 0; onChanged(); return this; } - @java.lang.Override - public final boolean isInitialized() { - return true; + private java.util.List actionList_ = + java.util.Collections.emptyList(); + private void ensureActionListIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + actionList_ = new java.util.ArrayList(actionList_); + bitField0_ |= 0x00000002; + } } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - policy.Policy.PolicyRuleValue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleValue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder> actionListBuilder_; - private java.lang.Object policyRuleValue_ = ""; /** - * string policyRuleValue = 1; - * @return The policyRuleValue. + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - public java.lang.String getPolicyRuleValue() { - java.lang.Object ref = policyRuleValue_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyRuleValue_ = s; - return s; + public java.util.List getActionListList() { + if (actionListBuilder_ == null) { + return java.util.Collections.unmodifiableList(actionList_); } else { - return (java.lang.String) ref; + return actionListBuilder_.getMessageList(); } } /** - * string policyRuleValue = 1; - * @return The bytes for policyRuleValue. + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - public com.google.protobuf.ByteString - getPolicyRuleValueBytes() { - java.lang.Object ref = policyRuleValue_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - policyRuleValue_ = b; - return b; + public int getActionListCount() { + if (actionListBuilder_ == null) { + return actionList_.size(); } else { - return (com.google.protobuf.ByteString) ref; + return actionListBuilder_.getCount(); } } /** - * string policyRuleValue = 1; - * @param value The policyRuleValue to set. - * @return This builder for chaining. + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - public Builder setPolicyRuleValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - policyRuleValue_ = value; - onChanged(); - return this; + public policy.PolicyAction.PolicyRuleAction getActionList(int index) { + if (actionListBuilder_ == null) { + return actionList_.get(index); + } else { + return actionListBuilder_.getMessage(index); + } } /** - * string policyRuleValue = 1; - * @return This builder for chaining. + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - public Builder clearPolicyRuleValue() { - - policyRuleValue_ = getDefaultInstance().getPolicyRuleValue(); - onChanged(); + public Builder setActionList( + int index, policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.set(index, value); + onChanged(); + } else { + actionListBuilder_.setMessage(index, value); + } return this; } /** - * string policyRuleValue = 1; - * @param value The bytes for policyRuleValue to set. - * @return This builder for chaining. + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; */ - public Builder setPolicyRuleValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - policyRuleValue_ = value; - onChanged(); + public Builder setActionList( + int index, policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.set(index, builderForValue.build()); + onChanged(); + } else { + actionListBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder addActionList(policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.add(value); + onChanged(); + } else { + actionListBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder addActionList( + int index, policy.PolicyAction.PolicyRuleAction value) { + if (actionListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureActionListIsMutable(); + actionList_.add(index, value); + onChanged(); + } else { + actionListBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder addActionList( + policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.add(builderForValue.build()); + onChanged(); + } else { + actionListBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder addActionList( + int index, policy.PolicyAction.PolicyRuleAction.Builder builderForValue) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.add(index, builderForValue.build()); + onChanged(); + } else { + actionListBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder addAllActionList( + java.lang.Iterable values) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, actionList_); + onChanged(); + } else { + actionListBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder clearActionList() { + if (actionListBuilder_ == null) { + actionList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + actionListBuilder_.clear(); + } + return this; + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public Builder removeActionList(int index) { + if (actionListBuilder_ == null) { + ensureActionListIsMutable(); + actionList_.remove(index); + onChanged(); + } else { + actionListBuilder_.remove(index); + } return this; } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public policy.PolicyAction.PolicyRuleAction.Builder getActionListBuilder( + int index) { + return getActionListFieldBuilder().getBuilder(index); + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public policy.PolicyAction.PolicyRuleActionOrBuilder getActionListOrBuilder( + int index) { + if (actionListBuilder_ == null) { + return actionList_.get(index); } else { + return actionListBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public java.util.List + getActionListOrBuilderList() { + if (actionListBuilder_ != null) { + return actionListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(actionList_); + } + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public policy.PolicyAction.PolicyRuleAction.Builder addActionListBuilder() { + return getActionListFieldBuilder().addBuilder( + policy.PolicyAction.PolicyRuleAction.getDefaultInstance()); + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public policy.PolicyAction.PolicyRuleAction.Builder addActionListBuilder( + int index) { + return getActionListFieldBuilder().addBuilder( + index, policy.PolicyAction.PolicyRuleAction.getDefaultInstance()); + } + /** + *
+       * One or more actions should be applied
+       * 
+ * + * repeated .policy.PolicyRuleAction actionList = 6; + */ + public java.util.List + getActionListBuilderList() { + return getActionListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder> + getActionListFieldBuilder() { + if (actionListBuilder_ == null) { + actionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.PolicyAction.PolicyRuleAction, policy.PolicyAction.PolicyRuleAction.Builder, policy.PolicyAction.PolicyRuleActionOrBuilder>( + actionList_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + actionList_ = null; + } + return actionListBuilder_; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -2724,91 +3473,173 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleValue) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleBasic) } - // @@protoc_insertion_point(class_scope:policy.PolicyRuleValue) - private static final policy.Policy.PolicyRuleValue DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleBasic) + private static final policy.Policy.PolicyRuleBasic DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleValue(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleBasic(); } - public static policy.Policy.PolicyRuleValue getDefaultInstance() { + public static policy.Policy.PolicyRuleBasic getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PolicyRuleValue parsePartialFrom( + public PolicyRuleBasic parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleValue(input, extensionRegistry); + return new PolicyRuleBasic(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRuleValue getDefaultInstanceForType() { + public policy.Policy.PolicyRuleBasic getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PolicyRuleEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleEvent) + public interface PolicyRuleServiceOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleService) com.google.protobuf.MessageOrBuilder { /** - * .context.Event event = 1; - * @return Whether the event field is set. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. + */ + boolean hasPolicyRuleBasic(); + /** + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. + */ + policy.Policy.PolicyRuleBasic getPolicyRuleBasic(); + /** + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + */ + policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder(); + + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + * @return Whether the serviceId field is set. + */ + boolean hasServiceId(); + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + * @return The serviceId. + */ + context.ContextOuterClass.ServiceId getServiceId(); + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + */ + context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder(); + + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + java.util.List + getDeviceListList(); + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + context.ContextOuterClass.DeviceId getDeviceList(int index); + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - boolean hasEvent(); + int getDeviceListCount(); /** - * .context.Event event = 1; - * @return The event. + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - context.ContextOuterClass.Event getEvent(); + java.util.List + getDeviceListOrBuilderList(); /** - * .context.Event event = 1; + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - context.ContextOuterClass.EventOrBuilder getEventOrBuilder(); + context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index); } /** *
-   * IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management
-   *     Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/
-   * Event
+   * Service-oriented policy rule
    * 
* - * Protobuf type {@code policy.PolicyRuleEvent} + * Protobuf type {@code policy.PolicyRuleService} */ - public static final class PolicyRuleEvent extends + public static final class PolicyRuleService extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleEvent) - PolicyRuleEventOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleService) + PolicyRuleServiceOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleEvent.newBuilder() to construct. - private PolicyRuleEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use PolicyRuleService.newBuilder() to construct. + private PolicyRuleService(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private PolicyRuleEvent() { + private PolicyRuleService() { + deviceList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleEvent(); + return new PolicyRuleService(); } @java.lang.Override @@ -2816,7 +3647,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleEvent( + private PolicyRuleService( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2824,6 +3655,7 @@ public final class Policy { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -2835,18 +3667,40 @@ public final class Policy { done = true; break; case 10: { - context.ContextOuterClass.Event.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); + policy.Policy.PolicyRuleBasic.Builder subBuilder = null; + if (policyRuleBasic_ != null) { + subBuilder = policyRuleBasic_.toBuilder(); + } + policyRuleBasic_ = input.readMessage(policy.Policy.PolicyRuleBasic.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(policyRuleBasic_); + policyRuleBasic_ = subBuilder.buildPartial(); } - event_ = input.readMessage(context.ContextOuterClass.Event.parser(), extensionRegistry); + + break; + } + case 18: { + context.ContextOuterClass.ServiceId.Builder subBuilder = null; + if (serviceId_ != null) { + subBuilder = serviceId_.toBuilder(); + } + serviceId_ = input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(serviceId_); + serviceId_ = subBuilder.buildPartial(); } break; } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deviceList_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -2862,65 +3716,184 @@ public final class Policy { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleService_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleEvent.class, policy.Policy.PolicyRuleEvent.Builder.class); + policy.Policy.PolicyRuleService.class, policy.Policy.PolicyRuleService.Builder.class); } - public static final int EVENT_FIELD_NUMBER = 1; - private context.ContextOuterClass.Event event_; + public static final int POLICYRULEBASIC_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. */ @java.lang.Override - public boolean hasEvent() { - return event_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasic_ != null; } /** - * .context.Event event = 1; - * @return The event. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. */ @java.lang.Override - public context.ContextOuterClass.Event getEvent() { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } /** - * .context.Event event = 1; + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ @java.lang.Override - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - return getEvent(); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + return getPolicyRuleBasic(); } - private byte memoizedIsInitialized = -1; + public static final int SERVICEID_FIELD_NUMBER = 2; + private context.ContextOuterClass.ServiceId serviceId_; + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + * @return Whether the serviceId field is set. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; + public boolean hasServiceId() { + return serviceId_ != null; + } + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + * @return The serviceId. + */ + @java.lang.Override + public context.ContextOuterClass.ServiceId getServiceId() { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } + /** + *
+     * Affected service and (some of) its device(s)
+     * 
+ * + * .context.ServiceId serviceId = 2; + */ + @java.lang.Override + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + return getServiceId(); + } + + public static final int DEVICELIST_FIELD_NUMBER = 3; + private java.util.List deviceList_; + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + @java.lang.Override + public java.util.List getDeviceListList() { + return deviceList_; + } + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + @java.lang.Override + public java.util.List + getDeviceListOrBuilderList() { + return deviceList_; + } + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + @java.lang.Override + public int getDeviceListCount() { + return deviceList_.size(); + } + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + return deviceList_.get(index); + } + /** + *
+     * List of devices this service is traversing (not exhaustive)
+     * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + @java.lang.Override + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + return deviceList_.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 (event_ != null) { - output.writeMessage(1, getEvent()); + if (policyRuleBasic_ != null) { + output.writeMessage(1, getPolicyRuleBasic()); + } + if (serviceId_ != null) { + output.writeMessage(2, getServiceId()); + } + for (int i = 0; i < deviceList_.size(); i++) { + output.writeMessage(3, deviceList_.get(i)); } unknownFields.writeTo(output); } @@ -2931,9 +3904,17 @@ public final class Policy { if (size != -1) return size; size = 0; - if (event_ != null) { + if (policyRuleBasic_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPolicyRuleBasic()); + } + if (serviceId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getServiceId()); + } + for (int i = 0; i < deviceList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEvent()); + .computeMessageSize(3, deviceList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -2945,16 +3926,23 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleEvent)) { + if (!(obj instanceof policy.Policy.PolicyRuleService)) { return super.equals(obj); } - policy.Policy.PolicyRuleEvent other = (policy.Policy.PolicyRuleEvent) obj; + policy.Policy.PolicyRuleService other = (policy.Policy.PolicyRuleService) obj; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; + if (hasPolicyRuleBasic() != other.hasPolicyRuleBasic()) return false; + if (hasPolicyRuleBasic()) { + if (!getPolicyRuleBasic() + .equals(other.getPolicyRuleBasic())) return false; + } + if (hasServiceId() != other.hasServiceId()) return false; + if (hasServiceId()) { + if (!getServiceId() + .equals(other.getServiceId())) return false; } + if (!getDeviceListList() + .equals(other.getDeviceListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2966,78 +3954,86 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); + if (hasPolicyRuleBasic()) { + hash = (37 * hash) + POLICYRULEBASIC_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleBasic().hashCode(); + } + if (hasServiceId()) { + hash = (37 * hash) + SERVICEID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + } + if (getDeviceListCount() > 0) { + hash = (37 * hash) + DEVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getDeviceListList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleEvent parseFrom(byte[] data) + public static policy.Policy.PolicyRuleService parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleEvent parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleService parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService 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 policy.Policy.PolicyRuleEvent parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleService parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleEvent parseDelimitedFrom( + public static policy.Policy.PolicyRuleService 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 policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleEvent parseFrom( + public static policy.Policy.PolicyRuleService parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3050,7 +4046,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleEvent prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleService prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3067,31 +4063,29 @@ public final class Policy { } /** *
-     * IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management
-     *     Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/
-     * Event
+     * Service-oriented policy rule
      * 
* - * Protobuf type {@code policy.PolicyRuleEvent} + * Protobuf type {@code policy.PolicyRuleService} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleEvent) - policy.Policy.PolicyRuleEventOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleService) + policy.Policy.PolicyRuleServiceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleService_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleEvent.class, policy.Policy.PolicyRuleEvent.Builder.class); + policy.Policy.PolicyRuleService.class, policy.Policy.PolicyRuleService.Builder.class); } - // Construct using policy.Policy.PolicyRuleEvent.newBuilder() + // Construct using policy.Policy.PolicyRuleService.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3104,16 +4098,29 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getDeviceListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (eventBuilder_ == null) { - event_ = null; + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; + } else { + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; + } + if (serviceIdBuilder_ == null) { + serviceId_ = null; + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - event_ = null; - eventBuilder_ = null; + deviceListBuilder_.clear(); } return this; } @@ -3121,17 +4128,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleEvent_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleService_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleEvent getDefaultInstanceForType() { - return policy.Policy.PolicyRuleEvent.getDefaultInstance(); + public policy.Policy.PolicyRuleService getDefaultInstanceForType() { + return policy.Policy.PolicyRuleService.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleEvent build() { - policy.Policy.PolicyRuleEvent result = buildPartial(); + public policy.Policy.PolicyRuleService build() { + policy.Policy.PolicyRuleService result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3139,12 +4146,27 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleEvent buildPartial() { - policy.Policy.PolicyRuleEvent result = new policy.Policy.PolicyRuleEvent(this); - if (eventBuilder_ == null) { - result.event_ = event_; + public policy.Policy.PolicyRuleService buildPartial() { + policy.Policy.PolicyRuleService result = new policy.Policy.PolicyRuleService(this); + int from_bitField0_ = bitField0_; + if (policyRuleBasicBuilder_ == null) { + result.policyRuleBasic_ = policyRuleBasic_; + } else { + result.policyRuleBasic_ = policyRuleBasicBuilder_.build(); + } + if (serviceIdBuilder_ == null) { + result.serviceId_ = serviceId_; + } else { + result.serviceId_ = serviceIdBuilder_.build(); + } + if (deviceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceList_ = deviceList_; } else { - result.event_ = eventBuilder_.build(); + result.deviceList_ = deviceListBuilder_.build(); } onBuilt(); return result; @@ -3184,18 +4206,47 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleEvent) { - return mergeFrom((policy.Policy.PolicyRuleEvent)other); + if (other instanceof policy.Policy.PolicyRuleService) { + return mergeFrom((policy.Policy.PolicyRuleService)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleEvent other) { - if (other == policy.Policy.PolicyRuleEvent.getDefaultInstance()) return this; - if (other.hasEvent()) { - mergeEvent(other.getEvent()); + public Builder mergeFrom(policy.Policy.PolicyRuleService other) { + if (other == policy.Policy.PolicyRuleService.getDefaultInstance()) return this; + if (other.hasPolicyRuleBasic()) { + mergePolicyRuleBasic(other.getPolicyRuleBasic()); + } + if (other.hasServiceId()) { + mergeServiceId(other.getServiceId()); + } + if (deviceListBuilder_ == null) { + if (!other.deviceList_.isEmpty()) { + if (deviceList_.isEmpty()) { + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceListIsMutable(); + deviceList_.addAll(other.deviceList_); + } + onChanged(); + } + } else { + if (!other.deviceList_.isEmpty()) { + if (deviceListBuilder_.isEmpty()) { + deviceListBuilder_.dispose(); + deviceListBuilder_ = null; + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceListFieldBuilder() : null; + } else { + deviceListBuilder_.addAllMessages(other.deviceList_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -3212,11 +4263,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleEvent parsedMessage = null; + policy.Policy.PolicyRuleService parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleEvent) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleService) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3225,956 +4276,628 @@ public final class Policy { } return this; } + private int bitField0_; - private context.ContextOuterClass.Event event_; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> eventBuilder_; + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> policyRuleBasicBuilder_; /** - * .context.Event event = 1; - * @return Whether the event field is set. + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasicBuilder_ != null || policyRuleBasic_ != null; } /** - * .context.Event event = 1; - * @return The event. + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. */ - public context.ContextOuterClass.Event getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? context.ContextOuterClass.Event.getDefaultInstance() : event_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } else { - return eventBuilder_.getMessage(); + return policyRuleBasicBuilder_.getMessage(); } } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder setEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { + public Builder setPolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - event_ = value; + policyRuleBasic_ = value; onChanged(); } else { - eventBuilder_.setMessage(value); + policyRuleBasicBuilder_.setMessage(value); } return this; } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder setEvent( - context.ContextOuterClass.Event.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); + public Builder setPolicyRuleBasic( + policy.Policy.PolicyRuleBasic.Builder builderForValue) { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = builderForValue.build(); onChanged(); } else { - eventBuilder_.setMessage(builderForValue.build()); + policyRuleBasicBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder mergeEvent(context.ContextOuterClass.Event value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - context.ContextOuterClass.Event.newBuilder(event_).mergeFrom(value).buildPartial(); + public Builder mergePolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { + if (policyRuleBasic_ != null) { + policyRuleBasic_ = + policy.Policy.PolicyRuleBasic.newBuilder(policyRuleBasic_).mergeFrom(value).buildPartial(); } else { - event_ = value; + policyRuleBasic_ = value; } onChanged(); } else { - eventBuilder_.mergeFrom(value); + policyRuleBasicBuilder_.mergeFrom(value); } return this; } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; + public Builder clearPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; onChanged(); } else { - event_ = null; - eventBuilder_ = null; + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; } return this; } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public context.ContextOuterClass.Event.Builder getEventBuilder() { + public policy.Policy.PolicyRuleBasic.Builder getPolicyRuleBasicBuilder() { onChanged(); - return getEventFieldBuilder().getBuilder(); + return getPolicyRuleBasicFieldBuilder().getBuilder(); } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public context.ContextOuterClass.EventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + if (policyRuleBasicBuilder_ != null) { + return policyRuleBasicBuilder_.getMessageOrBuilder(); } else { - return event_ == null ? - context.ContextOuterClass.Event.getDefaultInstance() : event_; + return policyRuleBasic_ == null ? + policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } } /** - * .context.Event event = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - context.ContextOuterClass.Event, context.ContextOuterClass.Event.Builder, context.ContextOuterClass.EventOrBuilder>( - getEvent(), + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> + getPolicyRuleBasicFieldBuilder() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasicBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder>( + getPolicyRuleBasic(), getParentForChildren(), isClean()); - event_ = null; + policyRuleBasic_ = null; } - return eventBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + return policyRuleBasicBuilder_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private context.ContextOuterClass.ServiceId serviceId_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceIdBuilder_; + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + * @return Whether the serviceId field is set. + */ + public boolean hasServiceId() { + return serviceIdBuilder_ != null || serviceId_ != null; } + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + * @return The serviceId. + */ + public context.ContextOuterClass.ServiceId getServiceId() { + if (serviceIdBuilder_ == null) { + return serviceId_ == null ? context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } else { + return serviceIdBuilder_.getMessage(); + } + } + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public Builder setServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceId_ = value; + onChanged(); + } else { + serviceIdBuilder_.setMessage(value); + } + return this; + } + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public Builder setServiceId( + context.ContextOuterClass.ServiceId.Builder builderForValue) { + if (serviceIdBuilder_ == null) { + serviceId_ = builderForValue.build(); + onChanged(); + } else { + serviceIdBuilder_.setMessage(builderForValue.build()); + } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleEvent) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleEvent) - private static final policy.Policy.PolicyRuleEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleEvent(); - } - - public static policy.Policy.PolicyRuleEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PolicyRuleEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleEvent(input, extensionRegistry); + return this; } - }; + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public Builder mergeServiceId(context.ContextOuterClass.ServiceId value) { + if (serviceIdBuilder_ == null) { + if (serviceId_ != null) { + serviceId_ = + context.ContextOuterClass.ServiceId.newBuilder(serviceId_).mergeFrom(value).buildPartial(); + } else { + serviceId_ = value; + } + onChanged(); + } else { + serviceIdBuilder_.mergeFrom(value); + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + return this; + } + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public Builder clearServiceId() { + if (serviceIdBuilder_ == null) { + serviceId_ = null; + onChanged(); + } else { + serviceId_ = null; + serviceIdBuilder_ = null; + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public policy.Policy.PolicyRuleEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleConditionOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleCondition) - com.google.protobuf.MessageOrBuilder { - - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return Whether the polRuleConditionVar field is set. - */ - boolean hasPolRuleConditionVar(); - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return The polRuleConditionVar. - */ - policy.Policy.PolicyRuleVariable getPolRuleConditionVar(); - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - */ - policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder(); - - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return Whether the polRuleConditionVal field is set. - */ - boolean hasPolRuleConditionVal(); - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return The polRuleConditionVal. - */ - policy.Policy.PolicyRuleValue getPolRuleConditionVal(); - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - */ - policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder(); - } - /** - *
-   * Condition
-   * 
- * - * Protobuf type {@code policy.PolicyRuleCondition} - */ - public static final class PolicyRuleCondition extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleCondition) - PolicyRuleConditionOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRuleCondition.newBuilder() to construct. - private PolicyRuleCondition(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PolicyRuleCondition() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRuleCondition(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRuleCondition( - 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: { - policy.Policy.PolicyRuleVariable.Builder subBuilder = null; - if (polRuleConditionVar_ != null) { - subBuilder = polRuleConditionVar_.toBuilder(); - } - polRuleConditionVar_ = input.readMessage(policy.Policy.PolicyRuleVariable.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(polRuleConditionVar_); - polRuleConditionVar_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - policy.Policy.PolicyRuleValue.Builder subBuilder = null; - if (polRuleConditionVal_ != null) { - subBuilder = polRuleConditionVal_.toBuilder(); - } - polRuleConditionVal_ = input.readMessage(policy.Policy.PolicyRuleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(polRuleConditionVal_); - polRuleConditionVal_ = 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 policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleCondition.class, policy.Policy.PolicyRuleCondition.Builder.class); - } - - public static final int POLRULECONDITIONVAR_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleVariable polRuleConditionVar_; - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return Whether the polRuleConditionVar field is set. - */ - @java.lang.Override - public boolean hasPolRuleConditionVar() { - return polRuleConditionVar_ != null; - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return The polRuleConditionVar. - */ - @java.lang.Override - public policy.Policy.PolicyRuleVariable getPolRuleConditionVar() { - return polRuleConditionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - */ - @java.lang.Override - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder() { - return getPolRuleConditionVar(); - } - - public static final int POLRULECONDITIONVAL_FIELD_NUMBER = 2; - private policy.Policy.PolicyRuleValue polRuleConditionVal_; - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return Whether the polRuleConditionVal field is set. - */ - @java.lang.Override - public boolean hasPolRuleConditionVal() { - return polRuleConditionVal_ != null; - } - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return The polRuleConditionVal. - */ - @java.lang.Override - public policy.Policy.PolicyRuleValue getPolRuleConditionVal() { - return polRuleConditionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; - } - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - */ - @java.lang.Override - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder() { - return getPolRuleConditionVal(); - } - - 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 (polRuleConditionVar_ != null) { - output.writeMessage(1, getPolRuleConditionVar()); + return this; } - if (polRuleConditionVal_ != null) { - output.writeMessage(2, getPolRuleConditionVal()); + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public context.ContextOuterClass.ServiceId.Builder getServiceIdBuilder() { + + onChanged(); + return getServiceIdFieldBuilder().getBuilder(); } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (polRuleConditionVar_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolRuleConditionVar()); + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + public context.ContextOuterClass.ServiceIdOrBuilder getServiceIdOrBuilder() { + if (serviceIdBuilder_ != null) { + return serviceIdBuilder_.getMessageOrBuilder(); + } else { + return serviceId_ == null ? + context.ContextOuterClass.ServiceId.getDefaultInstance() : serviceId_; + } } - if (polRuleConditionVal_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPolRuleConditionVal()); + /** + *
+       * Affected service and (some of) its device(s)
+       * 
+ * + * .context.ServiceId serviceId = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> + getServiceIdFieldBuilder() { + if (serviceIdBuilder_ == null) { + serviceIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( + getServiceId(), + getParentForChildren(), + isClean()); + serviceId_ = null; + } + return serviceIdBuilder_; } - 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 policy.Policy.PolicyRuleCondition)) { - return super.equals(obj); + private java.util.List deviceList_ = + java.util.Collections.emptyList(); + private void ensureDeviceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList(deviceList_); + bitField0_ |= 0x00000001; + } } - policy.Policy.PolicyRuleCondition other = (policy.Policy.PolicyRuleCondition) obj; - if (hasPolRuleConditionVar() != other.hasPolRuleConditionVar()) return false; - if (hasPolRuleConditionVar()) { - if (!getPolRuleConditionVar() - .equals(other.getPolRuleConditionVar())) return false; - } - if (hasPolRuleConditionVal() != other.hasPolRuleConditionVal()) return false; - if (hasPolRuleConditionVal()) { - if (!getPolRuleConditionVal() - .equals(other.getPolRuleConditionVal())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public java.util.List getDeviceListList() { + if (deviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceList_); + } else { + return deviceListBuilder_.getMessageList(); + } } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolRuleConditionVar()) { - hash = (37 * hash) + POLRULECONDITIONVAR_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionVar().hashCode(); + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public int getDeviceListCount() { + if (deviceListBuilder_ == null) { + return deviceList_.size(); + } else { + return deviceListBuilder_.getCount(); + } } - if (hasPolRuleConditionVal()) { - hash = (37 * hash) + POLRULECONDITIONVAL_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionVal().hashCode(); + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); + } else { + return deviceListBuilder_.getMessage(index); + } } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static policy.Policy.PolicyRuleCondition parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static policy.Policy.PolicyRuleCondition parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static policy.Policy.PolicyRuleCondition parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition 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 policy.Policy.PolicyRuleCondition parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition 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 policy.Policy.PolicyRuleCondition parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static policy.Policy.PolicyRuleCondition 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(policy.Policy.PolicyRuleCondition 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; - } - /** - *
-     * Condition
-     * 
- * - * Protobuf type {@code policy.PolicyRuleCondition} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleCondition) - policy.Policy.PolicyRuleConditionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleCondition.class, policy.Policy.PolicyRuleCondition.Builder.class); - } - - // Construct using policy.Policy.PolicyRuleCondition.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 (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = null; - } else { - polRuleConditionVar_ = null; - polRuleConditionVarBuilder_ = null; - } - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = null; - } else { - polRuleConditionVal_ = null; - polRuleConditionValBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleCondition_descriptor; - } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition getDefaultInstanceForType() { - return policy.Policy.PolicyRuleCondition.getDefaultInstance(); - } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition build() { - policy.Policy.PolicyRuleCondition result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public policy.Policy.PolicyRuleCondition buildPartial() { - policy.Policy.PolicyRuleCondition result = new policy.Policy.PolicyRuleCondition(this); - if (polRuleConditionVarBuilder_ == null) { - result.polRuleConditionVar_ = polRuleConditionVar_; - } else { - result.polRuleConditionVar_ = polRuleConditionVarBuilder_.build(); - } - if (polRuleConditionValBuilder_ == null) { - result.polRuleConditionVal_ = polRuleConditionVal_; - } else { - result.polRuleConditionVal_ = polRuleConditionValBuilder_.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 policy.Policy.PolicyRuleCondition) { - return mergeFrom((policy.Policy.PolicyRuleCondition)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(policy.Policy.PolicyRuleCondition other) { - if (other == policy.Policy.PolicyRuleCondition.getDefaultInstance()) return this; - if (other.hasPolRuleConditionVar()) { - mergePolRuleConditionVar(other.getPolRuleConditionVar()); - } - if (other.hasPolRuleConditionVal()) { - mergePolRuleConditionVal(other.getPolRuleConditionVal()); - } - 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 { - policy.Policy.PolicyRuleCondition parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleCondition) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private policy.Policy.PolicyRuleVariable polRuleConditionVar_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> polRuleConditionVarBuilder_; /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return Whether the polRuleConditionVar field is set. - */ - public boolean hasPolRuleConditionVar() { - return polRuleConditionVarBuilder_ != null || polRuleConditionVar_ != null; - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - * @return The polRuleConditionVar. - */ - public policy.Policy.PolicyRuleVariable getPolRuleConditionVar() { - if (polRuleConditionVarBuilder_ == null) { - return polRuleConditionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } else { - return polRuleConditionVarBuilder_.getMessage(); - } - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder setPolRuleConditionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleConditionVarBuilder_ == null) { + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - polRuleConditionVar_ = value; + ensureDeviceListIsMutable(); + deviceList_.set(index, value); onChanged(); } else { - polRuleConditionVarBuilder_.setMessage(value); + deviceListBuilder_.setMessage(index, value); } - return this; } /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder setPolRuleConditionVar( - policy.Policy.PolicyRuleVariable.Builder builderForValue) { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = builderForValue.build(); + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.set(index, builderForValue.build()); onChanged(); } else { - polRuleConditionVarBuilder_.setMessage(builderForValue.build()); + deviceListBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder mergePolRuleConditionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleConditionVarBuilder_ == null) { - if (polRuleConditionVar_ != null) { - polRuleConditionVar_ = - policy.Policy.PolicyRuleVariable.newBuilder(polRuleConditionVar_).mergeFrom(value).buildPartial(); - } else { - polRuleConditionVar_ = value; + public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureDeviceListIsMutable(); + deviceList_.add(value); onChanged(); } else { - polRuleConditionVarBuilder_.mergeFrom(value); + deviceListBuilder_.addMessage(value); } - return this; } /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder clearPolRuleConditionVar() { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVar_ = null; - onChanged(); - } else { - polRuleConditionVar_ = null; - polRuleConditionVarBuilder_ = null; - } - - return this; - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - */ - public policy.Policy.PolicyRuleVariable.Builder getPolRuleConditionVarBuilder() { - - onChanged(); - return getPolRuleConditionVarFieldBuilder().getBuilder(); - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - */ - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleConditionVarOrBuilder() { - if (polRuleConditionVarBuilder_ != null) { - return polRuleConditionVarBuilder_.getMessageOrBuilder(); + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(index, value); + onChanged(); } else { - return polRuleConditionVar_ == null ? - policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleConditionVar_; - } - } - /** - * .policy.PolicyRuleVariable polRuleConditionVar = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> - getPolRuleConditionVarFieldBuilder() { - if (polRuleConditionVarBuilder_ == null) { - polRuleConditionVarBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder>( - getPolRuleConditionVar(), - getParentForChildren(), - isClean()); - polRuleConditionVar_ = null; + deviceListBuilder_.addMessage(index, value); } - return polRuleConditionVarBuilder_; - } - - private policy.Policy.PolicyRuleValue polRuleConditionVal_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> polRuleConditionValBuilder_; - /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return Whether the polRuleConditionVal field is set. - */ - public boolean hasPolRuleConditionVal() { - return polRuleConditionValBuilder_ != null || polRuleConditionVal_ != null; + return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; - * @return The polRuleConditionVal. + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public policy.Policy.PolicyRuleValue getPolRuleConditionVal() { - if (polRuleConditionValBuilder_ == null) { - return polRuleConditionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; + public Builder addDeviceList( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(builderForValue.build()); + onChanged(); } else { - return polRuleConditionValBuilder_.getMessage(); + deviceListBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder setPolRuleConditionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleConditionValBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - polRuleConditionVal_ = value; + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(index, builderForValue.build()); onChanged(); } else { - polRuleConditionValBuilder_.setMessage(value); + deviceListBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder setPolRuleConditionVal( - policy.Policy.PolicyRuleValue.Builder builderForValue) { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = builderForValue.build(); + public Builder addAllDeviceList( + java.lang.Iterable values) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceList_); onChanged(); } else { - polRuleConditionValBuilder_.setMessage(builderForValue.build()); + deviceListBuilder_.addAllMessages(values); } - return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder mergePolRuleConditionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleConditionValBuilder_ == null) { - if (polRuleConditionVal_ != null) { - polRuleConditionVal_ = - policy.Policy.PolicyRuleValue.newBuilder(polRuleConditionVal_).mergeFrom(value).buildPartial(); - } else { - polRuleConditionVal_ = value; - } + public Builder clearDeviceList() { + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - polRuleConditionValBuilder_.mergeFrom(value); + deviceListBuilder_.clear(); } - return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public Builder clearPolRuleConditionVal() { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionVal_ = null; + public Builder removeDeviceList(int index) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.remove(index); onChanged(); } else { - polRuleConditionVal_ = null; - polRuleConditionValBuilder_ = null; + deviceListBuilder_.remove(index); } - return this; } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public policy.Policy.PolicyRuleValue.Builder getPolRuleConditionValBuilder() { - - onChanged(); - return getPolRuleConditionValFieldBuilder().getBuilder(); + public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().getBuilder(index); + } + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); } else { + return deviceListBuilder_.getMessageOrBuilder(index); + } } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleConditionValOrBuilder() { - if (polRuleConditionValBuilder_ != null) { - return polRuleConditionValBuilder_.getMessageOrBuilder(); + public java.util.List + getDeviceListOrBuilderList() { + if (deviceListBuilder_ != null) { + return deviceListBuilder_.getMessageOrBuilderList(); } else { - return polRuleConditionVal_ == null ? - policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleConditionVal_; + return java.util.Collections.unmodifiableList(deviceList_); } } /** - * .policy.PolicyRuleValue polRuleConditionVal = 2; + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> - getPolRuleConditionValFieldBuilder() { - if (polRuleConditionValBuilder_ == null) { - polRuleConditionValBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder>( - getPolRuleConditionVal(), + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { + return getDeviceListFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + *
+       * List of devices this service is traversing (not exhaustive)
+       * 
+ * + * repeated .context.DeviceId deviceList = 3; + */ + public java.util.List + getDeviceListBuilderList() { + return getDeviceListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListFieldBuilder() { + if (deviceListBuilder_ == null) { + deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceList_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - polRuleConditionVal_ = null; + deviceList_ = null; } - return polRuleConditionValBuilder_; + return deviceListBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -4189,104 +4912,146 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleCondition) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleService) } - // @@protoc_insertion_point(class_scope:policy.PolicyRuleCondition) - private static final policy.Policy.PolicyRuleCondition DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleService) + private static final policy.Policy.PolicyRuleService DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleCondition(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleService(); } - public static policy.Policy.PolicyRuleCondition getDefaultInstance() { + public static policy.Policy.PolicyRuleService getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PolicyRuleCondition parsePartialFrom( + public PolicyRuleService parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleCondition(input, extensionRegistry); + return new PolicyRuleService(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRuleCondition getDefaultInstanceForType() { + public policy.Policy.PolicyRuleService getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface PolicyRuleActionOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRuleAction) + public interface PolicyRuleDeviceOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleDevice) com.google.protobuf.MessageOrBuilder { /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return Whether the polRuleActionVar field is set. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. */ - boolean hasPolRuleActionVar(); + boolean hasPolicyRuleBasic(); /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return The polRuleActionVar. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. */ - policy.Policy.PolicyRuleVariable getPolRuleActionVar(); + policy.Policy.PolicyRuleBasic getPolicyRuleBasic(); /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder(); + policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder(); /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return Whether the polRuleActionVal field is set. + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + java.util.List + getDeviceListList(); + /** + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + context.ContextOuterClass.DeviceId getDeviceList(int index); + /** + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - boolean hasPolRuleActionVal(); + int getDeviceListCount(); /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return The polRuleActionVal. + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - policy.Policy.PolicyRuleValue getPolRuleActionVal(); + java.util.List + getDeviceListOrBuilderList(); /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder(); + context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index); } /** *
-   * Action
+   * Device-oriented policy rule
    * 
* - * Protobuf type {@code policy.PolicyRuleAction} + * Protobuf type {@code policy.PolicyRuleDevice} */ - public static final class PolicyRuleAction extends + public static final class PolicyRuleDevice extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRuleAction) - PolicyRuleActionOrBuilder { + // @@protoc_insertion_point(message_implements:policy.PolicyRuleDevice) + PolicyRuleDeviceOrBuilder { private static final long serialVersionUID = 0L; - // Use PolicyRuleAction.newBuilder() to construct. - private PolicyRuleAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use PolicyRuleDevice.newBuilder() to construct. + private PolicyRuleDevice(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private PolicyRuleAction() { + private PolicyRuleDevice() { + deviceList_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { - return new PolicyRuleAction(); + return new PolicyRuleDevice(); } @java.lang.Override @@ -4294,7 +5059,7 @@ public final class Policy { getUnknownFields() { return this.unknownFields; } - private PolicyRuleAction( + private PolicyRuleDevice( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4302,6 +5067,7 @@ public final class Policy { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4313,29 +5079,25 @@ public final class Policy { done = true; break; case 10: { - policy.Policy.PolicyRuleVariable.Builder subBuilder = null; - if (polRuleActionVar_ != null) { - subBuilder = polRuleActionVar_.toBuilder(); + policy.Policy.PolicyRuleBasic.Builder subBuilder = null; + if (policyRuleBasic_ != null) { + subBuilder = policyRuleBasic_.toBuilder(); } - polRuleActionVar_ = input.readMessage(policy.Policy.PolicyRuleVariable.parser(), extensionRegistry); + policyRuleBasic_ = input.readMessage(policy.Policy.PolicyRuleBasic.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom(polRuleActionVar_); - polRuleActionVar_ = subBuilder.buildPartial(); + subBuilder.mergeFrom(policyRuleBasic_); + policyRuleBasic_ = subBuilder.buildPartial(); } break; } case 18: { - policy.Policy.PolicyRuleValue.Builder subBuilder = null; - if (polRuleActionVal_ != null) { - subBuilder = polRuleActionVal_.toBuilder(); - } - polRuleActionVal_ = input.readMessage(policy.Policy.PolicyRuleValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(polRuleActionVal_); - polRuleActionVal_ = subBuilder.buildPartial(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - + deviceList_.add( + input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry)); break; } default: { @@ -4353,73 +5115,122 @@ public final class Policy { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleAction_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleDevice_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleAction.class, policy.Policy.PolicyRuleAction.Builder.class); + policy.Policy.PolicyRuleDevice.class, policy.Policy.PolicyRuleDevice.Builder.class); } - public static final int POLRULEACTIONVAR_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleVariable polRuleActionVar_; + public static final int POLICYRULEBASIC_FIELD_NUMBER = 1; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return Whether the polRuleActionVar field is set. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. */ @java.lang.Override - public boolean hasPolRuleActionVar() { - return polRuleActionVar_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasic_ != null; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return The polRuleActionVar. + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. */ @java.lang.Override - public policy.Policy.PolicyRuleVariable getPolRuleActionVar() { - return polRuleActionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+     * Basic policy rule attributes
+     * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ @java.lang.Override - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder() { - return getPolRuleActionVar(); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + return getPolicyRuleBasic(); } - public static final int POLRULEACTIONVAL_FIELD_NUMBER = 2; - private policy.Policy.PolicyRuleValue polRuleActionVal_; + public static final int DEVICELIST_FIELD_NUMBER = 2; + private java.util.List deviceList_; + /** + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + @java.lang.Override + public java.util.List getDeviceListList() { + return deviceList_; + } + /** + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + @java.lang.Override + public java.util.List + getDeviceListOrBuilderList() { + return deviceList_; + } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return Whether the polRuleActionVal field is set. + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ @java.lang.Override - public boolean hasPolRuleActionVal() { - return polRuleActionVal_ != null; + public int getDeviceListCount() { + return deviceList_.size(); } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return The polRuleActionVal. + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ @java.lang.Override - public policy.Policy.PolicyRuleValue getPolRuleActionVal() { - return polRuleActionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + return deviceList_.get(index); } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+     * Affected device(s)
+     * 
+ * + * repeated .context.DeviceId deviceList = 2; */ @java.lang.Override - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder() { - return getPolRuleActionVal(); + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + return deviceList_.get(index); } private byte memoizedIsInitialized = -1; @@ -4436,11 +5247,11 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (polRuleActionVar_ != null) { - output.writeMessage(1, getPolRuleActionVar()); + if (policyRuleBasic_ != null) { + output.writeMessage(1, getPolicyRuleBasic()); } - if (polRuleActionVal_ != null) { - output.writeMessage(2, getPolRuleActionVal()); + for (int i = 0; i < deviceList_.size(); i++) { + output.writeMessage(2, deviceList_.get(i)); } unknownFields.writeTo(output); } @@ -4451,13 +5262,13 @@ public final class Policy { if (size != -1) return size; size = 0; - if (polRuleActionVar_ != null) { + if (policyRuleBasic_ != null) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolRuleActionVar()); + .computeMessageSize(1, getPolicyRuleBasic()); } - if (polRuleActionVal_ != null) { + for (int i = 0; i < deviceList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getPolRuleActionVal()); + .computeMessageSize(2, deviceList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -4469,21 +5280,18 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRuleAction)) { + if (!(obj instanceof policy.Policy.PolicyRuleDevice)) { return super.equals(obj); } - policy.Policy.PolicyRuleAction other = (policy.Policy.PolicyRuleAction) obj; + policy.Policy.PolicyRuleDevice other = (policy.Policy.PolicyRuleDevice) obj; - if (hasPolRuleActionVar() != other.hasPolRuleActionVar()) return false; - if (hasPolRuleActionVar()) { - if (!getPolRuleActionVar() - .equals(other.getPolRuleActionVar())) return false; - } - if (hasPolRuleActionVal() != other.hasPolRuleActionVal()) return false; - if (hasPolRuleActionVal()) { - if (!getPolRuleActionVal() - .equals(other.getPolRuleActionVal())) return false; + if (hasPolicyRuleBasic() != other.hasPolicyRuleBasic()) return false; + if (hasPolicyRuleBasic()) { + if (!getPolicyRuleBasic() + .equals(other.getPolicyRuleBasic())) return false; } + if (!getDeviceListList() + .equals(other.getDeviceListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -4495,82 +5303,82 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolRuleActionVar()) { - hash = (37 * hash) + POLRULEACTIONVAR_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionVar().hashCode(); + if (hasPolicyRuleBasic()) { + hash = (37 * hash) + POLICYRULEBASIC_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleBasic().hashCode(); } - if (hasPolRuleActionVal()) { - hash = (37 * hash) + POLRULEACTIONVAL_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionVal().hashCode(); + if (getDeviceListCount() > 0) { + hash = (37 * hash) + DEVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getDeviceListList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom(byte[] data) + public static policy.Policy.PolicyRuleDevice parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRuleAction parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDevice parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice 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 policy.Policy.PolicyRuleAction parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleDevice parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseDelimitedFrom( + public static policy.Policy.PolicyRuleDevice 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 policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRuleAction parseFrom( + public static policy.Policy.PolicyRuleDevice parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4583,7 +5391,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRuleAction prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleDevice prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4600,29 +5408,29 @@ public final class Policy { } /** *
-     * Action
+     * Device-oriented policy rule
      * 
* - * Protobuf type {@code policy.PolicyRuleAction} + * Protobuf type {@code policy.PolicyRuleDevice} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRuleAction) - policy.Policy.PolicyRuleActionOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleDevice) + policy.Policy.PolicyRuleDeviceOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRuleAction_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleDevice_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRuleAction.class, policy.Policy.PolicyRuleAction.Builder.class); + policy.Policy.PolicyRuleDevice.class, policy.Policy.PolicyRuleDevice.Builder.class); } - // Construct using policy.Policy.PolicyRuleAction.newBuilder() + // Construct using policy.Policy.PolicyRuleDevice.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4635,22 +5443,23 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getDeviceListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = null; + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; } else { - polRuleActionVar_ = null; - polRuleActionVarBuilder_ = null; + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; } - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = null; + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - polRuleActionVal_ = null; - polRuleActionValBuilder_ = null; + deviceListBuilder_.clear(); } return this; } @@ -4658,17 +5467,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRuleAction_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleDevice_descriptor; } @java.lang.Override - public policy.Policy.PolicyRuleAction getDefaultInstanceForType() { - return policy.Policy.PolicyRuleAction.getDefaultInstance(); + public policy.Policy.PolicyRuleDevice getDefaultInstanceForType() { + return policy.Policy.PolicyRuleDevice.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRuleAction build() { - policy.Policy.PolicyRuleAction result = buildPartial(); + public policy.Policy.PolicyRuleDevice build() { + policy.Policy.PolicyRuleDevice result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4676,17 +5485,22 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRuleAction buildPartial() { - policy.Policy.PolicyRuleAction result = new policy.Policy.PolicyRuleAction(this); - if (polRuleActionVarBuilder_ == null) { - result.polRuleActionVar_ = polRuleActionVar_; + public policy.Policy.PolicyRuleDevice buildPartial() { + policy.Policy.PolicyRuleDevice result = new policy.Policy.PolicyRuleDevice(this); + int from_bitField0_ = bitField0_; + if (policyRuleBasicBuilder_ == null) { + result.policyRuleBasic_ = policyRuleBasic_; } else { - result.polRuleActionVar_ = polRuleActionVarBuilder_.build(); + result.policyRuleBasic_ = policyRuleBasicBuilder_.build(); } - if (polRuleActionValBuilder_ == null) { - result.polRuleActionVal_ = polRuleActionVal_; + if (deviceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deviceList_ = deviceList_; } else { - result.polRuleActionVal_ = polRuleActionValBuilder_.build(); + result.deviceList_ = deviceListBuilder_.build(); } onBuilt(); return result; @@ -4726,21 +5540,44 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRuleAction) { - return mergeFrom((policy.Policy.PolicyRuleAction)other); + if (other instanceof policy.Policy.PolicyRuleDevice) { + return mergeFrom((policy.Policy.PolicyRuleDevice)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRuleAction other) { - if (other == policy.Policy.PolicyRuleAction.getDefaultInstance()) return this; - if (other.hasPolRuleActionVar()) { - mergePolRuleActionVar(other.getPolRuleActionVar()); + public Builder mergeFrom(policy.Policy.PolicyRuleDevice other) { + if (other == policy.Policy.PolicyRuleDevice.getDefaultInstance()) return this; + if (other.hasPolicyRuleBasic()) { + mergePolicyRuleBasic(other.getPolicyRuleBasic()); } - if (other.hasPolRuleActionVal()) { - mergePolRuleActionVal(other.getPolRuleActionVal()); + if (deviceListBuilder_ == null) { + if (!other.deviceList_.isEmpty()) { + if (deviceList_.isEmpty()) { + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeviceListIsMutable(); + deviceList_.addAll(other.deviceList_); + } + onChanged(); + } + } else { + if (!other.deviceList_.isEmpty()) { + if (deviceListBuilder_.isEmpty()) { + deviceListBuilder_.dispose(); + deviceListBuilder_ = null; + deviceList_ = other.deviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + deviceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDeviceListFieldBuilder() : null; + } else { + deviceListBuilder_.addAllMessages(other.deviceList_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -4757,11 +5594,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRuleAction parsedMessage = null; + policy.Policy.PolicyRuleDevice parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRuleAction) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleDevice) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -4770,1027 +5607,688 @@ public final class Policy { } return this; } + private int bitField0_; - private policy.Policy.PolicyRuleVariable polRuleActionVar_; + private policy.Policy.PolicyRuleBasic policyRuleBasic_; private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> polRuleActionVarBuilder_; + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> policyRuleBasicBuilder_; /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return Whether the polRuleActionVar field is set. + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return Whether the policyRuleBasic field is set. */ - public boolean hasPolRuleActionVar() { - return polRuleActionVarBuilder_ != null || polRuleActionVar_ != null; + public boolean hasPolicyRuleBasic() { + return policyRuleBasicBuilder_ != null || policyRuleBasic_ != null; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; - * @return The polRuleActionVar. + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; + * @return The policyRuleBasic. */ - public policy.Policy.PolicyRuleVariable getPolRuleActionVar() { - if (polRuleActionVarBuilder_ == null) { - return polRuleActionVar_ == null ? policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + public policy.Policy.PolicyRuleBasic getPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + return policyRuleBasic_ == null ? policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } else { - return polRuleActionVarBuilder_.getMessage(); + return policyRuleBasicBuilder_.getMessage(); } } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder setPolRuleActionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleActionVarBuilder_ == null) { + public Builder setPolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - polRuleActionVar_ = value; + policyRuleBasic_ = value; onChanged(); } else { - polRuleActionVarBuilder_.setMessage(value); + policyRuleBasicBuilder_.setMessage(value); } return this; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder setPolRuleActionVar( - policy.Policy.PolicyRuleVariable.Builder builderForValue) { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = builderForValue.build(); + public Builder setPolicyRuleBasic( + policy.Policy.PolicyRuleBasic.Builder builderForValue) { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = builderForValue.build(); onChanged(); } else { - polRuleActionVarBuilder_.setMessage(builderForValue.build()); + policyRuleBasicBuilder_.setMessage(builderForValue.build()); } return this; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder mergePolRuleActionVar(policy.Policy.PolicyRuleVariable value) { - if (polRuleActionVarBuilder_ == null) { - if (polRuleActionVar_ != null) { - polRuleActionVar_ = - policy.Policy.PolicyRuleVariable.newBuilder(polRuleActionVar_).mergeFrom(value).buildPartial(); + public Builder mergePolicyRuleBasic(policy.Policy.PolicyRuleBasic value) { + if (policyRuleBasicBuilder_ == null) { + if (policyRuleBasic_ != null) { + policyRuleBasic_ = + policy.Policy.PolicyRuleBasic.newBuilder(policyRuleBasic_).mergeFrom(value).buildPartial(); } else { - polRuleActionVar_ = value; + policyRuleBasic_ = value; } onChanged(); } else { - polRuleActionVarBuilder_.mergeFrom(value); + policyRuleBasicBuilder_.mergeFrom(value); } return this; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public Builder clearPolRuleActionVar() { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVar_ = null; + public Builder clearPolicyRuleBasic() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasic_ = null; onChanged(); } else { - polRuleActionVar_ = null; - polRuleActionVarBuilder_ = null; + policyRuleBasic_ = null; + policyRuleBasicBuilder_ = null; } return this; } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public policy.Policy.PolicyRuleVariable.Builder getPolRuleActionVarBuilder() { + public policy.Policy.PolicyRuleBasic.Builder getPolicyRuleBasicBuilder() { onChanged(); - return getPolRuleActionVarFieldBuilder().getBuilder(); + return getPolicyRuleBasicFieldBuilder().getBuilder(); } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ - public policy.Policy.PolicyRuleVariableOrBuilder getPolRuleActionVarOrBuilder() { - if (polRuleActionVarBuilder_ != null) { - return polRuleActionVarBuilder_.getMessageOrBuilder(); + public policy.Policy.PolicyRuleBasicOrBuilder getPolicyRuleBasicOrBuilder() { + if (policyRuleBasicBuilder_ != null) { + return policyRuleBasicBuilder_.getMessageOrBuilder(); } else { - return polRuleActionVar_ == null ? - policy.Policy.PolicyRuleVariable.getDefaultInstance() : polRuleActionVar_; + return policyRuleBasic_ == null ? + policy.Policy.PolicyRuleBasic.getDefaultInstance() : policyRuleBasic_; } } /** - * .policy.PolicyRuleVariable polRuleActionVar = 1; + *
+       * Basic policy rule attributes
+       * 
+ * + * .policy.PolicyRuleBasic policyRuleBasic = 1; */ private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder> - getPolRuleActionVarFieldBuilder() { - if (polRuleActionVarBuilder_ == null) { - polRuleActionVarBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleVariable, policy.Policy.PolicyRuleVariable.Builder, policy.Policy.PolicyRuleVariableOrBuilder>( - getPolRuleActionVar(), + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder> + getPolicyRuleBasicFieldBuilder() { + if (policyRuleBasicBuilder_ == null) { + policyRuleBasicBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + policy.Policy.PolicyRuleBasic, policy.Policy.PolicyRuleBasic.Builder, policy.Policy.PolicyRuleBasicOrBuilder>( + getPolicyRuleBasic(), getParentForChildren(), isClean()); - polRuleActionVar_ = null; + policyRuleBasic_ = null; } - return polRuleActionVarBuilder_; + return policyRuleBasicBuilder_; } - private policy.Policy.PolicyRuleValue polRuleActionVal_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> polRuleActionValBuilder_; + private java.util.List deviceList_ = + java.util.Collections.emptyList(); + private void ensureDeviceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deviceList_ = new java.util.ArrayList(deviceList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; + + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public java.util.List getDeviceListList() { + if (deviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(deviceList_); + } else { + return deviceListBuilder_.getMessageList(); + } + } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return Whether the polRuleActionVal field is set. + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public boolean hasPolRuleActionVal() { - return polRuleActionValBuilder_ != null || polRuleActionVal_ != null; + public int getDeviceListCount() { + if (deviceListBuilder_ == null) { + return deviceList_.size(); + } else { + return deviceListBuilder_.getCount(); + } } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; - * @return The polRuleActionVal. + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public policy.Policy.PolicyRuleValue getPolRuleActionVal() { - if (polRuleActionValBuilder_ == null) { - return polRuleActionVal_ == null ? policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + public context.ContextOuterClass.DeviceId getDeviceList(int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); } else { - return polRuleActionValBuilder_.getMessage(); + return deviceListBuilder_.getMessage(index); } } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public Builder setPolRuleActionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleActionValBuilder_ == null) { + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - polRuleActionVal_ = value; + ensureDeviceListIsMutable(); + deviceList_.set(index, value); onChanged(); } else { - polRuleActionValBuilder_.setMessage(value); + deviceListBuilder_.setMessage(index, value); } - return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public Builder setPolRuleActionVal( - policy.Policy.PolicyRuleValue.Builder builderForValue) { - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = builderForValue.build(); + public Builder setDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.set(index, builderForValue.build()); onChanged(); } else { - polRuleActionValBuilder_.setMessage(builderForValue.build()); + deviceListBuilder_.setMessage(index, builderForValue.build()); } - return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public Builder mergePolRuleActionVal(policy.Policy.PolicyRuleValue value) { - if (polRuleActionValBuilder_ == null) { - if (polRuleActionVal_ != null) { - polRuleActionVal_ = - policy.Policy.PolicyRuleValue.newBuilder(polRuleActionVal_).mergeFrom(value).buildPartial(); - } else { - polRuleActionVal_ = value; + public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + ensureDeviceListIsMutable(); + deviceList_.add(value); onChanged(); } else { - polRuleActionValBuilder_.mergeFrom(value); + deviceListBuilder_.addMessage(value); } - return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public Builder clearPolRuleActionVal() { - if (polRuleActionValBuilder_ == null) { - polRuleActionVal_ = null; + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId value) { + if (deviceListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeviceListIsMutable(); + deviceList_.add(index, value); onChanged(); } else { - polRuleActionVal_ = null; - polRuleActionValBuilder_ = null; + deviceListBuilder_.addMessage(index, value); } - return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public policy.Policy.PolicyRuleValue.Builder getPolRuleActionValBuilder() { - - onChanged(); - return getPolRuleActionValFieldBuilder().getBuilder(); + public Builder addDeviceList( + context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(builderForValue.build()); + onChanged(); + } else { + deviceListBuilder_.addMessage(builderForValue.build()); + } + return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - public policy.Policy.PolicyRuleValueOrBuilder getPolRuleActionValOrBuilder() { - if (polRuleActionValBuilder_ != null) { - return polRuleActionValBuilder_.getMessageOrBuilder(); + public Builder addDeviceList( + int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.add(index, builderForValue.build()); + onChanged(); } else { - return polRuleActionVal_ == null ? - policy.Policy.PolicyRuleValue.getDefaultInstance() : polRuleActionVal_; + deviceListBuilder_.addMessage(index, builderForValue.build()); } + return this; } /** - * .policy.PolicyRuleValue polRuleActionVal = 2; + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder> - getPolRuleActionValFieldBuilder() { - if (polRuleActionValBuilder_ == null) { - polRuleActionValBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleValue, policy.Policy.PolicyRuleValue.Builder, policy.Policy.PolicyRuleValueOrBuilder>( - getPolRuleActionVal(), - getParentForChildren(), - isClean()); - polRuleActionVal_ = null; + public Builder addAllDeviceList( + java.lang.Iterable values) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, deviceList_); + onChanged(); + } else { + deviceListBuilder_.addAllMessages(values); } - return polRuleActionValBuilder_; + return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public Builder clearDeviceList() { + if (deviceListBuilder_ == null) { + deviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + deviceListBuilder_.clear(); + } + return this; } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public Builder removeDeviceList(int index) { + if (deviceListBuilder_ == null) { + ensureDeviceListIsMutable(); + deviceList_.remove(index); + onChanged(); + } else { + deviceListBuilder_.remove(index); + } + return this; } - - - // @@protoc_insertion_point(builder_scope:policy.PolicyRuleAction) - } - - // @@protoc_insertion_point(class_scope:policy.PolicyRuleAction) - private static final policy.Policy.PolicyRuleAction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRuleAction(); - } - - public static policy.Policy.PolicyRuleAction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PolicyRuleAction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRuleAction(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 policy.Policy.PolicyRuleAction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface PolicyRuleOrBuilder extends - // @@protoc_insertion_point(interface_extends:policy.PolicyRule) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return Whether the policyRuleId field is set. - */ - boolean hasPolicyRuleId(); - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return The policyRuleId. - */ - policy.Policy.PolicyRuleId getPolicyRuleId(); - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - */ - policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder(); - - /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The enum numeric value on the wire for policyRuleType. - */ - int getPolicyRuleTypeValue(); - /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The policyRuleType. - */ - policy.Policy.PolicyRuleType getPolicyRuleType(); - - /** - * uint32 PolicyRulePriority = 3; - * @return The policyRulePriority. - */ - int getPolicyRulePriority(); - - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return Whether the event field is set. - */ - boolean hasEvent(); - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return The event. - */ - policy.Policy.PolicyRuleEvent getEvent(); - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder(); - - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - java.util.List - getPolRuleConditionListList(); - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index); - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - int getPolRuleConditionListCount(); - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - java.util.List - getPolRuleConditionListOrBuilderList(); - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index); - - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ - java.util.List - getPolRuleActionListList(); - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ - policy.Policy.PolicyRuleAction getPolRuleActionList(int index); - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ - int getPolRuleActionListCount(); - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ - java.util.List - getPolRuleActionListOrBuilderList(); - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ - policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( - int index); - - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - java.util.List - getServiceListList(); - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - context.ContextOuterClass.ServiceId getServiceList(int index); - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - int getServiceListCount(); - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - java.util.List - getServiceListOrBuilderList(); - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index); - - /** - * repeated .context.DeviceId deviceList = 8; - */ - java.util.List - getDeviceListList(); - /** - * repeated .context.DeviceId deviceList = 8; - */ - context.ContextOuterClass.DeviceId getDeviceList(int index); - /** - * repeated .context.DeviceId deviceList = 8; - */ - int getDeviceListCount(); - /** - * repeated .context.DeviceId deviceList = 8; - */ - java.util.List - getDeviceListOrBuilderList(); - /** - * repeated .context.DeviceId deviceList = 8; - */ - context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( - int index); - } - /** - *
-   * Policy rule partially complies with IETF’s:
-   *     RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060
-   *     RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460
-   * Enhanced with a policy rule event according to the ECA model
-   * 
- * - * Protobuf type {@code policy.PolicyRule} - */ - public static final class PolicyRule extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:policy.PolicyRule) - PolicyRuleOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyRule.newBuilder() to construct. - private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PolicyRule() { - policyRuleType_ = 0; - polRuleConditionList_ = java.util.Collections.emptyList(); - polRuleActionList_ = java.util.Collections.emptyList(); - serviceList_ = java.util.Collections.emptyList(); - deviceList_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PolicyRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PolicyRule( - 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: { - policy.Policy.PolicyRuleId.Builder subBuilder = null; - if (policyRuleId_ != null) { - subBuilder = policyRuleId_.toBuilder(); - } - policyRuleId_ = input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policyRuleId_); - policyRuleId_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - int rawValue = input.readEnum(); - - policyRuleType_ = rawValue; - break; - } - case 24: { - - policyRulePriority_ = input.readUInt32(); - break; - } - case 34: { - policy.Policy.PolicyRuleEvent.Builder subBuilder = null; - if (event_ != null) { - subBuilder = event_.toBuilder(); - } - event_ = input.readMessage(policy.Policy.PolicyRuleEvent.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(event_); - event_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - polRuleConditionList_.add( - input.readMessage(policy.Policy.PolicyRuleCondition.parser(), extensionRegistry)); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - polRuleActionList_.add( - input.readMessage(policy.Policy.PolicyRuleAction.parser(), extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - serviceList_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - serviceList_.add( - input.readMessage(context.ContextOuterClass.ServiceId.parser(), extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - deviceList_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; - } - deviceList_.add( - input.readMessage(context.ContextOuterClass.DeviceId.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)) { - polRuleConditionList_ = java.util.Collections.unmodifiableList(polRuleConditionList_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = java.util.Collections.unmodifiableList(polRuleActionList_); + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().getBuilder(index); + } + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + int index) { + if (deviceListBuilder_ == null) { + return deviceList_.get(index); } else { + return deviceListBuilder_.getMessageOrBuilder(index); } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - serviceList_ = java.util.Collections.unmodifiableList(serviceList_); + } + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public java.util.List + getDeviceListOrBuilderList() { + if (deviceListBuilder_ != null) { + return deviceListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(deviceList_); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - deviceList_ = java.util.Collections.unmodifiableList(deviceList_); + } + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { + return getDeviceListFieldBuilder().addBuilder( + context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + int index) { + return getDeviceListFieldBuilder().addBuilder( + index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + } + /** + *
+       * Affected device(s)
+       * 
+ * + * repeated .context.DeviceId deviceList = 2; + */ + public java.util.List + getDeviceListBuilderList() { + return getDeviceListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> + getDeviceListFieldBuilder() { + if (deviceListBuilder_ == null) { + deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( + deviceList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + deviceList_ = null; } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + return deviceListBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRule_fieldAccessorTable - .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRule.class, policy.Policy.PolicyRule.Builder.class); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - public static final int POLICYRULEID_FIELD_NUMBER = 1; - private policy.Policy.PolicyRuleId policyRuleId_; - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return Whether the policyRuleId field is set. - */ - @java.lang.Override - public boolean hasPolicyRuleId() { - return policyRuleId_ != null; - } - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return The policyRuleId. - */ - @java.lang.Override - public policy.Policy.PolicyRuleId getPolicyRuleId() { - return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; - } - /** - *
-     * Basic policy rule attributes
-     * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - */ - @java.lang.Override - public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { - return getPolicyRuleId(); - } - public static final int POLICYRULETYPE_FIELD_NUMBER = 2; - private int policyRuleType_; - /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The enum numeric value on the wire for policyRuleType. - */ - @java.lang.Override public int getPolicyRuleTypeValue() { - return policyRuleType_; - } - /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The policyRuleType. - */ - @java.lang.Override public policy.Policy.PolicyRuleType getPolicyRuleType() { - @SuppressWarnings("deprecation") - policy.Policy.PolicyRuleType result = policy.Policy.PolicyRuleType.valueOf(policyRuleType_); - return result == null ? policy.Policy.PolicyRuleType.UNRECOGNIZED : result; + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleDevice) } - public static final int POLICYRULEPRIORITY_FIELD_NUMBER = 3; - private int policyRulePriority_; - /** - * uint32 PolicyRulePriority = 3; - * @return The policyRulePriority. - */ - @java.lang.Override - public int getPolicyRulePriority() { - return policyRulePriority_; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleDevice) + private static final policy.Policy.PolicyRuleDevice DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleDevice(); } - public static final int EVENT_FIELD_NUMBER = 4; - private policy.Policy.PolicyRuleEvent event_; - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return Whether the event field is set. - */ - @java.lang.Override - public boolean hasEvent() { - return event_ != null; - } - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return The event. - */ - @java.lang.Override - public policy.Policy.PolicyRuleEvent getEvent() { - return event_ == null ? policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; - } - /** - *
-     * Event-Condition-Action model
-     * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - @java.lang.Override - public policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder() { - return getEvent(); + public static policy.Policy.PolicyRuleDevice getDefaultInstance() { + return DEFAULT_INSTANCE; } - public static final int POLRULECONDITIONLIST_FIELD_NUMBER = 5; - private java.util.List polRuleConditionList_; - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - @java.lang.Override - public java.util.List getPolRuleConditionListList() { - return polRuleConditionList_; - } - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - @java.lang.Override - public java.util.List - getPolRuleConditionListOrBuilderList() { - return polRuleConditionList_; - } - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - @java.lang.Override - public int getPolRuleConditionListCount() { - return polRuleConditionList_.size(); - } - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - @java.lang.Override - public policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index) { - return polRuleConditionList_.get(index); - } - /** - *
-     * One or more conditions must be met
-     * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - @java.lang.Override - public policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index) { - return polRuleConditionList_.get(index); + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRuleDevice parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleDevice(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; } - public static final int POLRULEACTIONLIST_FIELD_NUMBER = 6; - private java.util.List polRuleActionList_; - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ @java.lang.Override - public java.util.List getPolRuleActionListList() { - return polRuleActionList_; + public com.google.protobuf.Parser getParserForType() { + return PARSER; } - /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; - */ + @java.lang.Override - public java.util.List - getPolRuleActionListOrBuilderList() { - return polRuleActionList_; + public policy.Policy.PolicyRuleDevice getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } + + } + + public interface PolicyRuleIdListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleIdList) + com.google.protobuf.MessageOrBuilder { + /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public int getPolRuleActionListCount() { - return polRuleActionList_.size(); - } + java.util.List + getPolicyRuleIdListList(); /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public policy.Policy.PolicyRuleAction getPolRuleActionList(int index) { - return polRuleActionList_.get(index); - } + policy.Policy.PolicyRuleId getPolicyRuleIdList(int index); /** - *
-     * One or more actions should be applied
-     * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( - int index) { - return polRuleActionList_.get(index); - } - - public static final int SERVICELIST_FIELD_NUMBER = 7; - private java.util.List serviceList_; + int getPolicyRuleIdListCount(); /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public java.util.List getServiceListList() { - return serviceList_; - } + java.util.List + getPolicyRuleIdListOrBuilderList(); /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public java.util.List - getServiceListOrBuilderList() { - return serviceList_; + policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( + int index); + } + /** + *
+   * A list of policy rule IDs
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleIdList} + */ + public static final class PolicyRuleIdList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleIdList) + PolicyRuleIdListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleIdList.newBuilder() to construct. + private PolicyRuleIdList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ + private PolicyRuleIdList() { + policyRuleIdList_ = java.util.Collections.emptyList(); + } + @java.lang.Override - public int getServiceListCount() { - return serviceList_.size(); + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleIdList(); } - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ + @java.lang.Override - public context.ContextOuterClass.ServiceId getServiceList(int index) { - return serviceList_.get(index); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - /** - *
-     * Affected services and devices
-     * 
- * - * repeated .context.ServiceId serviceList = 7; - */ + private PolicyRuleIdList( + 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)) { + policyRuleIdList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + policyRuleIdList_.add( + input.readMessage(policy.Policy.PolicyRuleId.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)) { + policyRuleIdList_ = java.util.Collections.unmodifiableList(policyRuleIdList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; + } + @java.lang.Override - public context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index) { - return serviceList_.get(index); + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleIdList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleIdList.class, policy.Policy.PolicyRuleIdList.Builder.class); } - public static final int DEVICELIST_FIELD_NUMBER = 8; - private java.util.List deviceList_; + public static final int POLICYRULEIDLIST_FIELD_NUMBER = 1; + private java.util.List policyRuleIdList_; /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ @java.lang.Override - public java.util.List getDeviceListList() { - return deviceList_; + public java.util.List getPolicyRuleIdListList() { + return policyRuleIdList_; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ @java.lang.Override - public java.util.List - getDeviceListOrBuilderList() { - return deviceList_; + public java.util.List + getPolicyRuleIdListOrBuilderList() { + return policyRuleIdList_; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ @java.lang.Override - public int getDeviceListCount() { - return deviceList_.size(); + public int getPolicyRuleIdListCount() { + return policyRuleIdList_.size(); } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ @java.lang.Override - public context.ContextOuterClass.DeviceId getDeviceList(int index) { - return deviceList_.get(index); + public policy.Policy.PolicyRuleId getPolicyRuleIdList(int index) { + return policyRuleIdList_.get(index); } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ @java.lang.Override - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( int index) { - return deviceList_.get(index); + return policyRuleIdList_.get(index); } private byte memoizedIsInitialized = -1; @@ -5807,29 +6305,8 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (policyRuleId_ != null) { - output.writeMessage(1, getPolicyRuleId()); - } - if (policyRuleType_ != policy.Policy.PolicyRuleType.POLICYTYPE_DEVICE.getNumber()) { - output.writeEnum(2, policyRuleType_); - } - if (policyRulePriority_ != 0) { - output.writeUInt32(3, policyRulePriority_); - } - if (event_ != null) { - output.writeMessage(4, getEvent()); - } - for (int i = 0; i < polRuleConditionList_.size(); i++) { - output.writeMessage(5, polRuleConditionList_.get(i)); - } - for (int i = 0; i < polRuleActionList_.size(); i++) { - output.writeMessage(6, polRuleActionList_.get(i)); - } - for (int i = 0; i < serviceList_.size(); i++) { - output.writeMessage(7, serviceList_.get(i)); - } - for (int i = 0; i < deviceList_.size(); i++) { - output.writeMessage(8, deviceList_.get(i)); + for (int i = 0; i < policyRuleIdList_.size(); i++) { + output.writeMessage(1, policyRuleIdList_.get(i)); } unknownFields.writeTo(output); } @@ -5840,37 +6317,9 @@ public final class Policy { if (size != -1) return size; size = 0; - if (policyRuleId_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPolicyRuleId()); - } - if (policyRuleType_ != policy.Policy.PolicyRuleType.POLICYTYPE_DEVICE.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, policyRuleType_); - } - if (policyRulePriority_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, policyRulePriority_); - } - if (event_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getEvent()); - } - for (int i = 0; i < polRuleConditionList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, polRuleConditionList_.get(i)); - } - for (int i = 0; i < polRuleActionList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, polRuleActionList_.get(i)); - } - for (int i = 0; i < serviceList_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, serviceList_.get(i)); - } - for (int i = 0; i < deviceList_.size(); i++) { + for (int i = 0; i < policyRuleIdList_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, deviceList_.get(i)); + .computeMessageSize(1, policyRuleIdList_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5882,32 +6331,13 @@ public final class Policy { if (obj == this) { return true; } - if (!(obj instanceof policy.Policy.PolicyRule)) { + if (!(obj instanceof policy.Policy.PolicyRuleIdList)) { return super.equals(obj); } - policy.Policy.PolicyRule other = (policy.Policy.PolicyRule) obj; + policy.Policy.PolicyRuleIdList other = (policy.Policy.PolicyRuleIdList) obj; - if (hasPolicyRuleId() != other.hasPolicyRuleId()) return false; - if (hasPolicyRuleId()) { - if (!getPolicyRuleId() - .equals(other.getPolicyRuleId())) return false; - } - if (policyRuleType_ != other.policyRuleType_) return false; - if (getPolicyRulePriority() - != other.getPolicyRulePriority()) return false; - if (hasEvent() != other.hasEvent()) return false; - if (hasEvent()) { - if (!getEvent() - .equals(other.getEvent())) return false; - } - if (!getPolRuleConditionListList() - .equals(other.getPolRuleConditionListList())) return false; - if (!getPolRuleActionListList() - .equals(other.getPolRuleActionListList())) return false; - if (!getServiceListList() - .equals(other.getServiceListList())) return false; - if (!getDeviceListList() - .equals(other.getDeviceListList())) return false; + if (!getPolicyRuleIdListList() + .equals(other.getPolicyRuleIdListList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -5919,102 +6349,78 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPolicyRuleId()) { - hash = (37 * hash) + POLICYRULEID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleId().hashCode(); - } - hash = (37 * hash) + POLICYRULETYPE_FIELD_NUMBER; - hash = (53 * hash) + policyRuleType_; - hash = (37 * hash) + POLICYRULEPRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRulePriority(); - if (hasEvent()) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); - } - if (getPolRuleConditionListCount() > 0) { - hash = (37 * hash) + POLRULECONDITIONLIST_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleConditionListList().hashCode(); - } - if (getPolRuleActionListCount() > 0) { - hash = (37 * hash) + POLRULEACTIONLIST_FIELD_NUMBER; - hash = (53 * hash) + getPolRuleActionListList().hashCode(); - } - if (getServiceListCount() > 0) { - hash = (37 * hash) + SERVICELIST_FIELD_NUMBER; - hash = (53 * hash) + getServiceListList().hashCode(); - } - if (getDeviceListCount() > 0) { - hash = (37 * hash) + DEVICELIST_FIELD_NUMBER; - hash = (53 * hash) + getDeviceListList().hashCode(); + if (getPolicyRuleIdListCount() > 0) { + hash = (37 * hash) + POLICYRULEIDLIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleIdListList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom(byte[] data) + public static policy.Policy.PolicyRuleIdList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static policy.Policy.PolicyRule parseFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleIdList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList 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 policy.Policy.PolicyRule parseDelimitedFrom(java.io.InputStream input) + public static policy.Policy.PolicyRuleIdList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseDelimitedFrom( + public static policy.Policy.PolicyRuleIdList 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 policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static policy.Policy.PolicyRule parseFrom( + public static policy.Policy.PolicyRuleIdList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6027,7 +6433,7 @@ public final class Policy { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(policy.Policy.PolicyRule prototype) { + public static Builder newBuilder(policy.Policy.PolicyRuleIdList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -6044,32 +6450,29 @@ public final class Policy { } /** *
-     * Policy rule partially complies with IETF’s:
-     *     RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060
-     *     RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460
-     * Enhanced with a policy rule event according to the ECA model
+     * A list of policy rule IDs
      * 
* - * Protobuf type {@code policy.PolicyRule} + * Protobuf type {@code policy.PolicyRuleIdList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:policy.PolicyRule) - policy.Policy.PolicyRuleOrBuilder { + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleIdList) + policy.Policy.PolicyRuleIdListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return policy.Policy.internal_static_policy_PolicyRule_fieldAccessorTable + return policy.Policy.internal_static_policy_PolicyRuleIdList_fieldAccessorTable .ensureFieldAccessorsInitialized( - policy.Policy.PolicyRule.class, policy.Policy.PolicyRule.Builder.class); + policy.Policy.PolicyRuleIdList.class, policy.Policy.PolicyRuleIdList.Builder.class); } - // Construct using policy.Policy.PolicyRule.newBuilder() + // Construct using policy.Policy.PolicyRuleIdList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6082,54 +6485,17 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPolRuleConditionListFieldBuilder(); - getPolRuleActionListFieldBuilder(); - getServiceListFieldBuilder(); - getDeviceListFieldBuilder(); + getPolicyRuleIdListFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; - } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; - } - policyRuleType_ = 0; - - policyRulePriority_ = 0; - - if (eventBuilder_ == null) { - event_ = null; - } else { - event_ = null; - eventBuilder_ = null; - } - if (polRuleConditionListBuilder_ == null) { - polRuleConditionList_ = java.util.Collections.emptyList(); + if (policyRuleIdListBuilder_ == null) { + policyRuleIdList_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - polRuleConditionListBuilder_.clear(); - } - if (polRuleActionListBuilder_ == null) { - polRuleActionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - polRuleActionListBuilder_.clear(); - } - if (serviceListBuilder_ == null) { - serviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - serviceListBuilder_.clear(); - } - if (deviceListBuilder_ == null) { - deviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); - } else { - deviceListBuilder_.clear(); + policyRuleIdListBuilder_.clear(); } return this; } @@ -6137,17 +6503,17 @@ public final class Policy { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return policy.Policy.internal_static_policy_PolicyRule_descriptor; + return policy.Policy.internal_static_policy_PolicyRuleIdList_descriptor; } @java.lang.Override - public policy.Policy.PolicyRule getDefaultInstanceForType() { - return policy.Policy.PolicyRule.getDefaultInstance(); + public policy.Policy.PolicyRuleIdList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleIdList.getDefaultInstance(); } @java.lang.Override - public policy.Policy.PolicyRule build() { - policy.Policy.PolicyRule result = buildPartial(); + public policy.Policy.PolicyRuleIdList build() { + policy.Policy.PolicyRuleIdList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -6155,56 +6521,17 @@ public final class Policy { } @java.lang.Override - public policy.Policy.PolicyRule buildPartial() { - policy.Policy.PolicyRule result = new policy.Policy.PolicyRule(this); + public policy.Policy.PolicyRuleIdList buildPartial() { + policy.Policy.PolicyRuleIdList result = new policy.Policy.PolicyRuleIdList(this); int from_bitField0_ = bitField0_; - if (policyRuleIdBuilder_ == null) { - result.policyRuleId_ = policyRuleId_; - } else { - result.policyRuleId_ = policyRuleIdBuilder_.build(); - } - result.policyRuleType_ = policyRuleType_; - result.policyRulePriority_ = policyRulePriority_; - if (eventBuilder_ == null) { - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - if (polRuleConditionListBuilder_ == null) { + if (policyRuleIdListBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = java.util.Collections.unmodifiableList(polRuleConditionList_); + policyRuleIdList_ = java.util.Collections.unmodifiableList(policyRuleIdList_); bitField0_ = (bitField0_ & ~0x00000001); } - result.polRuleConditionList_ = polRuleConditionList_; - } else { - result.polRuleConditionList_ = polRuleConditionListBuilder_.build(); - } - if (polRuleActionListBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = java.util.Collections.unmodifiableList(polRuleActionList_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.polRuleActionList_ = polRuleActionList_; - } else { - result.polRuleActionList_ = polRuleActionListBuilder_.build(); - } - if (serviceListBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - serviceList_ = java.util.Collections.unmodifiableList(serviceList_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.serviceList_ = serviceList_; - } else { - result.serviceList_ = serviceListBuilder_.build(); - } - if (deviceListBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { - deviceList_ = java.util.Collections.unmodifiableList(deviceList_); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.deviceList_ = deviceList_; + result.policyRuleIdList_ = policyRuleIdList_; } else { - result.deviceList_ = deviceListBuilder_.build(); + result.policyRuleIdList_ = policyRuleIdListBuilder_.build(); } onBuilt(); return result; @@ -6244,129 +6571,39 @@ public final class Policy { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof policy.Policy.PolicyRule) { - return mergeFrom((policy.Policy.PolicyRule)other); + if (other instanceof policy.Policy.PolicyRuleIdList) { + return mergeFrom((policy.Policy.PolicyRuleIdList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(policy.Policy.PolicyRule other) { - if (other == policy.Policy.PolicyRule.getDefaultInstance()) return this; - if (other.hasPolicyRuleId()) { - mergePolicyRuleId(other.getPolicyRuleId()); - } - if (other.policyRuleType_ != 0) { - setPolicyRuleTypeValue(other.getPolicyRuleTypeValue()); - } - if (other.getPolicyRulePriority() != 0) { - setPolicyRulePriority(other.getPolicyRulePriority()); - } - if (other.hasEvent()) { - mergeEvent(other.getEvent()); - } - if (polRuleConditionListBuilder_ == null) { - if (!other.polRuleConditionList_.isEmpty()) { - if (polRuleConditionList_.isEmpty()) { - polRuleConditionList_ = other.polRuleConditionList_; + public Builder mergeFrom(policy.Policy.PolicyRuleIdList other) { + if (other == policy.Policy.PolicyRuleIdList.getDefaultInstance()) return this; + if (policyRuleIdListBuilder_ == null) { + if (!other.policyRuleIdList_.isEmpty()) { + if (policyRuleIdList_.isEmpty()) { + policyRuleIdList_ = other.policyRuleIdList_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.addAll(other.polRuleConditionList_); + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.addAll(other.policyRuleIdList_); } onChanged(); } } else { - if (!other.polRuleConditionList_.isEmpty()) { - if (polRuleConditionListBuilder_.isEmpty()) { - polRuleConditionListBuilder_.dispose(); - polRuleConditionListBuilder_ = null; - polRuleConditionList_ = other.polRuleConditionList_; + if (!other.policyRuleIdList_.isEmpty()) { + if (policyRuleIdListBuilder_.isEmpty()) { + policyRuleIdListBuilder_.dispose(); + policyRuleIdListBuilder_ = null; + policyRuleIdList_ = other.policyRuleIdList_; bitField0_ = (bitField0_ & ~0x00000001); - polRuleConditionListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolRuleConditionListFieldBuilder() : null; - } else { - polRuleConditionListBuilder_.addAllMessages(other.polRuleConditionList_); - } - } - } - if (polRuleActionListBuilder_ == null) { - if (!other.polRuleActionList_.isEmpty()) { - if (polRuleActionList_.isEmpty()) { - polRuleActionList_ = other.polRuleActionList_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.addAll(other.polRuleActionList_); - } - onChanged(); - } - } else { - if (!other.polRuleActionList_.isEmpty()) { - if (polRuleActionListBuilder_.isEmpty()) { - polRuleActionListBuilder_.dispose(); - polRuleActionListBuilder_ = null; - polRuleActionList_ = other.polRuleActionList_; - bitField0_ = (bitField0_ & ~0x00000002); - polRuleActionListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolRuleActionListFieldBuilder() : null; - } else { - polRuleActionListBuilder_.addAllMessages(other.polRuleActionList_); - } - } - } - if (serviceListBuilder_ == null) { - if (!other.serviceList_.isEmpty()) { - if (serviceList_.isEmpty()) { - serviceList_ = other.serviceList_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureServiceListIsMutable(); - serviceList_.addAll(other.serviceList_); - } - onChanged(); - } - } else { - if (!other.serviceList_.isEmpty()) { - if (serviceListBuilder_.isEmpty()) { - serviceListBuilder_.dispose(); - serviceListBuilder_ = null; - serviceList_ = other.serviceList_; - bitField0_ = (bitField0_ & ~0x00000004); - serviceListBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getServiceListFieldBuilder() : null; - } else { - serviceListBuilder_.addAllMessages(other.serviceList_); - } - } - } - if (deviceListBuilder_ == null) { - if (!other.deviceList_.isEmpty()) { - if (deviceList_.isEmpty()) { - deviceList_ = other.deviceList_; - bitField0_ = (bitField0_ & ~0x00000008); - } else { - ensureDeviceListIsMutable(); - deviceList_.addAll(other.deviceList_); - } - onChanged(); - } - } else { - if (!other.deviceList_.isEmpty()) { - if (deviceListBuilder_.isEmpty()) { - deviceListBuilder_.dispose(); - deviceListBuilder_ = null; - deviceList_ = other.deviceList_; - bitField0_ = (bitField0_ & ~0x00000008); - deviceListBuilder_ = + policyRuleIdListBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDeviceListFieldBuilder() : null; + getPolicyRuleIdListFieldBuilder() : null; } else { - deviceListBuilder_.addAllMessages(other.deviceList_); + policyRuleIdListBuilder_.addAllMessages(other.policyRuleIdList_); } } } @@ -6385,11 +6622,11 @@ public final class Policy { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - policy.Policy.PolicyRule parsedMessage = null; + policy.Policy.PolicyRuleIdList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (policy.Policy.PolicyRule) e.getUnfinishedMessage(); + parsedMessage = (policy.Policy.PolicyRuleIdList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -6398,1577 +6635,1848 @@ public final class Policy { } return this; } - private int bitField0_; - - private policy.Policy.PolicyRuleId policyRuleId_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdBuilder_; + private int bitField0_; + + private java.util.List policyRuleIdList_ = + java.util.Collections.emptyList(); + private void ensurePolicyRuleIdListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyRuleIdList_ = new java.util.ArrayList(policyRuleIdList_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRuleIdListBuilder_; + + /** + * repeated .policy.PolicyRuleId policyRuleIdList = 1; + */ + public java.util.List getPolicyRuleIdListList() { + if (policyRuleIdListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleIdList_); + } else { + return policyRuleIdListBuilder_.getMessageList(); + } + } + /** + * repeated .policy.PolicyRuleId policyRuleIdList = 1; + */ + public int getPolicyRuleIdListCount() { + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.size(); + } else { + return policyRuleIdListBuilder_.getCount(); + } + } + /** + * repeated .policy.PolicyRuleId policyRuleIdList = 1; + */ + public policy.Policy.PolicyRuleId getPolicyRuleIdList(int index) { + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.get(index); + } else { + return policyRuleIdListBuilder_.getMessage(index); + } + } + /** + * repeated .policy.PolicyRuleId policyRuleIdList = 1; + */ + public Builder setPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.set(index, value); + onChanged(); + } else { + policyRuleIdListBuilder_.setMessage(index, value); + } + return this; + } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return Whether the policyRuleId field is set. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public boolean hasPolicyRuleId() { - return policyRuleIdBuilder_ != null || policyRuleId_ != null; + public Builder setPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.set(index, builderForValue.build()); + onChanged(); + } else { + policyRuleIdListBuilder_.setMessage(index, builderForValue.build()); + } + return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; - * @return The policyRuleId. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public policy.Policy.PolicyRuleId getPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - return policyRuleId_ == null ? policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + public Builder addPolicyRuleIdList(policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(value); + onChanged(); } else { - return policyRuleIdBuilder_.getMessage(); + policyRuleIdListBuilder_.addMessage(value); } + return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder setPolicyRuleId(policy.Policy.PolicyRuleId value) { - if (policyRuleIdBuilder_ == null) { + public Builder addPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId value) { + if (policyRuleIdListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - policyRuleId_ = value; + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(index, value); onChanged(); } else { - policyRuleIdBuilder_.setMessage(value); + policyRuleIdListBuilder_.addMessage(index, value); } - return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder setPolicyRuleId( + public Builder addPolicyRuleIdList( policy.Policy.PolicyRuleId.Builder builderForValue) { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = builderForValue.build(); + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(builderForValue.build()); onChanged(); } else { - policyRuleIdBuilder_.setMessage(builderForValue.build()); + policyRuleIdListBuilder_.addMessage(builderForValue.build()); } - return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder mergePolicyRuleId(policy.Policy.PolicyRuleId value) { - if (policyRuleIdBuilder_ == null) { - if (policyRuleId_ != null) { - policyRuleId_ = - policy.Policy.PolicyRuleId.newBuilder(policyRuleId_).mergeFrom(value).buildPartial(); - } else { - policyRuleId_ = value; - } + public Builder addPolicyRuleIdList( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.add(index, builderForValue.build()); onChanged(); } else { - policyRuleIdBuilder_.mergeFrom(value); + policyRuleIdListBuilder_.addMessage(index, builderForValue.build()); } - return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder clearPolicyRuleId() { - if (policyRuleIdBuilder_ == null) { - policyRuleId_ = null; + public Builder addAllPolicyRuleIdList( + java.lang.Iterable values) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, policyRuleIdList_); onChanged(); } else { - policyRuleId_ = null; - policyRuleIdBuilder_ = null; + policyRuleIdListBuilder_.addAllMessages(values); } - return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdBuilder() { - - onChanged(); - return getPolicyRuleIdFieldBuilder().getBuilder(); + public Builder clearPolicyRuleIdList() { + if (policyRuleIdListBuilder_ == null) { + policyRuleIdList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyRuleIdListBuilder_.clear(); + } + return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdOrBuilder() { - if (policyRuleIdBuilder_ != null) { - return policyRuleIdBuilder_.getMessageOrBuilder(); + public Builder removePolicyRuleIdList(int index) { + if (policyRuleIdListBuilder_ == null) { + ensurePolicyRuleIdListIsMutable(); + policyRuleIdList_.remove(index); + onChanged(); } else { - return policyRuleId_ == null ? - policy.Policy.PolicyRuleId.getDefaultInstance() : policyRuleId_; + policyRuleIdListBuilder_.remove(index); } + return this; } /** - *
-       * Basic policy rule attributes
-       * 
- * - * .policy.PolicyRuleId policyRuleId = 1; + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> - getPolicyRuleIdFieldBuilder() { - if (policyRuleIdBuilder_ == null) { - policyRuleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( - getPolicyRuleId(), - getParentForChildren(), - isClean()); - policyRuleId_ = null; + public policy.Policy.PolicyRuleId.Builder getPolicyRuleIdListBuilder( + int index) { + return getPolicyRuleIdListFieldBuilder().getBuilder(index); + } + /** + * repeated .policy.PolicyRuleId policyRuleIdList = 1; + */ + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRuleIdListOrBuilder( + int index) { + if (policyRuleIdListBuilder_ == null) { + return policyRuleIdList_.get(index); } else { + return policyRuleIdListBuilder_.getMessageOrBuilder(index); } - return policyRuleIdBuilder_; } - - private int policyRuleType_ = 0; /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The enum numeric value on the wire for policyRuleType. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override public int getPolicyRuleTypeValue() { - return policyRuleType_; + public java.util.List + getPolicyRuleIdListOrBuilderList() { + if (policyRuleIdListBuilder_ != null) { + return policyRuleIdListBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyRuleIdList_); + } } /** - * .policy.PolicyRuleType policyRuleType = 2; - * @param value The enum numeric value on the wire for policyRuleType to set. - * @return This builder for chaining. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder setPolicyRuleTypeValue(int value) { - - policyRuleType_ = value; - onChanged(); - return this; + public policy.Policy.PolicyRuleId.Builder addPolicyRuleIdListBuilder() { + return getPolicyRuleIdListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return The policyRuleType. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - @java.lang.Override - public policy.Policy.PolicyRuleType getPolicyRuleType() { - @SuppressWarnings("deprecation") - policy.Policy.PolicyRuleType result = policy.Policy.PolicyRuleType.valueOf(policyRuleType_); - return result == null ? policy.Policy.PolicyRuleType.UNRECOGNIZED : result; + public policy.Policy.PolicyRuleId.Builder addPolicyRuleIdListBuilder( + int index) { + return getPolicyRuleIdListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * .policy.PolicyRuleType policyRuleType = 2; - * @param value The policyRuleType to set. - * @return This builder for chaining. + * repeated .policy.PolicyRuleId policyRuleIdList = 1; */ - public Builder setPolicyRuleType(policy.Policy.PolicyRuleType value) { - if (value == null) { - throw new NullPointerException(); + public java.util.List + getPolicyRuleIdListBuilderList() { + return getPolicyRuleIdListFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRuleIdListFieldBuilder() { + if (policyRuleIdListBuilder_ == null) { + policyRuleIdListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( + policyRuleIdList_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyRuleIdList_ = null; + } + return policyRuleIdListBuilder_; + } + @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:policy.PolicyRuleIdList) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleIdList) + private static final policy.Policy.PolicyRuleIdList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleIdList(); + } + + public static policy.Policy.PolicyRuleIdList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRuleIdList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleIdList(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 policy.Policy.PolicyRuleIdList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PolicyRuleServiceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleServiceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + java.util.List + getPolicyRuleServiceListList(); + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index); + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + int getPolicyRuleServiceListCount(); + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + java.util.List + getPolicyRuleServiceListOrBuilderList(); + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( + int index); + } + /** + *
+   * A list of service-oriented policy rules
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleServiceList} + */ + public static final class PolicyRuleServiceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleServiceList) + PolicyRuleServiceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleServiceList.newBuilder() to construct. + private PolicyRuleServiceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PolicyRuleServiceList() { + policyRuleServiceList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleServiceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleServiceList( + 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)) { + policyRuleServiceList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + policyRuleServiceList_.add( + input.readMessage(policy.Policy.PolicyRuleService.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } } - - policyRuleType_ = value.getNumber(); - onChanged(); - return this; + } 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)) { + policyRuleServiceList_ = java.util.Collections.unmodifiableList(policyRuleServiceList_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - /** - * .policy.PolicyRuleType policyRuleType = 2; - * @return This builder for chaining. - */ - public Builder clearPolicyRuleType() { - - policyRuleType_ = 0; - onChanged(); - return this; + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleServiceList.class, policy.Policy.PolicyRuleServiceList.Builder.class); + } + + public static final int POLICYRULESERVICELIST_FIELD_NUMBER = 1; + private java.util.List policyRuleServiceList_; + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + @java.lang.Override + public java.util.List getPolicyRuleServiceListList() { + return policyRuleServiceList_; + } + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + @java.lang.Override + public java.util.List + getPolicyRuleServiceListOrBuilderList() { + return policyRuleServiceList_; + } + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + @java.lang.Override + public int getPolicyRuleServiceListCount() { + return policyRuleServiceList_.size(); + } + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + @java.lang.Override + public policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index) { + return policyRuleServiceList_.get(index); + } + /** + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; + */ + @java.lang.Override + public policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( + int index) { + return policyRuleServiceList_.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 < policyRuleServiceList_.size(); i++) { + output.writeMessage(1, policyRuleServiceList_.get(i)); } + unknownFields.writeTo(output); + } - private int policyRulePriority_ ; - /** - * uint32 PolicyRulePriority = 3; - * @return The policyRulePriority. - */ - @java.lang.Override - public int getPolicyRulePriority() { - return policyRulePriority_; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < policyRuleServiceList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, policyRuleServiceList_.get(i)); } - /** - * uint32 PolicyRulePriority = 3; - * @param value The policyRulePriority to set. - * @return This builder for chaining. - */ - public Builder setPolicyRulePriority(int value) { - - policyRulePriority_ = value; - onChanged(); - return this; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - * uint32 PolicyRulePriority = 3; - * @return This builder for chaining. - */ - public Builder clearPolicyRulePriority() { - - policyRulePriority_ = 0; - onChanged(); - return this; + if (!(obj instanceof policy.Policy.PolicyRuleServiceList)) { + return super.equals(obj); } + policy.Policy.PolicyRuleServiceList other = (policy.Policy.PolicyRuleServiceList) obj; - private policy.Policy.PolicyRuleEvent event_; - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder> eventBuilder_; - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return Whether the event field is set. - */ - public boolean hasEvent() { - return eventBuilder_ != null || event_ != null; + if (!getPolicyRuleServiceListList() + .equals(other.getPolicyRuleServiceListList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - * @return The event. - */ - public policy.Policy.PolicyRuleEvent getEvent() { - if (eventBuilder_ == null) { - return event_ == null ? policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; - } else { - return eventBuilder_.getMessage(); - } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPolicyRuleServiceListCount() > 0) { + hash = (37 * hash) + POLICYRULESERVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleServiceListList().hashCode(); } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public Builder setEvent(policy.Policy.PolicyRuleEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - event_ = value; - onChanged(); - } else { - eventBuilder_.setMessage(value); - } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - return this; - } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public Builder setEvent( - policy.Policy.PolicyRuleEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - event_ = builderForValue.build(); - onChanged(); - } else { - eventBuilder_.setMessage(builderForValue.build()); - } + public static policy.Policy.PolicyRuleServiceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleServiceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList 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 policy.Policy.PolicyRuleServiceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList 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 policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleServiceList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - return this; - } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public Builder mergeEvent(policy.Policy.PolicyRuleEvent value) { - if (eventBuilder_ == null) { - if (event_ != null) { - event_ = - policy.Policy.PolicyRuleEvent.newBuilder(event_).mergeFrom(value).buildPartial(); - } else { - event_ = value; - } - onChanged(); - } else { - eventBuilder_.mergeFrom(value); - } + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(policy.Policy.PolicyRuleServiceList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } - return this; + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A list of service-oriented policy rules
+     * 
+ * + * Protobuf type {@code policy.PolicyRuleServiceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleServiceList) + policy.Policy.PolicyRuleServiceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = null; - onChanged(); - } else { - event_ = null; - eventBuilder_ = null; - } - return this; - } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public policy.Policy.PolicyRuleEvent.Builder getEventBuilder() { - - onChanged(); - return getEventFieldBuilder().getBuilder(); - } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - public policy.Policy.PolicyRuleEventOrBuilder getEventOrBuilder() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilder(); - } else { - return event_ == null ? - policy.Policy.PolicyRuleEvent.getDefaultInstance() : event_; - } - } - /** - *
-       * Event-Condition-Action model
-       * 
- * - * .policy.PolicyRuleEvent event = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - policy.Policy.PolicyRuleEvent, policy.Policy.PolicyRuleEvent.Builder, policy.Policy.PolicyRuleEventOrBuilder>( - getEvent(), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleServiceList.class, policy.Policy.PolicyRuleServiceList.Builder.class); } - private java.util.List polRuleConditionList_ = - java.util.Collections.emptyList(); - private void ensurePolRuleConditionListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - polRuleConditionList_ = new java.util.ArrayList(polRuleConditionList_); - bitField0_ |= 0x00000001; - } + // Construct using policy.Policy.PolicyRuleServiceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder> polRuleConditionListBuilder_; - - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public java.util.List getPolRuleConditionListList() { - if (polRuleConditionListBuilder_ == null) { - return java.util.Collections.unmodifiableList(polRuleConditionList_); - } else { - return polRuleConditionListBuilder_.getMessageList(); - } - } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public int getPolRuleConditionListCount() { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.size(); - } else { - return polRuleConditionListBuilder_.getCount(); - } + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public policy.Policy.PolicyRuleCondition getPolRuleConditionList(int index) { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.get(index); - } else { - return polRuleConditionListBuilder_.getMessage(index); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPolicyRuleServiceListFieldBuilder(); } } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder setPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.set(index, value); - onChanged(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - polRuleConditionListBuilder_.setMessage(index, value); + policyRuleServiceListBuilder_.clear(); } return this; } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder setPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.set(index, builderForValue.build()); - onChanged(); - } else { - polRuleConditionListBuilder_.setMessage(index, builderForValue.build()); - } - return this; + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.Policy.internal_static_policy_PolicyRuleServiceList_descriptor; } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder addPolRuleConditionList(policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(value); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(value); - } - return this; + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleServiceList.getDefaultInstance(); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder addPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition value) { - if (polRuleConditionListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(index, value); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(index, value); + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList build() { + policy.Policy.PolicyRuleServiceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - return this; + return result; } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder addPolRuleConditionList( - policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(builderForValue.build()); - onChanged(); + + @java.lang.Override + public policy.Policy.PolicyRuleServiceList buildPartial() { + policy.Policy.PolicyRuleServiceList result = new policy.Policy.PolicyRuleServiceList(this); + int from_bitField0_ = bitField0_; + if (policyRuleServiceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = java.util.Collections.unmodifiableList(policyRuleServiceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyRuleServiceList_ = policyRuleServiceList_; } else { - polRuleConditionListBuilder_.addMessage(builderForValue.build()); + result.policyRuleServiceList_ = policyRuleServiceListBuilder_.build(); } - return this; + onBuilt(); + return result; } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder addPolRuleConditionList( - int index, policy.Policy.PolicyRuleCondition.Builder builderForValue) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.add(index, builderForValue.build()); - onChanged(); - } else { - polRuleConditionListBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder addAllPolRuleConditionList( - java.lang.Iterable values) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, polRuleConditionList_); - onChanged(); - } else { - polRuleConditionListBuilder_.addAllMessages(values); - } - return this; + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder clearPolRuleConditionList() { - if (polRuleConditionListBuilder_ == null) { - polRuleConditionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - polRuleConditionListBuilder_.clear(); - } - return this; + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public Builder removePolRuleConditionList(int index) { - if (polRuleConditionListBuilder_ == null) { - ensurePolRuleConditionListIsMutable(); - polRuleConditionList_.remove(index); - onChanged(); - } else { - polRuleConditionListBuilder_.remove(index); - } - return this; + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public policy.Policy.PolicyRuleCondition.Builder getPolRuleConditionListBuilder( - int index) { - return getPolRuleConditionListFieldBuilder().getBuilder(index); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public policy.Policy.PolicyRuleConditionOrBuilder getPolRuleConditionListOrBuilder( - int index) { - if (polRuleConditionListBuilder_ == null) { - return polRuleConditionList_.get(index); } else { - return polRuleConditionListBuilder_.getMessageOrBuilder(index); - } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public java.util.List - getPolRuleConditionListOrBuilderList() { - if (polRuleConditionListBuilder_ != null) { - return polRuleConditionListBuilder_.getMessageOrBuilderList(); + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof policy.Policy.PolicyRuleServiceList) { + return mergeFrom((policy.Policy.PolicyRuleServiceList)other); } else { - return java.util.Collections.unmodifiableList(polRuleConditionList_); + super.mergeFrom(other); + return this; } } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public policy.Policy.PolicyRuleCondition.Builder addPolRuleConditionListBuilder() { - return getPolRuleConditionListFieldBuilder().addBuilder( - policy.Policy.PolicyRuleCondition.getDefaultInstance()); - } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public policy.Policy.PolicyRuleCondition.Builder addPolRuleConditionListBuilder( - int index) { - return getPolRuleConditionListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRuleCondition.getDefaultInstance()); + + public Builder mergeFrom(policy.Policy.PolicyRuleServiceList other) { + if (other == policy.Policy.PolicyRuleServiceList.getDefaultInstance()) return this; + if (policyRuleServiceListBuilder_ == null) { + if (!other.policyRuleServiceList_.isEmpty()) { + if (policyRuleServiceList_.isEmpty()) { + policyRuleServiceList_ = other.policyRuleServiceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.addAll(other.policyRuleServiceList_); + } + onChanged(); + } + } else { + if (!other.policyRuleServiceList_.isEmpty()) { + if (policyRuleServiceListBuilder_.isEmpty()) { + policyRuleServiceListBuilder_.dispose(); + policyRuleServiceListBuilder_ = null; + policyRuleServiceList_ = other.policyRuleServiceList_; + bitField0_ = (bitField0_ & ~0x00000001); + policyRuleServiceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPolicyRuleServiceListFieldBuilder() : null; + } else { + policyRuleServiceListBuilder_.addAllMessages(other.policyRuleServiceList_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; } - /** - *
-       * One or more conditions must be met
-       * 
- * - * repeated .policy.PolicyRuleCondition polRuleConditionList = 5; - */ - public java.util.List - getPolRuleConditionListBuilderList() { - return getPolRuleConditionListFieldBuilder().getBuilderList(); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder> - getPolRuleConditionListFieldBuilder() { - if (polRuleConditionListBuilder_ == null) { - polRuleConditionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleCondition, policy.Policy.PolicyRuleCondition.Builder, policy.Policy.PolicyRuleConditionOrBuilder>( - polRuleConditionList_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - polRuleConditionList_ = null; + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + policy.Policy.PolicyRuleServiceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.Policy.PolicyRuleServiceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } } - return polRuleConditionListBuilder_; + return this; } + private int bitField0_; - private java.util.List polRuleActionList_ = + private java.util.List policyRuleServiceList_ = java.util.Collections.emptyList(); - private void ensurePolRuleActionListIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - polRuleActionList_ = new java.util.ArrayList(polRuleActionList_); - bitField0_ |= 0x00000002; + private void ensurePolicyRuleServiceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyRuleServiceList_ = new java.util.ArrayList(policyRuleServiceList_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder> polRuleActionListBuilder_; + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder> policyRuleServiceListBuilder_; /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public java.util.List getPolRuleActionListList() { - if (polRuleActionListBuilder_ == null) { - return java.util.Collections.unmodifiableList(polRuleActionList_); + public java.util.List getPolicyRuleServiceListList() { + if (policyRuleServiceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleServiceList_); } else { - return polRuleActionListBuilder_.getMessageList(); + return policyRuleServiceListBuilder_.getMessageList(); } } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public int getPolRuleActionListCount() { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.size(); + public int getPolicyRuleServiceListCount() { + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.size(); } else { - return polRuleActionListBuilder_.getCount(); + return policyRuleServiceListBuilder_.getCount(); } } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public policy.Policy.PolicyRuleAction getPolRuleActionList(int index) { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.get(index); + public policy.Policy.PolicyRuleService getPolicyRuleServiceList(int index) { + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.get(index); } else { - return polRuleActionListBuilder_.getMessage(index); + return policyRuleServiceListBuilder_.getMessage(index); } } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder setPolRuleActionList( - int index, policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder setPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.set(index, value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.set(index, value); onChanged(); } else { - polRuleActionListBuilder_.setMessage(index, value); + policyRuleServiceListBuilder_.setMessage(index, value); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder setPolRuleActionList( - int index, policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.set(index, builderForValue.build()); + public Builder setPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.set(index, builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.setMessage(index, builderForValue.build()); + policyRuleServiceListBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder addPolRuleActionList(policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder addPolicyRuleServiceList(policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(value); onChanged(); } else { - polRuleActionListBuilder_.addMessage(value); + policyRuleServiceListBuilder_.addMessage(value); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder addPolRuleActionList( - int index, policy.Policy.PolicyRuleAction value) { - if (polRuleActionListBuilder_ == null) { + public Builder addPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService value) { + if (policyRuleServiceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(index, value); + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(index, value); onChanged(); } else { - polRuleActionListBuilder_.addMessage(index, value); + policyRuleServiceListBuilder_.addMessage(index, value); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder addPolRuleActionList( - policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(builderForValue.build()); + public Builder addPolicyRuleServiceList( + policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.addMessage(builderForValue.build()); + policyRuleServiceListBuilder_.addMessage(builderForValue.build()); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder addPolRuleActionList( - int index, policy.Policy.PolicyRuleAction.Builder builderForValue) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.add(index, builderForValue.build()); + public Builder addPolicyRuleServiceList( + int index, policy.Policy.PolicyRuleService.Builder builderForValue) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.add(index, builderForValue.build()); onChanged(); } else { - polRuleActionListBuilder_.addMessage(index, builderForValue.build()); + policyRuleServiceListBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder addAllPolRuleActionList( - java.lang.Iterable values) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); + public Builder addAllPolicyRuleServiceList( + java.lang.Iterable values) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, polRuleActionList_); + values, policyRuleServiceList_); onChanged(); } else { - polRuleActionListBuilder_.addAllMessages(values); + policyRuleServiceListBuilder_.addAllMessages(values); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder clearPolRuleActionList() { - if (polRuleActionListBuilder_ == null) { - polRuleActionList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder clearPolicyRuleServiceList() { + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - polRuleActionListBuilder_.clear(); + policyRuleServiceListBuilder_.clear(); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public Builder removePolRuleActionList(int index) { - if (polRuleActionListBuilder_ == null) { - ensurePolRuleActionListIsMutable(); - polRuleActionList_.remove(index); + public Builder removePolicyRuleServiceList(int index) { + if (policyRuleServiceListBuilder_ == null) { + ensurePolicyRuleServiceListIsMutable(); + policyRuleServiceList_.remove(index); onChanged(); } else { - polRuleActionListBuilder_.remove(index); + policyRuleServiceListBuilder_.remove(index); } return this; } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public policy.Policy.PolicyRuleAction.Builder getPolRuleActionListBuilder( + public policy.Policy.PolicyRuleService.Builder getPolicyRuleServiceListBuilder( int index) { - return getPolRuleActionListFieldBuilder().getBuilder(index); + return getPolicyRuleServiceListFieldBuilder().getBuilder(index); } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public policy.Policy.PolicyRuleActionOrBuilder getPolRuleActionListOrBuilder( + public policy.Policy.PolicyRuleServiceOrBuilder getPolicyRuleServiceListOrBuilder( int index) { - if (polRuleActionListBuilder_ == null) { - return polRuleActionList_.get(index); } else { - return polRuleActionListBuilder_.getMessageOrBuilder(index); + if (policyRuleServiceListBuilder_ == null) { + return policyRuleServiceList_.get(index); } else { + return policyRuleServiceListBuilder_.getMessageOrBuilder(index); } } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public java.util.List - getPolRuleActionListOrBuilderList() { - if (polRuleActionListBuilder_ != null) { - return polRuleActionListBuilder_.getMessageOrBuilderList(); + public java.util.List + getPolicyRuleServiceListOrBuilderList() { + if (policyRuleServiceListBuilder_ != null) { + return policyRuleServiceListBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(polRuleActionList_); + return java.util.Collections.unmodifiableList(policyRuleServiceList_); } } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public policy.Policy.PolicyRuleAction.Builder addPolRuleActionListBuilder() { - return getPolRuleActionListFieldBuilder().addBuilder( - policy.Policy.PolicyRuleAction.getDefaultInstance()); + public policy.Policy.PolicyRuleService.Builder addPolicyRuleServiceListBuilder() { + return getPolicyRuleServiceListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleService.getDefaultInstance()); } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public policy.Policy.PolicyRuleAction.Builder addPolRuleActionListBuilder( + public policy.Policy.PolicyRuleService.Builder addPolicyRuleServiceListBuilder( int index) { - return getPolRuleActionListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRuleAction.getDefaultInstance()); + return getPolicyRuleServiceListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleService.getDefaultInstance()); } /** - *
-       * One or more actions should be applied
-       * 
- * - * repeated .policy.PolicyRuleAction polRuleActionList = 6; + * repeated .policy.PolicyRuleService policyRuleServiceList = 1; */ - public java.util.List - getPolRuleActionListBuilderList() { - return getPolRuleActionListFieldBuilder().getBuilderList(); + public java.util.List + getPolicyRuleServiceListBuilderList() { + return getPolicyRuleServiceListFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder> - getPolRuleActionListFieldBuilder() { - if (polRuleActionListBuilder_ == null) { - polRuleActionListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRuleAction, policy.Policy.PolicyRuleAction.Builder, policy.Policy.PolicyRuleActionOrBuilder>( - polRuleActionList_, - ((bitField0_ & 0x00000002) != 0), + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder> + getPolicyRuleServiceListFieldBuilder() { + if (policyRuleServiceListBuilder_ == null) { + policyRuleServiceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleService.Builder, policy.Policy.PolicyRuleServiceOrBuilder>( + policyRuleServiceList_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - polRuleActionList_ = null; + policyRuleServiceList_ = null; + } + return policyRuleServiceListBuilder_; + } + @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:policy.PolicyRuleServiceList) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleServiceList) + private static final policy.Policy.PolicyRuleServiceList DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleServiceList(); + } + + public static policy.Policy.PolicyRuleServiceList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRuleServiceList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleServiceList(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 policy.Policy.PolicyRuleServiceList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PolicyRuleDeviceListOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleDeviceList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + java.util.List + getPolicyRuleDeviceListList(); + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index); + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + int getPolicyRuleDeviceListCount(); + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + java.util.List + getPolicyRuleDeviceListOrBuilderList(); + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( + int index); + } + /** + *
+   * A list of device-oriented policy rules
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleDeviceList} + */ + public static final class PolicyRuleDeviceList extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleDeviceList) + PolicyRuleDeviceListOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleDeviceList.newBuilder() to construct. + private PolicyRuleDeviceList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PolicyRuleDeviceList() { + policyRuleDeviceList_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleDeviceList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleDeviceList( + 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)) { + policyRuleDeviceList_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + policyRuleDeviceList_.add( + input.readMessage(policy.Policy.PolicyRuleDevice.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)) { + policyRuleDeviceList_ = java.util.Collections.unmodifiableList(policyRuleDeviceList_); } - return polRuleActionListBuilder_; + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleDeviceList.class, policy.Policy.PolicyRuleDeviceList.Builder.class); + } + + public static final int POLICYRULEDEVICELIST_FIELD_NUMBER = 1; + private java.util.List policyRuleDeviceList_; + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + @java.lang.Override + public java.util.List getPolicyRuleDeviceListList() { + return policyRuleDeviceList_; + } + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + @java.lang.Override + public java.util.List + getPolicyRuleDeviceListOrBuilderList() { + return policyRuleDeviceList_; + } + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + @java.lang.Override + public int getPolicyRuleDeviceListCount() { + return policyRuleDeviceList_.size(); + } + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + @java.lang.Override + public policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index) { + return policyRuleDeviceList_.get(index); + } + /** + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; + */ + @java.lang.Override + public policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( + int index) { + return policyRuleDeviceList_.get(index); + } - private java.util.List serviceList_ = - java.util.Collections.emptyList(); - private void ensureServiceListIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - serviceList_ = new java.util.ArrayList(serviceList_); - bitField0_ |= 0x00000004; - } - } + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> serviceListBuilder_; + memoizedIsInitialized = 1; + return true; + } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public java.util.List getServiceListList() { - if (serviceListBuilder_ == null) { - return java.util.Collections.unmodifiableList(serviceList_); - } else { - return serviceListBuilder_.getMessageList(); - } + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < policyRuleDeviceList_.size(); i++) { + output.writeMessage(1, policyRuleDeviceList_.get(i)); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public int getServiceListCount() { - if (serviceListBuilder_ == null) { - return serviceList_.size(); - } else { - return serviceListBuilder_.getCount(); - } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < policyRuleDeviceList_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, policyRuleDeviceList_.get(i)); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public context.ContextOuterClass.ServiceId getServiceList(int index) { - if (serviceListBuilder_ == null) { - return serviceList_.get(index); - } else { - return serviceListBuilder_.getMessage(index); - } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder setServiceList( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.set(index, value); - onChanged(); - } else { - serviceListBuilder_.setMessage(index, value); - } - return this; + if (!(obj instanceof policy.Policy.PolicyRuleDeviceList)) { + return super.equals(obj); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder setServiceList( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.set(index, builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.setMessage(index, builderForValue.build()); - } - return this; + policy.Policy.PolicyRuleDeviceList other = (policy.Policy.PolicyRuleDeviceList) obj; + + if (!getPolicyRuleDeviceListList() + .equals(other.getPolicyRuleDeviceListList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder addServiceList(context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.add(value); - onChanged(); - } else { - serviceListBuilder_.addMessage(value); - } - return this; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPolicyRuleDeviceListCount() > 0) { + hash = (37 * hash) + POLICYRULEDEVICELIST_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRuleDeviceListList().hashCode(); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder addServiceList( - int index, context.ContextOuterClass.ServiceId value) { - if (serviceListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureServiceListIsMutable(); - serviceList_.add(index, value); - onChanged(); - } else { - serviceListBuilder_.addMessage(index, value); - } - return this; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.Policy.PolicyRuleDeviceList parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.Policy.PolicyRuleDeviceList parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleDeviceList 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 policy.Policy.PolicyRuleDeviceList parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleDeviceList 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 policy.Policy.PolicyRuleDeviceList parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.Policy.PolicyRuleDeviceList 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(policy.Policy.PolicyRuleDeviceList 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; + } + /** + *
+     * A list of device-oriented policy rules
+     * 
+ * + * Protobuf type {@code policy.PolicyRuleDeviceList} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleDeviceList) + policy.Policy.PolicyRuleDeviceListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder addServiceList( - context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.add(builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.addMessage(builderForValue.build()); - } - return this; + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.Policy.PolicyRuleDeviceList.class, policy.Policy.PolicyRuleDeviceList.Builder.class); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder addServiceList( - int index, context.ContextOuterClass.ServiceId.Builder builderForValue) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.add(index, builderForValue.build()); - onChanged(); - } else { - serviceListBuilder_.addMessage(index, builderForValue.build()); - } - return this; + + // Construct using policy.Policy.PolicyRuleDeviceList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder addAllServiceList( - java.lang.Iterable values) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, serviceList_); - onChanged(); - } else { - serviceListBuilder_.addAllMessages(values); - } - return this; + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder clearServiceList() { - if (serviceListBuilder_ == null) { - serviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - serviceListBuilder_.clear(); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPolicyRuleDeviceListFieldBuilder(); } - return this; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public Builder removeServiceList(int index) { - if (serviceListBuilder_ == null) { - ensureServiceListIsMutable(); - serviceList_.remove(index); - onChanged(); + @java.lang.Override + public Builder clear() { + super.clear(); + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); } else { - serviceListBuilder_.remove(index); + policyRuleDeviceListBuilder_.clear(); } return this; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public context.ContextOuterClass.ServiceId.Builder getServiceListBuilder( - int index) { - return getServiceListFieldBuilder().getBuilder(index); + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.Policy.internal_static_policy_PolicyRuleDeviceList_descriptor; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public context.ContextOuterClass.ServiceIdOrBuilder getServiceListOrBuilder( - int index) { - if (serviceListBuilder_ == null) { - return serviceList_.get(index); } else { - return serviceListBuilder_.getMessageOrBuilder(index); + + @java.lang.Override + public policy.Policy.PolicyRuleDeviceList getDefaultInstanceForType() { + return policy.Policy.PolicyRuleDeviceList.getDefaultInstance(); + } + + @java.lang.Override + public policy.Policy.PolicyRuleDeviceList build() { + policy.Policy.PolicyRuleDeviceList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public java.util.List - getServiceListOrBuilderList() { - if (serviceListBuilder_ != null) { - return serviceListBuilder_.getMessageOrBuilderList(); + + @java.lang.Override + public policy.Policy.PolicyRuleDeviceList buildPartial() { + policy.Policy.PolicyRuleDeviceList result = new policy.Policy.PolicyRuleDeviceList(this); + int from_bitField0_ = bitField0_; + if (policyRuleDeviceListBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyRuleDeviceList_ = java.util.Collections.unmodifiableList(policyRuleDeviceList_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyRuleDeviceList_ = policyRuleDeviceList_; } else { - return java.util.Collections.unmodifiableList(serviceList_); + result.policyRuleDeviceList_ = policyRuleDeviceListBuilder_.build(); } + onBuilt(); + return result; } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceListBuilder() { - return getServiceListFieldBuilder().addBuilder( - context.ContextOuterClass.ServiceId.getDefaultInstance()); + + @java.lang.Override + public Builder clone() { + return super.clone(); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public context.ContextOuterClass.ServiceId.Builder addServiceListBuilder( - int index) { - return getServiceListFieldBuilder().addBuilder( - index, context.ContextOuterClass.ServiceId.getDefaultInstance()); + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); } - /** - *
-       * Affected services and devices
-       * 
- * - * repeated .context.ServiceId serviceList = 7; - */ - public java.util.List - getServiceListBuilderList() { - return getServiceListFieldBuilder().getBuilderList(); + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder> - getServiceListFieldBuilder() { - if (serviceListBuilder_ == null) { - serviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.ServiceId, context.ContextOuterClass.ServiceId.Builder, context.ContextOuterClass.ServiceIdOrBuilder>( - serviceList_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - serviceList_ = null; + @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 policy.Policy.PolicyRuleDeviceList) { + return mergeFrom((policy.Policy.PolicyRuleDeviceList)other); + } else { + super.mergeFrom(other); + return this; } - return serviceListBuilder_; } - private java.util.List deviceList_ = + public Builder mergeFrom(policy.Policy.PolicyRuleDeviceList other) { + if (other == policy.Policy.PolicyRuleDeviceList.getDefaultInstance()) return this; + if (policyRuleDeviceListBuilder_ == null) { + if (!other.policyRuleDeviceList_.isEmpty()) { + if (policyRuleDeviceList_.isEmpty()) { + policyRuleDeviceList_ = other.policyRuleDeviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.addAll(other.policyRuleDeviceList_); + } + onChanged(); + } + } else { + if (!other.policyRuleDeviceList_.isEmpty()) { + if (policyRuleDeviceListBuilder_.isEmpty()) { + policyRuleDeviceListBuilder_.dispose(); + policyRuleDeviceListBuilder_ = null; + policyRuleDeviceList_ = other.policyRuleDeviceList_; + bitField0_ = (bitField0_ & ~0x00000001); + policyRuleDeviceListBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPolicyRuleDeviceListFieldBuilder() : null; + } else { + policyRuleDeviceListBuilder_.addAllMessages(other.policyRuleDeviceList_); + } + } + } + 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 { + policy.Policy.PolicyRuleDeviceList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.Policy.PolicyRuleDeviceList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List policyRuleDeviceList_ = java.util.Collections.emptyList(); - private void ensureDeviceListIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { - deviceList_ = new java.util.ArrayList(deviceList_); - bitField0_ |= 0x00000008; + private void ensurePolicyRuleDeviceListIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyRuleDeviceList_ = new java.util.ArrayList(policyRuleDeviceList_); + bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> deviceListBuilder_; + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder> policyRuleDeviceListBuilder_; /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public java.util.List getDeviceListList() { - if (deviceListBuilder_ == null) { - return java.util.Collections.unmodifiableList(deviceList_); + public java.util.List getPolicyRuleDeviceListList() { + if (policyRuleDeviceListBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRuleDeviceList_); } else { - return deviceListBuilder_.getMessageList(); + return policyRuleDeviceListBuilder_.getMessageList(); } } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public int getDeviceListCount() { - if (deviceListBuilder_ == null) { - return deviceList_.size(); + public int getPolicyRuleDeviceListCount() { + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.size(); } else { - return deviceListBuilder_.getCount(); + return policyRuleDeviceListBuilder_.getCount(); } } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public context.ContextOuterClass.DeviceId getDeviceList(int index) { - if (deviceListBuilder_ == null) { - return deviceList_.get(index); + public policy.Policy.PolicyRuleDevice getPolicyRuleDeviceList(int index) { + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.get(index); } else { - return deviceListBuilder_.getMessage(index); + return policyRuleDeviceListBuilder_.getMessage(index); } } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder setDeviceList( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder setPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.set(index, value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.set(index, value); onChanged(); } else { - deviceListBuilder_.setMessage(index, value); + policyRuleDeviceListBuilder_.setMessage(index, value); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder setDeviceList( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.set(index, builderForValue.build()); + public Builder setPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.set(index, builderForValue.build()); onChanged(); } else { - deviceListBuilder_.setMessage(index, builderForValue.build()); + policyRuleDeviceListBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder addDeviceList(context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder addPolicyRuleDeviceList(policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.add(value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(value); onChanged(); } else { - deviceListBuilder_.addMessage(value); + policyRuleDeviceListBuilder_.addMessage(value); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder addDeviceList( - int index, context.ContextOuterClass.DeviceId value) { - if (deviceListBuilder_ == null) { + public Builder addPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice value) { + if (policyRuleDeviceListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureDeviceListIsMutable(); - deviceList_.add(index, value); + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(index, value); onChanged(); } else { - deviceListBuilder_.addMessage(index, value); + policyRuleDeviceListBuilder_.addMessage(index, value); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder addDeviceList( - context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.add(builderForValue.build()); + public Builder addPolicyRuleDeviceList( + policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(builderForValue.build()); onChanged(); } else { - deviceListBuilder_.addMessage(builderForValue.build()); + policyRuleDeviceListBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder addDeviceList( - int index, context.ContextOuterClass.DeviceId.Builder builderForValue) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.add(index, builderForValue.build()); + public Builder addPolicyRuleDeviceList( + int index, policy.Policy.PolicyRuleDevice.Builder builderForValue) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.add(index, builderForValue.build()); onChanged(); } else { - deviceListBuilder_.addMessage(index, builderForValue.build()); + policyRuleDeviceListBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder addAllDeviceList( - java.lang.Iterable values) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); + public Builder addAllPolicyRuleDeviceList( + java.lang.Iterable values) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, deviceList_); + values, policyRuleDeviceList_); onChanged(); } else { - deviceListBuilder_.addAllMessages(values); + policyRuleDeviceListBuilder_.addAllMessages(values); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder clearDeviceList() { - if (deviceListBuilder_ == null) { - deviceList_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + public Builder clearPolicyRuleDeviceList() { + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceList_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - deviceListBuilder_.clear(); + policyRuleDeviceListBuilder_.clear(); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public Builder removeDeviceList(int index) { - if (deviceListBuilder_ == null) { - ensureDeviceListIsMutable(); - deviceList_.remove(index); + public Builder removePolicyRuleDeviceList(int index) { + if (policyRuleDeviceListBuilder_ == null) { + ensurePolicyRuleDeviceListIsMutable(); + policyRuleDeviceList_.remove(index); onChanged(); } else { - deviceListBuilder_.remove(index); + policyRuleDeviceListBuilder_.remove(index); } return this; } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public context.ContextOuterClass.DeviceId.Builder getDeviceListBuilder( + public policy.Policy.PolicyRuleDevice.Builder getPolicyRuleDeviceListBuilder( int index) { - return getDeviceListFieldBuilder().getBuilder(index); + return getPolicyRuleDeviceListFieldBuilder().getBuilder(index); } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public context.ContextOuterClass.DeviceIdOrBuilder getDeviceListOrBuilder( + public policy.Policy.PolicyRuleDeviceOrBuilder getPolicyRuleDeviceListOrBuilder( int index) { - if (deviceListBuilder_ == null) { - return deviceList_.get(index); } else { - return deviceListBuilder_.getMessageOrBuilder(index); + if (policyRuleDeviceListBuilder_ == null) { + return policyRuleDeviceList_.get(index); } else { + return policyRuleDeviceListBuilder_.getMessageOrBuilder(index); } } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public java.util.List - getDeviceListOrBuilderList() { - if (deviceListBuilder_ != null) { - return deviceListBuilder_.getMessageOrBuilderList(); + public java.util.List + getPolicyRuleDeviceListOrBuilderList() { + if (policyRuleDeviceListBuilder_ != null) { + return policyRuleDeviceListBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(deviceList_); + return java.util.Collections.unmodifiableList(policyRuleDeviceList_); } } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder() { - return getDeviceListFieldBuilder().addBuilder( - context.ContextOuterClass.DeviceId.getDefaultInstance()); + public policy.Policy.PolicyRuleDevice.Builder addPolicyRuleDeviceListBuilder() { + return getPolicyRuleDeviceListFieldBuilder().addBuilder( + policy.Policy.PolicyRuleDevice.getDefaultInstance()); } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public context.ContextOuterClass.DeviceId.Builder addDeviceListBuilder( + public policy.Policy.PolicyRuleDevice.Builder addPolicyRuleDeviceListBuilder( int index) { - return getDeviceListFieldBuilder().addBuilder( - index, context.ContextOuterClass.DeviceId.getDefaultInstance()); + return getPolicyRuleDeviceListFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleDevice.getDefaultInstance()); } /** - * repeated .context.DeviceId deviceList = 8; + * repeated .policy.PolicyRuleDevice policyRuleDeviceList = 1; */ - public java.util.List - getDeviceListBuilderList() { - return getDeviceListFieldBuilder().getBuilderList(); + public java.util.List + getPolicyRuleDeviceListBuilderList() { + return getPolicyRuleDeviceListFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> - getDeviceListFieldBuilder() { - if (deviceListBuilder_ == null) { - deviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>( - deviceList_, - ((bitField0_ & 0x00000008) != 0), + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder> + getPolicyRuleDeviceListFieldBuilder() { + if (policyRuleDeviceListBuilder_ == null) { + policyRuleDeviceListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleDevice.Builder, policy.Policy.PolicyRuleDeviceOrBuilder>( + policyRuleDeviceList_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - deviceList_ = null; + policyRuleDeviceList_ = null; } - return deviceListBuilder_; + return policyRuleDeviceListBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -7983,41 +8491,41 @@ public final class Policy { } - // @@protoc_insertion_point(builder_scope:policy.PolicyRule) + // @@protoc_insertion_point(builder_scope:policy.PolicyRuleDeviceList) } - // @@protoc_insertion_point(class_scope:policy.PolicyRule) - private static final policy.Policy.PolicyRule DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:policy.PolicyRuleDeviceList) + private static final policy.Policy.PolicyRuleDeviceList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new policy.Policy.PolicyRule(); + DEFAULT_INSTANCE = new policy.Policy.PolicyRuleDeviceList(); } - public static policy.Policy.PolicyRule getDefaultInstance() { + public static policy.Policy.PolicyRuleDeviceList getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public PolicyRule parsePartialFrom( + public PolicyRuleDeviceList parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRule(input, extensionRegistry); + return new PolicyRuleDeviceList(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public policy.Policy.PolicyRule getDefaultInstanceForType() { + public policy.Policy.PolicyRuleDeviceList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -8028,27 +8536,27 @@ public final class Policy { com.google.protobuf.MessageOrBuilder { /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - java.util.List - getPolicyRuleListList(); + java.util.List + getPolicyRulesList(); /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - policy.Policy.PolicyRule getPolicyRuleList(int index); + policy.Policy.PolicyRuleId getPolicyRules(int index); /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - int getPolicyRuleListCount(); + int getPolicyRulesCount(); /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - java.util.List - getPolicyRuleListOrBuilderList(); + java.util.List + getPolicyRulesOrBuilderList(); /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + policy.Policy.PolicyRuleIdOrBuilder getPolicyRulesOrBuilder( int index); } /** @@ -8068,7 +8576,7 @@ public final class Policy { super(builder); } private PolicyRuleList() { - policyRuleList_ = java.util.Collections.emptyList(); + policyRules_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -8104,11 +8612,11 @@ public final class Policy { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = new java.util.ArrayList(); + policyRules_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - policyRuleList_.add( - input.readMessage(policy.Policy.PolicyRule.parser(), extensionRegistry)); + policyRules_.add( + input.readMessage(policy.Policy.PolicyRuleId.parser(), extensionRegistry)); break; } default: { @@ -8127,7 +8635,7 @@ public final class Policy { e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = java.util.Collections.unmodifiableList(policyRuleList_); + policyRules_ = java.util.Collections.unmodifiableList(policyRules_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -8146,44 +8654,44 @@ public final class Policy { policy.Policy.PolicyRuleList.class, policy.Policy.PolicyRuleList.Builder.class); } - public static final int POLICYRULELIST_FIELD_NUMBER = 1; - private java.util.List policyRuleList_; + public static final int POLICYRULES_FIELD_NUMBER = 1; + private java.util.List policyRules_; /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ @java.lang.Override - public java.util.List getPolicyRuleListList() { - return policyRuleList_; + public java.util.List getPolicyRulesList() { + return policyRules_; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ @java.lang.Override - public java.util.List - getPolicyRuleListOrBuilderList() { - return policyRuleList_; + public java.util.List + getPolicyRulesOrBuilderList() { + return policyRules_; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ @java.lang.Override - public int getPolicyRuleListCount() { - return policyRuleList_.size(); + public int getPolicyRulesCount() { + return policyRules_.size(); } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ @java.lang.Override - public policy.Policy.PolicyRule getPolicyRuleList(int index) { - return policyRuleList_.get(index); + public policy.Policy.PolicyRuleId getPolicyRules(int index) { + return policyRules_.get(index); } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ @java.lang.Override - public policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRulesOrBuilder( int index) { - return policyRuleList_.get(index); + return policyRules_.get(index); } private byte memoizedIsInitialized = -1; @@ -8200,8 +8708,8 @@ public final class Policy { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < policyRuleList_.size(); i++) { - output.writeMessage(1, policyRuleList_.get(i)); + for (int i = 0; i < policyRules_.size(); i++) { + output.writeMessage(1, policyRules_.get(i)); } unknownFields.writeTo(output); } @@ -8212,9 +8720,9 @@ public final class Policy { if (size != -1) return size; size = 0; - for (int i = 0; i < policyRuleList_.size(); i++) { + for (int i = 0; i < policyRules_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, policyRuleList_.get(i)); + .computeMessageSize(1, policyRules_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -8231,8 +8739,8 @@ public final class Policy { } policy.Policy.PolicyRuleList other = (policy.Policy.PolicyRuleList) obj; - if (!getPolicyRuleListList() - .equals(other.getPolicyRuleListList())) return false; + if (!getPolicyRulesList() + .equals(other.getPolicyRulesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -8244,9 +8752,9 @@ public final class Policy { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getPolicyRuleListCount() > 0) { - hash = (37 * hash) + POLICYRULELIST_FIELD_NUMBER; - hash = (53 * hash) + getPolicyRuleListList().hashCode(); + if (getPolicyRulesCount() > 0) { + hash = (37 * hash) + POLICYRULES_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRulesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; @@ -8380,17 +8888,17 @@ public final class Policy { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { - getPolicyRuleListFieldBuilder(); + getPolicyRulesFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - if (policyRuleListBuilder_ == null) { - policyRuleList_ = java.util.Collections.emptyList(); + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { - policyRuleListBuilder_.clear(); + policyRulesBuilder_.clear(); } return this; } @@ -8419,14 +8927,14 @@ public final class Policy { public policy.Policy.PolicyRuleList buildPartial() { policy.Policy.PolicyRuleList result = new policy.Policy.PolicyRuleList(this); int from_bitField0_ = bitField0_; - if (policyRuleListBuilder_ == null) { + if (policyRulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = java.util.Collections.unmodifiableList(policyRuleList_); + policyRules_ = java.util.Collections.unmodifiableList(policyRules_); bitField0_ = (bitField0_ & ~0x00000001); } - result.policyRuleList_ = policyRuleList_; + result.policyRules_ = policyRules_; } else { - result.policyRuleList_ = policyRuleListBuilder_.build(); + result.policyRules_ = policyRulesBuilder_.build(); } onBuilt(); return result; @@ -8476,29 +8984,29 @@ public final class Policy { public Builder mergeFrom(policy.Policy.PolicyRuleList other) { if (other == policy.Policy.PolicyRuleList.getDefaultInstance()) return this; - if (policyRuleListBuilder_ == null) { - if (!other.policyRuleList_.isEmpty()) { - if (policyRuleList_.isEmpty()) { - policyRuleList_ = other.policyRuleList_; + if (policyRulesBuilder_ == null) { + if (!other.policyRules_.isEmpty()) { + if (policyRules_.isEmpty()) { + policyRules_ = other.policyRules_; bitField0_ = (bitField0_ & ~0x00000001); } else { - ensurePolicyRuleListIsMutable(); - policyRuleList_.addAll(other.policyRuleList_); + ensurePolicyRulesIsMutable(); + policyRules_.addAll(other.policyRules_); } onChanged(); } } else { - if (!other.policyRuleList_.isEmpty()) { - if (policyRuleListBuilder_.isEmpty()) { - policyRuleListBuilder_.dispose(); - policyRuleListBuilder_ = null; - policyRuleList_ = other.policyRuleList_; + if (!other.policyRules_.isEmpty()) { + if (policyRulesBuilder_.isEmpty()) { + policyRulesBuilder_.dispose(); + policyRulesBuilder_ = null; + policyRules_ = other.policyRules_; bitField0_ = (bitField0_ & ~0x00000001); - policyRuleListBuilder_ = + policyRulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPolicyRuleListFieldBuilder() : null; + getPolicyRulesFieldBuilder() : null; } else { - policyRuleListBuilder_.addAllMessages(other.policyRuleList_); + policyRulesBuilder_.addAllMessages(other.policyRules_); } } } @@ -8532,244 +9040,244 @@ public final class Policy { } private int bitField0_; - private java.util.List policyRuleList_ = + private java.util.List policyRules_ = java.util.Collections.emptyList(); - private void ensurePolicyRuleListIsMutable() { + private void ensurePolicyRulesIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - policyRuleList_ = new java.util.ArrayList(policyRuleList_); + policyRules_ = new java.util.ArrayList(policyRules_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder> policyRuleListBuilder_; + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> policyRulesBuilder_; /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public java.util.List getPolicyRuleListList() { - if (policyRuleListBuilder_ == null) { - return java.util.Collections.unmodifiableList(policyRuleList_); + public java.util.List getPolicyRulesList() { + if (policyRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRules_); } else { - return policyRuleListBuilder_.getMessageList(); + return policyRulesBuilder_.getMessageList(); } } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public int getPolicyRuleListCount() { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.size(); + public int getPolicyRulesCount() { + if (policyRulesBuilder_ == null) { + return policyRules_.size(); } else { - return policyRuleListBuilder_.getCount(); + return policyRulesBuilder_.getCount(); } } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public policy.Policy.PolicyRule getPolicyRuleList(int index) { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.get(index); + public policy.Policy.PolicyRuleId getPolicyRules(int index) { + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); } else { - return policyRuleListBuilder_.getMessage(index); + return policyRulesBuilder_.getMessage(index); } } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder setPolicyRuleList( - int index, policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder setPolicyRules( + int index, policy.Policy.PolicyRuleId value) { + if (policyRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.set(index, value); + ensurePolicyRulesIsMutable(); + policyRules_.set(index, value); onChanged(); } else { - policyRuleListBuilder_.setMessage(index, value); + policyRulesBuilder_.setMessage(index, value); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder setPolicyRuleList( - int index, policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.set(index, builderForValue.build()); + public Builder setPolicyRules( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.set(index, builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.setMessage(index, builderForValue.build()); + policyRulesBuilder_.setMessage(index, builderForValue.build()); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder addPolicyRuleList(policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder addPolicyRules(policy.Policy.PolicyRuleId value) { + if (policyRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(value); + ensurePolicyRulesIsMutable(); + policyRules_.add(value); onChanged(); } else { - policyRuleListBuilder_.addMessage(value); + policyRulesBuilder_.addMessage(value); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder addPolicyRuleList( - int index, policy.Policy.PolicyRule value) { - if (policyRuleListBuilder_ == null) { + public Builder addPolicyRules( + int index, policy.Policy.PolicyRuleId value) { + if (policyRulesBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(index, value); + ensurePolicyRulesIsMutable(); + policyRules_.add(index, value); onChanged(); } else { - policyRuleListBuilder_.addMessage(index, value); + policyRulesBuilder_.addMessage(index, value); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder addPolicyRuleList( - policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(builderForValue.build()); + public Builder addPolicyRules( + policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.addMessage(builderForValue.build()); + policyRulesBuilder_.addMessage(builderForValue.build()); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder addPolicyRuleList( - int index, policy.Policy.PolicyRule.Builder builderForValue) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.add(index, builderForValue.build()); + public Builder addPolicyRules( + int index, policy.Policy.PolicyRuleId.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(index, builderForValue.build()); onChanged(); } else { - policyRuleListBuilder_.addMessage(index, builderForValue.build()); + policyRulesBuilder_.addMessage(index, builderForValue.build()); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder addAllPolicyRuleList( - java.lang.Iterable values) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); + public Builder addAllPolicyRules( + java.lang.Iterable values) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, policyRuleList_); + values, policyRules_); onChanged(); } else { - policyRuleListBuilder_.addAllMessages(values); + policyRulesBuilder_.addAllMessages(values); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder clearPolicyRuleList() { - if (policyRuleListBuilder_ == null) { - policyRuleList_ = java.util.Collections.emptyList(); + public Builder clearPolicyRules() { + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - policyRuleListBuilder_.clear(); + policyRulesBuilder_.clear(); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public Builder removePolicyRuleList(int index) { - if (policyRuleListBuilder_ == null) { - ensurePolicyRuleListIsMutable(); - policyRuleList_.remove(index); + public Builder removePolicyRules(int index) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.remove(index); onChanged(); } else { - policyRuleListBuilder_.remove(index); + policyRulesBuilder_.remove(index); } return this; } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public policy.Policy.PolicyRule.Builder getPolicyRuleListBuilder( + public policy.Policy.PolicyRuleId.Builder getPolicyRulesBuilder( int index) { - return getPolicyRuleListFieldBuilder().getBuilder(index); + return getPolicyRulesFieldBuilder().getBuilder(index); } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public policy.Policy.PolicyRuleOrBuilder getPolicyRuleListOrBuilder( + public policy.Policy.PolicyRuleIdOrBuilder getPolicyRulesOrBuilder( int index) { - if (policyRuleListBuilder_ == null) { - return policyRuleList_.get(index); } else { - return policyRuleListBuilder_.getMessageOrBuilder(index); + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); } else { + return policyRulesBuilder_.getMessageOrBuilder(index); } } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public java.util.List - getPolicyRuleListOrBuilderList() { - if (policyRuleListBuilder_ != null) { - return policyRuleListBuilder_.getMessageOrBuilderList(); + public java.util.List + getPolicyRulesOrBuilderList() { + if (policyRulesBuilder_ != null) { + return policyRulesBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(policyRuleList_); + return java.util.Collections.unmodifiableList(policyRules_); } } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public policy.Policy.PolicyRule.Builder addPolicyRuleListBuilder() { - return getPolicyRuleListFieldBuilder().addBuilder( - policy.Policy.PolicyRule.getDefaultInstance()); + public policy.Policy.PolicyRuleId.Builder addPolicyRulesBuilder() { + return getPolicyRulesFieldBuilder().addBuilder( + policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public policy.Policy.PolicyRule.Builder addPolicyRuleListBuilder( + public policy.Policy.PolicyRuleId.Builder addPolicyRulesBuilder( int index) { - return getPolicyRuleListFieldBuilder().addBuilder( - index, policy.Policy.PolicyRule.getDefaultInstance()); + return getPolicyRulesFieldBuilder().addBuilder( + index, policy.Policy.PolicyRuleId.getDefaultInstance()); } /** - * repeated .policy.PolicyRule policyRuleList = 1; + * repeated .policy.PolicyRuleId policyRules = 1; */ - public java.util.List - getPolicyRuleListBuilderList() { - return getPolicyRuleListFieldBuilder().getBuilderList(); + public java.util.List + getPolicyRulesBuilderList() { + return getPolicyRulesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder> - getPolicyRuleListFieldBuilder() { - if (policyRuleListBuilder_ == null) { - policyRuleListBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - policy.Policy.PolicyRule, policy.Policy.PolicyRule.Builder, policy.Policy.PolicyRuleOrBuilder>( - policyRuleList_, + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder> + getPolicyRulesFieldBuilder() { + if (policyRulesBuilder_ == null) { + policyRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleId.Builder, policy.Policy.PolicyRuleIdOrBuilder>( + policyRules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - policyRuleList_ = null; + policyRules_ = null; } - return policyRuleListBuilder_; + return policyRulesBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -8835,35 +9343,35 @@ public final class Policy { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_policy_PolicyRuleState_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleVariable_descriptor; + internal_static_policy_PolicyRuleBasic_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleVariable_fieldAccessorTable; + internal_static_policy_PolicyRuleBasic_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleValue_descriptor; + internal_static_policy_PolicyRuleService_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleValue_fieldAccessorTable; + internal_static_policy_PolicyRuleService_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleEvent_descriptor; + internal_static_policy_PolicyRuleDevice_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleEvent_fieldAccessorTable; + internal_static_policy_PolicyRuleDevice_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleCondition_descriptor; + internal_static_policy_PolicyRuleIdList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleCondition_fieldAccessorTable; + internal_static_policy_PolicyRuleIdList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRuleAction_descriptor; + internal_static_policy_PolicyRuleServiceList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRuleAction_fieldAccessorTable; + internal_static_policy_PolicyRuleServiceList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_policy_PolicyRule_descriptor; + internal_static_policy_PolicyRuleDeviceList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_policy_PolicyRule_fieldAccessorTable; + internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_policy_PolicyRuleList_descriptor; private static final @@ -8878,50 +9386,60 @@ public final class Policy { descriptor; static { java.lang.String[] descriptorData = { - "\n\014policy.proto\022\006policy\032\rcontext.proto\"+\n" + - "\014PolicyRuleId\022\033\n\004uuid\030\001 \001(\0132\r.context.Uu" + - "id\"b\n\017PolicyRuleState\022#\n\014policyRuleId\030\001 " + - "\001(\0132\r.context.Uuid\022*\n\017policyRuleState\030\002 " + - "\001(\0162\021.policy.RuleState\"0\n\022PolicyRuleVari" + - "able\022\032\n\022policyRuleVariable\030\001 \001(\t\"*\n\017Poli" + - "cyRuleValue\022\027\n\017policyRuleValue\030\001 \001(\t\"0\n\017" + - "PolicyRuleEvent\022\035\n\005event\030\001 \001(\0132\016.context" + - ".Event\"\204\001\n\023PolicyRuleCondition\0227\n\023polRul" + - "eConditionVar\030\001 \001(\0132\032.policy.PolicyRuleV" + - "ariable\0224\n\023polRuleConditionVal\030\002 \001(\0132\027.p" + - "olicy.PolicyRuleValue\"{\n\020PolicyRuleActio" + - "n\0224\n\020polRuleActionVar\030\001 \001(\0132\032.policy.Pol" + - "icyRuleVariable\0221\n\020polRuleActionVal\030\002 \001(" + - "\0132\027.policy.PolicyRuleValue\"\354\002\n\nPolicyRul" + - "e\022*\n\014policyRuleId\030\001 \001(\0132\024.policy.PolicyR" + - "uleId\022.\n\016policyRuleType\030\002 \001(\0162\026.policy.P" + - "olicyRuleType\022\032\n\022PolicyRulePriority\030\003 \001(" + - "\r\022&\n\005event\030\004 \001(\0132\027.policy.PolicyRuleEven" + - "t\0229\n\024polRuleConditionList\030\005 \003(\0132\033.policy" + - ".PolicyRuleCondition\0223\n\021polRuleActionLis" + - "t\030\006 \003(\0132\030.policy.PolicyRuleAction\022\'\n\013ser" + - "viceList\030\007 \003(\0132\022.context.ServiceId\022%\n\nde" + - "viceList\030\010 \003(\0132\021.context.DeviceId\"<\n\016Pol" + - "icyRuleList\022*\n\016policyRuleList\030\001 \003(\0132\022.po" + - "licy.PolicyRule*G\n\tRuleState\022\023\n\017POLICY_I" + - "NACTIVE\020\000\022\022\n\016POLICY_PLANNED\020\001\022\021\n\rPOLICY_" + - "ACTIVE\020\002*?\n\016PolicyRuleType\022\025\n\021POLICYTYPE" + - "_DEVICE\020\000\022\026\n\022POLICYTYPE_NETWORK\020\0012\214\003\n\rPo" + - "licyService\022:\n\tPolicyAdd\022\022.policy.Policy" + - "Rule\032\027.policy.PolicyRuleState\"\000\022=\n\014Polic" + - "yUpdate\022\022.policy.PolicyRule\032\027.policy.Pol" + - "icyRuleState\"\000\022=\n\014PolicyDelete\022\022.policy." + - "PolicyRule\032\027.policy.PolicyRuleState\"\000\0227\n" + - "\tGetPolicy\022\024.policy.PolicyRuleId\032\022.polic" + - "y.PolicyRule\"\000\022B\n\023GetPolicyByDeviceId\022\021." + - "context.DeviceId\032\026.policy.PolicyRuleList" + - "\"\000\022D\n\024GetPolicyByServiceId\022\022.context.Ser" + - "viceId\032\026.policy.PolicyRuleList\"\000b\006proto3" + "\n\014policy.proto\022\006policy\032\rcontext.proto\032\026p" + + "olicy_condition.proto\032\023policy_action.pro" + + "to\"+\n\014PolicyRuleId\022\033\n\004uuid\030\001 \001(\0132\r.conte" + + "xt.Uuid\"=\n\017PolicyRuleState\022*\n\017policyRule" + + "State\030\001 \001(\0162\021.policy.RuleState\"\225\002\n\017Polic" + + "yRuleBasic\022*\n\014policyRuleId\030\001 \001(\0132\024.polic" + + "y.PolicyRuleId\0220\n\017policyRuleState\030\002 \001(\0132" + + "\027.policy.PolicyRuleState\022\020\n\010priority\030\003 \001" + + "(\r\0222\n\rconditionList\030\004 \003(\0132\033.policy.Polic" + + "yRuleCondition\0220\n\017booleanOperator\030\005 \001(\0162" + + "\027.policy.BooleanOperator\022,\n\nactionList\030\006" + + " \003(\0132\030.policy.PolicyRuleAction\"\223\001\n\021Polic" + + "yRuleService\0220\n\017policyRuleBasic\030\001 \001(\0132\027." + + "policy.PolicyRuleBasic\022%\n\tserviceId\030\002 \001(" + + "\0132\022.context.ServiceId\022%\n\ndeviceList\030\003 \003(" + + "\0132\021.context.DeviceId\"k\n\020PolicyRuleDevice" + + "\0220\n\017policyRuleBasic\030\001 \001(\0132\027.policy.Polic" + + "yRuleBasic\022%\n\ndeviceList\030\002 \003(\0132\021.context" + + ".DeviceId\"B\n\020PolicyRuleIdList\022.\n\020policyR" + + "uleIdList\030\001 \003(\0132\024.policy.PolicyRuleId\"Q\n" + + "\025PolicyRuleServiceList\0228\n\025policyRuleServ" + + "iceList\030\001 \003(\0132\031.policy.PolicyRuleService" + + "\"N\n\024PolicyRuleDeviceList\0226\n\024policyRuleDe" + + "viceList\030\001 \003(\0132\030.policy.PolicyRuleDevice" + + "\";\n\016PolicyRuleList\022)\n\013policyRules\030\001 \003(\0132" + + "\024.policy.PolicyRuleId*\365\001\n\tRuleState\022\024\n\020P" + + "OLICY_UNDEFINED\020\000\022\021\n\rPOLICY_FAILED\020\001\022\023\n\017" + + "POLICY_INSERTED\020\002\022\024\n\020POLICY_VALIDATED\020\003\022" + + "\026\n\022POLICY_PROVISIONED\020\004\022\021\n\rPOLICY_ACTIVE" + + "\020\005\022\023\n\017POLICY_ENFORCED\020\006\022\026\n\022POLICY_INEFFE" + + "CTIVE\020\007\022\024\n\020POLICY_EFFECTIVE\020\010\022\022\n\016POLICY_" + + "UPDATED\020\t\022\022\n\016POLICY_REMOVED\020\n2\323\004\n\rPolicy" + + "Service\022H\n\020PolicyAddService\022\031.policy.Pol" + + "icyRuleService\032\027.policy.PolicyRuleState\"" + + "\000\022F\n\017PolicyAddDevice\022\030.policy.PolicyRule" + + "Device\032\027.policy.PolicyRuleState\"\000\022K\n\023Pol" + + "icyUpdateService\022\031.policy.PolicyRuleServ" + + "ice\032\027.policy.PolicyRuleState\"\000\022I\n\022Policy" + + "UpdateDevice\022\030.policy.PolicyRuleDevice\032\027" + + ".policy.PolicyRuleState\"\000\022?\n\014PolicyDelet" + + "e\022\024.policy.PolicyRuleId\032\027.policy.PolicyR" + + "uleState\"\000\022E\n\020GetPolicyService\022\024.policy." + + "PolicyRuleId\032\031.policy.PolicyRuleService\"" + + "\000\022C\n\017GetPolicyDevice\022\024.policy.PolicyRule" + + "Id\032\030.policy.PolicyRuleDevice\"\000\022K\n\024GetPol" + + "icyByServiceId\022\022.context.ServiceId\032\035.pol" + + "icy.PolicyRuleServiceList\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { context.ContextOuterClass.getDescriptor(), + policy.PolicyCondition.getDescriptor(), + policy.PolicyAction.getDescriptor(), }); internal_static_policy_PolicyRuleId_descriptor = getDescriptor().getMessageTypes().get(0); @@ -8934,50 +9452,52 @@ public final class Policy { internal_static_policy_PolicyRuleState_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_policy_PolicyRuleState_descriptor, - new java.lang.String[] { "PolicyRuleId", "PolicyRuleState", }); - internal_static_policy_PolicyRuleVariable_descriptor = + new java.lang.String[] { "PolicyRuleState", }); + internal_static_policy_PolicyRuleBasic_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_policy_PolicyRuleVariable_fieldAccessorTable = new + internal_static_policy_PolicyRuleBasic_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleVariable_descriptor, - new java.lang.String[] { "PolicyRuleVariable", }); - internal_static_policy_PolicyRuleValue_descriptor = + internal_static_policy_PolicyRuleBasic_descriptor, + new java.lang.String[] { "PolicyRuleId", "PolicyRuleState", "Priority", "ConditionList", "BooleanOperator", "ActionList", }); + internal_static_policy_PolicyRuleService_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_policy_PolicyRuleValue_fieldAccessorTable = new + internal_static_policy_PolicyRuleService_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleValue_descriptor, - new java.lang.String[] { "PolicyRuleValue", }); - internal_static_policy_PolicyRuleEvent_descriptor = + internal_static_policy_PolicyRuleService_descriptor, + new java.lang.String[] { "PolicyRuleBasic", "ServiceId", "DeviceList", }); + internal_static_policy_PolicyRuleDevice_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_policy_PolicyRuleEvent_fieldAccessorTable = new + internal_static_policy_PolicyRuleDevice_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleEvent_descriptor, - new java.lang.String[] { "Event", }); - internal_static_policy_PolicyRuleCondition_descriptor = + internal_static_policy_PolicyRuleDevice_descriptor, + new java.lang.String[] { "PolicyRuleBasic", "DeviceList", }); + internal_static_policy_PolicyRuleIdList_descriptor = getDescriptor().getMessageTypes().get(5); - internal_static_policy_PolicyRuleCondition_fieldAccessorTable = new + internal_static_policy_PolicyRuleIdList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleCondition_descriptor, - new java.lang.String[] { "PolRuleConditionVar", "PolRuleConditionVal", }); - internal_static_policy_PolicyRuleAction_descriptor = + internal_static_policy_PolicyRuleIdList_descriptor, + new java.lang.String[] { "PolicyRuleIdList", }); + internal_static_policy_PolicyRuleServiceList_descriptor = getDescriptor().getMessageTypes().get(6); - internal_static_policy_PolicyRuleAction_fieldAccessorTable = new + internal_static_policy_PolicyRuleServiceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRuleAction_descriptor, - new java.lang.String[] { "PolRuleActionVar", "PolRuleActionVal", }); - internal_static_policy_PolicyRule_descriptor = + internal_static_policy_PolicyRuleServiceList_descriptor, + new java.lang.String[] { "PolicyRuleServiceList", }); + internal_static_policy_PolicyRuleDeviceList_descriptor = getDescriptor().getMessageTypes().get(7); - internal_static_policy_PolicyRule_fieldAccessorTable = new + internal_static_policy_PolicyRuleDeviceList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_policy_PolicyRule_descriptor, - new java.lang.String[] { "PolicyRuleId", "PolicyRuleType", "PolicyRulePriority", "Event", "PolRuleConditionList", "PolRuleActionList", "ServiceList", "DeviceList", }); + internal_static_policy_PolicyRuleDeviceList_descriptor, + new java.lang.String[] { "PolicyRuleDeviceList", }); internal_static_policy_PolicyRuleList_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_policy_PolicyRuleList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_policy_PolicyRuleList_descriptor, - new java.lang.String[] { "PolicyRuleList", }); + new java.lang.String[] { "PolicyRules", }); context.ContextOuterClass.getDescriptor(); + policy.PolicyCondition.getDescriptor(); + policy.PolicyAction.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyAction.java b/src/policy/target/generated-sources/grpc/policy/PolicyAction.java new file mode 100644 index 0000000000000000000000000000000000000000..ea6ee17d03fecab1e341cdfbc97d5dd5f3b2576c --- /dev/null +++ b/src/policy/target/generated-sources/grpc/policy/PolicyAction.java @@ -0,0 +1,932 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: policy_action.proto + +package policy; + +public final class PolicyAction { + private PolicyAction() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code policy.PolicyRuleActionEnum} + */ + public enum PolicyRuleActionEnum + implements com.google.protobuf.ProtocolMessageEnum { + /** + * POLICYRULE_ACTION_NO_ACTION = 0; + */ + POLICYRULE_ACTION_NO_ACTION(0), + /** + * POLICYRULE_ACTION_SET_DEVICE_STATUS = 1; + */ + POLICYRULE_ACTION_SET_DEVICE_STATUS(1), + /** + * POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2; + */ + POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE(2), + /** + * POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3; + */ + POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT(3), + UNRECOGNIZED(-1), + ; + + /** + * POLICYRULE_ACTION_NO_ACTION = 0; + */ + public static final int POLICYRULE_ACTION_NO_ACTION_VALUE = 0; + /** + * POLICYRULE_ACTION_SET_DEVICE_STATUS = 1; + */ + public static final int POLICYRULE_ACTION_SET_DEVICE_STATUS_VALUE = 1; + /** + * POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2; + */ + public static final int POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE_VALUE = 2; + /** + * POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3; + */ + public static final int POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT_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 PolicyRuleActionEnum 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 PolicyRuleActionEnum forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_ACTION_NO_ACTION; + case 1: return POLICYRULE_ACTION_SET_DEVICE_STATUS; + case 2: return POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE; + case 3: return POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + PolicyRuleActionEnum> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PolicyRuleActionEnum findValueByNumber(int number) { + return PolicyRuleActionEnum.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 policy.PolicyAction.getDescriptor().getEnumTypes().get(0); + } + + private static final PolicyRuleActionEnum[] VALUES = values(); + + public static PolicyRuleActionEnum 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 PolicyRuleActionEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.PolicyRuleActionEnum) + } + + public interface PolicyRuleActionOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleAction) + com.google.protobuf.MessageOrBuilder { + + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The action. + */ + policy.PolicyAction.PolicyRuleActionEnum getAction(); + + /** + * repeated string parameters = 2; + * @return A list containing the parameters. + */ + java.util.List + getParametersList(); + /** + * repeated string parameters = 2; + * @return The count of parameters. + */ + int getParametersCount(); + /** + * repeated string parameters = 2; + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + java.lang.String getParameters(int index); + /** + * repeated string parameters = 2; + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + com.google.protobuf.ByteString + getParametersBytes(int index); + } + /** + *
+   * Action
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleAction} + */ + public static final class PolicyRuleAction extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleAction) + PolicyRuleActionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleAction.newBuilder() to construct. + private PolicyRuleAction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PolicyRuleAction() { + action_ = 0; + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleAction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleAction( + 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 8: { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameters_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + parameters_.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)) { + parameters_ = parameters_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyAction.PolicyRuleAction.class, policy.PolicyAction.PolicyRuleAction.Builder.class); + } + + public static final int ACTION_FIELD_NUMBER = 1; + private int action_; + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The action. + */ + @java.lang.Override public policy.PolicyAction.PolicyRuleActionEnum getAction() { + @SuppressWarnings("deprecation") + policy.PolicyAction.PolicyRuleActionEnum result = policy.PolicyAction.PolicyRuleActionEnum.valueOf(action_); + return result == null ? policy.PolicyAction.PolicyRuleActionEnum.UNRECOGNIZED : result; + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList parameters_; + /** + * repeated string parameters = 2; + * @return A list containing the parameters. + */ + public com.google.protobuf.ProtocolStringList + getParametersList() { + return parameters_; + } + /** + * repeated string parameters = 2; + * @return The count of parameters. + */ + public int getParametersCount() { + return parameters_.size(); + } + /** + * repeated string parameters = 2; + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + public java.lang.String getParameters(int index) { + return parameters_.get(index); + } + /** + * repeated string parameters = 2; + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + public com.google.protobuf.ByteString + getParametersBytes(int index) { + return parameters_.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 { + if (action_ != policy.PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION.getNumber()) { + output.writeEnum(1, action_); + } + for (int i = 0; i < parameters_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parameters_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (action_ != policy.PolicyAction.PolicyRuleActionEnum.POLICYRULE_ACTION_NO_ACTION.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, action_); + } + { + int dataSize = 0; + for (int i = 0; i < parameters_.size(); i++) { + dataSize += computeStringSizeNoTag(parameters_.getRaw(i)); + } + size += dataSize; + size += 1 * getParametersList().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 policy.PolicyAction.PolicyRuleAction)) { + return super.equals(obj); + } + policy.PolicyAction.PolicyRuleAction other = (policy.PolicyAction.PolicyRuleAction) obj; + + if (action_ != other.action_) return false; + if (!getParametersList() + .equals(other.getParametersList())) 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) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.PolicyAction.PolicyRuleAction parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyAction.PolicyRuleAction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction 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 policy.PolicyAction.PolicyRuleAction parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction 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 policy.PolicyAction.PolicyRuleAction parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyAction.PolicyRuleAction 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(policy.PolicyAction.PolicyRuleAction 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; + } + /** + *
+     * Action
+     * 
+ * + * Protobuf type {@code policy.PolicyRuleAction} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleAction) + policy.PolicyAction.PolicyRuleActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyAction.PolicyRuleAction.class, policy.PolicyAction.PolicyRuleAction.Builder.class); + } + + // Construct using policy.PolicyAction.PolicyRuleAction.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(); + action_ = 0; + + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.PolicyAction.internal_static_policy_PolicyRuleAction_descriptor; + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction getDefaultInstanceForType() { + return policy.PolicyAction.PolicyRuleAction.getDefaultInstance(); + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction build() { + policy.PolicyAction.PolicyRuleAction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public policy.PolicyAction.PolicyRuleAction buildPartial() { + policy.PolicyAction.PolicyRuleAction result = new policy.PolicyAction.PolicyRuleAction(this); + int from_bitField0_ = bitField0_; + result.action_ = action_; + if (((bitField0_ & 0x00000001) != 0)) { + parameters_ = parameters_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parameters_ = parameters_; + 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 policy.PolicyAction.PolicyRuleAction) { + return mergeFrom((policy.PolicyAction.PolicyRuleAction)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(policy.PolicyAction.PolicyRuleAction other) { + if (other == policy.PolicyAction.PolicyRuleAction.getDefaultInstance()) return this; + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + 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 { + policy.PolicyAction.PolicyRuleAction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.PolicyAction.PolicyRuleAction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int action_ = 0; + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override public int getActionValue() { + return action_; + } + /** + * .policy.PolicyRuleActionEnum action = 1; + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return The action. + */ + @java.lang.Override + public policy.PolicyAction.PolicyRuleActionEnum getAction() { + @SuppressWarnings("deprecation") + policy.PolicyAction.PolicyRuleActionEnum result = policy.PolicyAction.PolicyRuleActionEnum.valueOf(action_); + return result == null ? policy.PolicyAction.PolicyRuleActionEnum.UNRECOGNIZED : result; + } + /** + * .policy.PolicyRuleActionEnum action = 1; + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(policy.PolicyAction.PolicyRuleActionEnum value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .policy.PolicyRuleActionEnum action = 1; + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parameters_ = new com.google.protobuf.LazyStringArrayList(parameters_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string parameters = 2; + * @return A list containing the parameters. + */ + public com.google.protobuf.ProtocolStringList + getParametersList() { + return parameters_.getUnmodifiableView(); + } + /** + * repeated string parameters = 2; + * @return The count of parameters. + */ + public int getParametersCount() { + return parameters_.size(); + } + /** + * repeated string parameters = 2; + * @param index The index of the element to return. + * @return The parameters at the given index. + */ + public java.lang.String getParameters(int index) { + return parameters_.get(index); + } + /** + * repeated string parameters = 2; + * @param index The index of the value to return. + * @return The bytes of the parameters at the given index. + */ + public com.google.protobuf.ByteString + getParametersBytes(int index) { + return parameters_.getByteString(index); + } + /** + * repeated string parameters = 2; + * @param index The index to set the value at. + * @param value The parameters to set. + * @return This builder for chaining. + */ + public Builder setParameters( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string parameters = 2; + * @param value The parameters to add. + * @return This builder for chaining. + */ + public Builder addParameters( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + return this; + } + /** + * repeated string parameters = 2; + * @param values The parameters to add. + * @return This builder for chaining. + */ + public Builder addAllParameters( + java.lang.Iterable values) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, parameters_); + onChanged(); + return this; + } + /** + * repeated string parameters = 2; + * @return This builder for chaining. + */ + public Builder clearParameters() { + parameters_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated string parameters = 2; + * @param value The bytes of the parameters to add. + * @return This builder for chaining. + */ + public Builder addParametersBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureParametersIsMutable(); + parameters_.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:policy.PolicyRuleAction) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleAction) + private static final policy.PolicyAction.PolicyRuleAction DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.PolicyAction.PolicyRuleAction(); + } + + public static policy.PolicyAction.PolicyRuleAction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRuleAction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleAction(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 policy.PolicyAction.PolicyRuleAction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_policy_PolicyRuleAction_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_policy_PolicyRuleAction_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\023policy_action.proto\022\006policy\"T\n\020PolicyR" + + "uleAction\022,\n\006action\030\001 \001(\0162\034.policy.Polic" + + "yRuleActionEnum\022\022\n\nparameters\030\002 \003(\t*\274\001\n\024" + + "PolicyRuleActionEnum\022\037\n\033POLICYRULE_ACTIO" + + "N_NO_ACTION\020\000\022\'\n#POLICYRULE_ACTION_SET_D" + + "EVICE_STATUS\020\001\022,\n(POLICYRULE_ACTION_ADD_" + + "SERVICE_CONFIGRULE\020\002\022,\n(POLICYRULE_ACTIO" + + "N_ADD_SERVICE_CONSTRAINT\020\003b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_policy_PolicyRuleAction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_policy_PolicyRuleAction_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_policy_PolicyRuleAction_descriptor, + new java.lang.String[] { "Action", "Parameters", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java b/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java new file mode 100644 index 0000000000000000000000000000000000000000..ecd7192778b6f5e7d0f7ee8f189565c828860c21 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/policy/PolicyCondition.java @@ -0,0 +1,1362 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: policy_condition.proto + +package policy; + +public final class PolicyCondition { + private PolicyCondition() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + *
+   * Operator to be used when comparing Kpis with condition values
+   * 
+ * + * Protobuf enum {@code policy.NumericalOperator} + */ + public enum NumericalOperator + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Kpi numerical operator undefined
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; + */ + POLICYRULE_CONDITION_NUMERICAL_UNDEFINED(0), + /** + *
+     * Kpi is equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; + */ + POLICYRULE_CONDITION_NUMERICAL_EQUAL(1), + /** + *
+     * Kpi is not equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; + */ + POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL(2), + /** + *
+     * Kpi is less than value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; + */ + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN(3), + /** + *
+     * Kpi is less than or equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; + */ + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL(4), + /** + *
+     * Kpi is greater than value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; + */ + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN(5), + /** + *
+     * Kpi is less than or equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; + */ + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL(6), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Kpi numerical operator undefined
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_UNDEFINED_VALUE = 0; + /** + *
+     * Kpi is equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_EQUAL_VALUE = 1; + /** + *
+     * Kpi is not equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL_VALUE = 2; + /** + *
+     * Kpi is less than value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_VALUE = 3; + /** + *
+     * Kpi is less than or equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL_VALUE = 4; + /** + *
+     * Kpi is greater than value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_VALUE = 5; + /** + *
+     * Kpi is less than or equal with value
+     * 
+ * + * POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; + */ + public static final int POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL_VALUE = 6; + + + 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 NumericalOperator 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 NumericalOperator forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_CONDITION_NUMERICAL_UNDEFINED; + case 1: return POLICYRULE_CONDITION_NUMERICAL_EQUAL; + case 2: return POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL; + case 3: return POLICYRULE_CONDITION_NUMERICAL_LESS_THAN; + case 4: return POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL; + case 5: return POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN; + case 6: return POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NumericalOperator> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NumericalOperator findValueByNumber(int number) { + return NumericalOperator.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 policy.PolicyCondition.getDescriptor().getEnumTypes().get(0); + } + + private static final NumericalOperator[] VALUES = values(); + + public static NumericalOperator 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 NumericalOperator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.NumericalOperator) + } + + /** + *
+   * Operator to be used when evaluating each condition
+   * 
+ * + * Protobuf enum {@code policy.BooleanOperator} + */ + public enum BooleanOperator + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Boolean operator undefined
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; + */ + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED(0), + /** + *
+     * Boolean AND operator
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_AND = 1; + */ + POLICYRULE_CONDITION_BOOLEAN_AND(1), + /** + *
+     * Boolean OR operator
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_OR = 2; + */ + POLICYRULE_CONDITION_BOOLEAN_OR(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Boolean operator undefined
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_UNDEFINED_VALUE = 0; + /** + *
+     * Boolean AND operator
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_AND = 1; + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_AND_VALUE = 1; + /** + *
+     * Boolean OR operator
+     * 
+ * + * POLICYRULE_CONDITION_BOOLEAN_OR = 2; + */ + public static final int POLICYRULE_CONDITION_BOOLEAN_OR_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 BooleanOperator 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 BooleanOperator forNumber(int value) { + switch (value) { + case 0: return POLICYRULE_CONDITION_BOOLEAN_UNDEFINED; + case 1: return POLICYRULE_CONDITION_BOOLEAN_AND; + case 2: return POLICYRULE_CONDITION_BOOLEAN_OR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + BooleanOperator> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public BooleanOperator findValueByNumber(int number) { + return BooleanOperator.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 policy.PolicyCondition.getDescriptor().getEnumTypes().get(1); + } + + private static final BooleanOperator[] VALUES = values(); + + public static BooleanOperator 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 BooleanOperator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:policy.BooleanOperator) + } + + public interface PolicyRuleConditionOrBuilder extends + // @@protoc_insertion_point(interface_extends:policy.PolicyRuleCondition) + com.google.protobuf.MessageOrBuilder { + + /** + * .monitoring.KpiId kpiId = 1; + * @return Whether the kpiId field is set. + */ + boolean hasKpiId(); + /** + * .monitoring.KpiId kpiId = 1; + * @return The kpiId. + */ + monitoring.Monitoring.KpiId getKpiId(); + /** + * .monitoring.KpiId kpiId = 1; + */ + monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder(); + + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The enum numeric value on the wire for numericalOperator. + */ + int getNumericalOperatorValue(); + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The numericalOperator. + */ + policy.PolicyCondition.NumericalOperator getNumericalOperator(); + + /** + * .monitoring.KpiValue kpiValue = 3; + * @return Whether the kpiValue field is set. + */ + boolean hasKpiValue(); + /** + * .monitoring.KpiValue kpiValue = 3; + * @return The kpiValue. + */ + monitoring.Monitoring.KpiValue getKpiValue(); + /** + * .monitoring.KpiValue kpiValue = 3; + */ + monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder(); + } + /** + *
+   * Condition
+   * 
+ * + * Protobuf type {@code policy.PolicyRuleCondition} + */ + public static final class PolicyRuleCondition extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:policy.PolicyRuleCondition) + PolicyRuleConditionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRuleCondition.newBuilder() to construct. + private PolicyRuleCondition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PolicyRuleCondition() { + numericalOperator_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PolicyRuleCondition(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PolicyRuleCondition( + 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: { + monitoring.Monitoring.KpiId.Builder subBuilder = null; + if (kpiId_ != null) { + subBuilder = kpiId_.toBuilder(); + } + kpiId_ = input.readMessage(monitoring.Monitoring.KpiId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiId_); + kpiId_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + numericalOperator_ = rawValue; + break; + } + case 26: { + monitoring.Monitoring.KpiValue.Builder subBuilder = null; + if (kpiValue_ != null) { + subBuilder = kpiValue_.toBuilder(); + } + kpiValue_ = input.readMessage(monitoring.Monitoring.KpiValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(kpiValue_); + kpiValue_ = 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 policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyCondition.PolicyRuleCondition.class, policy.PolicyCondition.PolicyRuleCondition.Builder.class); + } + + public static final int KPIID_FIELD_NUMBER = 1; + private monitoring.Monitoring.KpiId kpiId_; + /** + * .monitoring.KpiId kpiId = 1; + * @return Whether the kpiId field is set. + */ + @java.lang.Override + public boolean hasKpiId() { + return kpiId_ != null; + } + /** + * .monitoring.KpiId kpiId = 1; + * @return The kpiId. + */ + @java.lang.Override + public monitoring.Monitoring.KpiId getKpiId() { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + /** + * .monitoring.KpiId kpiId = 1; + */ + @java.lang.Override + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + return getKpiId(); + } + + public static final int NUMERICALOPERATOR_FIELD_NUMBER = 2; + private int numericalOperator_; + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The enum numeric value on the wire for numericalOperator. + */ + @java.lang.Override public int getNumericalOperatorValue() { + return numericalOperator_; + } + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The numericalOperator. + */ + @java.lang.Override public policy.PolicyCondition.NumericalOperator getNumericalOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.NumericalOperator result = policy.PolicyCondition.NumericalOperator.valueOf(numericalOperator_); + return result == null ? policy.PolicyCondition.NumericalOperator.UNRECOGNIZED : result; + } + + public static final int KPIVALUE_FIELD_NUMBER = 3; + private monitoring.Monitoring.KpiValue kpiValue_; + /** + * .monitoring.KpiValue kpiValue = 3; + * @return Whether the kpiValue field is set. + */ + @java.lang.Override + public boolean hasKpiValue() { + return kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpiValue = 3; + * @return The kpiValue. + */ + @java.lang.Override + public monitoring.Monitoring.KpiValue getKpiValue() { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + @java.lang.Override + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + return getKpiValue(); + } + + 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 (kpiId_ != null) { + output.writeMessage(1, getKpiId()); + } + if (numericalOperator_ != policy.PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED.getNumber()) { + output.writeEnum(2, numericalOperator_); + } + if (kpiValue_ != null) { + output.writeMessage(3, getKpiValue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kpiId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getKpiId()); + } + if (numericalOperator_ != policy.PolicyCondition.NumericalOperator.POLICYRULE_CONDITION_NUMERICAL_UNDEFINED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, numericalOperator_); + } + if (kpiValue_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getKpiValue()); + } + 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 policy.PolicyCondition.PolicyRuleCondition)) { + return super.equals(obj); + } + policy.PolicyCondition.PolicyRuleCondition other = (policy.PolicyCondition.PolicyRuleCondition) obj; + + if (hasKpiId() != other.hasKpiId()) return false; + if (hasKpiId()) { + if (!getKpiId() + .equals(other.getKpiId())) return false; + } + if (numericalOperator_ != other.numericalOperator_) return false; + if (hasKpiValue() != other.hasKpiValue()) return false; + if (hasKpiValue()) { + if (!getKpiValue() + .equals(other.getKpiValue())) 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 (hasKpiId()) { + hash = (37 * hash) + KPIID_FIELD_NUMBER; + hash = (53 * hash) + getKpiId().hashCode(); + } + hash = (37 * hash) + NUMERICALOPERATOR_FIELD_NUMBER; + hash = (53 * hash) + numericalOperator_; + if (hasKpiValue()) { + hash = (37 * hash) + KPIVALUE_FIELD_NUMBER; + hash = (53 * hash) + getKpiValue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static policy.PolicyCondition.PolicyRuleCondition parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition 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 policy.PolicyCondition.PolicyRuleCondition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition 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 policy.PolicyCondition.PolicyRuleCondition parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static policy.PolicyCondition.PolicyRuleCondition 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(policy.PolicyCondition.PolicyRuleCondition 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; + } + /** + *
+     * Condition
+     * 
+ * + * Protobuf type {@code policy.PolicyRuleCondition} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:policy.PolicyRuleCondition) + policy.PolicyCondition.PolicyRuleConditionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_fieldAccessorTable + .ensureFieldAccessorsInitialized( + policy.PolicyCondition.PolicyRuleCondition.class, policy.PolicyCondition.PolicyRuleCondition.Builder.class); + } + + // Construct using policy.PolicyCondition.PolicyRuleCondition.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 (kpiIdBuilder_ == null) { + kpiId_ = null; + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + numericalOperator_ = 0; + + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return policy.PolicyCondition.internal_static_policy_PolicyRuleCondition_descriptor; + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition getDefaultInstanceForType() { + return policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance(); + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition build() { + policy.PolicyCondition.PolicyRuleCondition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public policy.PolicyCondition.PolicyRuleCondition buildPartial() { + policy.PolicyCondition.PolicyRuleCondition result = new policy.PolicyCondition.PolicyRuleCondition(this); + if (kpiIdBuilder_ == null) { + result.kpiId_ = kpiId_; + } else { + result.kpiId_ = kpiIdBuilder_.build(); + } + result.numericalOperator_ = numericalOperator_; + if (kpiValueBuilder_ == null) { + result.kpiValue_ = kpiValue_; + } else { + result.kpiValue_ = kpiValueBuilder_.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 policy.PolicyCondition.PolicyRuleCondition) { + return mergeFrom((policy.PolicyCondition.PolicyRuleCondition)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(policy.PolicyCondition.PolicyRuleCondition other) { + if (other == policy.PolicyCondition.PolicyRuleCondition.getDefaultInstance()) return this; + if (other.hasKpiId()) { + mergeKpiId(other.getKpiId()); + } + if (other.numericalOperator_ != 0) { + setNumericalOperatorValue(other.getNumericalOperatorValue()); + } + if (other.hasKpiValue()) { + mergeKpiValue(other.getKpiValue()); + } + 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 { + policy.PolicyCondition.PolicyRuleCondition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (policy.PolicyCondition.PolicyRuleCondition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private monitoring.Monitoring.KpiId kpiId_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> kpiIdBuilder_; + /** + * .monitoring.KpiId kpiId = 1; + * @return Whether the kpiId field is set. + */ + public boolean hasKpiId() { + return kpiIdBuilder_ != null || kpiId_ != null; + } + /** + * .monitoring.KpiId kpiId = 1; + * @return The kpiId. + */ + public monitoring.Monitoring.KpiId getKpiId() { + if (kpiIdBuilder_ == null) { + return kpiId_ == null ? monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } else { + return kpiIdBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public Builder setKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiId_ = value; + onChanged(); + } else { + kpiIdBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public Builder setKpiId( + monitoring.Monitoring.KpiId.Builder builderForValue) { + if (kpiIdBuilder_ == null) { + kpiId_ = builderForValue.build(); + onChanged(); + } else { + kpiIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public Builder mergeKpiId(monitoring.Monitoring.KpiId value) { + if (kpiIdBuilder_ == null) { + if (kpiId_ != null) { + kpiId_ = + monitoring.Monitoring.KpiId.newBuilder(kpiId_).mergeFrom(value).buildPartial(); + } else { + kpiId_ = value; + } + onChanged(); + } else { + kpiIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public Builder clearKpiId() { + if (kpiIdBuilder_ == null) { + kpiId_ = null; + onChanged(); + } else { + kpiId_ = null; + kpiIdBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public monitoring.Monitoring.KpiId.Builder getKpiIdBuilder() { + + onChanged(); + return getKpiIdFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiId kpiId = 1; + */ + public monitoring.Monitoring.KpiIdOrBuilder getKpiIdOrBuilder() { + if (kpiIdBuilder_ != null) { + return kpiIdBuilder_.getMessageOrBuilder(); + } else { + return kpiId_ == null ? + monitoring.Monitoring.KpiId.getDefaultInstance() : kpiId_; + } + } + /** + * .monitoring.KpiId kpiId = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder> + getKpiIdFieldBuilder() { + if (kpiIdBuilder_ == null) { + kpiIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiId, monitoring.Monitoring.KpiId.Builder, monitoring.Monitoring.KpiIdOrBuilder>( + getKpiId(), + getParentForChildren(), + isClean()); + kpiId_ = null; + } + return kpiIdBuilder_; + } + + private int numericalOperator_ = 0; + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The enum numeric value on the wire for numericalOperator. + */ + @java.lang.Override public int getNumericalOperatorValue() { + return numericalOperator_; + } + /** + * .policy.NumericalOperator numericalOperator = 2; + * @param value The enum numeric value on the wire for numericalOperator to set. + * @return This builder for chaining. + */ + public Builder setNumericalOperatorValue(int value) { + + numericalOperator_ = value; + onChanged(); + return this; + } + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return The numericalOperator. + */ + @java.lang.Override + public policy.PolicyCondition.NumericalOperator getNumericalOperator() { + @SuppressWarnings("deprecation") + policy.PolicyCondition.NumericalOperator result = policy.PolicyCondition.NumericalOperator.valueOf(numericalOperator_); + return result == null ? policy.PolicyCondition.NumericalOperator.UNRECOGNIZED : result; + } + /** + * .policy.NumericalOperator numericalOperator = 2; + * @param value The numericalOperator to set. + * @return This builder for chaining. + */ + public Builder setNumericalOperator(policy.PolicyCondition.NumericalOperator value) { + if (value == null) { + throw new NullPointerException(); + } + + numericalOperator_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .policy.NumericalOperator numericalOperator = 2; + * @return This builder for chaining. + */ + public Builder clearNumericalOperator() { + + numericalOperator_ = 0; + onChanged(); + return this; + } + + private monitoring.Monitoring.KpiValue kpiValue_; + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> kpiValueBuilder_; + /** + * .monitoring.KpiValue kpiValue = 3; + * @return Whether the kpiValue field is set. + */ + public boolean hasKpiValue() { + return kpiValueBuilder_ != null || kpiValue_ != null; + } + /** + * .monitoring.KpiValue kpiValue = 3; + * @return The kpiValue. + */ + public monitoring.Monitoring.KpiValue getKpiValue() { + if (kpiValueBuilder_ == null) { + return kpiValue_ == null ? monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } else { + return kpiValueBuilder_.getMessage(); + } + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public Builder setKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kpiValue_ = value; + onChanged(); + } else { + kpiValueBuilder_.setMessage(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public Builder setKpiValue( + monitoring.Monitoring.KpiValue.Builder builderForValue) { + if (kpiValueBuilder_ == null) { + kpiValue_ = builderForValue.build(); + onChanged(); + } else { + kpiValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public Builder mergeKpiValue(monitoring.Monitoring.KpiValue value) { + if (kpiValueBuilder_ == null) { + if (kpiValue_ != null) { + kpiValue_ = + monitoring.Monitoring.KpiValue.newBuilder(kpiValue_).mergeFrom(value).buildPartial(); + } else { + kpiValue_ = value; + } + onChanged(); + } else { + kpiValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public Builder clearKpiValue() { + if (kpiValueBuilder_ == null) { + kpiValue_ = null; + onChanged(); + } else { + kpiValue_ = null; + kpiValueBuilder_ = null; + } + + return this; + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public monitoring.Monitoring.KpiValue.Builder getKpiValueBuilder() { + + onChanged(); + return getKpiValueFieldBuilder().getBuilder(); + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + public monitoring.Monitoring.KpiValueOrBuilder getKpiValueOrBuilder() { + if (kpiValueBuilder_ != null) { + return kpiValueBuilder_.getMessageOrBuilder(); + } else { + return kpiValue_ == null ? + monitoring.Monitoring.KpiValue.getDefaultInstance() : kpiValue_; + } + } + /** + * .monitoring.KpiValue kpiValue = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder> + getKpiValueFieldBuilder() { + if (kpiValueBuilder_ == null) { + kpiValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + monitoring.Monitoring.KpiValue, monitoring.Monitoring.KpiValue.Builder, monitoring.Monitoring.KpiValueOrBuilder>( + getKpiValue(), + getParentForChildren(), + isClean()); + kpiValue_ = null; + } + return kpiValueBuilder_; + } + @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:policy.PolicyRuleCondition) + } + + // @@protoc_insertion_point(class_scope:policy.PolicyRuleCondition) + private static final policy.PolicyCondition.PolicyRuleCondition DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new policy.PolicyCondition.PolicyRuleCondition(); + } + + public static policy.PolicyCondition.PolicyRuleCondition getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRuleCondition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PolicyRuleCondition(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 policy.PolicyCondition.PolicyRuleCondition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_policy_PolicyRuleCondition_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_policy_PolicyRuleCondition_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\026policy_condition.proto\022\006policy\032\020monito" + + "ring.proto\"\225\001\n\023PolicyRuleCondition\022 \n\005kp" + + "iId\030\001 \001(\0132\021.monitoring.KpiId\0224\n\021numerica" + + "lOperator\030\002 \001(\0162\031.policy.NumericalOperat" + + "or\022&\n\010kpiValue\030\003 \001(\0132\024.monitoring.KpiVal" + + "ue*\343\002\n\021NumericalOperator\022,\n(POLICYRULE_C" + + "ONDITION_NUMERICAL_UNDEFINED\020\000\022(\n$POLICY" + + "RULE_CONDITION_NUMERICAL_EQUAL\020\001\022,\n(POLI" + + "CYRULE_CONDITION_NUMERICAL_NOT_EQUAL\020\002\022," + + "\n(POLICYRULE_CONDITION_NUMERICAL_LESS_TH" + + "AN\020\003\0222\n.POLICYRULE_CONDITION_NUMERICAL_L" + + "ESS_THAN_EQUAL\020\004\022/\n+POLICYRULE_CONDITION" + + "_NUMERICAL_GREATER_THAN\020\005\0225\n1POLICYRULE_" + + "CONDITION_NUMERICAL_GREATER_THAN_EQUAL\020\006" + + "*\210\001\n\017BooleanOperator\022*\n&POLICYRULE_CONDI" + + "TION_BOOLEAN_UNDEFINED\020\000\022$\n POLICYRULE_C" + + "ONDITION_BOOLEAN_AND\020\001\022#\n\037POLICYRULE_CON" + + "DITION_BOOLEAN_OR\020\002b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + monitoring.Monitoring.getDescriptor(), + }); + internal_static_policy_PolicyRuleCondition_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_policy_PolicyRuleCondition_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_policy_PolicyRuleCondition_descriptor, + new java.lang.String[] { "KpiId", "NumericalOperator", "KpiValue", }); + monitoring.Monitoring.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyService.java b/src/policy/target/generated-sources/grpc/policy/PolicyService.java index 8c2e637f5dcf6b5783dd68900a03a72e58cc6206..277fbbfc5012570bf43a81fbb1da5e3e9211a49e 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyService.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyService.java @@ -8,17 +8,21 @@ comments = "Source: policy.proto") public interface PolicyService extends MutinyService { - io.smallrye.mutiny.Uni policyAdd(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni policyAddService(policy.Policy.PolicyRuleService request); - io.smallrye.mutiny.Uni policyUpdate(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni policyAddDevice(policy.Policy.PolicyRuleDevice request); - io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRule request); + io.smallrye.mutiny.Uni policyUpdateService(policy.Policy.PolicyRuleService request); - io.smallrye.mutiny.Uni getPolicy(policy.Policy.PolicyRuleId request); + io.smallrye.mutiny.Uni policyUpdateDevice(policy.Policy.PolicyRuleDevice request); - io.smallrye.mutiny.Uni getPolicyByDeviceId(context.ContextOuterClass.DeviceId request); + io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRuleId request); - io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request); + io.smallrye.mutiny.Uni getPolicyService(policy.Policy.PolicyRuleId request); + + io.smallrye.mutiny.Uni getPolicyDevice(policy.Policy.PolicyRuleId request); + + io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request); diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java index 08c0e47d9fbf9b232553fd4ce1a9c7e948f42519..ada3eeaec2f779759a0b6ff7cb5724098fc9c186 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceBean.java @@ -16,23 +16,39 @@ public class PolicyServiceBean extends MutinyPolicyServiceGrpc.PolicyServiceImpl } @Override - public io.smallrye.mutiny.Uni policyAdd(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyAddService(policy.Policy.PolicyRuleService request) { try { - return delegate.policyAdd(request); + return delegate.policyAddService(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni policyUpdate(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyAddDevice(policy.Policy.PolicyRuleDevice request) { try { - return delegate.policyUpdate(request); + return delegate.policyAddDevice(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyUpdateService(policy.Policy.PolicyRuleService request) { + try { + return delegate.policyUpdateService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + try { + return delegate.policyUpdateDevice(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRuleId request) { try { return delegate.policyDelete(request); } catch (UnsupportedOperationException e) { @@ -40,23 +56,23 @@ public class PolicyServiceBean extends MutinyPolicyServiceGrpc.PolicyServiceImpl } } @Override - public io.smallrye.mutiny.Uni getPolicy(policy.Policy.PolicyRuleId request) { + public io.smallrye.mutiny.Uni getPolicyService(policy.Policy.PolicyRuleId request) { try { - return delegate.getPolicy(request); + return delegate.getPolicyService(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni getPolicyDevice(policy.Policy.PolicyRuleId request) { try { - return delegate.getPolicyByDeviceId(request); + return delegate.getPolicyDevice(request); } catch (UnsupportedOperationException e) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } } @Override - public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { try { return delegate.getPolicyByServiceId(request); } catch (UnsupportedOperationException e) { diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java index 6d447719767146f965aa0f82c72c684d2c0a37bb..5f5af2002955123b646ebba86f013d79326f5b8b 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceClient.java @@ -21,27 +21,35 @@ public class PolicyServiceClient implements PolicyService, MutinyClient policyAdd(policy.Policy.PolicyRule request) { - return stub.policyAdd(request); + public io.smallrye.mutiny.Uni policyAddService(policy.Policy.PolicyRuleService request) { + return stub.policyAddService(request); } @Override - public io.smallrye.mutiny.Uni policyUpdate(policy.Policy.PolicyRule request) { - return stub.policyUpdate(request); + public io.smallrye.mutiny.Uni policyAddDevice(policy.Policy.PolicyRuleDevice request) { + return stub.policyAddDevice(request); } @Override - public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRule request) { + public io.smallrye.mutiny.Uni policyUpdateService(policy.Policy.PolicyRuleService request) { + return stub.policyUpdateService(request); + } + @Override + public io.smallrye.mutiny.Uni policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return stub.policyUpdateDevice(request); + } + @Override + public io.smallrye.mutiny.Uni policyDelete(policy.Policy.PolicyRuleId request) { return stub.policyDelete(request); } @Override - public io.smallrye.mutiny.Uni getPolicy(policy.Policy.PolicyRuleId request) { - return stub.getPolicy(request); + public io.smallrye.mutiny.Uni getPolicyService(policy.Policy.PolicyRuleId request) { + return stub.getPolicyService(request); } @Override - public io.smallrye.mutiny.Uni getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { - return stub.getPolicyByDeviceId(request); + public io.smallrye.mutiny.Uni getPolicyDevice(policy.Policy.PolicyRuleId request) { + return stub.getPolicyDevice(request); } @Override - public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public io.smallrye.mutiny.Uni getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return stub.getPolicyByServiceId(request); } diff --git a/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java b/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java index 76cba32684b0d766bfc9ed58dc6f93cd239d4431..af57ac56746c2d1943a455a53b9ce6fc02228692 100644 --- a/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java +++ b/src/policy/target/generated-sources/grpc/policy/PolicyServiceGrpc.java @@ -14,89 +14,151 @@ public final class PolicyServiceGrpc { public static final String SERVICE_NAME = "policy.PolicyService"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getPolicyAddMethod; + private static volatile io.grpc.MethodDescriptor getPolicyAddServiceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PolicyAdd", - requestType = policy.Policy.PolicyRule.class, + fullMethodName = SERVICE_NAME + '/' + "PolicyAddService", + requestType = policy.Policy.PolicyRuleService.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPolicyAddMethod() { - io.grpc.MethodDescriptor getPolicyAddMethod; - if ((getPolicyAddMethod = PolicyServiceGrpc.getPolicyAddMethod) == null) { + public static io.grpc.MethodDescriptor getPolicyAddServiceMethod() { + io.grpc.MethodDescriptor getPolicyAddServiceMethod; + if ((getPolicyAddServiceMethod = PolicyServiceGrpc.getPolicyAddServiceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getPolicyAddMethod = PolicyServiceGrpc.getPolicyAddMethod) == null) { - PolicyServiceGrpc.getPolicyAddMethod = getPolicyAddMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getPolicyAddServiceMethod = PolicyServiceGrpc.getPolicyAddServiceMethod) == null) { + PolicyServiceGrpc.getPolicyAddServiceMethod = getPolicyAddServiceMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAdd")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAddService")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleService.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAdd")) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAddService")) .build(); } } } - return getPolicyAddMethod; + return getPolicyAddServiceMethod; } - private static volatile io.grpc.MethodDescriptor getPolicyUpdateMethod; + private static volatile io.grpc.MethodDescriptor getPolicyAddDeviceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PolicyUpdate", - requestType = policy.Policy.PolicyRule.class, + fullMethodName = SERVICE_NAME + '/' + "PolicyAddDevice", + requestType = policy.Policy.PolicyRuleDevice.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPolicyUpdateMethod() { - io.grpc.MethodDescriptor getPolicyUpdateMethod; - if ((getPolicyUpdateMethod = PolicyServiceGrpc.getPolicyUpdateMethod) == null) { + public static io.grpc.MethodDescriptor getPolicyAddDeviceMethod() { + io.grpc.MethodDescriptor getPolicyAddDeviceMethod; + if ((getPolicyAddDeviceMethod = PolicyServiceGrpc.getPolicyAddDeviceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getPolicyUpdateMethod = PolicyServiceGrpc.getPolicyUpdateMethod) == null) { - PolicyServiceGrpc.getPolicyUpdateMethod = getPolicyUpdateMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getPolicyAddDeviceMethod = PolicyServiceGrpc.getPolicyAddDeviceMethod) == null) { + PolicyServiceGrpc.getPolicyAddDeviceMethod = getPolicyAddDeviceMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdate")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyAddDevice")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleDevice.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdate")) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyAddDevice")) .build(); } } } - return getPolicyUpdateMethod; + return getPolicyAddDeviceMethod; } - private static volatile io.grpc.MethodDescriptor getPolicyUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PolicyUpdateService", + requestType = policy.Policy.PolicyRuleService.class, + responseType = policy.Policy.PolicyRuleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPolicyUpdateServiceMethod() { + io.grpc.MethodDescriptor getPolicyUpdateServiceMethod; + if ((getPolicyUpdateServiceMethod = PolicyServiceGrpc.getPolicyUpdateServiceMethod) == null) { + synchronized (PolicyServiceGrpc.class) { + if ((getPolicyUpdateServiceMethod = PolicyServiceGrpc.getPolicyUpdateServiceMethod) == null) { + PolicyServiceGrpc.getPolicyUpdateServiceMethod = getPolicyUpdateServiceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleService.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleState.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdateService")) + .build(); + } + } + } + return getPolicyUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor getPolicyUpdateDeviceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PolicyUpdateDevice", + requestType = policy.Policy.PolicyRuleDevice.class, + responseType = policy.Policy.PolicyRuleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPolicyUpdateDeviceMethod() { + io.grpc.MethodDescriptor getPolicyUpdateDeviceMethod; + if ((getPolicyUpdateDeviceMethod = PolicyServiceGrpc.getPolicyUpdateDeviceMethod) == null) { + synchronized (PolicyServiceGrpc.class) { + if ((getPolicyUpdateDeviceMethod = PolicyServiceGrpc.getPolicyUpdateDeviceMethod) == null) { + PolicyServiceGrpc.getPolicyUpdateDeviceMethod = getPolicyUpdateDeviceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyUpdateDevice")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleDevice.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + policy.Policy.PolicyRuleState.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyUpdateDevice")) + .build(); + } + } + } + return getPolicyUpdateDeviceMethod; + } + + private static volatile io.grpc.MethodDescriptor getPolicyDeleteMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "PolicyDelete", - requestType = policy.Policy.PolicyRule.class, + requestType = policy.Policy.PolicyRuleId.class, responseType = policy.Policy.PolicyRuleState.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPolicyDeleteMethod() { - io.grpc.MethodDescriptor getPolicyDeleteMethod; + io.grpc.MethodDescriptor getPolicyDeleteMethod; if ((getPolicyDeleteMethod = PolicyServiceGrpc.getPolicyDeleteMethod) == null) { synchronized (PolicyServiceGrpc.class) { if ((getPolicyDeleteMethod = PolicyServiceGrpc.getPolicyDeleteMethod) == null) { PolicyServiceGrpc.getPolicyDeleteMethod = getPolicyDeleteMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PolicyDelete")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) + policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleState.getDefaultInstance())) .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("PolicyDelete")) @@ -108,90 +170,90 @@ public final class PolicyServiceGrpc { } private static volatile io.grpc.MethodDescriptor getGetPolicyMethod; + policy.Policy.PolicyRuleService> getGetPolicyServiceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicy", + fullMethodName = SERVICE_NAME + '/' + "GetPolicyService", requestType = policy.Policy.PolicyRuleId.class, - responseType = policy.Policy.PolicyRule.class, + responseType = policy.Policy.PolicyRuleService.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetPolicyMethod() { - io.grpc.MethodDescriptor getGetPolicyMethod; - if ((getGetPolicyMethod = PolicyServiceGrpc.getGetPolicyMethod) == null) { + policy.Policy.PolicyRuleService> getGetPolicyServiceMethod() { + io.grpc.MethodDescriptor getGetPolicyServiceMethod; + if ((getGetPolicyServiceMethod = PolicyServiceGrpc.getGetPolicyServiceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getGetPolicyMethod = PolicyServiceGrpc.getGetPolicyMethod) == null) { - PolicyServiceGrpc.getGetPolicyMethod = getGetPolicyMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getGetPolicyServiceMethod = PolicyServiceGrpc.getGetPolicyServiceMethod) == null) { + PolicyServiceGrpc.getGetPolicyServiceMethod = getGetPolicyServiceMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicy")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyService")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRule.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicy")) + policy.Policy.PolicyRuleService.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyService")) .build(); } } } - return getGetPolicyMethod; + return getGetPolicyServiceMethod; } - private static volatile io.grpc.MethodDescriptor getGetPolicyByDeviceIdMethod; + private static volatile io.grpc.MethodDescriptor getGetPolicyDeviceMethod; @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicyByDeviceId", - requestType = context.ContextOuterClass.DeviceId.class, - responseType = policy.Policy.PolicyRuleList.class, + fullMethodName = SERVICE_NAME + '/' + "GetPolicyDevice", + requestType = policy.Policy.PolicyRuleId.class, + responseType = policy.Policy.PolicyRuleDevice.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetPolicyByDeviceIdMethod() { - io.grpc.MethodDescriptor getGetPolicyByDeviceIdMethod; - if ((getGetPolicyByDeviceIdMethod = PolicyServiceGrpc.getGetPolicyByDeviceIdMethod) == null) { + public static io.grpc.MethodDescriptor getGetPolicyDeviceMethod() { + io.grpc.MethodDescriptor getGetPolicyDeviceMethod; + if ((getGetPolicyDeviceMethod = PolicyServiceGrpc.getGetPolicyDeviceMethod) == null) { synchronized (PolicyServiceGrpc.class) { - if ((getGetPolicyByDeviceIdMethod = PolicyServiceGrpc.getGetPolicyByDeviceIdMethod) == null) { - PolicyServiceGrpc.getGetPolicyByDeviceIdMethod = getGetPolicyByDeviceIdMethod = - io.grpc.MethodDescriptor.newBuilder() + if ((getGetPolicyDeviceMethod = PolicyServiceGrpc.getGetPolicyDeviceMethod) == null) { + PolicyServiceGrpc.getGetPolicyDeviceMethod = getGetPolicyDeviceMethod = + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyByDeviceId")) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyDevice")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.DeviceId.getDefaultInstance())) + policy.Policy.PolicyRuleId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRuleList.getDefaultInstance())) - .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyByDeviceId")) + policy.Policy.PolicyRuleDevice.getDefaultInstance())) + .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyDevice")) .build(); } } } - return getGetPolicyByDeviceIdMethod; + return getGetPolicyDeviceMethod; } private static volatile io.grpc.MethodDescriptor getGetPolicyByServiceIdMethod; + policy.Policy.PolicyRuleServiceList> getGetPolicyByServiceIdMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetPolicyByServiceId", requestType = context.ContextOuterClass.ServiceId.class, - responseType = policy.Policy.PolicyRuleList.class, + responseType = policy.Policy.PolicyRuleServiceList.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor getGetPolicyByServiceIdMethod() { - io.grpc.MethodDescriptor getGetPolicyByServiceIdMethod; + policy.Policy.PolicyRuleServiceList> getGetPolicyByServiceIdMethod() { + io.grpc.MethodDescriptor getGetPolicyByServiceIdMethod; if ((getGetPolicyByServiceIdMethod = PolicyServiceGrpc.getGetPolicyByServiceIdMethod) == null) { synchronized (PolicyServiceGrpc.class) { if ((getGetPolicyByServiceIdMethod = PolicyServiceGrpc.getGetPolicyByServiceIdMethod) == null) { PolicyServiceGrpc.getGetPolicyByServiceIdMethod = getGetPolicyByServiceIdMethod = - io.grpc.MethodDescriptor.newBuilder() + io.grpc.MethodDescriptor.newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyByServiceId")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( context.ContextOuterClass.ServiceId.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - policy.Policy.PolicyRuleList.getDefaultInstance())) + policy.Policy.PolicyRuleServiceList.getDefaultInstance())) .setSchemaDescriptor(new PolicyServiceMethodDescriptorSupplier("GetPolicyByServiceId")) .build(); } @@ -250,89 +312,117 @@ public final class PolicyServiceGrpc { /** */ - public void policyAdd(policy.Policy.PolicyRule request, + public void policyAddService(policy.Policy.PolicyRuleService request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddServiceMethod(), responseObserver); + } + + /** + */ + public void policyAddDevice(policy.Policy.PolicyRuleDevice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddDeviceMethod(), responseObserver); + } + + /** + */ + public void policyUpdateService(policy.Policy.PolicyRuleService request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyAddMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateServiceMethod(), responseObserver); } /** */ - public void policyUpdate(policy.Policy.PolicyRule request, + public void policyUpdateDevice(policy.Policy.PolicyRuleDevice request, io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyUpdateDeviceMethod(), responseObserver); } /** */ - public void policyDelete(policy.Policy.PolicyRule request, + public void policyDelete(policy.Policy.PolicyRuleId request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPolicyDeleteMethod(), responseObserver); } /** */ - public void getPolicy(policy.Policy.PolicyRuleId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); + public void getPolicyService(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyServiceMethod(), responseObserver); } /** */ - public void getPolicyByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyByDeviceIdMethod(), responseObserver); + public void getPolicyDevice(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyDeviceMethod(), responseObserver); } /** */ public void getPolicyByServiceId(context.ContextOuterClass.ServiceId request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyByServiceIdMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - getPolicyAddMethod(), + getPolicyAddServiceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleService, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_ADD))) + this, METHODID_POLICY_ADD_SERVICE))) .addMethod( - getPolicyUpdateMethod(), + getPolicyAddDeviceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleDevice, policy.Policy.PolicyRuleState>( - this, METHODID_POLICY_UPDATE))) + this, METHODID_POLICY_ADD_DEVICE))) + .addMethod( + getPolicyUpdateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleService, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_UPDATE_SERVICE))) + .addMethod( + getPolicyUpdateDeviceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + policy.Policy.PolicyRuleDevice, + policy.Policy.PolicyRuleState>( + this, METHODID_POLICY_UPDATE_DEVICE))) .addMethod( getPolicyDeleteMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - policy.Policy.PolicyRule, + policy.Policy.PolicyRuleId, policy.Policy.PolicyRuleState>( this, METHODID_POLICY_DELETE))) .addMethod( - getGetPolicyMethod(), + getGetPolicyServiceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< policy.Policy.PolicyRuleId, - policy.Policy.PolicyRule>( - this, METHODID_GET_POLICY))) + policy.Policy.PolicyRuleService>( + this, METHODID_GET_POLICY_SERVICE))) .addMethod( - getGetPolicyByDeviceIdMethod(), + getGetPolicyDeviceMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< - context.ContextOuterClass.DeviceId, - policy.Policy.PolicyRuleList>( - this, METHODID_GET_POLICY_BY_DEVICE_ID))) + policy.Policy.PolicyRuleId, + policy.Policy.PolicyRuleDevice>( + this, METHODID_GET_POLICY_DEVICE))) .addMethod( getGetPolicyByServiceIdMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.ServiceId, - policy.Policy.PolicyRuleList>( + policy.Policy.PolicyRuleServiceList>( this, METHODID_GET_POLICY_BY_SERVICE_ID))) .build(); } @@ -354,23 +444,39 @@ public final class PolicyServiceGrpc { /** */ - public void policyAdd(policy.Policy.PolicyRule request, + public void policyAddService(policy.Policy.PolicyRuleService request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPolicyAddMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getPolicyAddServiceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void policyUpdate(policy.Policy.PolicyRule request, + public void policyAddDevice(policy.Policy.PolicyRuleDevice request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPolicyUpdateMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getPolicyAddDeviceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void policyDelete(policy.Policy.PolicyRule request, + public void policyUpdateService(policy.Policy.PolicyRuleService request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPolicyUpdateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void policyUpdateDevice(policy.Policy.PolicyRuleDevice request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPolicyUpdateDeviceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void policyDelete(policy.Policy.PolicyRuleId request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getPolicyDeleteMethod(), getCallOptions()), request, responseObserver); @@ -378,24 +484,24 @@ public final class PolicyServiceGrpc { /** */ - public void getPolicy(policy.Policy.PolicyRuleId request, - io.grpc.stub.StreamObserver responseObserver) { + public void getPolicyService(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetPolicyServiceMethod(), getCallOptions()), request, responseObserver); } /** */ - public void getPolicyByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver responseObserver) { + public void getPolicyDevice(policy.Policy.PolicyRuleId request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyByDeviceIdMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetPolicyDeviceMethod(), getCallOptions()), request, responseObserver); } /** */ public void getPolicyByServiceId(context.ContextOuterClass.ServiceId request, - io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetPolicyByServiceIdMethod(), getCallOptions()), request, responseObserver); } @@ -417,42 +523,56 @@ public final class PolicyServiceGrpc { /** */ - public policy.Policy.PolicyRuleState policyAdd(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyAddService(policy.Policy.PolicyRuleService request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPolicyAddMethod(), getCallOptions(), request); + getChannel(), getPolicyAddServiceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleState policyUpdate(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyAddDevice(policy.Policy.PolicyRuleDevice request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPolicyUpdateMethod(), getCallOptions(), request); + getChannel(), getPolicyAddDeviceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleState policyDelete(policy.Policy.PolicyRule request) { + public policy.Policy.PolicyRuleState policyUpdateService(policy.Policy.PolicyRuleService request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPolicyUpdateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleState policyUpdateDevice(policy.Policy.PolicyRuleDevice request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPolicyUpdateDeviceMethod(), getCallOptions(), request); + } + + /** + */ + public policy.Policy.PolicyRuleState policyDelete(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPolicyDeleteMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRule getPolicy(policy.Policy.PolicyRuleId request) { + public policy.Policy.PolicyRuleService getPolicyService(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyMethod(), getCallOptions(), request); + getChannel(), getGetPolicyServiceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleList getPolicyByDeviceId(context.ContextOuterClass.DeviceId request) { + public policy.Policy.PolicyRuleDevice getPolicyDevice(policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyByDeviceIdMethod(), getCallOptions(), request); + getChannel(), getGetPolicyDeviceMethod(), getCallOptions(), request); } /** */ - public policy.Policy.PolicyRuleList getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { + public policy.Policy.PolicyRuleServiceList getPolicyByServiceId(context.ContextOuterClass.ServiceId request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetPolicyByServiceIdMethod(), getCallOptions(), request); } @@ -474,59 +594,77 @@ public final class PolicyServiceGrpc { /** */ - public com.google.common.util.concurrent.ListenableFuture policyAdd( - policy.Policy.PolicyRule request) { + public com.google.common.util.concurrent.ListenableFuture policyAddService( + policy.Policy.PolicyRuleService request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPolicyAddServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture policyAddDevice( + policy.Policy.PolicyRuleDevice request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPolicyAddDeviceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture policyUpdateService( + policy.Policy.PolicyRuleService request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPolicyAddMethod(), getCallOptions()), request); + getChannel().newCall(getPolicyUpdateServiceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture policyUpdate( - policy.Policy.PolicyRule request) { + public com.google.common.util.concurrent.ListenableFuture policyUpdateDevice( + policy.Policy.PolicyRuleDevice request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPolicyUpdateMethod(), getCallOptions()), request); + getChannel().newCall(getPolicyUpdateDeviceMethod(), getCallOptions()), request); } /** */ public com.google.common.util.concurrent.ListenableFuture policyDelete( - policy.Policy.PolicyRule request) { + policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPolicyDeleteMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture getPolicy( + public com.google.common.util.concurrent.ListenableFuture getPolicyService( policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyMethod(), getCallOptions()), request); + getChannel().newCall(getGetPolicyServiceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture getPolicyByDeviceId( - context.ContextOuterClass.DeviceId request) { + public com.google.common.util.concurrent.ListenableFuture getPolicyDevice( + policy.Policy.PolicyRuleId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyByDeviceIdMethod(), getCallOptions()), request); + getChannel().newCall(getGetPolicyDeviceMethod(), getCallOptions()), request); } /** */ - public com.google.common.util.concurrent.ListenableFuture getPolicyByServiceId( + public com.google.common.util.concurrent.ListenableFuture getPolicyByServiceId( context.ContextOuterClass.ServiceId request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetPolicyByServiceIdMethod(), getCallOptions()), request); } } - private static final int METHODID_POLICY_ADD = 0; - private static final int METHODID_POLICY_UPDATE = 1; - private static final int METHODID_POLICY_DELETE = 2; - private static final int METHODID_GET_POLICY = 3; - private static final int METHODID_GET_POLICY_BY_DEVICE_ID = 4; - private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 5; + private static final int METHODID_POLICY_ADD_SERVICE = 0; + private static final int METHODID_POLICY_ADD_DEVICE = 1; + private static final int METHODID_POLICY_UPDATE_SERVICE = 2; + private static final int METHODID_POLICY_UPDATE_DEVICE = 3; + private static final int METHODID_POLICY_DELETE = 4; + private static final int METHODID_GET_POLICY_SERVICE = 5; + private static final int METHODID_GET_POLICY_DEVICE = 6; + private static final int METHODID_GET_POLICY_BY_SERVICE_ID = 7; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -545,29 +683,37 @@ public final class PolicyServiceGrpc { @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { - case METHODID_POLICY_ADD: - serviceImpl.policyAdd((policy.Policy.PolicyRule) request, + case METHODID_POLICY_ADD_SERVICE: + serviceImpl.policyAddService((policy.Policy.PolicyRuleService) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_POLICY_ADD_DEVICE: + serviceImpl.policyAddDevice((policy.Policy.PolicyRuleDevice) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_POLICY_UPDATE_SERVICE: + serviceImpl.policyUpdateService((policy.Policy.PolicyRuleService) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_POLICY_UPDATE: - serviceImpl.policyUpdate((policy.Policy.PolicyRule) request, + case METHODID_POLICY_UPDATE_DEVICE: + serviceImpl.policyUpdateDevice((policy.Policy.PolicyRuleDevice) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_POLICY_DELETE: - serviceImpl.policyDelete((policy.Policy.PolicyRule) request, + serviceImpl.policyDelete((policy.Policy.PolicyRuleId) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GET_POLICY: - serviceImpl.getPolicy((policy.Policy.PolicyRuleId) request, - (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_GET_POLICY_SERVICE: + serviceImpl.getPolicyService((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_GET_POLICY_BY_DEVICE_ID: - serviceImpl.getPolicyByDeviceId((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_GET_POLICY_DEVICE: + serviceImpl.getPolicyDevice((policy.Policy.PolicyRuleId) request, + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_POLICY_BY_SERVICE_ID: serviceImpl.getPolicyByServiceId((context.ContextOuterClass.ServiceId) request, - (io.grpc.stub.StreamObserver) responseObserver); + (io.grpc.stub.StreamObserver) responseObserver); break; default: throw new AssertionError(); @@ -630,11 +776,13 @@ public final class PolicyServiceGrpc { if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new PolicyServiceFileDescriptorSupplier()) - .addMethod(getPolicyAddMethod()) - .addMethod(getPolicyUpdateMethod()) + .addMethod(getPolicyAddServiceMethod()) + .addMethod(getPolicyAddDeviceMethod()) + .addMethod(getPolicyUpdateServiceMethod()) + .addMethod(getPolicyUpdateDeviceMethod()) .addMethod(getPolicyDeleteMethod()) - .addMethod(getGetPolicyMethod()) - .addMethod(getGetPolicyByDeviceIdMethod()) + .addMethod(getGetPolicyServiceMethod()) + .addMethod(getGetPolicyDeviceMethod()) .addMethod(getGetPolicyByServiceIdMethod()) .build(); } diff --git a/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java b/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..8caa9641d654e5b0f3e07635b366684d8ab5f980 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/MutinyServiceServiceGrpc.java @@ -0,0 +1,168 @@ +package service; + +import static service.ServiceServiceGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public final class MutinyServiceServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyServiceServiceGrpc() {} + + public static MutinyServiceServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyServiceServiceStub(channel); + } + + + public static final class MutinyServiceServiceStub extends io.grpc.stub.AbstractStub implements io.quarkus.grpc.runtime.MutinyStub { + private ServiceServiceGrpc.ServiceServiceStub delegateStub; + + private MutinyServiceServiceStub(io.grpc.Channel channel) { + super(channel); + delegateStub = ServiceServiceGrpc.newStub(channel); + } + + private MutinyServiceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = ServiceServiceGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyServiceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyServiceServiceStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni createService(context.ContextOuterClass.Service request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::createService); + } + + + public io.smallrye.mutiny.Uni updateService(context.ContextOuterClass.Service request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::updateService); + } + + + public io.smallrye.mutiny.Uni deleteService(context.ContextOuterClass.ServiceId request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::deleteService); + } + + } + + + public static abstract class ServiceServiceImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public ServiceServiceImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni createService(context.ContextOuterClass.Service request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni updateService(context.ContextOuterClass.Service request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Uni deleteService(context.ContextOuterClass.ServiceId request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + service.ServiceServiceGrpc.getCreateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_CREATE_SERVICE, compression))) + .addMethod( + service.ServiceServiceGrpc.getUpdateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_UPDATE_SERVICE, compression))) + .addMethod( + service.ServiceServiceGrpc.getDeleteServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_SERVICE, compression))) + .build(); + } + } + + private static final int METHODID_CREATE_SERVICE = 0; + private static final int METHODID_UPDATE_SERVICE = 1; + private static final int METHODID_DELETE_SERVICE = 2; + + 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 ServiceServiceImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(ServiceServiceImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::createService); + break; + case METHODID_UPDATE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::updateService); + break; + case METHODID_DELETE_SERVICE: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.ServiceId) request, + (io.grpc.stub.StreamObserver) responseObserver, + compression, + serviceImpl::deleteService); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke(io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/Service.java b/src/policy/target/generated-sources/grpc/service/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..32393a23714ffd1c1aa69d0909a3ffe7bc876146 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/Service.java @@ -0,0 +1,42 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: service.proto + +package service; + +public final class Service { + private Service() {} + 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 static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rservice.proto\022\007service\032\rcontext.proto2" + + "\271\001\n\016ServiceService\0227\n\rCreateService\022\020.co" + + "ntext.Service\032\022.context.ServiceId\"\000\0227\n\rU" + + "pdateService\022\020.context.Service\032\022.context" + + ".ServiceId\"\000\0225\n\rDeleteService\022\022.context." + + "ServiceId\032\016.context.Empty\"\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + context.ContextOuterClass.getDescriptor(), + }); + context.ContextOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/policy/target/generated-sources/grpc/service/ServiceService.java b/src/policy/target/generated-sources/grpc/service/ServiceService.java new file mode 100644 index 0000000000000000000000000000000000000000..b51f2353623b201978b84ff8587553a8ef606b51 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceService.java @@ -0,0 +1,20 @@ +package service; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public interface ServiceService extends MutinyService { + + + io.smallrye.mutiny.Uni createService(context.ContextOuterClass.Service request); + + io.smallrye.mutiny.Uni updateService(context.ContextOuterClass.Service request); + + io.smallrye.mutiny.Uni deleteService(context.ContextOuterClass.ServiceId request); + + + + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java new file mode 100644 index 0000000000000000000000000000000000000000..a4c34aaa82129ae725d7b2ff7abeff7dc6c159cc --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceBean.java @@ -0,0 +1,43 @@ +package service; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public class ServiceServiceBean extends MutinyServiceServiceGrpc.ServiceServiceImplBase implements BindableService, MutinyBean { + + private final ServiceService delegate; + + ServiceServiceBean(@GrpcService ServiceService delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni createService(context.ContextOuterClass.Service request) { + try { + return delegate.createService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni updateService(context.ContextOuterClass.Service request) { + try { + return delegate.updateService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + @Override + public io.smallrye.mutiny.Uni deleteService(context.ContextOuterClass.ServiceId request) { + try { + return delegate.deleteService(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..91522d4779a6ee7c85c9589588ea7cc0cba39efc --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceClient.java @@ -0,0 +1,36 @@ +package service; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: service.proto") +public class ServiceServiceClient implements ServiceService, MutinyClient { + + private final MutinyServiceServiceGrpc.MutinyServiceServiceStub stub; + + public ServiceServiceClient(String name, io.grpc.Channel channel, BiFunction stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyServiceServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyServiceServiceGrpc.MutinyServiceServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni createService(context.ContextOuterClass.Service request) { + return stub.createService(request); + } + @Override + public io.smallrye.mutiny.Uni updateService(context.ContextOuterClass.Service request) { + return stub.updateService(request); + } + @Override + public io.smallrye.mutiny.Uni deleteService(context.ContextOuterClass.ServiceId request) { + return stub.deleteService(request); + } + +} \ No newline at end of file diff --git a/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java b/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..66419a93bacee7dad02d302044b8024e8ed12154 --- /dev/null +++ b/src/policy/target/generated-sources/grpc/service/ServiceServiceGrpc.java @@ -0,0 +1,423 @@ +package service; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: service.proto") +public final class ServiceServiceGrpc { + + private ServiceServiceGrpc() {} + + public static final String SERVICE_NAME = "service.ServiceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateService", + requestType = context.ContextOuterClass.Service.class, + responseType = context.ContextOuterClass.ServiceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateServiceMethod() { + io.grpc.MethodDescriptor getCreateServiceMethod; + if ((getCreateServiceMethod = ServiceServiceGrpc.getCreateServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getCreateServiceMethod = ServiceServiceGrpc.getCreateServiceMethod) == null) { + ServiceServiceGrpc.getCreateServiceMethod = getCreateServiceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Service.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("CreateService")) + .build(); + } + } + } + return getCreateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateService", + requestType = context.ContextOuterClass.Service.class, + responseType = context.ContextOuterClass.ServiceId.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateServiceMethod() { + io.grpc.MethodDescriptor getUpdateServiceMethod; + if ((getUpdateServiceMethod = ServiceServiceGrpc.getUpdateServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getUpdateServiceMethod = ServiceServiceGrpc.getUpdateServiceMethod) == null) { + ServiceServiceGrpc.getUpdateServiceMethod = getUpdateServiceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Service.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("UpdateService")) + .build(); + } + } + } + return getUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteService", + requestType = context.ContextOuterClass.ServiceId.class, + responseType = context.ContextOuterClass.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteServiceMethod() { + io.grpc.MethodDescriptor getDeleteServiceMethod; + if ((getDeleteServiceMethod = ServiceServiceGrpc.getDeleteServiceMethod) == null) { + synchronized (ServiceServiceGrpc.class) { + if ((getDeleteServiceMethod = ServiceServiceGrpc.getDeleteServiceMethod) == null) { + ServiceServiceGrpc.getDeleteServiceMethod = getDeleteServiceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.ServiceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ServiceServiceMethodDescriptorSupplier("DeleteService")) + .build(); + } + } + } + return getDeleteServiceMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ServiceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceStub(channel, callOptions); + } + }; + return ServiceServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ServiceServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceBlockingStub(channel, callOptions); + } + }; + return ServiceServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ServiceServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ServiceServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceFutureStub(channel, callOptions); + } + }; + return ServiceServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class ServiceServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void createService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateServiceMethod(), responseObserver); + } + + /** + */ + public void updateService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateServiceMethod(), responseObserver); + } + + /** + */ + public void deleteService(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteServiceMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_CREATE_SERVICE))) + .addMethod( + getUpdateServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Service, + context.ContextOuterClass.ServiceId>( + this, METHODID_UPDATE_SERVICE))) + .addMethod( + getDeleteServiceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.ServiceId, + context.ContextOuterClass.Empty>( + this, METHODID_DELETE_SERVICE))) + .build(); + } + } + + /** + */ + public static final class ServiceServiceStub extends io.grpc.stub.AbstractAsyncStub { + private ServiceServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceStub(channel, callOptions); + } + + /** + */ + public void createService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void updateService(context.ContextOuterClass.Service request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void deleteService(context.ContextOuterClass.ServiceId request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class ServiceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private ServiceServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceBlockingStub(channel, callOptions); + } + + /** + */ + public context.ContextOuterClass.ServiceId createService(context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.ServiceId updateService(context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateServiceMethod(), getCallOptions(), request); + } + + /** + */ + public context.ContextOuterClass.Empty deleteService(context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteServiceMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class ServiceServiceFutureStub extends io.grpc.stub.AbstractFutureStub { + private ServiceServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ServiceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ServiceServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture createService( + context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture updateService( + context.ContextOuterClass.Service request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture deleteService( + context.ContextOuterClass.ServiceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SERVICE = 0; + private static final int METHODID_UPDATE_SERVICE = 1; + private static final int METHODID_DELETE_SERVICE = 2; + + 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 ServiceServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ServiceServiceImplBase 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_CREATE_SERVICE: + serviceImpl.createService((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SERVICE: + serviceImpl.updateService((context.ContextOuterClass.Service) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SERVICE: + serviceImpl.deleteService((context.ContextOuterClass.ServiceId) 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 ServiceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ServiceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return service.Service.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ServiceService"); + } + } + + private static final class ServiceServiceFileDescriptorSupplier + extends ServiceServiceBaseDescriptorSupplier { + ServiceServiceFileDescriptorSupplier() {} + } + + private static final class ServiceServiceMethodDescriptorSupplier + extends ServiceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ServiceServiceMethodDescriptorSupplier(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 (ServiceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ServiceServiceFileDescriptorSupplier()) + .addMethod(getCreateServiceMethod()) + .addMethod(getUpdateServiceMethod()) + .addMethod(getDeleteServiceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/policy/target/kubernetes/kubernetes.yml b/src/policy/target/kubernetes/kubernetes.yml index b82855281d2afc44e0a8f9e02637c09c0ab95d7c..680929bc031df90594a743eb96316d3c99508cef 100644 --- a/src/policy/target/kubernetes/kubernetes.yml +++ b/src/policy/target/kubernetes/kubernetes.yml @@ -3,51 +3,46 @@ apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 46a3c5ec903563da8a3b9cf2dfefd2556ad63eaa - app.quarkus.io/build-timestamp: 2021-11-11 - 13:57:11 +0000 + app.quarkus.io/commit-id: 7d24cfdf286fcca1ff04620ee026933bedd8960e + app.quarkus.io/build-timestamp: 2022-08-04 - 22:13:18 +0000 labels: app.kubernetes.io/name: policyservice - app.kubernetes.io/version: 0.0.1 app: policyservice name: policyservice spec: ports: - - name: grpc-server - port: 9999 - targetPort: 9999 - name: http port: 8080 targetPort: 8080 + - name: grpc + port: 6060 + targetPort: 6060 selector: app.kubernetes.io/name: policyservice - app.kubernetes.io/version: 0.0.1 - type: NodePort + type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 46a3c5ec903563da8a3b9cf2dfefd2556ad63eaa - app.quarkus.io/build-timestamp: 2021-11-11 - 13:57:11 +0000 + app.quarkus.io/commit-id: 7d24cfdf286fcca1ff04620ee026933bedd8960e + app.quarkus.io/build-timestamp: 2022-08-04 - 22:13:18 +0000 labels: app: policyservice - app.kubernetes.io/version: 0.0.1 app.kubernetes.io/name: policyservice name: policyservice spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/version: 0.0.1 app.kubernetes.io/name: policyservice template: metadata: annotations: - app.quarkus.io/commit-id: 46a3c5ec903563da8a3b9cf2dfefd2556ad63eaa - app.quarkus.io/build-timestamp: 2021-11-11 - 13:57:11 +0000 + app.quarkus.io/commit-id: 7d24cfdf286fcca1ff04620ee026933bedd8960e + app.quarkus.io/build-timestamp: 2022-08-04 - 22:13:18 +0000 labels: app: policyservice - app.kubernetes.io/version: 0.0.1 app.kubernetes.io/name: policyservice spec: containers: @@ -56,7 +51,13 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: registry.gitlab.com/teraflow-h2020/controller/policy:0.0.1 + - name: CONTEXT_SERVICE_HOST + value: contextservice + - name: SERVICE_SERVICE_HOST + value: serviceservice + - name: MONITORING_SERVICE_HOST + value: monitoringservice + image: registry.gitlab.com/teraflow-h2020/controller/policy:0.1.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -64,25 +65,25 @@ spec: path: /q/health/live port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 name: policyservice ports: - - containerPort: 9999 - name: grpc-server - protocol: TCP - containerPort: 8080 name: http protocol: TCP + - containerPort: 6060 + name: grpc + protocol: TCP readinessProbe: failureThreshold: 3 httpGet: path: /q/health/ready port: 8080 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 45 + initialDelaySeconds: 2 + periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 diff --git a/src/policy/util/set_version.sh b/src/policy/util/set_version.sh new file mode 100755 index 0000000000000000000000000000000000000000..0d73a243ea9cf6eeaa77601de6eff54c09ee40a2 --- /dev/null +++ b/src/policy/util/set_version.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +set -eu + +if (( $# != 1 )); then + echo "Usage: set_version.sh " >&2 + exit 1 +fi + +version="$1" + +if [ "$(git status --untracked-files=no --porcelain)" ]; then + printf "Uncommitted changes in tracked files.\nPlease commit first and then run the script!\n" + exit 0; +fi + +./mvnw versions:set versions:commit -DnewVersion="${version}" +git commit -am "release(policy): ${version}" diff --git a/src/service/.gitlab-ci.yml b/src/service/.gitlab-ci.yml index 9b579ac863f972fa02d18bcc16218555f5a78259..c40bc90cfe0b20669fe89aa9d6ecda562d7d0422 100644 --- a/src/service/.gitlab-ci.yml +++ b/src/service/.gitlab-ci.yml @@ -1,4 +1,18 @@ -# Build, tag and push the Docker image to the GitLab registry +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry build service: variables: IMAGE_NAME: 'service' # name of the microservice @@ -7,19 +21,21 @@ build service: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" -# after_script: -# - docker rmi $(docker images --quiet --filter=dangling=true) + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml # Apply unit test to the component @@ -36,23 +52,32 @@ unit test service: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 3030:3030 --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 3030:3030 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - - docker exec -i $IMAGE_NAME bash -c "pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py" + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - src/$IMAGE_NAME/tests/Dockerfile - - manifests/$IMAGE_NAMEservice.yaml + - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml # Deployment of the service in Kubernetes Cluster deploy service: @@ -64,10 +89,10 @@ deploy service: - unit test service # - integ_test execute script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAMEservice.yaml' + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - kubectl version - kubectl get all - - kubectl apply -f "manifests/$IMAGE_NAMEservice.yaml" + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - kubectl get all # environment: # name: test diff --git a/src/service/Config.py b/src/service/Config.py index 592392a1bde5757f83fd67589a7b7b7d6cc3e6c0..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/Config.py +++ b/src/service/Config.py @@ -1,12 +1,14 @@ -import logging +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 3030 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 - -# Prometheus settings -METRICS_PORT = 9192 diff --git a/src/service/Dockerfile b/src/service/Dockerfile index 306379a06d33c67c082540e19f3b1ca349becff2..c53a897821b759a8005118ba81a3a0f5c0b73c66 100644 --- a/src/service/Dockerfile +++ b/src/service/Dockerfile @@ -1,4 +1,18 @@ -FROM python:3-slim +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -14,22 +28,43 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/service +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY service/requirements.in service/requirements.in -RUN pip-compile --output-file=service/requirements.txt service/requirements.in -RUN python3 -m pip install -r service/requirements.in +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Add files into working directory -COPY common/. common -COPY service/. service +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/service +WORKDIR /var/teraflow/service +COPY src/service/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/service/. service/ -# Start service service +# Start the service ENTRYPOINT ["python", "-m", "service.service"] diff --git a/src/service/__init__.py b/src/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/__init__.py +++ b/src/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/_old_code_backup/ServiceServiceServicerImpl.py b/src/service/_old_code_backup/ServiceServiceServicerImpl.py deleted file mode 100644 index b1f370abc1d3eed1b3b756bf31b95c01209539fd..0000000000000000000000000000000000000000 --- a/src/service/_old_code_backup/ServiceServiceServicerImpl.py +++ /dev/null @@ -1,277 +0,0 @@ -from typing import Dict -import grpc, logging -from prometheus_client import Counter, Histogram -from common.database.api.Database import Database -from common.exceptions.ServiceException import ServiceException -from service.proto.context_pb2 import Empty -from service.proto.service_pb2 import ConnectionList, Service, ServiceId, ServiceList -from service.proto.service_pb2_grpc import ServiceServiceServicer -from service.service.Tools import check_service_id_request, check_service_request - -LOGGER = logging.getLogger(__name__) - -GETSERVICELIST_COUNTER_STARTED = Counter ('service_getservicelist_counter_started', - 'Service:GetServiceList counter of requests started' ) -GETSERVICELIST_COUNTER_COMPLETED = Counter ('service_getservicelist_counter_completed', - 'Service:GetServiceList counter of requests completed') -GETSERVICELIST_COUNTER_FAILED = Counter ('service_getservicelist_counter_failed', - 'Service:GetServiceList counter of requests failed' ) -GETSERVICELIST_HISTOGRAM_DURATION = Histogram('service_getservicelist_histogram_duration', - 'Service:GetServiceList histogram of request duration') - -CREATESERVICE_COUNTER_STARTED = Counter ('service_createservice_counter_started', - 'Service:CreateService counter of requests started' ) -CREATESERVICE_COUNTER_COMPLETED = Counter ('service_createservice_counter_completed', - 'Service:CreateService counter of requests completed') -CREATESERVICE_COUNTER_FAILED = Counter ('service_createservice_counter_failed', - 'Service:CreateService counter of requests failed' ) -CREATESERVICE_HISTOGRAM_DURATION = Histogram('service_createservice_histogram_duration', - 'Service:CreateService histogram of request duration') - -UPDATESERVICE_COUNTER_STARTED = Counter ('service_updateservice_counter_started', - 'Service:UpdateService counter of requests started' ) -UPDATESERVICE_COUNTER_COMPLETED = Counter ('service_updateservice_counter_completed', - 'Service:UpdateService counter of requests completed') -UPDATESERVICE_COUNTER_FAILED = Counter ('service_updateservice_counter_failed', - 'Service:UpdateService counter of requests failed' ) -UPDATESERVICE_HISTOGRAM_DURATION = Histogram('service_updateservice_histogram_duration', - 'Service:UpdateService histogram of request duration') - -DELETESERVICE_COUNTER_STARTED = Counter ('service_deleteservice_counter_started', - 'Service:DeleteService counter of requests started' ) -DELETESERVICE_COUNTER_COMPLETED = Counter ('service_deleteservice_counter_completed', - 'Service:DeleteService counter of requests completed') -DELETESERVICE_COUNTER_FAILED = Counter ('service_deleteservice_counter_failed', - 'Service:DeleteService counter of requests failed' ) -DELETESERVICE_HISTOGRAM_DURATION = Histogram('service_deleteservice_histogram_duration', - 'Service:DeleteService histogram of request duration') - -GETSERVICEBYID_COUNTER_STARTED = Counter ('service_getservicebyid_counter_started', - 'Service:GetServiceById counter of requests started' ) -GETSERVICEBYID_COUNTER_COMPLETED = Counter ('service_getservicebyid_counter_completed', - 'Service:GetServiceById counter of requests completed') -GETSERVICEBYID_COUNTER_FAILED = Counter ('service_getservicebyid_counter_failed', - 'Service:GetServiceById counter of requests failed' ) -GETSERVICEBYID_HISTOGRAM_DURATION = Histogram('service_getservicebyid_histogram_duration', - 'Service:GetServiceById histogram of request duration') - -GETCONNECTIONLIST_COUNTER_STARTED = Counter ('service_getconnectionlist_counter_started', - 'Service:GetConnectionList counter of requests started' ) -GETCONNECTIONLIST_COUNTER_COMPLETED = Counter ('service_getconnectionlist_counter_completed', - 'Service:GetConnectionList counter of requests completed') -GETCONNECTIONLIST_COUNTER_FAILED = Counter ('service_getconnectionlist_counter_failed', - 'Service:GetConnectionList counter of requests failed' ) -GETCONNECTIONLIST_HISTOGRAM_DURATION = Histogram('service_getconnectionlist_histogram_duration', - 'Service:GetConnectionList histogram of request duration') - -class ServiceServiceServicerImpl(ServiceServiceServicer): - def __init__(self, database : Database): - LOGGER.debug('Creating Servicer...') - self.database = database - LOGGER.debug('Servicer Created') - - @GETSERVICELIST_HISTOGRAM_DURATION.time() - def GetServiceList(self, request : Empty, grpc_context : grpc.ServicerContext) -> ServiceList: - GETSERVICELIST_COUNTER_STARTED.inc() - try: - LOGGER.debug('GetServiceList request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - - # ----- Retrieve data from the database -------------------------------------------------------------------- - db_context_uuids = self.database.contexts.get() - json_services = [] - for db_context_uuid in db_context_uuids: - db_context = self.database.context(db_context_uuid) - json_services.extend(db_context.dump_services()) - - # ----- Compose reply -------------------------------------------------------------------------------------- - reply = ServiceList(cs=json_services) - LOGGER.debug('GetServiceList reply: {}'.format(str(reply))) - GETSERVICELIST_COUNTER_COMPLETED.inc() - return reply - except ServiceException as e: # pragma: no cover (ServiceException not thrown) - LOGGER.exception('GetServiceList exception') - GETSERVICELIST_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('GetServiceList exception') - GETSERVICELIST_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - - @CREATESERVICE_HISTOGRAM_DURATION.time() - def CreateService(self, request : Service, grpc_context : grpc.ServicerContext) -> ServiceId: - CREATESERVICE_COUNTER_STARTED.inc() - try: - LOGGER.debug('CreateService request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - context_id, service_id, service_type, service_config, service_state, db_endpoints, constraint_tuples = \ - check_service_request('CreateService', request, self.database, LOGGER) - - # ----- Implement changes in the database ------------------------------------------------------------------ - db_context = self.database.context(context_id) - db_service = db_context.service(service_id) - db_service.create(service_type, service_config, service_state) - - for db_endpoint in db_endpoints: - service_endpoint_id = '{}:{}/{}'.format( - db_endpoint.topology_uuid, db_endpoint.device_uuid, db_endpoint.endpoint_uuid) - db_service.endpoint(service_endpoint_id).create(db_endpoint) - - for cons_type,cons_value in constraint_tuples: db_service.constraint(cons_type).create(cons_value) - - # ----- Compose reply -------------------------------------------------------------------------------------- - reply = ServiceId(**db_service.dump_id()) - LOGGER.debug('CreateService reply: {}'.format(str(reply))) - CREATESERVICE_COUNTER_COMPLETED.inc() - return reply - except ServiceException as e: - LOGGER.exception('CreateService exception') - CREATESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('CreateService exception') - CREATESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - - @UPDATESERVICE_HISTOGRAM_DURATION.time() - def UpdateService(self, request : Service, grpc_context : grpc.ServicerContext) -> ServiceId: - UPDATESERVICE_COUNTER_STARTED.inc() - try: - LOGGER.debug('UpdateService request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - context_id, service_id, service_type, service_config, service_state, db_endpoints, constraint_tuples = \ - check_service_request('UpdateService', request, self.database, LOGGER) - - # ----- Implement changes in the database ------------------------------------------------------------------ - db_context = self.database.context(context_id) - db_service = db_context.service(service_id) - - # Update service attributes - db_service.update(update_attributes={ - 'service_type' : service_type, - 'service_config': service_config, - 'service_state' : service_state, - }) - - # Update service constraints; first add missing, then remove existing, but not added to Service - db_service_constraint_types = set(db_service.constraints.get()) - for constraint_type,constraint_value in constraint_tuples: - if constraint_type in db_service_constraint_types: - db_service.constraint(constraint_type).update(update_attributes={ - 'constraint_value': constraint_value - }) - else: - db_service.constraint(constraint_type).create(constraint_value) - db_service_constraint_types.discard(constraint_type) - - for constraint_type in db_service_constraint_types: - db_service.constraint(constraint_type).delete() - - # Update service endpoints; first add missing, then remove existing, but not added to Service - db_service_endpoint_uuids = set(db_service.endpoints.get()) - for db_endpoint in db_endpoints: - service_endpoint_id = '{}:{}/{}'.format( - db_endpoint.topology_uuid, db_endpoint.device_uuid, db_endpoint.endpoint_uuid) - if service_endpoint_id not in db_service_endpoint_uuids: - db_service.endpoint(service_endpoint_id).create(db_endpoint) - db_service_endpoint_uuids.discard(service_endpoint_id) - - for db_service_endpoint_uuid in db_service_endpoint_uuids: - db_service.endpoint(db_service_endpoint_uuid).delete() - - # ----- Compose reply -------------------------------------------------------------------------------------- - reply = ServiceId(**db_service.dump_id()) - LOGGER.debug('UpdateService reply: {}'.format(str(reply))) - UPDATESERVICE_COUNTER_COMPLETED.inc() - return reply - except ServiceException as e: - LOGGER.exception('UpdateService exception') - UPDATESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('UpdateService exception') - UPDATESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - - @DELETESERVICE_HISTOGRAM_DURATION.time() - def DeleteService(self, request : ServiceId, grpc_context : grpc.ServicerContext) -> Empty: - DELETESERVICE_COUNTER_STARTED.inc() - try: - LOGGER.debug('DeleteService request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - context_id, service_id = check_service_id_request('DeleteService', request, self.database, LOGGER) - - # ----- Implement changes in the database ------------------------------------------------------------------ - db_context = self.database.context(context_id) - db_service = db_context.service(service_id) - db_service.delete() - - # ----- Compose reply -------------------------------------------------------------------------------------- - reply = Empty() - LOGGER.debug('DeleteService reply: {}'.format(str(reply))) - DELETESERVICE_COUNTER_COMPLETED.inc() - return reply - except ServiceException as e: - LOGGER.exception('DeleteService exception') - DELETESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('DeleteService exception') - DELETESERVICE_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - - @GETSERVICEBYID_HISTOGRAM_DURATION.time() - def GetServiceById(self, request : ServiceId, grpc_context : grpc.ServicerContext) -> Service: - GETSERVICEBYID_COUNTER_STARTED.inc() - try: - LOGGER.debug('GetServiceById request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - context_id, service_id = check_service_id_request('GetServiceById', request, self.database, LOGGER) - - # ----- Retrieve data from the database -------------------------------------------------------------------- - db_context = self.database.context(context_id) - db_service = db_context.service(service_id) - - # ----- Compose reply -------------------------------------------------------------------------------------- - reply = Service(**db_service.dump()) - LOGGER.debug('GetServiceById reply: {}'.format(str(reply))) - GETSERVICEBYID_COUNTER_COMPLETED.inc() - return reply - except ServiceException as e: - LOGGER.exception('GetServiceById exception') - GETSERVICEBYID_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('GetServiceById exception') - GETSERVICEBYID_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - - @GETCONNECTIONLIST_HISTOGRAM_DURATION.time() - def GetConnectionList(self, request : Empty, grpc_context : grpc.ServicerContext) -> ConnectionList: - GETCONNECTIONLIST_COUNTER_STARTED.inc() - try: - LOGGER.debug('GetConnectionList request: {}'.format(str(request))) - - # ----- Validate request data and pre-conditions ----------------------------------------------------------- - - # ----- Retrieve data from the database -------------------------------------------------------------------- - raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, 'RPC GetConnectionList() not implemented') - - # ----- Compose reply -------------------------------------------------------------------------------------- - #reply = ConnectionList() - #LOGGER.debug('GetConnectionList reply: {}'.format(str(reply))) - #GETCONNECTIONLIST_COUNTER_COMPLETED.inc() - #return reply - except ServiceException as e: - LOGGER.exception('GetConnectionList exception') - GETCONNECTIONLIST_COUNTER_FAILED.inc() - grpc_context.abort(e.code, e.details) - except Exception as e: # pragma: no cover - LOGGER.exception('GetConnectionList exception') - GETCONNECTIONLIST_COUNTER_FAILED.inc() - grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) diff --git a/src/service/_old_code_backup/Tools.py b/src/service/_old_code_backup/Tools.py deleted file mode 100644 index 62d602c058a55cdd229050cf3ba6301b4519fdb3..0000000000000000000000000000000000000000 --- a/src/service/_old_code_backup/Tools.py +++ /dev/null @@ -1,143 +0,0 @@ -import grpc, logging -from typing import Dict, List, Set, Tuple -from common.Checkers import chk_options, chk_string -from common.database.api.Database import Database -from common.database.api.context.Constants import DEFAULT_TOPOLOGY_ID -from common.database.api.context.topology.device.Endpoint import Endpoint -from common.database.api.context.service.ServiceState import ServiceState, servicestate_enum_values, \ - to_servicestate_enum -from common.database.api.context.service.ServiceType import ServiceType, servicetype_enum_values, to_servicetype_enum -from common.exceptions.ServiceException import ServiceException -from common.tools.service.DeviceCheckers import check_device_endpoint_exists -from common.tools.service.EndpointIdCheckers import check_endpoint_id -from common.tools.service.EnumCheckers import check_enum -from common.tools.service.ServiceCheckers import check_service_exists, check_service_not_exists -from service.proto.context_pb2 import Constraint -from service.proto.service_pb2 import Service, ServiceId - -# For each method name, define acceptable service types. Empty set means accept all. -ACCEPTED_SERVICE_TYPES : Dict[str, Set[ServiceType]] = { - 'CreateService': set([ServiceType.L2NM, ServiceType.L3NM, ServiceType.TAPI_CONNECTIVITY_SERVICE]), - 'UpdateService': set([ServiceType.L2NM, ServiceType.L3NM, ServiceType.TAPI_CONNECTIVITY_SERVICE]), -} - -# For each method name, define acceptable service states. Empty set means accept all. -ACCEPTED_SERVICE_STATES : Dict[str, Set[ServiceState]] = { - 'CreateService': set([ServiceState.PLANNED]), - 'UpdateService': set([ServiceState.PLANNED, ServiceState.ACTIVE, ServiceState.PENDING_REMOVAL]), -} - -def _check_service_exists(method_name : str, database : Database, context_id : str, service_id : str): - if method_name in ['CreateService']: - check_service_not_exists(database, context_id, service_id) - elif method_name in ['UpdateService', 'DeleteService', 'GetServiceById']: - check_service_exists(database, context_id, service_id) - else: # pragma: no cover (test requires malforming the code) - msg = 'Unexpected condition [_check_service_exists(method_name={}, context_id={}, service_id={})]' - msg = msg.format(str(method_name), str(context_id), str(service_id)) - raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) - -def check_service_type(method_name : str, value : str) -> ServiceType: - return check_enum('ServiceType', method_name, value, to_servicetype_enum, ACCEPTED_SERVICE_TYPES) - -def check_service_state(method_name : str, value : str) -> ServiceState: - return check_enum('ServiceState', method_name, value, to_servicestate_enum, ACCEPTED_SERVICE_STATES) - -def check_service_constraint( - logger : logging.Logger, constraint_number : int, parent_name : str, constraint : Constraint, - add_constraints : Dict[str, Dict[str, Set[str]]]) -> Tuple[str, str]: - - try: - constraint_type = chk_string('constraint[#{}].constraint_type'.format(constraint_number), - constraint.constraint_type, - allow_empty=False) - constraint_value = chk_string('constraint[#{}].constraint_value'.format(constraint_number), - constraint.constraint_value, - allow_empty=False) - except Exception as e: - logger.exception('Invalid arguments:') - raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) - - if constraint_type in add_constraints: - msg = 'Duplicated ConstraintType({}) in {}.' - msg = msg.format(constraint_type, parent_name) - raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) - - add_constraints[constraint_type] = constraint_value - return constraint_type, constraint_value - -def check_service_request( - method_name : str, request : Service, database : Database, logger : logging.Logger - ) -> Tuple[str, str, ServiceType, str, ServiceState, List[Endpoint], List[Tuple[str, str]]]: - - # ----- Parse attributes ------------------------------------------------------------------------------------------- - try: - context_id = chk_string ('service.cs_id.contextId.contextUuid.uuid', - request.cs_id.contextId.contextUuid.uuid, - allow_empty=False) - service_id = chk_string ('service.cs_id.cs_id.uuid', - request.cs_id.cs_id.uuid, - allow_empty=False) - service_type = chk_options('service.serviceType', - request.serviceType, - servicetype_enum_values()) - service_config = chk_string ('service.serviceConfig.serviceConfig', - request.serviceConfig.serviceConfig, - allow_empty=True) - service_state = chk_options('service.serviceState.serviceState', - request.serviceState.serviceState, - servicestate_enum_values()) - except Exception as e: - logger.exception('Invalid arguments:') - raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) - - service_type = check_service_type(method_name, service_type) - service_state = check_service_state(method_name, service_state) - - # ----- Check if service exists in database ------------------------------------------------------------------------ - _check_service_exists(method_name, database, context_id, service_id) - - # ----- Parse constraints ------------------------------------------------------------------------------------------ - add_constraints : Dict[str, str] = {} - constraint_tuples : List[Tuple[str, str]] = [] - for constraint_number,constraint in enumerate(request.constraint): - parent_name = 'Constraint(#{}) of Context({})/Service({})'.format(constraint_number, context_id, service_id) - constraint_type, constraint_value = check_service_constraint( - logger, constraint_number, parent_name, constraint, add_constraints) - constraint_tuples.append((constraint_type, constraint_value)) - - # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- - add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} - db_endpoints : List[Endpoint] = [] - for endpoint_number,endpoint_id in enumerate(request.endpointList): - parent_name = 'Endpoint(#{}) of Context({})/Service({})'.format(endpoint_number, context_id, service_id) - - ep_topology_id, ep_device_id, ep_port_id = check_endpoint_id( - logger, endpoint_number, parent_name, endpoint_id, add_topology_devices_endpoints, - predefined_context_id=context_id, acceptable_context_ids=set([context_id])) - - db_endpoint = check_device_endpoint_exists( - database, parent_name, context_id, ep_topology_id, ep_device_id, ep_port_id) - db_endpoints.append(db_endpoint) - - return context_id, service_id, service_type, service_config, service_state, db_endpoints, constraint_tuples - -def check_service_id_request( - method_name : str, request : ServiceId, database : Database, logger : logging.Logger) -> Tuple[str, str]: - - # ----- Parse attributes ------------------------------------------------------------------------------------------- - try: - context_id = chk_string ('service_id.contextId.contextUuid.uuid', - request.contextId.contextUuid.uuid, - allow_empty=False) - service_id = chk_string ('service_id.cs_id.uuid', - request.cs_id.uuid, - allow_empty=False) - except Exception as e: - logger.exception('Invalid arguments:') - raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) - - # ----- Check if service exists in database ------------------------------------------------------------------------ - _check_service_exists(method_name, database, context_id, service_id) - - return context_id, service_id diff --git a/src/service/_old_code_backup/test_unitary.py b/src/service/_old_code_backup/test_unitary.py deleted file mode 100644 index fb7d1465d3308261e0f2bdc5bc534f67d89fae1e..0000000000000000000000000000000000000000 --- a/src/service/_old_code_backup/test_unitary.py +++ /dev/null @@ -1,364 +0,0 @@ -import copy, grpc, logging, pytest -from google.protobuf.json_format import MessageToDict -from common.database.Factory import get_database, DatabaseEngineEnum -from common.database.api.Database import Database -from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID -from common.database.tests.script import populate_example -from common.tests.Assertions import validate_empty, validate_service, validate_service_id, \ - validate_service_list_is_empty, validate_service_list_is_not_empty -from service.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from service.client.ServiceClient import ServiceClient -from service.proto.context_pb2 import Empty -from service.proto.service_pb2 import Service, ServiceId, ServiceStateEnum, ServiceType -from service.service.ServiceService import ServiceService - -port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -# use "copy.deepcopy" to prevent propagating forced changes during tests -CONTEXT_ID = {'contextUuid': {'uuid': DEFAULT_CONTEXT_ID}} -TOPOLOGY_ID = {'contextId': copy.deepcopy(CONTEXT_ID), 'topoId': {'uuid': DEFAULT_TOPOLOGY_ID}} -SERVICE_ID = {'contextId': copy.deepcopy(CONTEXT_ID), 'cs_id': {'uuid': 'DEV1'}} -SERVICE = { - 'cs_id': copy.deepcopy(SERVICE_ID), - 'serviceType': ServiceType.L3NM, - 'serviceConfig': {'serviceConfig': ''}, - 'serviceState': {'serviceState': ServiceStateEnum.PLANNED}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV1'}}, 'port_id': {'uuid' : 'EP5'}}, - {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV2'}}, 'port_id': {'uuid' : 'EP5'}}, - {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV3'}}, 'port_id': {'uuid' : 'EP5'}}, - ] -} - -@pytest.fixture(scope='session') -def database(): - _database = get_database(engine=DatabaseEngineEnum.INMEMORY) - populate_example(_database, add_services=False) - return _database - -@pytest.fixture(scope='session') -def service_service(database): - _service = ServiceService( - database, port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def service_client(service_service): - _client = ServiceClient(address='127.0.0.1', port=port) - yield _client - _client.close() - -def test_get_services_empty(service_client : ServiceClient): - # should work - validate_service_list_is_empty(MessageToDict( - service_client.GetServiceList(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_create_service_wrong_service_attributes(service_client : ServiceClient): - # should fail with wrong service context - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['cs_id']['contextId']['contextUuid']['uuid'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'service.cs_id.contextId.contextUuid.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with service context does not exist - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['cs_id']['contextId']['contextUuid']['uuid'] = 'wrong-context' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(wrong-context) does not exist in the database.' - assert e.value.details() == msg - - # should fail with wrong service id - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['cs_id']['cs_id']['uuid'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'service.cs_id.cs_id.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with wrong service type - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['serviceType'] = ServiceType.UNKNOWN - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Method(CreateService) does not accept ServiceType(UNKNOWN). '\ - 'Permitted values for Method(CreateService) are '\ - 'ServiceType([\'L2NM\', \'L3NM\', \'TAPI_CONNECTIVITY_SERVICE\']).' - assert e.value.details() == msg - - # should fail with wrong service state - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['serviceState']['serviceState'] = ServiceStateEnum.PENDING_REMOVAL - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Method(CreateService) does not accept ServiceState(PENDING_REMOVAL). '\ - 'Permitted values for Method(CreateService) are '\ - 'ServiceState([\'PLANNED\']).' - assert e.value.details() == msg - -def test_create_service_wrong_constraint(service_client : ServiceClient): - # should fail with wrong constraint type - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['constraint'][0]['constraint_type'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'constraint[#0].constraint_type() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with wrong constraint value - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['constraint'][0]['constraint_value'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'constraint[#0].constraint_value() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with dupplicated constraint type - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['constraint'][1] = copy_service['constraint'][0] - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Duplicated ConstraintType(latency_ms) in Constraint(#1) of Context(admin)/Service(DEV1).' - assert e.value.details() == msg - -def test_create_service_wrong_endpoint(service_client : ServiceClient, database : Database): - # should fail with wrong endpoint context - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['topoId']['contextId']['contextUuid']['uuid'] = 'wrong-context' - print(copy_service) - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Context(wrong-context) in Endpoint(#0) of '\ - 'Context(admin)/Service(DEV1) mismatches acceptable Contexts({\'admin\'}). '\ - 'Optionally, leave field empty to use predefined Context(admin).' - assert e.value.details() == msg - - # should fail with wrong endpoint topology - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['topoId']['topoId']['uuid'] = 'wrong-topo' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Context(admin)/Topology(wrong-topo) in Endpoint(#0) of '\ - 'Context(admin)/Service(DEV1) mismatches acceptable Topologies({\'admin\'}). '\ - 'Optionally, leave field empty to use predefined Topology(admin).' - assert e.value.details() == msg - - # should fail with endpoint device is empty - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['dev_id']['device_id']['uuid'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'endpoint_id[#0].dev_id.device_id.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with endpoint device not found - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['dev_id']['device_id']['uuid'] = 'wrong-device' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(admin)/Topology(admin)/Device(wrong-device) in Endpoint(#0) of '\ - 'Context(admin)/Service(DEV1) does not exist in the database.' - assert e.value.details() == msg - - # should fail with endpoint device duplicated - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][1] = copy_service['endpointList'][0] - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'Duplicated Context(admin)/Topology(admin)/Device(DEV1) in Endpoint(#1) of '\ - 'Context(admin)/Service(DEV1).' - assert e.value.details() == msg - - # should fail with endpoint port is empty - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['port_id']['uuid'] = '' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'endpoint_id[#0].port_id.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with endpoint port not found - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['port_id']['uuid'] = 'wrong-port' - service_client.CreateService(Service(**copy_service)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(admin)/Topology(admin)/Device(DEV1)/Port(wrong-port) in Endpoint(#0) of '\ - 'Context(admin)/Service(DEV1) does not exist in the database.' - assert e.value.details() == msg - -def test_get_service_does_not_exist(service_client : ServiceClient): - # should fail with service context does not exist - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service_id = copy.deepcopy(SERVICE_ID) - copy_service_id['contextId']['contextUuid']['uuid'] = 'wrong-context' - service_client.GetServiceById(ServiceId(**copy_service_id)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(wrong-context) does not exist in the database.' - assert e.value.details() == msg - - # should fail with service does not exist - with pytest.raises(grpc._channel._InactiveRpcError) as e: - service_client.GetServiceById(ServiceId(**SERVICE_ID)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(admin)/Service(DEV1) does not exist in the database.' - assert e.value.details() == msg - -def test_update_service_does_not_exist(service_client : ServiceClient): - # should fail with service does not exist - with pytest.raises(grpc._channel._InactiveRpcError) as e: - service_client.UpdateService(Service(**SERVICE)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(admin)/Service(DEV1) does not exist in the database.' - assert e.value.details() == msg - -def test_create_service(service_client : ServiceClient): - # should work - validate_service_id(MessageToDict( - service_client.CreateService(Service(**SERVICE)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_create_service_already_exists(service_client : ServiceClient): - # should fail with service already exists - with pytest.raises(grpc._channel._InactiveRpcError) as e: - service_client.CreateService(Service(**SERVICE)) - assert e.value.code() == grpc.StatusCode.ALREADY_EXISTS - msg = 'Context(admin)/Service(DEV1) already exists in the database.' - assert e.value.details() == msg - -def test_get_service(service_client : ServiceClient): - # should work - validate_service(MessageToDict( - service_client.GetServiceById(ServiceId(**SERVICE_ID)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_update_service(service_client : ServiceClient): - # should work - copy_service = copy.deepcopy(SERVICE) - copy_service['serviceConfig']['serviceConfig'] = '' - copy_service['serviceState']['serviceState'] = ServiceStateEnum.ACTIVE - copy_service['constraint'] = [ - {'constraint_type': 'latency_ms', 'constraint_value': '200'}, - {'constraint_type': 'bandwidth_gbps', 'constraint_value': '100'}, - ] - copy_service['endpointList'] = [ - { - 'topoId': {'contextId': {'contextUuid': {'uuid': 'admin'}}, 'topoId': {'uuid': 'admin'}}, - 'dev_id': {'device_id': {'uuid': 'DEV1'}}, - 'port_id': {'uuid' : 'EP5'} - }, - { - 'topoId': {'contextId': {'contextUuid': {'uuid': 'admin'}}, 'topoId': {'uuid': 'admin'}}, - 'dev_id': {'device_id': {'uuid': 'DEV2'}}, - 'port_id': {'uuid' : 'EP6'} - }, - ] - validate_service_id(MessageToDict( - service_client.UpdateService(Service(**copy_service)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_delete_service_wrong_service_id(service_client : ServiceClient): - # should fail with service context is empty - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service_id = copy.deepcopy(SERVICE_ID) - copy_service_id['contextId']['contextUuid']['uuid'] = '' - service_client.DeleteService(ServiceId(**copy_service_id)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'service_id.contextId.contextUuid.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with service context does not exist - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service_id = copy.deepcopy(SERVICE_ID) - copy_service_id['contextId']['contextUuid']['uuid'] = 'wrong-context' - service_client.DeleteService(ServiceId(**copy_service_id)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(wrong-context) does not exist in the database.' - assert e.value.details() == msg - - # should fail with service id is empty - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service_id = copy.deepcopy(SERVICE_ID) - copy_service_id['cs_id']['uuid'] = '' - service_client.DeleteService(ServiceId(**copy_service_id)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg = 'service_id.cs_id.uuid() is out of range: '\ - 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' - assert e.value.details() == msg - - # should fail with service id is empty - with pytest.raises(grpc._channel._InactiveRpcError) as e: - copy_service_id = copy.deepcopy(SERVICE_ID) - copy_service_id['cs_id']['uuid'] = 'wrong-service' - service_client.DeleteService(ServiceId(**copy_service_id)) - assert e.value.code() == grpc.StatusCode.NOT_FOUND - msg = 'Context(admin)/Service(wrong-service) does not exist in the database.' - assert e.value.details() == msg - -def test_delete_service(service_client : ServiceClient): - # should work - validate_empty(MessageToDict( - service_client.DeleteService(ServiceId(**SERVICE_ID)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_get_services_empty_2(service_client : ServiceClient): - # should work - validate_service_list_is_empty(MessageToDict( - service_client.GetServiceList(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_create_service_empty_endpoints(service_client : ServiceClient): - # should work - copy_service = copy.deepcopy(SERVICE) - copy_service['endpointList'][0]['topoId']['contextId']['contextUuid']['uuid'] = '' - copy_service['endpointList'][0]['topoId']['topoId']['uuid'] = '' - validate_service_id(MessageToDict( - service_client.CreateService(Service(**copy_service)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_get_services_full(service_client : ServiceClient): - # should work - validate_service_list_is_not_empty(MessageToDict( - service_client.GetServiceList(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) diff --git a/src/service/client/ServiceClient.py b/src/service/client/ServiceClient.py index 958e066238446d9642ba38c8a907f32df1dcf030..8168f818b747f76379d229634ed9fd289f28fb60 100644 --- a/src/service/client/ServiceClient.py +++ b/src/service/client/ServiceClient.py @@ -1,16 +1,36 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty, Service, ServiceId +from common.proto.service_pb2_grpc import ServiceServiceStub from common.tools.client.RetryDecorator import retry, delay_exponential -from service.proto.context_pb2 import ConnectionList, Empty, Service, ServiceId -from service.proto.service_pb2_grpc import ServiceServiceStub +from common.tools.grpc.Tools import grpc_message_to_json_string LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') class ServiceClient: - def __init__(self, address, port): - self.endpoint = '{:s}:{:s}'.format(str(address), str(port)) - LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.SERVICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.SERVICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None self.connect() @@ -21,34 +41,27 @@ class ServiceClient: self.stub = ServiceServiceStub(self.channel) def close(self): - if(self.channel is not None): self.channel.close() + if self.channel is not None: self.channel.close() self.channel = None self.stub = None - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def CreateService(self, request : Service) -> ServiceId: - LOGGER.debug('CreateService request: {:s}'.format(str(request))) + LOGGER.debug('CreateService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.CreateService(request) - LOGGER.debug('CreateService result: {:s}'.format(str(response))) + LOGGER.debug('CreateService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def UpdateService(self, request : Service) -> ServiceId: - LOGGER.debug('UpdateService request: {:s}'.format(str(request))) + LOGGER.debug('UpdateService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.UpdateService(request) - LOGGER.debug('UpdateService result: {:s}'.format(str(response))) + LOGGER.debug('UpdateService result: {:s}'.format(grpc_message_to_json_string(response))) return response - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + @RETRY_DECORATOR def DeleteService(self, request : ServiceId) -> Empty: - LOGGER.debug('DeleteService request: {:s}'.format(str(request))) + LOGGER.debug('DeleteService request: {:s}'.format(grpc_message_to_json_string(request))) response = self.stub.DeleteService(request) - LOGGER.debug('DeleteService result: {:s}'.format(str(response))) - return response - - @retry(exceptions=set(), max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') - def GetConnectionList(self, request : ServiceId) -> ConnectionList: - LOGGER.debug('GetConnectionList request: {:s}'.format(str(request))) - response = self.stub.GetConnectionList(request) - LOGGER.debug('GetConnectionList result: {:s}'.format(str(response))) + LOGGER.debug('DeleteService result: {:s}'.format(grpc_message_to_json_string(response))) return response diff --git a/src/service/client/__init__.py b/src/service/client/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/client/__init__.py +++ b/src/service/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/genproto.sh b/src/service/genproto.sh deleted file mode 100755 index 4a53ab9eec365b74a4d76356605fe97961b4279e..0000000000000000000000000000000000000000 --- a/src/service/genproto.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# 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. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -rm proto/context_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2_grpc.py diff --git a/src/service/proto/__init__.py b/src/service/proto/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/service/proto/context_pb2.py b/src/service/proto/context_pb2.py deleted file mode 100644 index 43d80f01d7ee513ff2d91abb704e9e95cf12f0b6..0000000000000000000000000000000000000000 --- a/src/service/proto/context_pb2.py +++ /dev/null @@ -1,2545 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xa5\r\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3552, - serialized_end=3658, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3661, - serialized_end=3858, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3861, - serialized_end=4004, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4007, - serialized_end=4136, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4139, - serialized_end=4275, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4277, - serialized_end=4370, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2605, - serialized_end=2735, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2738, - serialized_end=2872, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2874, - serialized_end=2975, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2977, - serialized_end=3040, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3042, - serialized_end=3096, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='related_service_id', full_name='context.Connection.related_service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path', full_name='context.Connection.path', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3099, - serialized_end=3240, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3242, - serialized_end=3307, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3309, - serialized_end=3367, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3369, - serialized_end=3463, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3465, - serialized_end=3550, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4373, - serialized_end=6074, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/service/proto/kpi_sample_types_pb2.py b/src/service/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/service/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/service/proto/service_pb2.py b/src/service/proto/service_pb2.py deleted file mode 100644 index 7a006915b8be39710a17faab075e382e322d918f..0000000000000000000000000000000000000000 --- a/src/service/proto/service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='service.proto', - package='service', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_SERVICESERVICE = _descriptor.ServiceDescriptor( - name='ServiceService', - full_name='service.ServiceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=42, - serialized_end=295, - methods=[ - _descriptor.MethodDescriptor( - name='CreateService', - full_name='service.ServiceService.CreateService', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UpdateService', - full_name='service.ServiceService.UpdateService', - index=1, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteService', - full_name='service.ServiceService.DeleteService', - index=2, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_SERVICESERVICE) - -DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/service/proto/service_pb2_grpc.py b/src/service/proto/service_pb2_grpc.py deleted file mode 100644 index 58cd47e937d5f7bc56ca317ccb72f5958eda740d..0000000000000000000000000000000000000000 --- a/src/service/proto/service_pb2_grpc.py +++ /dev/null @@ -1,165 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 - - -class ServiceServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateService = channel.unary_unary( - '/service.ServiceService/CreateService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.ServiceId.FromString, - ) - self.UpdateService = channel.unary_unary( - '/service.ServiceService/UpdateService', - request_serializer=context__pb2.Service.SerializeToString, - response_deserializer=context__pb2.ServiceId.FromString, - ) - self.DeleteService = channel.unary_unary( - '/service.ServiceService/DeleteService', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetConnectionList = channel.unary_unary( - '/service.ServiceService/GetConnectionList', - request_serializer=context__pb2.ServiceId.SerializeToString, - response_deserializer=context__pb2.ConnectionList.FromString, - ) - - -class ServiceServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def CreateService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteService(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetConnectionList(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ServiceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateService': grpc.unary_unary_rpc_method_handler( - servicer.CreateService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.ServiceId.SerializeToString, - ), - 'UpdateService': grpc.unary_unary_rpc_method_handler( - servicer.UpdateService, - request_deserializer=context__pb2.Service.FromString, - response_serializer=context__pb2.ServiceId.SerializeToString, - ), - 'DeleteService': grpc.unary_unary_rpc_method_handler( - servicer.DeleteService, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetConnectionList': grpc.unary_unary_rpc_method_handler( - servicer.GetConnectionList, - request_deserializer=context__pb2.ServiceId.FromString, - response_serializer=context__pb2.ConnectionList.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'service.ServiceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ServiceService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CreateService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/service.ServiceService/CreateService', - context__pb2.Service.SerializeToString, - context__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def UpdateService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/service.ServiceService/UpdateService', - context__pb2.Service.SerializeToString, - context__pb2.ServiceId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeleteService(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/service.ServiceService/DeleteService', - context__pb2.ServiceId.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetConnectionList(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/service.ServiceService/GetConnectionList', - context__pb2.ServiceId.SerializeToString, - context__pb2.ConnectionList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/service/requirements.in b/src/service/requirements.in index 25abdad1b5767117956a88b816399635348884c7..245ddb7a715017a6482b02b77d57b1e43f8d90be 100644 --- a/src/service/requirements.in +++ b/src/service/requirements.in @@ -1,6 +1,4 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis +anytree==2.8.0 +networkx==2.6.3 +pydot==1.4.2 +redis==4.1.2 diff --git a/src/service/service/ServiceService.py b/src/service/service/ServiceService.py index 6280af0b70eb37b8cf9c27954bf4db4690743198..b152376254b52f39c7351eca628165a4a05fac31 100644 --- a/src/service/service/ServiceService.py +++ b/src/service/service/ServiceService.py @@ -1,56 +1,33 @@ -import grpc -import logging -from concurrent import futures -from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH -from grpc_health.v1.health_pb2 import HealthCheckResponse -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from service.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from service.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.orm.backend.BackendEnum import BackendEnum +from common.orm.Database import Database +from common.orm.Factory import get_database_backend +from common.proto.service_pb2_grpc import add_ServiceServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService from .ServiceServiceServicerImpl import ServiceServiceServicerImpl +from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) +class ServiceService(GenericGrpcService): + def __init__(self, service_handler_factory : ServiceHandlerFactory, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.SERVICE) + super().__init__(port, cls_name=cls_name) + database = Database(get_database_backend(backend=BackendEnum.INMEMORY)) + self.service_servicer = ServiceServiceServicerImpl(database, service_handler_factory) -class ServiceService: - def __init__( - self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.service_servicer = None - self.health_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.service_servicer = ServiceServiceServicerImpl() + def install_servicers(self): add_ServiceServiceServicer_to_server(self.service_servicer, self.server) - - self.health_servicer = HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index e400d0b6e4e6741d387eef7c156eedd65ffb76da..6355cafbef0fc65338269df064a0f56e115b746e 100644 --- a/src/service/service/ServiceServiceServicerImpl.py +++ b/src/service/service/ServiceServiceServicerImpl.py @@ -1,98 +1,179 @@ -#from typing import Dict -import grpc, logging -#from common.exceptions.ServiceException import ServiceException +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Dict, List +import grpc, json, logging +from common.orm.Database import Database +from common.orm.HighLevel import get_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Empty, Service, ServiceId +from common.proto.service_pb2_grpc import ServiceServiceServicer from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method -from service.proto.context_pb2 import ConnectionList, Empty, Service, ServiceId #, ServiceList -from service.proto.service_pb2_grpc import ServiceServiceServicer -#from service.service.Tools import check_service_id_request, check_service_request +from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException, NotFoundException +from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.database.DeviceModel import DeviceModel +from .database.DatabaseServiceTools import ( + sync_service_from_context, sync_service_to_context, update_service_in_local_database) +from .database.ServiceModel import ServiceModel +from .path_computation_element.PathComputationElement import PathComputationElement, dump_connectivity +from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from .Tools import delete_service, sync_devices_from_context, update_service LOGGER = logging.getLogger(__name__) SERVICE_NAME = 'Service' -METHOD_NAMES = ['CreateService', 'UpdateService', 'DeleteService', 'GetConnectionList'] +METHOD_NAMES = ['CreateService', 'UpdateService', 'DeleteService'] METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) class ServiceServiceServicerImpl(ServiceServiceServicer): - def __init__(self): + def __init__(self, database : Database, service_handler_factory : ServiceHandlerFactory) -> None: LOGGER.debug('Creating Servicer...') + self.context_client = ContextClient() + self.device_client = DeviceClient() + self.database = database + self.service_handler_factory = service_handler_factory LOGGER.debug('Servicer Created') - #@safe_and_metered_rpc_method(METRICS, LOGGER) - #def GetServiceList(self, request : Empty, context : grpc.ServicerContext) -> ServiceList: - # db_context_uuids = self.database.contexts.get() - # json_services = [] - # for db_context_uuid in db_context_uuids: - # db_context = self.database.context(db_context_uuid) - # json_services.extend(db_context.dump_services()) - # return ServiceList(cs=json_services) - @safe_and_metered_rpc_method(METRICS, LOGGER) def CreateService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: - #context_id, service_id, service_type, service_config, service_state, db_endpoints, constraint_tuples = \ - # check_service_request('CreateService', request, self.database, LOGGER) - #db_context = self.database.context(context_id) - #db_service = db_context.service(service_id) - #db_service.create(service_type, service_config, service_state) - #for db_endpoint in db_endpoints: - # service_endpoint_id = '{}:{}/{}'.format( - # db_endpoint.topology_uuid, db_endpoint.device_uuid, db_endpoint.endpoint_uuid) - # db_service.endpoint(service_endpoint_id).create(db_endpoint) - #for cons_type,cons_value in constraint_tuples: db_service.constraint(cons_type).create(cons_value) - #return ServiceId(**db_service.dump_id()) - return ServiceId() + LOGGER.info('[CreateService] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) + + service_id = request.service_id + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + + if len(request.service_endpoint_ids) > 0: + unexpected_endpoints = [] + for service_endpoint_id in request.service_endpoint_ids: + unexpected_endpoints.append(grpc_message_to_json(service_endpoint_id)) + str_unexpected_endpoints = json.dumps(unexpected_endpoints, sort_keys=True) + raise InvalidArgumentException( + 'service.service_endpoint_ids', str_unexpected_endpoints, + extra_details='RPC method CreateService does not accept Endpoints. '\ + 'Endpoints should be configured after creating the service.') + + if len(request.service_constraints) > 0: + unexpected_constraints = [] + for service_constraint in request.service_constraints: + unexpected_constraints.append(grpc_message_to_json(service_constraint)) + str_unexpected_constraints = json.dumps(unexpected_constraints, sort_keys=True) + raise InvalidArgumentException( + 'service.service_constraints', str_unexpected_constraints, + extra_details='RPC method CreateService does not accept Constraints. '\ + 'Constraints should be configured after creating the service.') + + if len(request.service_config.config_rules) > 0: + unexpected_config_rules = grpc_message_to_json(request.service_config) + unexpected_config_rules = unexpected_config_rules['config_rules'] + str_unexpected_config_rules = json.dumps(unexpected_config_rules, sort_keys=True) + raise InvalidArgumentException( + 'service.service_config.config_rules', str_unexpected_config_rules, + extra_details='RPC method CreateService does not accept Config Rules. '\ + 'Config Rules should be configured after creating the service.') + + sync_service_from_context(service_context_uuid, service_uuid, self.context_client, self.database) + db_service,_ = update_service_in_local_database(self.database, request) + + LOGGER.info('[CreateService] db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + + sync_service_to_context(db_service, self.context_client) + return ServiceId(**db_service.dump_id()) @safe_and_metered_rpc_method(METRICS, LOGGER) def UpdateService(self, request : Service, context : grpc.ServicerContext) -> ServiceId: - #context_id, service_id, service_type, service_config, service_state, db_endpoints, constraint_tuples = \ - # check_service_request('UpdateService', request, self.database, LOGGER) - #db_context = self.database.context(context_id) - #db_service = db_context.service(service_id) - #db_service.update(update_attributes={ - # 'service_type' : service_type, - # 'service_config': service_config, - # 'service_state' : service_state, - #}) - ## Update service constraints; first add missing, then remove existing, but not added to Service - #db_service_constraint_types = set(db_service.constraints.get()) - #for constraint_type,constraint_value in constraint_tuples: - # if constraint_type in db_service_constraint_types: - # db_service.constraint(constraint_type).update(update_attributes={ - # 'constraint_value': constraint_value - # }) - # else: - # db_service.constraint(constraint_type).create(constraint_value) - # db_service_constraint_types.discard(constraint_type) - #for constraint_type in db_service_constraint_types: - # db_service.constraint(constraint_type).delete() - ## Update service endpoints; first add missing, then remove existing, but not added to Service - #db_service_endpoint_uuids = set(db_service.endpoints.get()) - #for db_endpoint in db_endpoints: - # service_endpoint_id = '{}:{}/{}'.format( - # db_endpoint.topology_uuid, db_endpoint.device_uuid, db_endpoint.endpoint_uuid) - # if service_endpoint_id not in db_service_endpoint_uuids: - # db_service.endpoint(service_endpoint_id).create(db_endpoint) - # db_service_endpoint_uuids.discard(service_endpoint_id) - #for db_service_endpoint_uuid in db_service_endpoint_uuids: - # db_service.endpoint(db_service_endpoint_uuid).delete() - #return ServiceId(**db_service.dump_id()) - return ServiceId() + LOGGER.info('[UpdateService] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) + + service_id = request.service_id + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + + pce = PathComputationElement() + pce.load_topology(self.context_client) + pce.load_connectivity(self.context_client, service_id) + #pce.dump_topology_to_file('../data/topo.dot') + #pce.dump_connectivity_to_file('../data/conn-before.txt') + connectivity = pce.route_service(request) + #pce.dump_connectivity_to_file('../data/conn-after.txt') + + LOGGER.info('[UpdateService] connectivity = {:s}'.format(str(dump_connectivity(connectivity)))) + + if connectivity is None: + # just update local database and context + str_service_key = key_to_str([service_context_uuid, service_uuid]) + db_service = get_object(self.database, ServiceModel, str_service_key, raise_if_not_found=False) + LOGGER.info('[UpdateService] before db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + db_devices : Dict[str, DeviceModel] = sync_devices_from_context( + self.context_client, self.database, db_service, request.service_endpoint_ids) + LOGGER.info('[UpdateService] db_devices[{:d}] = {:s}'.format( + len(db_devices), str({ + device_uuid:db_device.dump(include_config_rules=True, include_drivers=True, include_endpoints=True) + for device_uuid,db_device in db_devices.items() + }))) + sync_service_from_context(service_context_uuid, service_uuid, self.context_client, self.database) + db_service,_ = update_service_in_local_database(self.database, request) + LOGGER.info('[UpdateService] after db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + sync_service_to_context(db_service, self.context_client) + else: + for sub_service, sub_connections in connectivity.get('requirements', []): + for sub_connection in sub_connections: + update_service( + self.database, self.context_client, self.device_client, self.service_handler_factory, + sub_service, sub_connection) + + for connection in connectivity.get('connections'): + db_service = update_service( + self.database, self.context_client, self.device_client, self.service_handler_factory, + request, connection) + + str_service_key = key_to_str([service_context_uuid, service_uuid]) + db_service = get_object(self.database, ServiceModel, str_service_key, raise_if_not_found=False) + if db_service is None: raise NotFoundException('Service', str_service_key) + + LOGGER.info('[UpdateService] db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + + return ServiceId(**db_service.dump_id()) @safe_and_metered_rpc_method(METRICS, LOGGER) def DeleteService(self, request : ServiceId, context : grpc.ServicerContext) -> Empty: - #context_id, service_id = check_service_id_request('DeleteService', request, self.database, LOGGER) - #db_context = self.database.context(context_id) - #db_service = db_context.service(service_id) - #db_service.delete() - return Empty() + LOGGER.info('[DeleteService] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) - #@safe_and_metered_rpc_method(METRICS, LOGGER) - #def GetServiceById(self, request : ServiceId, context : grpc.ServicerContext) -> Service: - # context_id, service_id = check_service_id_request('GetServiceById', request, self.database, LOGGER) - # db_context = self.database.context(context_id) - # db_service = db_context.service(service_id) - # return Service(**db_service.dump()) + pce = PathComputationElement() + pce.load_topology(self.context_client) + pce.load_connectivity(self.context_client, request) + #pce.dump_topology_to_file('../data/topo.dot') + #pce.dump_connectivity_to_file('../data/conn-before.txt') + connectivity = pce.get_connectivity_from_service_id(request) + if connectivity is None: return Empty() + #pce.dump_connectivity_to_file('../data/conn-after.txt') - @safe_and_metered_rpc_method(METRICS, LOGGER) - def GetConnectionList(self, request : Empty, context : grpc.ServicerContext) -> ConnectionList: - #raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, 'RPC GetConnectionList() not implemented') - return ConnectionList() + LOGGER.info('[DeleteService] connectivity = {:s}'.format(str(dump_connectivity(connectivity)))) + + for connection in connectivity.get('connections'): + delete_service( + self.database, self.context_client, self.device_client, self.service_handler_factory, + request, connection) + + for sub_service, sub_connections in connectivity.get('requirements', []): + for sub_connection in sub_connections: + delete_service( + self.database, self.context_client, self.device_client, self.service_handler_factory, + sub_service.service_id, sub_connection) + + return Empty() diff --git a/src/service/service/Tools.py b/src/service/service/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..4386793c52a979cd0b3d86701a3476314857f3ac --- /dev/null +++ b/src/service/service/Tools.py @@ -0,0 +1,342 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from typing import Any, Dict, List, Optional, Tuple +from common.orm.Database import Database +from common.orm.HighLevel import get_object, get_related_objects +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import ( + ConfigRule, Connection, Constraint, EndPointId, Service, ServiceId, ServiceStatusEnum) +from common.rpc_method_wrapper.ServiceExceptions import ( + InvalidArgumentException, NotFoundException, OperationFailedException) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from .database.ConfigModel import ( + ConfigModel, ConfigRuleModel, ORM_ConfigActionEnum, get_config_rules, grpc_config_rules_to_raw) +from .database.ConstraintModel import ConstraintModel, ConstraintsModel, get_constraints, grpc_constraints_to_raw +from .database.DatabaseDeviceTools import sync_device_from_context +from .database.DatabaseServiceTools import ( + delete_service_from_context, sync_service_from_context, sync_service_to_context, update_service_in_local_database) +from .database.DeviceModel import DeviceModel, DriverModel +from .database.EndPointModel import EndPointModel, grpc_endpointids_to_raw +from .database.RelationModels import ServiceEndPointModel +from .database.ServiceModel import ServiceModel +from .service_handler_api._ServiceHandler import _ServiceHandler +from .service_handler_api.FilterFields import FilterFieldEnum +from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from .service_handler_api.Tools import ( + check_errors_deleteconfig, check_errors_deleteconstraint, check_errors_deleteendpoint, check_errors_setconfig, + check_errors_setconstraint, check_errors_setendpoint) + +LOGGER = logging.getLogger(__name__) + +def sync_devices_from_context( + context_client : ContextClient, database : Database, db_service : Optional[ServiceModel], + service_endpoint_ids : List[EndPointId] + ) -> Dict[str, DeviceModel]: + + required_device_uuids = set() + if db_service is not None: + db_endpoints = get_related_objects(db_service, ServiceEndPointModel, 'endpoint_fk') + for db_endpoint in db_endpoints: + db_device = get_object(database, DeviceModel, db_endpoint.device_fk, raise_if_not_found=False) + required_device_uuids.add(db_device.device_uuid) + + for endpoint_id in service_endpoint_ids: + required_device_uuids.add(endpoint_id.device_id.device_uuid.uuid) + + db_devices = {} + devices_not_found = set() + for device_uuid in required_device_uuids: + sync_device_from_context(device_uuid, context_client, database) + db_device = get_object(database, DeviceModel, device_uuid, raise_if_not_found=False) + if db_device is None: + devices_not_found.add(device_uuid) + else: + db_devices[device_uuid] = db_device + + if len(devices_not_found) > 0: + extra_details = ['Devices({:s}) cannot be retrieved from Context'.format(str(devices_not_found))] + raise NotFoundException('Device', '...', extra_details=extra_details) + + return db_devices + +def classify_config_rules( + db_service : ServiceModel, service_config_rules : List[ConfigRule], + resources_to_set: List[Tuple[str, Any]], resources_to_delete : List[Tuple[str, Any]]): + + context_config_rules = get_config_rules(db_service.database, db_service.pk, 'running') + context_config_rules = {config_rule[1]: config_rule[2] for config_rule in context_config_rules} + #LOGGER.info('[classify_config_rules] context_config_rules = {:s}'.format(str(context_config_rules))) + + request_config_rules = grpc_config_rules_to_raw(service_config_rules) + #LOGGER.info('[classify_config_rules] request_config_rules = {:s}'.format(str(request_config_rules))) + + for config_rule in request_config_rules: + action, key, value = config_rule + if action == ORM_ConfigActionEnum.SET: + if (key not in context_config_rules) or (context_config_rules[key] != value): + resources_to_set.append((key, value)) + elif action == ORM_ConfigActionEnum.DELETE: + if key in context_config_rules: + resources_to_delete.append((key, value)) + else: + raise InvalidArgumentException('config_rule.action', str(action), extra_details=str(request_config_rules)) + + #LOGGER.info('[classify_config_rules] resources_to_set = {:s}'.format(str(resources_to_set))) + #LOGGER.info('[classify_config_rules] resources_to_delete = {:s}'.format(str(resources_to_delete))) + +def classify_constraints( + db_service : ServiceModel, service_constraints : List[Constraint], + constraints_to_set: List[Tuple[str, str]], constraints_to_delete : List[Tuple[str, str]]): + + context_constraints = get_constraints(db_service.database, db_service.pk, 'running') + context_constraints = {constraint[0]: constraint[1] for constraint in context_constraints} + #LOGGER.info('[classify_constraints] context_constraints = {:s}'.format(str(context_constraints))) + + request_constraints = grpc_constraints_to_raw(service_constraints) + #LOGGER.info('[classify_constraints] request_constraints = {:s}'.format(str(request_constraints))) + + for constraint in request_constraints: + constraint_type, constraint_value = constraint + if constraint_type in context_constraints: + if context_constraints[constraint_type] != constraint_value: + constraints_to_set.append(constraint) + else: + constraints_to_set.append(constraint) + context_constraints.pop(constraint_type, None) + + for constraint in context_constraints: + constraints_to_delete.append(constraint) + + #LOGGER.info('[classify_constraints] constraints_to_set = {:s}'.format(str(constraints_to_set))) + #LOGGER.info('[classify_constraints] constraints_to_delete = {:s}'.format(str(constraints_to_delete))) + +def get_service_endpointids(db_service : ServiceModel) -> List[Tuple[str, str, Optional[str]]]: + db_endpoints : List[EndPointModel] = get_related_objects(db_service, ServiceEndPointModel, 'endpoint_fk') + endpoint_ids = [db_endpoint.dump_id() for db_endpoint in db_endpoints] + return [ + (endpoint_id['device_id']['device_uuid']['uuid'], endpoint_id['endpoint_uuid']['uuid'], + endpoint_id.get('topology_id', {}).get('topology_uuid', {}).get('uuid', None)) + for endpoint_id in endpoint_ids + ] + +def classify_endpointids( + db_service : ServiceModel, service_endpoint_ids : List[EndPointId], + endpointids_to_set: List[Tuple[str, str, Optional[str]]], + endpointids_to_delete : List[Tuple[str, str, Optional[str]]]): + + context_endpoint_ids = get_service_endpointids(db_service) + #LOGGER.info('[classify_endpointids] context_endpoint_ids = {:s}'.format(str(context_endpoint_ids))) + context_endpoint_ids = set(context_endpoint_ids) + #LOGGER.info('[classify_endpointids] context_endpoint_ids = {:s}'.format(str(context_endpoint_ids))) + + request_endpoint_ids = grpc_endpointids_to_raw(service_endpoint_ids) + #LOGGER.info('[classify_endpointids] request_endpoint_ids = {:s}'.format(str(request_endpoint_ids))) + + if len(service_endpoint_ids) != 2: return + for endpoint_id in request_endpoint_ids: + #if endpoint_id not in context_endpoint_ids: + # endpointids_to_set.append(endpoint_id) + #context_endpoint_ids.discard(endpoint_id) + endpointids_to_set.append(endpoint_id) + + #for endpoint_id in context_endpoint_ids: + # endpointids_to_delete.append(endpoint_id) + + #LOGGER.info('[classify_endpointids] endpointids_to_set = {:s}'.format(str(endpointids_to_set))) + #LOGGER.info('[classify_endpointids] endpointids_to_delete = {:s}'.format(str(endpointids_to_delete))) + +def get_service_handler_class( + service_handler_factory : ServiceHandlerFactory, db_service : ServiceModel, db_devices : Dict[str, DeviceModel] + ) -> Optional[_ServiceHandler]: + + str_service_key = db_service.pk + database = db_service.database + + # Assume all devices involved in the service must support at least one driver in common + device_drivers = None + for _,db_device in db_devices.items(): + db_driver_pks = db_device.references(DriverModel) + db_driver_names = [DriverModel(database, pk).driver.value for pk,_ in db_driver_pks] + if device_drivers is None: + device_drivers = set(db_driver_names) + else: + device_drivers.intersection_update(db_driver_names) + + filter_fields = { + FilterFieldEnum.SERVICE_TYPE.value : db_service.service_type.value, # must be supported + FilterFieldEnum.DEVICE_DRIVER.value : device_drivers, # at least one must be supported + } + + msg = 'Selecting service handler for service({:s}) with filter_fields({:s})...' + LOGGER.info(msg.format(str(str_service_key), str(filter_fields))) + service_handler_class = service_handler_factory.get_service_handler_class(**filter_fields) + msg = 'ServiceHandler({:s}) selected for service({:s}) with filter_fields({:s})...' + LOGGER.info(msg.format(str(service_handler_class.__name__), str(str_service_key), str(filter_fields))) + return service_handler_class + +def update_service( + database : Database, context_client : ContextClient, device_client : DeviceClient, + service_handler_factory : ServiceHandlerFactory, service : Service, connection : Connection + ) -> ServiceModel: + + service_id = service.service_id + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + str_service_key = key_to_str([service_context_uuid, service_uuid]) + + # Sync before updating service to ensure we have devices, endpoints, constraints, and config rules to be + # set/deleted before actuallymodifying them in the local in-memory database. + + sync_service_from_context(service_context_uuid, service_uuid, context_client, database) + db_service = get_object(database, ServiceModel, str_service_key, raise_if_not_found=False) + db_devices = sync_devices_from_context(context_client, database, db_service, service.service_endpoint_ids) + + if db_service is None: db_service,_ = update_service_in_local_database(database, service) + LOGGER.info('[update_service] db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + + resources_to_set : List[Tuple[str, Any]] = [] # resource_key, resource_value + resources_to_delete : List[Tuple[str, Any]] = [] # resource_key, resource_value + classify_config_rules(db_service, service.service_config.config_rules, resources_to_set, resources_to_delete) + + constraints_to_set : List[Tuple[str, str]] = [] # constraint_type, constraint_value + constraints_to_delete : List[Tuple[str, str]] = [] # constraint_type, constraint_value + classify_constraints(db_service, service.service_constraints, constraints_to_set, constraints_to_delete) + + endpointids_to_set : List[Tuple[str, str, Optional[str]]] = [] # device_uuid, endpoint_uuid, topology_uuid + endpointids_to_delete : List[Tuple[str, str, Optional[str]]] = [] # device_uuid, endpoint_uuid, topology_uuid + classify_endpointids(db_service, service.service_endpoint_ids, endpointids_to_set, endpointids_to_delete) + + service_handler_class = get_service_handler_class(service_handler_factory, db_service, db_devices) + service_handler_settings = {} + service_handler : _ServiceHandler = service_handler_class( + db_service, database, context_client, device_client, **service_handler_settings) + + errors = [] + + if len(errors) == 0: + results_deleteendpoint = service_handler.DeleteEndpoint(endpointids_to_delete) + errors.extend(check_errors_deleteendpoint(endpointids_to_delete, results_deleteendpoint)) + + if len(errors) == 0: + results_deleteconstraint = service_handler.DeleteConstraint(constraints_to_delete) + errors.extend(check_errors_deleteconstraint(constraints_to_delete, results_deleteconstraint)) + + if len(errors) == 0: + results_deleteconfig = service_handler.DeleteConfig(resources_to_delete) + errors.extend(check_errors_deleteconfig(resources_to_delete, results_deleteconfig)) + + if len(errors) == 0: + results_setconfig = service_handler.SetConfig(resources_to_set) + errors.extend(check_errors_setconfig(resources_to_set, results_setconfig)) + + if len(errors) == 0: + results_setconstraint = service_handler.SetConstraint(constraints_to_set) + errors.extend(check_errors_setconstraint(constraints_to_set, results_setconstraint)) + + if len(errors) == 0: + results_setendpoint = service_handler.SetEndpoint(endpointids_to_set) + errors.extend(check_errors_setendpoint(endpointids_to_set, results_setendpoint)) + + if len(errors) > 0: + raise OperationFailedException('UpdateService', extra_details=errors) + + LOGGER.info('[update_service] len(service.service_endpoint_ids) = {:d}'.format(len(service.service_endpoint_ids))) + if len(service.service_endpoint_ids) >= 2: + service.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_ACTIVE + + db_service,_ = update_service_in_local_database(database, service) + LOGGER.info('[update_service] db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + + sync_service_to_context(db_service, context_client) + context_client.SetConnection(connection) + return db_service + +def delete_service( + database : Database, context_client : ContextClient, device_client : DeviceClient, + service_handler_factory : ServiceHandlerFactory, service_id : ServiceId, connection : Connection + ) -> None: + + context_client.RemoveConnection(connection.connection_id) + + service_uuid = service_id.service_uuid.uuid + service_context_uuid = service_id.context_id.context_uuid.uuid + str_service_key = key_to_str([service_context_uuid, service_uuid]) + + # Sync before updating service to ensure we have devices, endpoints, constraints, and config rules to be + # set/deleted before actuallymodifying them in the local in-memory database. + + sync_service_from_context(service_context_uuid, service_uuid, context_client, database) + db_service : ServiceModel = get_object(database, ServiceModel, str_service_key, raise_if_not_found=False) + if db_service is None: return + LOGGER.info('[delete_service] db_service = {:s}'.format(str(db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True)))) + + db_devices = sync_devices_from_context(context_client, database, db_service, []) + + resources_to_delete : List[Tuple[str, str]] = [ # resource_key, resource_value + (config_rule[1], config_rule[2]) + for config_rule in get_config_rules(db_service.database, db_service.pk, 'running') + ] + + constraints_to_delete : List[Tuple[str, str]] = [ # constraint_type, constraint_value + (constraint[0], constraint[1]) + for constraint in get_constraints(db_service.database, db_service.pk, 'running') + ] + + # device_uuid, endpoint_uuid, topology_uuid + endpointids_to_delete : List[Tuple[str, str, Optional[str]]] = list(set(get_service_endpointids(db_service))) + + service_handler_class = get_service_handler_class(service_handler_factory, db_service, db_devices) + service_handler_settings = {} + service_handler : _ServiceHandler = service_handler_class( + db_service, database, context_client, device_client, **service_handler_settings) + + errors = [] + + if len(errors) == 0: + results_deleteendpoint = service_handler.DeleteEndpoint(endpointids_to_delete) + errors.extend(check_errors_deleteendpoint(endpointids_to_delete, results_deleteendpoint)) + + if len(errors) == 0: + results_deleteconstraint = service_handler.DeleteConstraint(constraints_to_delete) + errors.extend(check_errors_deleteconstraint(constraints_to_delete, results_deleteconstraint)) + + if len(errors) == 0: + results_deleteconfig = service_handler.DeleteConfig(resources_to_delete) + errors.extend(check_errors_deleteconfig(resources_to_delete, results_deleteconfig)) + + if len(errors) > 0: + raise OperationFailedException('DeleteService', extra_details=errors) + + delete_service_from_context(db_service, context_client) + + for db_service_endpoint_pk,_ in db_service.references(ServiceEndPointModel): + ServiceEndPointModel(database, db_service_endpoint_pk).delete() + + db_running_config = ConfigModel(database, db_service.service_config_fk) + for db_config_rule_pk,_ in db_running_config.references(ConfigRuleModel): + ConfigRuleModel(database, db_config_rule_pk).delete() + + db_running_constraints = ConstraintsModel(database, db_service.service_constraints_fk) + for db_constraint_pk,_ in db_running_constraints.references(ConstraintModel): + ConstraintModel(database, db_constraint_pk).delete() + + db_service.delete() + db_running_config.delete() + db_running_constraints.delete() diff --git a/src/service/service/__init__.py b/src/service/service/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/service/__init__.py +++ b/src/service/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/service/__main__.py b/src/service/service/__main__.py index 7de072b007d16fbd1c3274ee6a1ba04a5e0e56e5..1a67a309ff19bda2bf3174c80dfb908e99f72d14 100644 --- a/src/service/service/__main__.py +++ b/src/service/service/__main__.py @@ -1,11 +1,29 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import logging, signal, sys, threading from prometheus_client import start_http_server -from common.Settings import get_setting -from service.service.ServiceService import ServiceService -from service.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .ServiceService import ServiceService +from .service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from .service_handlers import SERVICE_HANDLERS terminate = threading.Event() -LOGGER = None +LOGGER : logging.Logger = None def signal_handler(signal, frame): # pylint: disable=redefined-outer-name LOGGER.warning('Terminate signal received') @@ -14,25 +32,31 @@ def signal_handler(signal, frame): # pylint: disable=redefined-outer-name def main(): global LOGGER # pylint: disable=global-statement - service_port = get_setting('SERVICESERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) - + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) + # Initialize ServiceHandler Factory + service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) + # Starting service service - grpc_service = ServiceService(port=service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = ServiceService(service_handler_factory) grpc_service.start() # Wait for Ctrl+C or termination signal diff --git a/src/service/service/database/ConfigModel.py b/src/service/service/database/ConfigModel.py new file mode 100644 index 0000000000000000000000000000000000000000..8472a44eaefefceaee36dcbe40d9a427eb2cbb36 --- /dev/null +++ b/src/service/service/database/ConfigModel.py @@ -0,0 +1,122 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, logging, operator +from enum import Enum +from typing import Dict, List, Tuple, Union +from common.orm.Database import Database +from common.orm.HighLevel import get_object, get_or_create_object, update_or_create_object +from common.orm.backend.Tools import key_to_str +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.IntegerField import IntegerField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.proto.context_pb2 import ConfigActionEnum +from common.tools.grpc.Tools import grpc_message_to_json_string +from .Tools import fast_hasher, grpc_to_enum, remove_dict_key + +LOGGER = logging.getLogger(__name__) + +class ORM_ConfigActionEnum(Enum): + UNDEFINED = ConfigActionEnum.CONFIGACTION_UNDEFINED + SET = ConfigActionEnum.CONFIGACTION_SET + DELETE = ConfigActionEnum.CONFIGACTION_DELETE + +grpc_to_enum__config_action = functools.partial( + grpc_to_enum, ConfigActionEnum, ORM_ConfigActionEnum) + +class ConfigModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + + def dump(self) -> List[Dict]: + db_config_rule_pks = self.references(ConfigRuleModel) + config_rules = [ConfigRuleModel(self.database, pk).dump(include_position=True) for pk,_ in db_config_rule_pks] + config_rules = sorted(config_rules, key=operator.itemgetter('position')) + return [remove_dict_key(config_rule, 'position') for config_rule in config_rules] + +class ConfigRuleModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + config_fk = ForeignKeyField(ConfigModel) + position = IntegerField(min_value=0, required=True) + action = EnumeratedField(ORM_ConfigActionEnum, required=True) + key = StringField(required=True, allow_empty=False) + value = StringField(required=False, allow_empty=True) + + def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ + result = { + 'action': self.action.value, + 'custom': { + 'resource_key': self.key, + 'resource_value': self.value, + }, + } + if include_position: result['position'] = self.position + return result + +def delete_all_config_rules(database : Database, db_parent_pk : str, config_name : str) -> None: + str_config_key = key_to_str([db_parent_pk, config_name], separator=':') + db_config : ConfigModel = get_object(database, ConfigModel, str_config_key, raise_if_not_found=False) + if db_config is None: return + db_config_rule_pks = db_config.references(ConfigRuleModel) + for pk,_ in db_config_rule_pks: ConfigRuleModel(database, pk).delete() + +def grpc_config_rules_to_raw(grpc_config_rules) -> List[Tuple[ORM_ConfigActionEnum, str, str]]: + def translate(grpc_config_rule): + action = grpc_to_enum__config_action(grpc_config_rule.action) + config_rule_type = str(grpc_config_rule.WhichOneof('config_rule')) + if config_rule_type != 'custom': + raise NotImplementedError('ConfigRule of type {:s} is not implemented: {:s}'.format( + config_rule_type, grpc_message_to_json_string(grpc_config_rule))) + return action, grpc_config_rule.custom.resource_key, grpc_config_rule.custom.resource_value + return [translate(grpc_config_rule) for grpc_config_rule in grpc_config_rules] + +def get_config_rules( + database : Database, db_parent_pk : str, config_name : str + ) -> List[Tuple[ORM_ConfigActionEnum, str, str]]: + + str_config_key = key_to_str([db_parent_pk, config_name], separator=':') + db_config = get_object(database, ConfigModel, str_config_key, raise_if_not_found=False) + return [] if db_config is None else [ + # pylint: disable=no-member, protected-access + (ORM_ConfigActionEnum._value2member_map_.get(config_rule['action']), + config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + for config_rule in db_config.dump() + if 'custom' in config_rule + ] + +def update_config( + database : Database, db_parent_pk : str, config_name : str, + raw_config_rules : List[Tuple[ORM_ConfigActionEnum, str, str]] +) -> List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]]: + + str_config_key = key_to_str([db_parent_pk, config_name], separator=':') + result : Tuple[ConfigModel, bool] = get_or_create_object(database, ConfigModel, str_config_key) + db_config, created = result + + db_objects : List[Tuple[Union[ConfigModel, ConfigRuleModel], bool]] = [(db_config, created)] + + for position,(action, resource_key, resource_value) in enumerate(raw_config_rules): + str_rule_key_hash = fast_hasher(resource_key) + str_config_rule_key = key_to_str([db_config.pk, str_rule_key_hash], separator=':') + result : Tuple[ConfigRuleModel, bool] = update_or_create_object( + database, ConfigRuleModel, str_config_rule_key, { + 'config_fk': db_config, 'position': position, 'action': action, 'key': resource_key, + 'value': resource_value, + }) + db_config_rule, updated = result + db_objects.append((db_config_rule, updated)) + + return db_objects diff --git a/src/service/service/database/ConstraintModel.py b/src/service/service/database/ConstraintModel.py new file mode 100644 index 0000000000000000000000000000000000000000..f75acf540fa04349cc3925bb11db94581232dd85 --- /dev/null +++ b/src/service/service/database/ConstraintModel.py @@ -0,0 +1,100 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, operator +from typing import Dict, List, Tuple, Union +from common.orm.Database import Database +from common.orm.HighLevel import get_object, get_or_create_object, update_or_create_object +from common.orm.backend.Tools import key_to_str +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.IntegerField import IntegerField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from service.service.database.Tools import fast_hasher, remove_dict_key + +LOGGER = logging.getLogger(__name__) + +class ConstraintsModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + + def dump(self) -> List[Dict]: + db_constraint_pks = self.references(ConstraintModel) + constraints = [ConstraintModel(self.database, pk).dump(include_position=True) for pk,_ in db_constraint_pks] + constraints = sorted(constraints, key=operator.itemgetter('position')) + return [remove_dict_key(constraint, 'position') for constraint in constraints] + +class ConstraintModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + constraints_fk = ForeignKeyField(ConstraintsModel) + position = IntegerField(min_value=0, required=True) + constraint_type = StringField(required=True, allow_empty=False) + constraint_value = StringField(required=True, allow_empty=False) + + def dump(self, include_position=True) -> Dict: # pylint: disable=arguments-differ + result = { + 'custom': { + 'constraint_type': self.constraint_type, + 'constraint_value': self.constraint_value, + }, + } + if include_position: result['position'] = self.position + return result + +def delete_all_constraints(database : Database, db_parent_pk : str, constraints_name : str) -> None: + str_constraints_key = key_to_str([db_parent_pk, constraints_name], separator=':') + db_constraints : ConstraintsModel = get_object( + database, ConstraintsModel, str_constraints_key, raise_if_not_found=False) + if db_constraints is None: return + db_constraint_pks = db_constraints.references(ConstraintModel) + for pk,_ in db_constraint_pks: ConstraintModel(database, pk).delete() + +def grpc_constraints_to_raw(grpc_constraints) -> List[Tuple[str, str]]: + return [ + (grpc_constraint.custom.constraint_type, grpc_constraint.custom.constraint_value) + for grpc_constraint in grpc_constraints + if grpc_constraint.WhichOneof('constraint') == 'custom' + ] + +def get_constraints(database : Database, db_parent_pk : str, constraints_name : str) -> List[Tuple[str, str]]: + str_constraints_key = key_to_str([db_parent_pk, constraints_name], separator=':') + db_constraints : ConstraintsModel = get_object( + database, ConstraintsModel, str_constraints_key, raise_if_not_found=False) + return [] if db_constraints is None else [ + (constraint['custom']['constraint_type'], constraint['custom']['constraint_value']) + for constraint in db_constraints.dump() + if 'custom' in constraint + ] + +def update_constraints( + database : Database, db_parent_pk : str, constraints_name : str, raw_constraints : List[Tuple[str, str]] +) -> List[Tuple[Union[ConstraintsModel, ConstraintModel], bool]]: + + str_constraints_key = key_to_str([db_parent_pk, constraints_name], separator=':') + result : Tuple[ConstraintsModel, bool] = get_or_create_object(database, ConstraintsModel, str_constraints_key) + db_constraints, created = result + + db_objects : List[Tuple[Union[ConstraintsModel, ConstraintModel], bool]] = [(db_constraints, created)] + + for position,(constraint_type, constraint_value) in enumerate(raw_constraints): + str_constraint_key_hash = fast_hasher(constraint_type) + str_constraint_key = key_to_str([db_constraints.pk, str_constraint_key_hash], separator=':') + result : Tuple[ConstraintModel, bool] = update_or_create_object( + database, ConstraintModel, str_constraint_key, { + 'constraints_fk': db_constraints, 'position': position, 'constraint_type': constraint_type, + 'constraint_value': constraint_value}) + db_constraints_rule, updated = result + db_objects.append((db_constraints_rule, updated)) + + return db_objects diff --git a/src/service/service/database/ContextModel.py b/src/service/service/database/ContextModel.py new file mode 100644 index 0000000000000000000000000000000000000000..b094961ca5ae7468505414ac164ebaa7b0f8f6f4 --- /dev/null +++ b/src/service/service/database/ContextModel.py @@ -0,0 +1,44 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from typing import Dict #, List +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model + +LOGGER = logging.getLogger(__name__) + +class ContextModel(Model): + pk = PrimaryKeyField() + context_uuid = StringField(required=True, allow_empty=False) + + def dump_id(self) -> Dict: + return {'context_uuid': {'uuid': self.context_uuid}} + +# def dump_service_ids(self) -> List[Dict]: +# from .ServiceModel import ServiceModel # pylint: disable=import-outside-toplevel +# db_service_pks = self.references(ServiceModel) +# return [ServiceModel(self.database, pk).dump_id() for pk,_ in db_service_pks] +# +# def dump_topology_ids(self) -> List[Dict]: +# from .TopologyModel import TopologyModel # pylint: disable=import-outside-toplevel +# db_topology_pks = self.references(TopologyModel) +# return [TopologyModel(self.database, pk).dump_id() for pk,_ in db_topology_pks] +# +# def dump(self, include_services=True, include_topologies=True) -> Dict: # pylint: disable=arguments-differ +# result = {'context_id': self.dump_id()} +# if include_services: result['service_ids'] = self.dump_service_ids() +# if include_topologies: result['topology_ids'] = self.dump_topology_ids() +# return result diff --git a/src/service/service/database/DatabaseDeviceTools.py b/src/service/service/database/DatabaseDeviceTools.py new file mode 100644 index 0000000000000000000000000000000000000000..2da9c584f731723b24b80439020c6a5eabe1f72e --- /dev/null +++ b/src/service/service/database/DatabaseDeviceTools.py @@ -0,0 +1,101 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc +from typing import Tuple +from common.orm.Database import Database +from common.orm.HighLevel import get_or_create_object, update_or_create_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Device, DeviceId +from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException +from context.client.ContextClient import ContextClient +from .ConfigModel import delete_all_config_rules, grpc_config_rules_to_raw, update_config +from .ContextModel import ContextModel +from .DeviceModel import DeviceModel, grpc_to_enum__device_operational_status, set_drivers +from .EndPointModel import EndPointModel +from .TopologyModel import TopologyModel + +def update_device_in_local_database(database : Database, device : Device) -> Tuple[DeviceModel, bool]: + device_uuid = device.device_id.device_uuid.uuid + + for i,endpoint in enumerate(device.device_endpoints): + endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid + if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid + if device_uuid != endpoint_device_uuid: + raise InvalidArgumentException( + 'request.device_endpoints[{:d}].device_id.device_uuid.uuid'.format(i), endpoint_device_uuid, + ['should be == {:s}({:s})'.format('request.device_id.device_uuid.uuid', device_uuid)]) + + config_rules = grpc_config_rules_to_raw(device.device_config.config_rules) + delete_all_config_rules(database, device_uuid, 'running') + running_config_result = update_config(database, device_uuid, 'running', config_rules) + + result : Tuple[DeviceModel, bool] = update_or_create_object(database, DeviceModel, device_uuid, { + 'device_uuid' : device_uuid, + 'device_type' : device.device_type, + 'device_operational_status': grpc_to_enum__device_operational_status(device.device_operational_status), + 'device_config_fk' : running_config_result[0][0], + }) + db_device, updated = result + set_drivers(database, db_device, device.device_drivers) + + for i,endpoint in enumerate(device.device_endpoints): + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint.endpoint_id.device_id.device_uuid.uuid + if len(endpoint_device_uuid) == 0: endpoint_device_uuid = device_uuid + + str_endpoint_key = key_to_str([device_uuid, endpoint_uuid]) + endpoint_attributes = { + 'device_fk' : db_device, + 'endpoint_uuid': endpoint_uuid, + 'endpoint_type': endpoint.endpoint_type, + } + + endpoint_topology_context_uuid = endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid + endpoint_topology_uuid = endpoint.endpoint_id.topology_id.topology_uuid.uuid + if len(endpoint_topology_context_uuid) > 0 and len(endpoint_topology_uuid) > 0: + result : Tuple[ContextModel, bool] = get_or_create_object( + database, ContextModel, endpoint_topology_context_uuid, defaults={ + 'context_uuid': endpoint_topology_context_uuid, + }) + db_context, _ = result + + str_topology_key = key_to_str([endpoint_topology_context_uuid, endpoint_topology_uuid]) + result : Tuple[TopologyModel, bool] = get_or_create_object( + database, TopologyModel, str_topology_key, defaults={ + 'context_fk': db_context, + 'topology_uuid': endpoint_topology_uuid, + }) + db_topology, _ = result + + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + endpoint_attributes['topology_fk'] = db_topology + + result : Tuple[EndPointModel, bool] = update_or_create_object( + database, EndPointModel, str_endpoint_key, endpoint_attributes) + _, db_endpoint_updated = result + updated = updated or db_endpoint_updated + + return db_device, updated + +def sync_device_from_context( + device_uuid : str, context_client : ContextClient, database : Database + ) -> Tuple[DeviceModel, bool]: + + try: + device : Device = context_client.GetDevice(DeviceId(device_uuid={'uuid': device_uuid})) + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise # pylint: disable=no-member + return None + return update_device_in_local_database(database, device) diff --git a/src/service/service/database/DatabaseServiceTools.py b/src/service/service/database/DatabaseServiceTools.py new file mode 100644 index 0000000000000000000000000000000000000000..27efa17ffca50737daba28ac2d8a81438eb2a433 --- /dev/null +++ b/src/service/service/database/DatabaseServiceTools.py @@ -0,0 +1,144 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc +from typing import Tuple +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.orm.Database import Database +from common.orm.HighLevel import get_object, get_or_create_object, update_or_create_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Service, ServiceId +from common.rpc_method_wrapper.ServiceExceptions import InvalidArgumentException +from context.client.ContextClient import ContextClient +from .ConfigModel import delete_all_config_rules, grpc_config_rules_to_raw, update_config +from .ConstraintModel import delete_all_constraints, grpc_constraints_to_raw, update_constraints +from .ContextModel import ContextModel +from .EndPointModel import EndPointModel +from .RelationModels import ServiceEndPointModel +from .ServiceModel import ServiceModel, grpc_to_enum__service_status, grpc_to_enum__service_type +from .TopologyModel import TopologyModel + +def update_service_in_local_database(database : Database, service : Service) -> Tuple[ServiceModel, bool]: + service_uuid = service.service_id.service_uuid.uuid + service_context_uuid = service.service_id.context_id.context_uuid.uuid + if len(service_context_uuid) == 0: service_context_uuid = DEFAULT_CONTEXT_UUID + + topology_uuids = {} + for i,endpoint_id in enumerate(service.service_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + endpoint_topology_context_uuid = endpoint_id.topology_id.context_id.context_uuid.uuid + + if len(endpoint_device_uuid) == 0: + raise InvalidArgumentException( + 'request.service_endpoint_ids[{:d}].device_id.device_uuid.uuid'.format(i), endpoint_device_uuid, + ['not set']) + + if len(endpoint_topology_context_uuid) == 0: endpoint_topology_context_uuid = service_context_uuid + if service_context_uuid != endpoint_topology_context_uuid: + raise InvalidArgumentException( + 'request.service_endpoint_ids[{:d}].topology_id.context_id.context_uuid.uuid'.format(i), + endpoint_device_uuid, + ['should be == {:s}({:s})'.format('service_id.context_id.context_uuid.uuid', service_context_uuid)]) + + topology_uuids.setdefault(endpoint_topology_uuid, set()).add( + 'request.service_endpoint_ids[{:d}].device_id.device_uuid.uuid'.format(i)) + + if len(topology_uuids) > 1: + raise InvalidArgumentException( + 'request.service_endpoint_ids', '...', + ['Multiple different topology_uuid values specified: {:s}'.format(str(topology_uuids))]) + if len(topology_uuids) == 1: + topology_uuid = topology_uuids.popitem()[0] + else: + topology_uuid = DEFAULT_TOPOLOGY_UUID + + result : Tuple[ContextModel, bool] = get_or_create_object( + database, ContextModel, service_context_uuid, defaults={'context_uuid': service_context_uuid}) + db_context, _ = result + + str_topology_key = None + if len(topology_uuid) > 0: + str_topology_key = key_to_str([service_context_uuid, topology_uuid]) + result : Tuple[TopologyModel, bool] = get_or_create_object( + database, TopologyModel, str_topology_key, defaults={ + 'context_fk': db_context, 'topology_uuid': topology_uuid}) + #db_topology, _ = result + + str_service_key = key_to_str([service_context_uuid, service_uuid]) + + config_rules = grpc_config_rules_to_raw(service.service_config.config_rules) + delete_all_config_rules(database, str_service_key, 'running') + running_config_result = update_config(database, str_service_key, 'running', config_rules) + + constraints = grpc_constraints_to_raw(service.service_constraints) + delete_all_constraints(database, str_service_key, 'running') + running_constraints_result = update_constraints(database, str_service_key, 'running', constraints) + + result : Tuple[ContextModel, bool] = get_or_create_object( + database, ContextModel, service_context_uuid, defaults={ + 'context_uuid': service_context_uuid, + }) + db_context, _ = result + + result : Tuple[ServiceModel, bool] = update_or_create_object(database, ServiceModel, str_service_key, { + 'context_fk' : db_context, + 'service_uuid' : service_uuid, + 'service_type' : grpc_to_enum__service_type(service.service_type), + 'service_status' : grpc_to_enum__service_status(service.service_status.service_status), + 'service_constraints_fk': running_constraints_result[0][0], + 'service_config_fk' : running_config_result[0][0], + }) + db_service, updated = result + + for i,endpoint_id in enumerate(service.service_endpoint_ids): + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_device_uuid = endpoint_id.device_id.device_uuid.uuid + + str_endpoint_key = key_to_str([endpoint_device_uuid, endpoint_uuid]) + if str_topology_key is not None: + str_endpoint_key = key_to_str([str_endpoint_key, str_topology_key], separator=':') + db_endpoint : EndPointModel = get_object(database, EndPointModel, str_endpoint_key) + + str_service_endpoint_key = key_to_str([str_service_key, str_endpoint_key], separator='--') + result : Tuple[ServiceEndPointModel, bool] = get_or_create_object( + database, ServiceEndPointModel, str_service_endpoint_key, { + 'service_fk': db_service, 'endpoint_fk': db_endpoint}) + _, service_endpoint_created = result + updated = updated or service_endpoint_created + + return db_service, updated + +def sync_service_from_context( + context_uuid : str, service_uuid : str, context_client : ContextClient, database : Database + ) -> Tuple[ServiceModel, bool]: + + try: + service : Service = context_client.GetService(ServiceId( + context_id={'context_uuid': {'uuid': context_uuid}}, + service_uuid={'uuid': service_uuid})) + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise # pylint: disable=no-member + return None + return update_service_in_local_database(database, service) + +def sync_service_to_context(db_service : ServiceModel, context_client : ContextClient) -> None: + if db_service is None: return + context_client.SetService(Service(**db_service.dump( + include_endpoint_ids=True, include_constraints=True, include_config_rules=True))) + +def delete_service_from_context(db_service : ServiceModel, context_client : ContextClient) -> None: + if db_service is None: return + context_client.RemoveService(ServiceId(**db_service.dump_id())) diff --git a/src/service/service/database/DeviceModel.py b/src/service/service/database/DeviceModel.py new file mode 100644 index 0000000000000000000000000000000000000000..0f0201190542397a34b68fa217706c904606ead3 --- /dev/null +++ b/src/service/service/database/DeviceModel.py @@ -0,0 +1,101 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, logging +from enum import Enum +from typing import Dict, List +from common.orm.Database import Database +from common.orm.backend.Tools import key_to_str +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from .ConfigModel import ConfigModel +from .Tools import grpc_to_enum + +LOGGER = logging.getLogger(__name__) + +class ORM_DeviceDriverEnum(Enum): + UNDEFINED = DeviceDriverEnum.DEVICEDRIVER_UNDEFINED + OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG + TRANSPORT_API = DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API + P4 = DeviceDriverEnum.DEVICEDRIVER_P4 + IETF_NETWORK_TOPOLOGY = DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY + ONF_TR_352 = DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352 + +grpc_to_enum__device_driver = functools.partial( + grpc_to_enum, DeviceDriverEnum, ORM_DeviceDriverEnum) + +class ORM_DeviceOperationalStatusEnum(Enum): + UNDEFINED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED + DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + ENABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + +grpc_to_enum__device_operational_status = functools.partial( + grpc_to_enum, DeviceOperationalStatusEnum, ORM_DeviceOperationalStatusEnum) + +class DeviceModel(Model): + pk = PrimaryKeyField() + device_uuid = StringField(required=True, allow_empty=False) + device_type = StringField() + device_config_fk = ForeignKeyField(ConfigModel) + device_operational_status = EnumeratedField(ORM_DeviceOperationalStatusEnum, required=True) + + def dump_id(self) -> Dict: + return {'device_uuid': {'uuid': self.device_uuid}} + + def dump_config(self) -> Dict: + return ConfigModel(self.database, self.device_config_fk).dump() + + def dump_drivers(self) -> List[int]: + db_driver_pks = self.references(DriverModel) + return [DriverModel(self.database, pk).dump() for pk,_ in db_driver_pks] + + def dump_endpoints(self) -> List[Dict]: + from .EndPointModel import EndPointModel # pylint: disable=import-outside-toplevel + db_endpoints_pks = self.references(EndPointModel) + return [EndPointModel(self.database, pk).dump() for pk,_ in db_endpoints_pks] + + def dump( # pylint: disable=arguments-differ + self, include_config_rules=True, include_drivers=True, include_endpoints=True + ) -> Dict: + result = { + 'device_id': self.dump_id(), + 'device_type': self.device_type, + 'device_operational_status': self.device_operational_status.value, + } + if include_config_rules: result.setdefault('device_config', {})['config_rules'] = self.dump_config() + if include_drivers: result['device_drivers'] = self.dump_drivers() + if include_endpoints: result['device_endpoints'] = self.dump_endpoints() + return result + +class DriverModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + device_fk = ForeignKeyField(DeviceModel) + driver = EnumeratedField(ORM_DeviceDriverEnum, required=True) + + def dump(self) -> Dict: + return self.driver.value + +def set_drivers(database : Database, db_device : DeviceModel, grpc_device_drivers): + db_device_pk = db_device.pk + for driver in grpc_device_drivers: + orm_driver = grpc_to_enum__device_driver(driver) + str_device_driver_key = key_to_str([db_device_pk, orm_driver.name]) + db_device_driver = DriverModel(database, str_device_driver_key) + db_device_driver.device_fk = db_device + db_device_driver.driver = orm_driver + db_device_driver.save() diff --git a/src/service/service/database/EndPointModel.py b/src/service/service/database/EndPointModel.py new file mode 100644 index 0000000000000000000000000000000000000000..e043e1c0e5c91f98fb23a53b9a1367f0f64a1ba1 --- /dev/null +++ b/src/service/service/database/EndPointModel.py @@ -0,0 +1,57 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from typing import Dict, List, Optional, Tuple +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.proto.context_pb2 import EndPointId +from .DeviceModel import DeviceModel +from .TopologyModel import TopologyModel + +LOGGER = logging.getLogger(__name__) + +class EndPointModel(Model): + pk = PrimaryKeyField() + topology_fk = ForeignKeyField(TopologyModel, required=False) + device_fk = ForeignKeyField(DeviceModel) + endpoint_uuid = StringField(required=True, allow_empty=False) + endpoint_type = StringField() + + def dump_id(self) -> Dict: + device_id = DeviceModel(self.database, self.device_fk).dump_id() + result = { + 'device_id': device_id, + 'endpoint_uuid': {'uuid': self.endpoint_uuid}, + } + if self.topology_fk is not None: + result['topology_id'] = TopologyModel(self.database, self.topology_fk).dump_id() + return result + + def dump(self) -> Dict: + return { + 'endpoint_id': self.dump_id(), + 'endpoint_type': self.endpoint_type, + } + +def grpc_endpointids_to_raw(grpc_endpointids : List[EndPointId]) -> List[Tuple[str, str, Optional[str]]]: + def translate(grpc_endpointid : EndPointId) -> Tuple[str, str, Optional[str]]: + device_uuid = grpc_endpointid.device_id.device_uuid.uuid + endpoint_uuid = grpc_endpointid.endpoint_uuid.uuid + topology_uuid = grpc_endpointid.topology_id.topology_uuid.uuid + if len(topology_uuid) == 0: topology_uuid = None + return device_uuid, endpoint_uuid, topology_uuid + return [translate(grpc_endpointid) for grpc_endpointid in grpc_endpointids] diff --git a/src/service/service/database/LinkModel.py b/src/service/service/database/LinkModel.py new file mode 100644 index 0000000000000000000000000000000000000000..742044b9758df297413ad2d0318520c825e8b738 --- /dev/null +++ b/src/service/service/database/LinkModel.py @@ -0,0 +1,40 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, operator +from typing import Dict, List +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_related_objects + +LOGGER = logging.getLogger(__name__) + +class LinkModel(Model): + pk = PrimaryKeyField() + link_uuid = StringField(required=True, allow_empty=False) + + def dump_id(self) -> Dict: + return {'link_uuid': {'uuid': self.link_uuid}} + + def dump_endpoint_ids(self) -> List[Dict]: + from .RelationModels import LinkEndPointModel # pylint: disable=import-outside-toplevel + db_endpoints = get_related_objects(self, LinkEndPointModel, 'endpoint_fk') + return [db_endpoint.dump_id() for db_endpoint in sorted(db_endpoints, key=operator.attrgetter('pk'))] + + def dump(self) -> Dict: + return { + 'link_id': self.dump_id(), + 'link_endpoint_ids': self.dump_endpoint_ids(), + } diff --git a/src/service/service/database/RelationModels.py b/src/service/service/database/RelationModels.py new file mode 100644 index 0000000000000000000000000000000000000000..ce596893f756c66a84cb6e516871f2cb3d5d181b --- /dev/null +++ b/src/service/service/database/RelationModels.py @@ -0,0 +1,45 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.model.Model import Model +from .DeviceModel import DeviceModel +from .EndPointModel import EndPointModel +from .LinkModel import LinkModel +from .ServiceModel import ServiceModel +from .TopologyModel import TopologyModel + +LOGGER = logging.getLogger(__name__) + +class LinkEndPointModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + link_fk = ForeignKeyField(LinkModel) + endpoint_fk = ForeignKeyField(EndPointModel) + +class ServiceEndPointModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + service_fk = ForeignKeyField(ServiceModel) + endpoint_fk = ForeignKeyField(EndPointModel) + +class TopologyDeviceModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + topology_fk = ForeignKeyField(TopologyModel) + device_fk = ForeignKeyField(DeviceModel) + +class TopologyLinkModel(Model): # pylint: disable=abstract-method + pk = PrimaryKeyField() + topology_fk = ForeignKeyField(TopologyModel) + link_fk = ForeignKeyField(LinkModel) diff --git a/src/service/service/database/ServiceModel.py b/src/service/service/database/ServiceModel.py new file mode 100644 index 0000000000000000000000000000000000000000..cf756af60a8178a9ae2fda2a5fa5ddeebc73912c --- /dev/null +++ b/src/service/service/database/ServiceModel.py @@ -0,0 +1,88 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, logging, operator +from enum import Enum +from typing import Dict, List +from common.orm.fields.EnumeratedField import EnumeratedField +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_related_objects +from common.proto.context_pb2 import ServiceStatusEnum, ServiceTypeEnum +from .ConfigModel import ConfigModel +from .ConstraintModel import ConstraintsModel +from .ContextModel import ContextModel +from .Tools import grpc_to_enum + +LOGGER = logging.getLogger(__name__) + +class ORM_ServiceTypeEnum(Enum): + UNKNOWN = ServiceTypeEnum.SERVICETYPE_UNKNOWN + L3NM = ServiceTypeEnum.SERVICETYPE_L3NM + L2NM = ServiceTypeEnum.SERVICETYPE_L2NM + TAPI_CONNECTIVITY_SERVICE = ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE + +grpc_to_enum__service_type = functools.partial( + grpc_to_enum, ServiceTypeEnum, ORM_ServiceTypeEnum) + +class ORM_ServiceStatusEnum(Enum): + UNDEFINED = ServiceStatusEnum.SERVICESTATUS_UNDEFINED + PLANNED = ServiceStatusEnum.SERVICESTATUS_PLANNED + ACTIVE = ServiceStatusEnum.SERVICESTATUS_ACTIVE + PENDING_REMOVAL = ServiceStatusEnum.SERVICESTATUS_PENDING_REMOVAL + +grpc_to_enum__service_status = functools.partial( + grpc_to_enum, ServiceStatusEnum, ORM_ServiceStatusEnum) + +class ServiceModel(Model): + pk = PrimaryKeyField() + context_fk = ForeignKeyField(ContextModel) + service_uuid = StringField(required=True, allow_empty=False) + service_type = EnumeratedField(ORM_ServiceTypeEnum, required=True) + service_constraints_fk = ForeignKeyField(ConstraintsModel) + service_status = EnumeratedField(ORM_ServiceStatusEnum, required=True) + service_config_fk = ForeignKeyField(ConfigModel) + + def dump_id(self) -> Dict: + context_id = ContextModel(self.database, self.context_fk).dump_id() + return { + 'context_id': context_id, + 'service_uuid': {'uuid': self.service_uuid}, + } + + def dump_endpoint_ids(self) -> List[Dict]: + from .RelationModels import ServiceEndPointModel # pylint: disable=import-outside-toplevel + db_endpoints = get_related_objects(self, ServiceEndPointModel, 'endpoint_fk') + return [db_endpoint.dump_id() for db_endpoint in sorted(db_endpoints, key=operator.attrgetter('pk'))] + + def dump_constraints(self) -> List[Dict]: + return ConstraintsModel(self.database, self.service_constraints_fk).dump() + + def dump_config(self) -> Dict: + return ConfigModel(self.database, self.service_config_fk).dump() + + def dump( # pylint: disable=arguments-differ + self, include_endpoint_ids=True, include_constraints=True, include_config_rules=True + ) -> Dict: + result = { + 'service_id': self.dump_id(), + 'service_type': self.service_type.value, + 'service_status': {'service_status': self.service_status.value}, + } + if include_endpoint_ids: result['service_endpoint_ids'] = self.dump_endpoint_ids() + if include_constraints: result['service_constraints'] = self.dump_constraints() + if include_config_rules: result.setdefault('service_config', {})['config_rules'] = self.dump_config() + return result diff --git a/src/service/service/database/Tools.py b/src/service/service/database/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..43bb71bd90582644c67d3ca528611eae937b6460 --- /dev/null +++ b/src/service/service/database/Tools.py @@ -0,0 +1,72 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import hashlib, re +from enum import Enum +from typing import Dict, List, Tuple, Union + +# Convenient helper function to remove dictionary items in dict/list/set comprehensions. + +def remove_dict_key(dictionary : Dict, key : str): + dictionary.pop(key, None) + return dictionary + +# Enumeration classes are redundant with gRPC classes, but gRPC does not provide a programmatical method to retrieve +# the values it expects from strings containing the desired value symbol or its integer value, so a kind of mapping is +# required. Besides, ORM Models expect Enum classes in EnumeratedFields; we create specific and conveniently defined +# Enum classes to serve both purposes. + +def grpc_to_enum(grpc_enum_class, orm_enum_class : Enum, grpc_enum_value): + grpc_enum_name = grpc_enum_class.Name(grpc_enum_value) + grpc_enum_prefix = orm_enum_class.__name__.upper() + grpc_enum_prefix = re.sub(r'^ORM_(.+)$', r'\1', grpc_enum_prefix) + grpc_enum_prefix = re.sub(r'^(.+)ENUM$', r'\1', grpc_enum_prefix) + grpc_enum_prefix = grpc_enum_prefix + '_' + orm_enum_name = grpc_enum_name.replace(grpc_enum_prefix, '') + orm_enum_value = orm_enum_class._member_map_.get(orm_enum_name) # pylint: disable=protected-access + return orm_enum_value + +# For some models, it is convenient to produce a string hash for fast comparisons of existence or modification. Method +# fast_hasher computes configurable length (between 1 and 64 byte) hashes and retrieves them in hex representation. + +FASTHASHER_ITEM_ACCEPTED_FORMAT = 'Union[bytes, str]' +FASTHASHER_DATA_ACCEPTED_FORMAT = 'Union[{fmt:s}, List[{fmt:s}], Tuple[{fmt:s}]]'.format( + fmt=FASTHASHER_ITEM_ACCEPTED_FORMAT) + +def fast_hasher(data : Union[bytes, str, List[Union[bytes, str]], Tuple[Union[bytes, str]]], digest_size : int = 8): + hasher = hashlib.blake2b(digest_size=digest_size) + # Do not accept sets, dicts, or other unordered dats tructures since their order is arbitrary thus producing + # different hashes depending on the order. Consider adding support for sets or dicts with previous sorting of + # items by their key. + + if isinstance(data, bytes): + data = [data] + elif isinstance(data, str): + data = [data.encode('UTF-8')] + elif isinstance(data, (list, tuple)): + pass + else: + msg = 'data({:s}) must be {:s}, found {:s}' + raise TypeError(msg.format(str(data), FASTHASHER_DATA_ACCEPTED_FORMAT, str(type(data)))) + + for i,item in enumerate(data): + if isinstance(item, str): + item = item.encode('UTF-8') + elif isinstance(item, bytes): + pass + else: + msg = 'data[{:d}]({:s}) must be {:s}, found {:s}' + raise TypeError(msg.format(i, str(item), FASTHASHER_ITEM_ACCEPTED_FORMAT, str(type(item)))) + hasher.update(item) + return hasher.hexdigest() diff --git a/src/service/service/database/TopologyModel.py b/src/service/service/database/TopologyModel.py new file mode 100644 index 0000000000000000000000000000000000000000..5909c7a2c63d05f2cbde7f0d8555e63587e96682 --- /dev/null +++ b/src/service/service/database/TopologyModel.py @@ -0,0 +1,54 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, operator +from typing import Dict, List +from common.orm.fields.ForeignKeyField import ForeignKeyField +from common.orm.fields.PrimaryKeyField import PrimaryKeyField +from common.orm.fields.StringField import StringField +from common.orm.model.Model import Model +from common.orm.HighLevel import get_related_objects +from .ContextModel import ContextModel + +LOGGER = logging.getLogger(__name__) + +class TopologyModel(Model): + pk = PrimaryKeyField() + context_fk = ForeignKeyField(ContextModel) + topology_uuid = StringField(required=True, allow_empty=False) + + def dump_id(self) -> Dict: + context_id = ContextModel(self.database, self.context_fk).dump_id() + return { + 'context_id': context_id, + 'topology_uuid': {'uuid': self.topology_uuid}, + } + + def dump_device_ids(self) -> List[Dict]: + from .RelationModels import TopologyDeviceModel # pylint: disable=import-outside-toplevel + db_devices = get_related_objects(self, TopologyDeviceModel, 'device_fk') + return [db_device.dump_id() for db_device in sorted(db_devices, key=operator.attrgetter('pk'))] + + def dump_link_ids(self) -> List[Dict]: + from .RelationModels import TopologyLinkModel # pylint: disable=import-outside-toplevel + db_links = get_related_objects(self, TopologyLinkModel, 'link_fk') + return [db_link.dump_id() for db_link in sorted(db_links, key=operator.attrgetter('pk'))] + + def dump( # pylint: disable=arguments-differ + self, include_devices=True, include_links=True + ) -> Dict: + result = {'topology_id': self.dump_id()} + if include_devices: result['device_ids'] = self.dump_device_ids() + if include_links: result['link_ids'] = self.dump_link_ids() + return result diff --git a/src/service/service/database/__init__.py b/src/service/service/database/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..926623031b92b7dc7ad545b5f5da369b7ab79856 --- /dev/null +++ b/src/service/service/database/__init__.py @@ -0,0 +1,16 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# In-Memory database with a simplified representation of Context Database focused on the Service model. +# Used as an internal data cache, for message validation, and message formatting purposes. diff --git a/src/service/service/path_computation_element/Enums.py b/src/service/service/path_computation_element/Enums.py new file mode 100644 index 0000000000000000000000000000000000000000..f55d545b54abf1749e1757200b509562dd4d0455 --- /dev/null +++ b/src/service/service/path_computation_element/Enums.py @@ -0,0 +1,37 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from enum import Enum + +class NodeTypeEnum(Enum): + DEVICE = 'device' + ENDPOINT = 'endpoint' + +class EndPointTypeEnum(Enum): + COPPER = 'copper' + OPTICAL = 'optical' + MICROWAVE = 'microwave' + +class EdgeTypeEnum(Enum): + INTERNAL = 'internal' + COPPER = 'copper' + OPTICAL = 'optical' + MICROWAVE = 'microwave' + VIRTUAL = 'virtual' + OTHER = 'other' + +class LayerTypeEnum(Enum): + COPPER = 'copper' + OPTICAL = 'optical' + MICROWAVE = 'microwave' diff --git a/src/service/service/path_computation_element/PathComputationElement.py b/src/service/service/path_computation_element/PathComputationElement.py new file mode 100644 index 0000000000000000000000000000000000000000..41a4c5d57722cb59ab3d3e505f9f79e68952ad5d --- /dev/null +++ b/src/service/service/path_computation_element/PathComputationElement.py @@ -0,0 +1,373 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, json, logging, networkx, uuid +from queue import Queue +from typing import Dict, List, Tuple +from networkx.drawing.nx_pydot import write_dot +from common.Constants import DEFAULT_CONTEXT_UUID +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ( + ConfigActionEnum, Connection, Device, Empty, EndPoint, EndPointId, Service, ServiceId, ServiceStatusEnum, + ServiceTypeEnum) +from common.tools.grpc.Tools import ( + grpc_message_list_to_json, grpc_message_list_to_json_string, grpc_message_to_json, grpc_message_to_json_string) +from context.client.ContextClient import ContextClient +from .Enums import EdgeTypeEnum, NodeTypeEnum +from .Tools import get_device, get_device_key, get_edge_type, get_endpoint, get_endpoint_key, get_link_key + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.INFO) + +SUB_SERVICE_TYPES = { + DeviceTypeEnum.EMULATED_PACKET_ROUTER.value : ServiceTypeEnum.SERVICETYPE_L3NM, + DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value: ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, + DeviceTypeEnum.PACKET_ROUTER.value : ServiceTypeEnum.SERVICETYPE_L3NM, + DeviceTypeEnum.OPTICAL_LINE_SYSTEM.value : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, +} +DEFAULT_SUB_SERVICE_TYPE = ServiceTypeEnum.SERVICETYPE_UNKNOWN + +def dump_requirements(requirements): + if requirements is None: return None + return [ + { + 'sub_service': grpc_message_to_json(sub_service), + 'sub_connections': grpc_message_list_to_json(sub_connections), + } + for sub_service,sub_connections in requirements + ] + +def dump_connectivity(connectivity): + if connectivity is None: return None + return { + 'service': grpc_message_to_json(connectivity.get('service')), + 'connections': grpc_message_list_to_json(connectivity.get('connections', [])), + 'requirements': dump_requirements(connectivity.get('requirements', [])), + } + +def dump_hops(hops): + if hops is None: return None + return [ + 'in_endpoint={:s}, device={:s}, out_endpoint={:s}'.format( + grpc_message_to_json_string(in_endpoint), grpc_message_to_json_string(device), + grpc_message_to_json_string(out_endpoint)) + for in_endpoint,device,out_endpoint in hops + ] + +class PathComputationElement: + def __init__(self) -> None: + self.__topology = networkx.Graph() + self.__connectivity = {} # (a_ep_key, z_ep_key) => {service, connection, sub_services: [], sub_connections: []} + self.__service_endpoints = {} # (context_uuid, service_uuid) => (a_ep_key, z_ep_key) + + def dump_topology_to_file(self, dot_filepath : str): + write_dot(self.__topology, dot_filepath) + + def dump_connectivity_to_file(self, filepath : str): + with open(filepath, 'w', encoding='UTF-8') as f: + f.write(str(self.__connectivity)) # do not use json; it contains protobuf objects + + def load_topology(self, context_client : ContextClient): + response_devices = context_client.ListDevices(Empty()) + devices = response_devices.devices + LOGGER.debug('Devices[{:d}] = {:s}'.format(len(devices), grpc_message_to_json_string(response_devices))) + assert len(devices) > 0 + + response_links = context_client.ListLinks(Empty()) + links = response_links.links + LOGGER.debug('Links[{:d}] = {:s}'.format(len(links), grpc_message_to_json_string(response_links))) + assert len(links) > 0 + + for device in response_devices.devices: + device_uuid = get_device_key(device.device_id) + self.__topology.add_node(device_uuid, node_type=NodeTypeEnum.DEVICE, device=device) + for endpoint in device.device_endpoints: + endpoint_key = get_endpoint_key(endpoint.endpoint_id, device_uuid=device_uuid) + self.__topology.add_node(endpoint_key, node_type=NodeTypeEnum.ENDPOINT, endpoint=endpoint) + self.__topology.add_edge(device_uuid, endpoint_key, edge_type=EdgeTypeEnum.INTERNAL) + + for link in response_links.links: + link_uuid = get_link_key(link.link_id) + if len(link.link_endpoint_ids) != 2: + msg = 'Link({:s}) with {:d} != 2 endpoints' + raise NotImplementedError(msg.format(link_uuid, len(link.link_endpoint_ids))) + endpoint_keys = [get_endpoint_key(endpoint_id) for endpoint_id in link.link_endpoint_ids] + edge_type = get_edge_type(self.__topology, endpoint_keys) + self.__topology.add_edge(endpoint_keys[0], endpoint_keys[1], link=link, edge_type=edge_type) + + def load_connectivity(self, context_client : ContextClient, service_id : ServiceId): + pending_service_ids = Queue() + pending_service_ids.put((service_id, True)) + + connectivity = {} + requirements : List[Tuple[Service, List[Connection]]] = connectivity.setdefault('requirements', []) + connections : List[Connection] = connectivity.setdefault('connections', []) + + while not pending_service_ids.empty(): + service_id,is_main = pending_service_ids.get() + + try: + service = context_client.GetService(service_id) + LOGGER.debug('[load_connectivity] GetService({:s}) = {:s}'.format( + grpc_message_to_json_string(service_id), grpc_message_to_json_string(service))) + except grpc.RpcError as e: + if is_main and e.code() == grpc.StatusCode.NOT_FOUND: continue # pylint: disable=no-member + raise + + # TODO: implement support for services with more than 2 endpoints; + # Right now, services with less than 2 endpoints are ignored; with more than 2 endpoints throws exception. + # e.g., compute pairs such as: + # list(filter(lambda ep: ep[0] < ep[1], itertools.product(service_endpoint_ids, service_endpoint_ids))) + service_endpoint_ids = service.service_endpoint_ids + if len(service_endpoint_ids) < 2: continue + if len(service_endpoint_ids) > 2: raise NotImplementedError('Service with more than 2 endpoints') + + service_connections = context_client.ListConnections(service_id) + LOGGER.debug('[load_connectivity] ListConnections({:s}) = {:s}'.format( + grpc_message_to_json_string(service_id), grpc_message_to_json_string(service_connections))) + + if is_main: + connectivity['service'] = service + a_endpoint_key = get_endpoint_key(service_endpoint_ids[0]) + z_endpoint_key = get_endpoint_key(service_endpoint_ids[-1]) + self.__connectivity[(a_endpoint_key, z_endpoint_key)] = connectivity + self.__connectivity[(z_endpoint_key, a_endpoint_key)] = connectivity + context_service_id = (service_id.context_id.context_uuid.uuid, service_id.service_uuid.uuid) + self.__service_endpoints[context_service_id] = (a_endpoint_key, z_endpoint_key) + connections.extend(service_connections.connections) + else: + requirements.append((service, service_connections.connections)) + + for connection in service_connections.connections: + for service_id in connection.sub_service_ids: + pending_service_ids.put((service_id, False)) + + def get_connectivity_from_service_id(self, service_id : ServiceId) -> Dict: + LOGGER.debug('[get_connectivity_from_service_id] service_id={:s}'.format( + grpc_message_to_json_string(service_id))) + + context_uuid = service_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid + context_service_id = (context_uuid, service_uuid) + if context_service_id in self.__service_endpoints: + a_endpoint_key, z_endpoint_key = self.__service_endpoints[context_service_id] + else: + return None + + if (a_endpoint_key, z_endpoint_key) in self.__connectivity: + connectivity = self.__connectivity.get((a_endpoint_key, z_endpoint_key)) + elif (z_endpoint_key, a_endpoint_key) in self.__connectivity: + connectivity = self.__connectivity.get((z_endpoint_key, a_endpoint_key)) + else: + connectivity = None + + if connectivity is None or connectivity.get('connections') is None: return None + LOGGER.debug('[get_connectivity_from_service_id] Connectivity: {:s}'.format( + str(dump_connectivity(connectivity)))) + return connectivity + + def get_connectivity(self, service : Service) -> Tuple[Dict, str, str]: + LOGGER.debug('[get_connectivity] service.service_id = {:s}'.format( + grpc_message_to_json_string(service.service_id))) + + context_uuid = service.service_id.context_id.context_uuid.uuid + service_uuid = service.service_id.service_uuid.uuid + context_service_id = (context_uuid, service_uuid) + + if context_service_id in self.__service_endpoints: + LOGGER.debug('[get_connectivity] exists') + a_endpoint_key, z_endpoint_key = self.__service_endpoints[context_service_id] + + LOGGER.debug('[get_connectivity] a_endpoint_key={:s}'.format(str(a_endpoint_key))) + LOGGER.debug('[get_connectivity] z_endpoint_key={:s}'.format(str(z_endpoint_key))) + else: + LOGGER.debug('[get_connectivity] new') + # TODO: implement support for services with more than 2 endpoints; + # Right now, less than 2 reports None, more than 2 endpoints throws an exception. + # e.g., compute pairs such as: + # list(filter(lambda ep: ep[0] < ep[1], itertools.product(service_endpoint_ids, service_endpoint_ids))) + service_endpoint_ids = service.service_endpoint_ids + + LOGGER.debug('[get_connectivity] service_endpoint_ids[{:d}] = {:s}'.format( + len(service_endpoint_ids), grpc_message_list_to_json_string(service_endpoint_ids))) + + if len(service_endpoint_ids) < 2: return None + if len(service_endpoint_ids) > 2: raise NotImplementedError('Service with more than 2 endpoints') + + a_endpoint_key = get_endpoint_key(service_endpoint_ids[0]) + z_endpoint_key = get_endpoint_key(service_endpoint_ids[-1]) + LOGGER.debug('[get_connectivity] a_endpoint_key={:s}'.format(str(a_endpoint_key))) + LOGGER.debug('[get_connectivity] z_endpoint_key={:s}'.format(str(z_endpoint_key))) + + if (a_endpoint_key, z_endpoint_key) in self.__connectivity: + connectivity = self.__connectivity.get((a_endpoint_key, z_endpoint_key)) + elif (z_endpoint_key, a_endpoint_key) in self.__connectivity: + connectivity = self.__connectivity.get((z_endpoint_key, a_endpoint_key)) + else: + connectivity = None + + LOGGER.debug('[get_connectivity] connectivity = {:s}'.format(str(dump_connectivity(connectivity)))) + + if connectivity is None or connectivity.get('connections') is None: return None, a_endpoint_key, z_endpoint_key + return connectivity, a_endpoint_key, z_endpoint_key + + def route_service(self, service : Service): + if self.__topology is None: raise Exception('Topology has not been loaded') + + connectivity = self.get_connectivity(service) + if connectivity is None: + LOGGER.debug('[route_service] connectivity = None') + return None + _, a_endpoint_key, z_endpoint_key = connectivity + + LOGGER.debug('[route_service] a_endpoint_key={:s}'.format(str(a_endpoint_key))) + LOGGER.debug('[route_service] z_endpoint_key={:s}'.format(str(z_endpoint_key))) + + # TODO: consider implementing something like a K-shortest path instead of a simple shortest path + # pylint: disable=no-value-for-parameter,unexpected-keyword-arg + #paths = networkx.all_shortest_paths(self.__topology, source=a_endpoint_key, target=z_endpoint_key) + path_node_keys = networkx.shortest_path( + self.__topology, source=a_endpoint_key, target=z_endpoint_key) + LOGGER.debug('[route_service] Path[{:d}] = {:s}'.format(len(path_node_keys), str(path_node_keys))) + + if len(path_node_keys) % 3 != 0: + msg = 'Weird path: length({:d}) mod 3 != 0. Path should be a sequence of endpoint-device-endpoint, '\ + ' so it must be multiple of 3' + raise Exception(msg.format(len(path_node_keys))) + + hops : List[Tuple[EndPoint, Device, EndPoint]] = [] + device_type__to__hops : Dict[str, List[int]] = {} + for i in range(0, len(path_node_keys), 3): + hop_device = get_device(self.__topology, path_node_keys[i+1]) + hop_a_endpoint = get_endpoint(self.__topology, path_node_keys[i+0]) + hop_z_endpoint = get_endpoint(self.__topology, path_node_keys[i+2]) + + hop_device_key = get_device_key(hop_device.device_id) + hop_a_endpoint_device_key = get_device_key(hop_a_endpoint.endpoint_id.device_id) + hop_z_endpoint_device_key = get_device_key(hop_z_endpoint.endpoint_id.device_id) + + if hop_a_endpoint_device_key != hop_device_key: + msg = 'Weird path: Hop[{:d}] a_endpoint.device({:s}) != device({:s})' + raise Exception(msg.format(i/3, str(hop_a_endpoint_device_key), str(hop_device_key))) + if hop_z_endpoint_device_key != hop_device_key: + msg = 'Weird path: Hop[{:d}] z_endpoint.device({:s}) != device({:s})' + raise Exception(msg.format(i/3, str(hop_z_endpoint_device_key), str(hop_device_key))) + + hops.append((hop_a_endpoint, hop_device, hop_z_endpoint)) + device_type__to__hops.setdefault(hop_device.device_type, []).append(len(hops) - 1) + + LOGGER.debug('[route_service] hops[{:d}] = {:s}'.format( + len(hops), str(dump_hops(hops)))) + LOGGER.debug('[route_service] device_type__to__hops = {:s}'.format(str(device_type__to__hops))) + + context_uuid = service.service_id.context_id.context_uuid.uuid + service_uuid = service.service_id.service_uuid.uuid + + # create main service's connection + main_service_device_type = hops[0][1].device_type + main_service_hop_indexes = device_type__to__hops.pop(main_service_device_type) + + # create sub-service and sub-services' connections + sub_service_ids = [] + requirements : List[Tuple[Service, List[Connection]]] = [] + for sub_service_device_type, sub_service_hop_indexes in device_type__to__hops.items(): + LOGGER.debug('[route_service] sub_service_device_type = {:s}'.format(str(sub_service_device_type))) + LOGGER.debug('[route_service] sub_service_hop_indexes = {:s}'.format(str(sub_service_hop_indexes))) + + # create sub-service + sub_service_uuid = '{:s}:optical'.format(service_uuid) + sub_service_id = { + 'context_id': {'context_uuid': {'uuid': context_uuid}}, + 'service_uuid': {'uuid': sub_service_uuid}, + } + sub_service = Service(**{ + 'service_id': sub_service_id, + 'service_type' : SUB_SERVICE_TYPES.get(sub_service_device_type, DEFAULT_SUB_SERVICE_TYPE), + 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_PLANNED}, + 'service_endpoint_ids': [ + hops[sub_service_hop_indexes[ 0]][ 0].endpoint_id, + hops[sub_service_hop_indexes[-1]][-1].endpoint_id, + ], + 'service_config': {'config_rules': [ + { + 'action': ConfigActionEnum.CONFIGACTION_SET, + 'custom': { + 'resource_key': 'settings', + 'resource_value': json.dumps({ + 'capacity_value': 1, + 'capacity_unit': 'GHz', + 'layer_proto_name': 'PHOTONIC_MEDIA', + 'layer_proto_qual': 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC', + 'direction': 'UNIDIRECTIONAL', + }, sort_keys=True), + } + } + ]}, + }) + LOGGER.debug('[route_service] sub_service = {:s}'.format(grpc_message_to_json_string(sub_service))) + + # create sub-service's connection + sub_connection_uuid = '{:s}:{:s}'.format(sub_service_uuid, sub_service_device_type) + sub_conn_path_hops = [] + for i in sub_service_hop_indexes: + sub_conn_path_hops.extend([hops[i][0].endpoint_id, hops[i][2].endpoint_id]) + sub_connection = Connection(**{ + 'connection_id': {'connection_uuid': {'uuid': sub_connection_uuid}}, + 'service_id': sub_service_id, + 'path_hops_endpoint_ids': sub_conn_path_hops, + }) + + LOGGER.debug('[route_service] sub_connection = {:s}'.format(grpc_message_to_json_string(sub_connection))) + + sub_service_ids.append(sub_service_id) + requirements.append((sub_service, [sub_connection])) + + LOGGER.debug('[route_service] sub_service_ids = {:s}'.format(str(sub_service_ids))) + LOGGER.debug('[route_service] requirements = {:s}'.format(str(dump_requirements(requirements)))) + LOGGER.debug('[route_service] requirements[{:d}] = {:s}'.format( + len(requirements), str(dump_requirements(requirements)))) + + connections : List[Connection] = [] + + connection_uuid = '{:s}:{:s}'.format(service_uuid, main_service_device_type) + connection_path_hops : List[EndPointId] = [] + for i in main_service_hop_indexes: + connection_path_hops.extend([hops[i][0].endpoint_id, hops[i][2].endpoint_id]) + connection = Connection(**{ + 'connection_id': {'connection_uuid': {'uuid': connection_uuid}}, + 'service_id': grpc_message_to_json(service.service_id), + 'path_hops_endpoint_ids': connection_path_hops, + 'sub_service_ids': sub_service_ids, + }) + LOGGER.debug('[route_service] connection = {:s}'.format(grpc_message_to_json_string(connection))) + connections.append(connection) + + LOGGER.debug('[route_service] connections[{:d}] = {:s}'.format( + len(connections), grpc_message_list_to_json_string(connections))) + + connectivity = { + 'service': service, + 'connections': connections, + 'requirements': requirements, + } + + LOGGER.debug('[route_service] connectivity = {:s}'.format(str(dump_connectivity(connectivity)))) + + self.__connectivity[(a_endpoint_key, z_endpoint_key)] = connectivity + self.__connectivity[(z_endpoint_key, a_endpoint_key)] = connectivity + + context_service_id = (context_uuid, service_uuid) + self.__service_endpoints[context_service_id] = (a_endpoint_key, z_endpoint_key) + + return connectivity diff --git a/src/service/service/path_computation_element/Tools.py b/src/service/service/path_computation_element/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..d8ebdd36dcd5511bd1031a31cafa047d9e04fccf --- /dev/null +++ b/src/service/service/path_computation_element/Tools.py @@ -0,0 +1,43 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import networkx +from typing import List, Optional +from common.proto.context_pb2 import Device, DeviceId, EndPoint, EndPointId, LinkId +from .Enums import EdgeTypeEnum + +def get_device_key(device_id : DeviceId) -> str: + return device_id.device_uuid.uuid # pylint: disable=no-member + +def get_endpoint_key(endpoint_id : EndPointId, device_uuid : Optional[str] = None) -> str: + if device_uuid is None: device_uuid = endpoint_id.device_id.device_uuid.uuid # pylint: disable=no-member + endpoint_uuid = endpoint_id.endpoint_uuid.uuid # pylint: disable=no-member + return '{:s}/{:s}'.format(device_uuid, endpoint_uuid) + +def get_link_key(link_id : LinkId) -> str: + return link_id.link_uuid.uuid # pylint: disable=no-member + +def get_device(topology : networkx.Graph, device_key : str) -> Device: + return topology.nodes[device_key]['device'] + +def get_endpoint(topology : networkx.Graph, endpoint_key : str) -> EndPoint: + return topology.nodes[endpoint_key]['endpoint'] + +def get_edge_type(topology : networkx.Graph, endpoint_keys : List[str]) -> EdgeTypeEnum: + # pylint: disable=no-member,protected-access + endpoint_types = {get_endpoint(topology, endpoint_key).endpoint_type for endpoint_key in endpoint_keys} + edge_type = None if len(endpoint_types) > 1 else \ + EdgeTypeEnum._value2member_map_.get(endpoint_types.pop()) + if edge_type is None: edge_type = EdgeTypeEnum.OTHER + return edge_type diff --git a/src/service/service/path_computation_element/TopologyViews.py b/src/service/service/path_computation_element/TopologyViews.py new file mode 100644 index 0000000000000000000000000000000000000000..e9161dc0d4e491d8fdfa239b8603fbf6613967ff --- /dev/null +++ b/src/service/service/path_computation_element/TopologyViews.py @@ -0,0 +1,57 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools, networkx +from typing import List, Optional, Union +from common.proto.context_pb2 import EndPoint +from context.service.database.EndPointModel import EndPointModel +from .Enums import EdgeTypeEnum, LayerTypeEnum +#from .Tools import get_endpoint + +def select_copper_edges(topology, n1, n2): + selected_edges = {EdgeTypeEnum.COPPER, EdgeTypeEnum.INTERNAL, EdgeTypeEnum.OTHER} + return topology[n1][n2].get('edge_type', EdgeTypeEnum.OTHER) in selected_edges + +def select_optical_edges(topology, n1, n2): + selected_edges = {EdgeTypeEnum.OPTICAL, EdgeTypeEnum.INTERNAL, EdgeTypeEnum.OTHER} + return topology[n1][n2].get('edge_type', EdgeTypeEnum.OTHER) in selected_edges + +def select_microwave_edges(topology, n1, n2): + selected_edges = {EdgeTypeEnum.MICROWAVE, EdgeTypeEnum.INTERNAL, EdgeTypeEnum.OTHER} + return topology[n1][n2].get('edge_type', EdgeTypeEnum.OTHER) in selected_edges + +SELECT_LAYER = { + LayerTypeEnum.COPPER : select_copper_edges, + LayerTypeEnum.OPTICAL : select_optical_edges, + LayerTypeEnum.MICROWAVE : select_microwave_edges, +} + +def get_layer(topology : networkx.Graph, layer : LayerTypeEnum): + filter_edge = functools.partial(SELECT_LAYER[layer], topology) + return networkx.subgraph_view(topology, filter_edge=filter_edge) + +def select_layer_from_endpoints(endpoints : List[Union[EndPointModel, EndPoint]]) -> Optional[LayerTypeEnum]: + endpoint_types = set() + for endpoint in endpoints: endpoint_types.add(endpoint.endpoint_type) + if len(endpoint_types) != 1: return None + # pylint: disable=no-member,protected-access + return LayerTypeEnum._value2member_map_.get(endpoint_types.pop()) + +#a_endpoint = get_endpoint(self.__topology, a_endpoint_key) +#z_endpoint = get_endpoint(self.__topology, z_endpoint_key) +#endpoints = [a_endpoint, z_endpoint] +#layer_type = select_layer_from_endpoints(endpoints) +#topology = self.__topology if layer_type is None else get_layer(self.__topology, layer_type) +#write_dot(topology, '../data/layer-{:s}.dot'.format('all' if layer_type is None else str(layer_type.value))) + diff --git a/src/service/service/path_computation_element/__init__.py b/src/service/service/path_computation_element/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/service/service/path_computation_element/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/service/service_handler_api/AnyTreeTools.py b/src/service/service/service_handler_api/AnyTreeTools.py new file mode 100644 index 0000000000000000000000000000000000000000..24aaa24249b41aa9a227ce73da0e263cbce15511 --- /dev/null +++ b/src/service/service/service_handler_api/AnyTreeTools.py @@ -0,0 +1,92 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree +from typing import Any, List, Optional, Union + +class TreeNode(anytree.node.Node): + def __init__(self, name, parent=None, children=None, **kwargs) -> None: + super().__init__(name, parent=parent, children=children, **kwargs) + self.value : Optional[Any] = None + + def get_full_path(self): + return self.separator.join([''] + [str(node.name) for node in self.path]) + +class RawStyle(anytree.render.AbstractStyle): + def __init__(self): + """ + Raw style. + + >>> from anytree import Node, RenderTree + >>> root = Node("root") + >>> s0 = Node("sub0", parent=root) + >>> s0b = Node("sub0B", parent=s0) + >>> s0a = Node("sub0A", parent=s0) + >>> s1 = Node("sub1", parent=root) + >>> print(RenderTree(root, style=RawStyle())) + Node('/root') + Node('/root/sub0') + Node('/root/sub0/sub0B') + Node('/root/sub0/sub0A') + Node('/root/sub1') + """ + super(RawStyle, self).__init__('', '', '') + +def get_subnode( + resolver : anytree.Resolver, root : TreeNode, key_or_path : Union[str, List[str]], default : Optional[Any] = None): + + if not isinstance(root, TreeNode): raise Exception('root must be a TreeNode') + if isinstance(key_or_path, str): key_or_path = key_or_path.split('/') + node = root + for path_item in key_or_path: + try: + node = resolver.get(node, path_item) + except anytree.ChildResolverError: + return default + return node + +def set_subnode_value(resolver : anytree.Resolver, root : TreeNode, key_or_path : Union[str, List[str]], value : Any): + if not isinstance(root, TreeNode): raise Exception('root must be a TreeNode') + if isinstance(key_or_path, str): key_or_path = key_or_path.split('/') + node = root + for path_item in key_or_path: + try: + node = resolver.get(node, path_item) + except anytree.ChildResolverError: + node = TreeNode(path_item, parent=node) + if isinstance(node.value, dict) and isinstance(value, dict): + node.value.update(value) + else: + node.value = value + +def delete_subnode(resolver : anytree.Resolver, root : TreeNode, key_or_path : Union[str, List[str]]): + if not isinstance(root, TreeNode): raise Exception('root must be a TreeNode') + node = get_subnode(resolver, root, key_or_path, default=None) + if node is None: return + parent : TreeNode = node.parent + children = list(parent.children) + children.remove(node) + parent.children = tuple(children) + +def dump_subtree(root : TreeNode): + if not isinstance(root, TreeNode): raise Exception('root must be a TreeNode') + results = [] + for row in anytree.RenderTree(root, style=RawStyle()): + node : TreeNode = row.node + path = node.get_full_path()[2:] # get full path except the heading root placeholder "/." + if len(path) == 0: continue + value = node.value + if value is None: continue + results.append((path, value)) + return results diff --git a/src/service/service/service_handler_api/Exceptions.py b/src/service/service/service_handler_api/Exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..f3344c97add64dafcdd63334667ebc3ead0d6d7e --- /dev/null +++ b/src/service/service/service_handler_api/Exceptions.py @@ -0,0 +1,66 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +class UnsatisfiedFilterException(Exception): + def __init__(self, filter_fields): + msg = 'No ServiceHandler satisfies FilterFields({:s})' + super().__init__(msg.format(str(filter_fields))) + +class UnsupportedServiceHandlerClassException(Exception): + def __init__(self, service_handler_class_name): + msg = 'Class({:s}) is not a subclass of _ServiceHandler' + super().__init__(msg.format(str(service_handler_class_name))) + +class UnsupportedFilterFieldException(Exception): + def __init__(self, unsupported_filter_fields, service_handler_class_name=None): + if service_handler_class_name: + msg = 'FilterFields({:s}) specified by ServiceHandler({:s}) are not supported' + msg = msg.format(str(unsupported_filter_fields), str(service_handler_class_name)) + else: + msg = 'FilterFields({:s}) specified in Filter are not supported' + msg = msg.format(str(unsupported_filter_fields)) + super().__init__(msg) + +class UnsupportedFilterFieldValueException(Exception): + def __init__( + self, filter_field_name, filter_field_value, allowed_filter_field_values, service_handler_class_name=None): + + if service_handler_class_name: + msg = 'FilterField({:s}={:s}) specified by ServiceHandler({:s}) is not supported. Allowed values are {:s}' + msg = msg.format( + str(filter_field_name), str(filter_field_value), str(service_handler_class_name), + str(allowed_filter_field_values)) + else: + msg = 'FilterField({:s}={:s}) specified in Filter is not supported. Allowed values are {:s}' + msg = msg.format(str(filter_field_name), str(filter_field_value), str(allowed_filter_field_values)) + super().__init__(msg) + +#class UnsupportedResourceKeyException(Exception): +# def __init__(self, resource_key): +# msg = 'ResourceKey({:s}) not supported' +# msg = msg.format(str(resource_key)) +# super().__init__(msg) +# +#class ConfigFieldNotFoundException(Exception): +# def __init__(self, config_field_name): +# msg = 'ConfigField({:s}) not specified in resource' +# msg = msg.format(str(config_field_name)) +# super().__init__(msg) +# +#class ConfigFieldsNotSupportedException(Exception): +# def __init__(self, config_fields): +# msg = 'ConfigFields({:s}) not supported in resource' +# msg = msg.format(str(config_fields)) +# super().__init__(msg) +# \ No newline at end of file diff --git a/src/service/service/service_handler_api/FilterFields.py b/src/service/service/service_handler_api/FilterFields.py new file mode 100644 index 0000000000000000000000000000000000000000..9d8f9ad28f69ef606bcf2e06e3a6a17514f016b4 --- /dev/null +++ b/src/service/service/service_handler_api/FilterFields.py @@ -0,0 +1,27 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from enum import Enum +from service.service.database.ServiceModel import ORM_ServiceTypeEnum +from service.service.database.DeviceModel import ORM_DeviceDriverEnum + +class FilterFieldEnum(Enum): + SERVICE_TYPE = 'service_type' + DEVICE_DRIVER = 'device_driver' + +# Map allowed filter fields to allowed values per Filter field. If no restriction (free text) None is specified +FILTER_FIELD_ALLOWED_VALUES = { + FilterFieldEnum.SERVICE_TYPE.value : {i.value for i in ORM_ServiceTypeEnum}, + FilterFieldEnum.DEVICE_DRIVER.value : {i.value for i in ORM_DeviceDriverEnum}, +} diff --git a/src/service/service/service_handler_api/ServiceHandlerFactory.py b/src/service/service/service_handler_api/ServiceHandlerFactory.py new file mode 100644 index 0000000000000000000000000000000000000000..8b7223a95613a8b490862bb3dad091baf3b38388 --- /dev/null +++ b/src/service/service/service_handler_api/ServiceHandlerFactory.py @@ -0,0 +1,93 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, operator +from enum import Enum +from typing import Any, Dict, Iterable, List, Set, Tuple +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from .Exceptions import ( + UnsatisfiedFilterException, UnsupportedServiceHandlerClassException, UnsupportedFilterFieldException, + UnsupportedFilterFieldValueException) +from .FilterFields import FILTER_FIELD_ALLOWED_VALUES, FilterFieldEnum + +LOGGER = logging.getLogger(__name__) + +class ServiceHandlerFactory: + def __init__(self, service_handlers : List[Tuple[type, List[Dict[FilterFieldEnum, Any]]]]) -> None: + # Dict{field_name => Dict{field_value => Set{ServiceHandler}}} + self.__indices : Dict[str, Dict[str, Set[_ServiceHandler]]] = {} + + for service_handler_class,filter_field_sets in service_handlers: + for filter_fields in filter_field_sets: + filter_fields = {k.value:v for k,v in filter_fields.items()} + self.register_service_handler_class(service_handler_class, **filter_fields) + + def register_service_handler_class(self, service_handler_class, **filter_fields): + if not issubclass(service_handler_class, _ServiceHandler): + raise UnsupportedServiceHandlerClassException(str(service_handler_class)) + + service_handler_name = service_handler_class.__name__ + supported_filter_fields = set(FILTER_FIELD_ALLOWED_VALUES.keys()) + unsupported_filter_fields = set(filter_fields.keys()).difference(supported_filter_fields) + if len(unsupported_filter_fields) > 0: + raise UnsupportedFilterFieldException( + unsupported_filter_fields, service_handler_class_name=service_handler_name) + + for field_name, field_values in filter_fields.items(): + field_indice = self.__indices.setdefault(field_name, dict()) + field_enum_values = FILTER_FIELD_ALLOWED_VALUES.get(field_name) + if not isinstance(field_values, Iterable) or isinstance(field_values, str): + field_values = [field_values] + for field_value in field_values: + if isinstance(field_value, Enum): field_value = field_value.value + if field_enum_values is not None and field_value not in field_enum_values: + raise UnsupportedFilterFieldValueException( + field_name, field_value, field_enum_values, service_handler_class_name=service_handler_name) + field_indice_service_handlers = field_indice.setdefault(field_value, set()) + field_indice_service_handlers.add(service_handler_class) + + def get_service_handler_class(self, **filter_fields) -> _ServiceHandler: + supported_filter_fields = set(FILTER_FIELD_ALLOWED_VALUES.keys()) + unsupported_filter_fields = set(filter_fields.keys()).difference(supported_filter_fields) + if len(unsupported_filter_fields) > 0: raise UnsupportedFilterFieldException(unsupported_filter_fields) + + candidate_service_handler_classes : Dict[_ServiceHandler, int] = None # num. filter hits per service_handler + for field_name, field_values in filter_fields.items(): + field_indice = self.__indices.get(field_name) + if field_indice is None: continue + if not isinstance(field_values, Iterable) or isinstance(field_values, str): + field_values = [field_values] + + field_enum_values = FILTER_FIELD_ALLOWED_VALUES.get(field_name) + + field_candidate_service_handler_classes = set() + for field_value in field_values: + if field_enum_values is not None and field_value not in field_enum_values: + raise UnsupportedFilterFieldValueException(field_name, field_value, field_enum_values) + field_indice_service_handlers = field_indice.get(field_value) + if field_indice_service_handlers is None: continue + field_candidate_service_handler_classes = field_candidate_service_handler_classes.union( + field_indice_service_handlers) + + if candidate_service_handler_classes is None: + candidate_service_handler_classes = {k:1 for k in field_candidate_service_handler_classes} + else: + for candidate_service_handler_class in candidate_service_handler_classes: + if candidate_service_handler_class not in field_candidate_service_handler_classes: continue + candidate_service_handler_classes[candidate_service_handler_class] += 1 + + if len(candidate_service_handler_classes) == 0: raise UnsatisfiedFilterException(filter_fields) + candidate_service_handler_classes = sorted( + candidate_service_handler_classes.items(), key=operator.itemgetter(1), reverse=True) + return candidate_service_handler_classes[0][0] diff --git a/src/service/service/service_handler_api/Tools.py b/src/service/service/service_handler_api/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..61ad7976132d2175319fffdeb5199f459c16d14f --- /dev/null +++ b/src/service/service/service_handler_api/Tools.py @@ -0,0 +1,42 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import functools +from typing import Any, List, Union + +ACTION_MSG_SET_ENDPOINT = 'Set EndPoint(device_uuid={:s}, endpoint_uuid={:s}, topology_uuid={:s})' +ACTION_MSG_DELETE_ENDPOINT = 'Delete EndPoint(device_uuid={:s}, endpoint_uuid={:s}, topology_uuid={:s})' + +ACTION_MSG_SET_CONSTRAINT = 'Set Constraint(constraint_type={:s}, constraint_value={:s})' +ACTION_MSG_DELETE_CONSTRAINT = 'Delete Constraint(constraint_type={:s}, constraint_value={:s})' + +ACTION_MSG_SET_CONFIG = 'Set Resource(key={:s}, value={:s})' +ACTION_MSG_DELETE_CONFIG = 'Delete Resource(key={:s}, value={:s})' + +def _check_errors( + message : str, parameters_list : List[Any], results_list : List[Union[bool, Exception]] + ) -> List[str]: + errors = [] + for parameters, results in zip(parameters_list, results_list): + if not isinstance(results, Exception): continue + message = message.format(*tuple(map(str, parameters))) + errors.append('Unable to {:s}; error({:s})'.format(message, str(results))) + return errors + +check_errors_setendpoint = functools.partial(_check_errors, ACTION_MSG_SET_ENDPOINT ) +check_errors_deleteendpoint = functools.partial(_check_errors, ACTION_MSG_DELETE_ENDPOINT ) +check_errors_setconstraint = functools.partial(_check_errors, ACTION_MSG_SET_CONSTRAINT ) +check_errors_deleteconstraint = functools.partial(_check_errors, ACTION_MSG_DELETE_CONSTRAINT) +check_errors_setconfig = functools.partial(_check_errors, ACTION_MSG_SET_CONFIG ) +check_errors_deleteconfig = functools.partial(_check_errors, ACTION_MSG_DELETE_CONFIG ) diff --git a/src/service/service/service_handler_api/_ServiceHandler.py b/src/service/service/service_handler_api/_ServiceHandler.py new file mode 100644 index 0000000000000000000000000000000000000000..e724ebcc986a1c5d205c2b77d9cb944d6faeb359 --- /dev/null +++ b/src/service/service/service_handler_api/_ServiceHandler.py @@ -0,0 +1,123 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Any, List, Optional, Tuple, Union +from common.orm.Database import Database +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.database.ServiceModel import ServiceModel + +class _ServiceHandler: + def __init__( + self, db_service : ServiceModel, database : Database, context_client : ContextClient, + device_client : DeviceClient, **settings + ) -> None: + """ Initialize Driver. + Parameters: + db_service + The service instance from the local in-memory database. + database + The instance of the local in-memory database. + context_client + An instance of context client to be used to retrieve information from the service and the devices. + device_client + An instance of device client to be used to configure the devices. + **settings + Extra settings required by the service handler. + """ + raise NotImplementedError() + + def SetEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + """ Set endpoints from a list. + Parameters: + endpoints : List[Tuple[str, str, Optional[str]]] + List of tuples, each containing a device_uuid, endpoint_uuid and, optionally, the topology_uuid + of the endpoint to be added. + Returns: + results : List[Union[bool, Exception]] + List of results for endpoint changes requested. Return values must be in the same order than + endpoints requested. If an endpoint is properly added, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() + + def DeleteEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + """ Delete endpoints form a list. + Parameters: + endpoints : List[Tuple[str, str, Optional[str]]] + List of tuples, each containing a device_uuid, endpoint_uuid, and the topology_uuid of the endpoint + to be removed. + Returns: + results : List[Union[bool, Exception]] + List of results for endpoint deletions requested. Return values must be in the same order than + endpoints requested. If an endpoint is properly deleted, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() + + def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + """ Create/Update constraints. + Parameters: + constraints : List[Tuple[str, Any]] + List of tuples, each containing a constraint_type and the new constraint_value to be set. + Returns: + results : List[Union[bool, Exception]] + List of results for constraint changes requested. Return values must be in the same order than + constraints requested. If a constraint is properly set, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() + + def DeleteConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + """ Delete constraints. + Parameters: + constraints : List[Tuple[str, Any]] + List of tuples, each containing a constraint_type pointing to the constraint to be deleted, and a + constraint_value containing possible additionally required values to locate the constraint to be + removed. + Returns: + results : List[Union[bool, Exception]] + List of results for constraint deletions requested. Return values must be in the same order than + constraints requested. If a constraint is properly deleted, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() + + def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + """ Create/Update configuration for a list of resources. + Parameters: + resources : List[Tuple[str, Any]] + List of tuples, each containing a resource_key pointing the resource to be modified, and a + resource_value containing the new value to be set. + Returns: + results : List[Union[bool, Exception]] + List of results for resource key changes requested. Return values must be in the same order than + resource keys requested. If a resource is properly set, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() + + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + """ Delete configuration for a list of resources. + Parameters: + resources : List[Tuple[str, Any]] + List of tuples, each containing a resource_key pointing the resource to be modified, and a + resource_value containing possible additionally required values to locate the value to be removed. + Returns: + results : List[Union[bool, Exception]] + List of results for resource key deletions requested. Return values must be in the same order than + resource keys requested. If a resource is properly deleted, True must be retrieved; otherwise, the + Exception that is raised during the processing must be retrieved. + """ + raise NotImplementedError() diff --git a/src/service/service/service_handler_api/__init__.py b/src/service/service/service_handler_api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/service/service/service_handler_api/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/service/service_handlers/__init__.py b/src/service/service/service_handlers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6abe4048fb6771efc0a44f11aa40fc7739a87648 --- /dev/null +++ b/src/service/service/service_handlers/__init__.py @@ -0,0 +1,39 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from ..service_handler_api.FilterFields import FilterFieldEnum, ORM_DeviceDriverEnum, ORM_ServiceTypeEnum +from .l3nm_emulated.L3NMEmulatedServiceHandler import L3NMEmulatedServiceHandler +from .l3nm_openconfig.L3NMOpenConfigServiceHandler import L3NMOpenConfigServiceHandler +from .tapi_tapi.TapiServiceHandler import TapiServiceHandler + +SERVICE_HANDLERS = [ + (L3NMEmulatedServiceHandler, [ + { + FilterFieldEnum.SERVICE_TYPE : ORM_ServiceTypeEnum.L3NM, + FilterFieldEnum.DEVICE_DRIVER : ORM_DeviceDriverEnum.UNDEFINED, + } + ]), + (L3NMOpenConfigServiceHandler, [ + { + FilterFieldEnum.SERVICE_TYPE : ORM_ServiceTypeEnum.L3NM, + FilterFieldEnum.DEVICE_DRIVER : ORM_DeviceDriverEnum.OPENCONFIG, + } + ]), + (TapiServiceHandler, [ + { + FilterFieldEnum.SERVICE_TYPE : ORM_ServiceTypeEnum.TAPI_CONNECTIVITY_SERVICE, + FilterFieldEnum.DEVICE_DRIVER : ORM_DeviceDriverEnum.TRANSPORT_API, + } + ]), +] diff --git a/src/service/service/service_handlers/l3nm_emulated/L3NMEmulatedServiceHandler.py b/src/service/service/service_handlers/l3nm_emulated/L3NMEmulatedServiceHandler.py new file mode 100644 index 0000000000000000000000000000000000000000..316b2ef8739efadf3f9f40d76d4e698117cc505f --- /dev/null +++ b/src/service/service/service_handlers/l3nm_emulated/L3NMEmulatedServiceHandler.py @@ -0,0 +1,379 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree, json, logging +from typing import Any, Dict, List, Optional, Tuple, Union +from common.orm.Database import Database +from common.orm.HighLevel import get_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Device +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.type_checkers.Checkers import chk_length, chk_type +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.database.ConfigModel import ORM_ConfigActionEnum, get_config_rules +from service.service.database.ContextModel import ContextModel +from service.service.database.DeviceModel import DeviceModel +from service.service.database.ServiceModel import ServiceModel +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from service.service.service_handler_api.AnyTreeTools import TreeNode, delete_subnode, get_subnode, set_subnode_value + +LOGGER = logging.getLogger(__name__) + +class L3NMEmulatedServiceHandler(_ServiceHandler): + def __init__( # pylint: disable=super-init-not-called + self, db_service : ServiceModel, database : Database, context_client : ContextClient, + device_client : DeviceClient, **settings + ) -> None: + self.__db_service = db_service + self.__database = database + self.__context_client = context_client # pylint: disable=unused-private-member + self.__device_client = device_client + + self.__db_context : ContextModel = get_object(self.__database, ContextModel, self.__db_service.context_fk) + str_service_key = key_to_str([self.__db_context.context_uuid, self.__db_service.service_uuid]) + db_config = get_config_rules(self.__database, str_service_key, 'running') + self.__resolver = anytree.Resolver(pathattr='name') + self.__config = TreeNode('.') + for action, resource_key, resource_value in db_config: + if action == ORM_ConfigActionEnum.SET: + try: + resource_value = json.loads(resource_value) + except: # pylint: disable=bare-except + pass + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + elif action == ORM_ConfigActionEnum.DELETE: + delete_subnode(self.__resolver, self.__config, resource_key) + + def SetEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__db_service.service_uuid + service_short_uuid = service_uuid.split('-')[-1] + network_instance_name = '{:s}-NetInst'.format(service_short_uuid) + network_interface_desc = '{:s}-NetIf'.format(service_uuid) + network_subinterface_desc = '{:s}-NetSubIf'.format(service_uuid) + + settings : TreeNode = get_subnode(self.__resolver, self.__config, '/settings', None) + if settings is None: raise Exception('Unable to retrieve service settings') + json_settings : Dict = settings.value + mtu = json_settings.get('mtu', 1450 ) # 1512 + #address_families = json_settings.get('address_families', [] ) # ['IPV4'] + bgp_as = json_settings.get('bgp_as', 0 ) # 65000 + bgp_route_target = json_settings.get('bgp_route_target', '0:0') # 65000:333 + + results = [] + for endpoint in endpoints: + try: + chk_type('endpoint', endpoint, (tuple, list)) + chk_length('endpoint', endpoint, min_length=2, max_length=3) + if len(endpoint) == 2: + device_uuid, endpoint_uuid = endpoint + else: + device_uuid, endpoint_uuid, _ = endpoint # ignore topology_uuid by now + + endpoint_settings_uri = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + endpoint_settings : TreeNode = get_subnode(self.__resolver, self.__config, endpoint_settings_uri, None) + if endpoint_settings is None: + raise Exception('Unable to retrieve service settings for endpoint({:s})'.format( + str(endpoint_settings_uri))) + json_endpoint_settings : Dict = endpoint_settings.value + #router_id = json_endpoint_settings.get('router_id', '0.0.0.0') # '10.95.0.10' + route_distinguisher = json_endpoint_settings.get('route_distinguisher', '0:0' ) # '60001:801' + sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 + vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 + address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1' + address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30 + if_subif_name = '{:s}.{:d}'.format(endpoint_uuid, vlan_id) + + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_set( + '/network_instance[{:s}]'.format(network_instance_name), { + 'name': network_instance_name, 'description': network_interface_desc, 'type': 'L3VRF', + 'route_distinguisher': route_distinguisher, + #'router_id': router_id, 'address_families': address_families, + }), + json_config_rule_set( + '/interface[{:s}]'.format(endpoint_uuid), { + 'name': endpoint_uuid, 'description': network_interface_desc, 'mtu': mtu, + }), + json_config_rule_set( + '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_uuid, sub_interface_index), { + 'name': endpoint_uuid, 'index': sub_interface_index, + 'description': network_subinterface_desc, 'vlan_id': vlan_id, + 'address_ip': address_ip, 'address_prefix': address_prefix, + }), + json_config_rule_set( + '/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), { + 'name': network_instance_name, 'id': if_subif_name, 'interface': endpoint_uuid, + 'subinterface': sub_interface_index, + }), + json_config_rule_set( + '/network_instance[{:s}]/protocols[BGP]'.format(network_instance_name), { + 'name': network_instance_name, 'identifier': 'BGP', 'protocol_name': 'BGP', 'as': bgp_as, + }), + json_config_rule_set( + '/network_instance[{:s}]/table_connections[STATIC][BGP][IPV4]'.format(network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'STATIC', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', #'default_import_policy': 'REJECT_ROUTE', + }), + json_config_rule_set( + '/network_instance[{:s}]/table_connections[DIRECTLY_CONNECTED][BGP][IPV4]'.format( + network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'DIRECTLY_CONNECTED', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', #'default_import_policy': 'REJECT_ROUTE', + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_import]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_import][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_import]'.format(network_instance_name), { + 'policy_name': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_import'.format(network_instance_name), 'statement_name': '3', + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'match_set_options': 'ANY', 'policy_result': 'ACCEPT_ROUTE', + }), + json_config_rule_set( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_import]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, 'import_policy': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_export]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_export][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_export]'.format(network_instance_name), { + 'policy_name': '{:s}_export'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_export'.format(network_instance_name), 'statement_name': '3', + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'match_set_options': 'ANY', 'policy_result': 'ACCEPT_ROUTE', + }), + json_config_rule_set( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_export]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, 'export_policy': '{:s}_export'.format(network_instance_name), + }), + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint))) + results.append(e) + + return results + + def DeleteEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__db_service.service_uuid + service_short_uuid = service_uuid.split('-')[-1] + network_instance_name = '{:s}-NetInst'.format(service_short_uuid) + + settings : TreeNode = get_subnode(self.__resolver, self.__config, '/settings', None) + if settings is None: raise Exception('Unable to retrieve service settings') + json_settings : Dict = settings.value + bgp_route_target = json_settings.get('bgp_route_target', '0:0') # 65000:333 + + results = [] + for endpoint in endpoints: + try: + chk_type('endpoint', endpoint, (tuple, list)) + chk_length('endpoint', endpoint, min_length=2, max_length=3) + if len(endpoint) == 2: + device_uuid, endpoint_uuid = endpoint + else: + device_uuid, endpoint_uuid, _ = endpoint # ignore topology_uuid by now + + endpoint_settings_uri = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + endpoint_settings : TreeNode = get_subnode(self.__resolver, self.__config, endpoint_settings_uri, None) + if endpoint_settings is None: + raise Exception('Unable to retrieve service settings for endpoint({:s})'.format( + str(endpoint_settings_uri))) + json_endpoint_settings : Dict = endpoint_settings.value + sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 + vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 + if_subif_name = '{:s}.{:d}'.format(endpoint_uuid, vlan_id) + + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_delete( + '/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), { + 'name': network_instance_name, 'id': if_subif_name, + }), + json_config_rule_delete( + '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_uuid, sub_interface_index), { + 'name': endpoint_uuid, 'index': sub_interface_index, + }), + json_config_rule_delete( + '/interface[{:s}]'.format(endpoint_uuid), { + 'name': endpoint_uuid, + }), + json_config_rule_delete( + '/network_instance[{:s}]/table_connections[DIRECTLY_CONNECTED][BGP][IPV4]'.format( + network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'DIRECTLY_CONNECTED', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', + }), + json_config_rule_delete( + '/network_instance[{:s}]/table_connections[STATIC][BGP][IPV4]'.format(network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'STATIC', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', + }), + json_config_rule_delete( + '/network_instance[{:s}]/protocols[BGP]'.format(network_instance_name), { + 'name': network_instance_name, 'identifier': 'BGP', 'protocol_name': 'BGP', + }), + json_config_rule_delete( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_import]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_import'.format(network_instance_name), 'statement_name': '3', + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_import]'.format(network_instance_name), { + 'policy_name': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_import][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_import]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + }), + json_config_rule_delete( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_export]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_export'.format(network_instance_name), 'statement_name': '3', + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_export]'.format(network_instance_name), { + 'policy_name': '{:s}_export'.format(network_instance_name), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_export][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_export]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + }), + json_config_rule_delete( + '/network_instance[{:s}]'.format(network_instance_name), { + 'name': network_instance_name + }), + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteEndpoint({:s})'.format(str(endpoint))) + results.append(e) + + return results + + def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[SetConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def DeleteConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[DeleteConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, resource_value = resource + resource_value = json.loads(resource_value) + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetConfig({:s})'.format(str(resource))) + results.append(e) + + return results + + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, _ = resource + delete_subnode(self.__resolver, self.__config, resource_key) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteConfig({:s})'.format(str(resource))) + results.append(e) + + return results diff --git a/src/service/service/service_handlers/l3nm_emulated/__init__.py b/src/service/service/service_handlers/l3nm_emulated/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/service/service/service_handlers/l3nm_emulated/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/service/service_handlers/l3nm_openconfig/L3NMOpenConfigServiceHandler.py b/src/service/service/service_handlers/l3nm_openconfig/L3NMOpenConfigServiceHandler.py new file mode 100644 index 0000000000000000000000000000000000000000..1faf8e7c25090a79c2d1c7a2bcec7c5db5ba8201 --- /dev/null +++ b/src/service/service/service_handlers/l3nm_openconfig/L3NMOpenConfigServiceHandler.py @@ -0,0 +1,379 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree, json, logging +from typing import Any, Dict, List, Optional, Tuple, Union +from common.orm.Database import Database +from common.orm.HighLevel import get_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Device +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.type_checkers.Checkers import chk_length, chk_type +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.database.ConfigModel import ORM_ConfigActionEnum, get_config_rules +from service.service.database.ContextModel import ContextModel +from service.service.database.DeviceModel import DeviceModel +from service.service.database.ServiceModel import ServiceModel +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from service.service.service_handler_api.AnyTreeTools import TreeNode, delete_subnode, get_subnode, set_subnode_value + +LOGGER = logging.getLogger(__name__) + +class L3NMOpenConfigServiceHandler(_ServiceHandler): + def __init__( # pylint: disable=super-init-not-called + self, db_service : ServiceModel, database : Database, context_client : ContextClient, + device_client : DeviceClient, **settings + ) -> None: + self.__db_service = db_service + self.__database = database + self.__context_client = context_client # pylint: disable=unused-private-member + self.__device_client = device_client + + self.__db_context : ContextModel = get_object(self.__database, ContextModel, self.__db_service.context_fk) + str_service_key = key_to_str([self.__db_context.context_uuid, self.__db_service.service_uuid]) + db_config = get_config_rules(self.__database, str_service_key, 'running') + self.__resolver = anytree.Resolver(pathattr='name') + self.__config = TreeNode('.') + for action, resource_key, resource_value in db_config: + if action == ORM_ConfigActionEnum.SET: + try: + resource_value = json.loads(resource_value) + except: # pylint: disable=bare-except + pass + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + elif action == ORM_ConfigActionEnum.DELETE: + delete_subnode(self.__resolver, self.__config, resource_key) + + def SetEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__db_service.service_uuid + service_short_uuid = service_uuid.split('-')[-1] + network_instance_name = '{:s}-NetInst'.format(service_short_uuid) + network_interface_desc = '{:s}-NetIf'.format(service_uuid) + network_subinterface_desc = '{:s}-NetSubIf'.format(service_uuid) + + settings : TreeNode = get_subnode(self.__resolver, self.__config, '/settings', None) + if settings is None: raise Exception('Unable to retrieve service settings') + json_settings : Dict = settings.value + mtu = json_settings.get('mtu', 1450 ) # 1512 + #address_families = json_settings.get('address_families', [] ) # ['IPV4'] + bgp_as = json_settings.get('bgp_as', 0 ) # 65000 + bgp_route_target = json_settings.get('bgp_route_target', '0:0') # 65000:333 + + results = [] + for endpoint in endpoints: + try: + chk_type('endpoint', endpoint, (tuple, list)) + chk_length('endpoint', endpoint, min_length=2, max_length=3) + if len(endpoint) == 2: + device_uuid, endpoint_uuid = endpoint + else: + device_uuid, endpoint_uuid, _ = endpoint # ignore topology_uuid by now + + endpoint_settings_uri = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + endpoint_settings : TreeNode = get_subnode(self.__resolver, self.__config, endpoint_settings_uri, None) + if endpoint_settings is None: + raise Exception('Unable to retrieve service settings for endpoint({:s})'.format( + str(endpoint_settings_uri))) + json_endpoint_settings : Dict = endpoint_settings.value + #router_id = json_endpoint_settings.get('router_id', '0.0.0.0') # '10.95.0.10' + route_distinguisher = json_endpoint_settings.get('route_distinguisher', '0:0' ) # '60001:801' + sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 + vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 + address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1' + address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30 + if_subif_name = '{:s}.{:d}'.format(endpoint_uuid, vlan_id) + + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_set( + '/network_instance[{:s}]'.format(network_instance_name), { + 'name': network_instance_name, 'description': network_interface_desc, 'type': 'L3VRF', + 'route_distinguisher': route_distinguisher, + #'router_id': router_id, 'address_families': address_families, + }), + json_config_rule_set( + '/interface[{:s}]'.format(endpoint_uuid), { + 'name': endpoint_uuid, 'description': network_interface_desc, 'mtu': mtu, + }), + json_config_rule_set( + '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_uuid, sub_interface_index), { + 'name': endpoint_uuid, 'index': sub_interface_index, + 'description': network_subinterface_desc, 'vlan_id': vlan_id, + 'address_ip': address_ip, 'address_prefix': address_prefix, + }), + json_config_rule_set( + '/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), { + 'name': network_instance_name, 'id': if_subif_name, 'interface': endpoint_uuid, + 'subinterface': sub_interface_index, + }), + json_config_rule_set( + '/network_instance[{:s}]/protocols[BGP]'.format(network_instance_name), { + 'name': network_instance_name, 'identifier': 'BGP', 'protocol_name': 'BGP', 'as': bgp_as, + }), + json_config_rule_set( + '/network_instance[{:s}]/table_connections[STATIC][BGP][IPV4]'.format(network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'STATIC', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', #'default_import_policy': 'REJECT_ROUTE', + }), + json_config_rule_set( + '/network_instance[{:s}]/table_connections[DIRECTLY_CONNECTED][BGP][IPV4]'.format( + network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'DIRECTLY_CONNECTED', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', #'default_import_policy': 'REJECT_ROUTE', + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_import]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_import][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_import]'.format(network_instance_name), { + 'policy_name': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_import'.format(network_instance_name), 'statement_name': '3', + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'match_set_options': 'ANY', 'policy_result': 'ACCEPT_ROUTE', + }), + json_config_rule_set( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_import]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, 'import_policy': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_export]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/bgp_defined_set[{:s}_rt_export][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_export]'.format(network_instance_name), { + 'policy_name': '{:s}_export'.format(network_instance_name), + }), + json_config_rule_set( + '/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_export'.format(network_instance_name), 'statement_name': '3', + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'match_set_options': 'ANY', 'policy_result': 'ACCEPT_ROUTE', + }), + json_config_rule_set( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_export]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, 'export_policy': '{:s}_export'.format(network_instance_name), + }), + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint))) + results.append(e) + + return results + + def DeleteEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__db_service.service_uuid + service_short_uuid = service_uuid.split('-')[-1] + network_instance_name = '{:s}-NetInst'.format(service_short_uuid) + + settings : TreeNode = get_subnode(self.__resolver, self.__config, '/settings', None) + if settings is None: raise Exception('Unable to retrieve service settings') + json_settings : Dict = settings.value + bgp_route_target = json_settings.get('bgp_route_target', '0:0') # 65000:333 + + results = [] + for endpoint in endpoints: + try: + chk_type('endpoint', endpoint, (tuple, list)) + chk_length('endpoint', endpoint, min_length=2, max_length=3) + if len(endpoint) == 2: + device_uuid, endpoint_uuid = endpoint + else: + device_uuid, endpoint_uuid, _ = endpoint # ignore topology_uuid by now + + endpoint_settings_uri = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid) + endpoint_settings : TreeNode = get_subnode(self.__resolver, self.__config, endpoint_settings_uri, None) + if endpoint_settings is None: + raise Exception('Unable to retrieve service settings for endpoint({:s})'.format( + str(endpoint_settings_uri))) + json_endpoint_settings : Dict = endpoint_settings.value + sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 + vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 + if_subif_name = '{:s}.{:d}'.format(endpoint_uuid, vlan_id) + + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_delete( + '/network_instance[{:s}]/interface[{:s}]'.format(network_instance_name, if_subif_name), { + 'name': network_instance_name, 'id': if_subif_name, + }), + json_config_rule_delete( + '/interface[{:s}]/subinterface[{:d}]'.format(endpoint_uuid, sub_interface_index), { + 'name': endpoint_uuid, 'index': sub_interface_index, + }), + json_config_rule_delete( + '/interface[{:s}]'.format(endpoint_uuid), { + 'name': endpoint_uuid, + }), + json_config_rule_delete( + '/network_instance[{:s}]/table_connections[DIRECTLY_CONNECTED][BGP][IPV4]'.format( + network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'DIRECTLY_CONNECTED', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', + }), + json_config_rule_delete( + '/network_instance[{:s}]/table_connections[STATIC][BGP][IPV4]'.format(network_instance_name), { + 'name': network_instance_name, 'src_protocol': 'STATIC', 'dst_protocol': 'BGP', + 'address_family': 'IPV4', + }), + json_config_rule_delete( + '/network_instance[{:s}]/protocols[BGP]'.format(network_instance_name), { + 'name': network_instance_name, 'identifier': 'BGP', 'protocol_name': 'BGP', + }), + json_config_rule_delete( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_import]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_import]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_import'.format(network_instance_name), 'statement_name': '3', + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_import]'.format(network_instance_name), { + 'policy_name': '{:s}_import'.format(network_instance_name), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_import][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_import]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_import'.format(network_instance_name), + }), + json_config_rule_delete( + # pylint: disable=duplicate-string-formatting-argument + '/network_instance[{:s}]/inter_instance_policies[{:s}_export]'.format( + network_instance_name, network_instance_name), { + 'name': network_instance_name, + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_export]/statement[{:s}]'.format( + network_instance_name, '3'), { + 'policy_name': '{:s}_export'.format(network_instance_name), 'statement_name': '3', + }), + json_config_rule_delete( + '/routing_policy/policy_definition[{:s}_export]'.format(network_instance_name), { + 'policy_name': '{:s}_export'.format(network_instance_name), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_export][route-target:{:s}]'.format( + network_instance_name, bgp_route_target), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + 'ext_community_member' : 'route-target:{:s}'.format(bgp_route_target), + }), + json_config_rule_delete( + '/routing_policy/bgp_defined_set[{:s}_rt_export]'.format(network_instance_name), { + 'ext_community_set_name': '{:s}_rt_export'.format(network_instance_name), + }), + json_config_rule_delete( + '/network_instance[{:s}]'.format(network_instance_name), { + 'name': network_instance_name + }), + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteEndpoint({:s})'.format(str(endpoint))) + results.append(e) + + return results + + def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[SetConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def DeleteConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[DeleteConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, resource_value = resource + resource_value = json.loads(resource_value) + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetConfig({:s})'.format(str(resource))) + results.append(e) + + return results + + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, _ = resource + delete_subnode(self.__resolver, self.__config, resource_key) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteConfig({:s})'.format(str(resource))) + results.append(e) + + return results diff --git a/src/service/service/service_handlers/l3nm_openconfig/__init__.py b/src/service/service/service_handlers/l3nm_openconfig/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/service/service/service_handlers/l3nm_openconfig/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py b/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py new file mode 100644 index 0000000000000000000000000000000000000000..1249af0ae7944f09bd12f2fab4e6e78523320c06 --- /dev/null +++ b/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py @@ -0,0 +1,170 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import anytree, json, logging +from typing import Any, Dict, List, Optional, Tuple, Union +from common.orm.Database import Database +from common.orm.HighLevel import get_object +from common.orm.backend.Tools import key_to_str +from common.proto.context_pb2 import Device +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.type_checkers.Checkers import chk_type +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.database.ConfigModel import ORM_ConfigActionEnum, get_config_rules +from service.service.database.ContextModel import ContextModel +from service.service.database.DeviceModel import DeviceModel +from service.service.database.ServiceModel import ServiceModel +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from service.service.service_handler_api.AnyTreeTools import TreeNode, delete_subnode, get_subnode, set_subnode_value + +LOGGER = logging.getLogger(__name__) + +class TapiServiceHandler(_ServiceHandler): + def __init__( # pylint: disable=super-init-not-called + self, db_service : ServiceModel, database : Database, context_client : ContextClient, + device_client : DeviceClient, **settings + ) -> None: + self.__db_service = db_service + self.__database = database + self.__context_client = context_client # pylint: disable=unused-private-member + self.__device_client = device_client + + self.__db_context : ContextModel = get_object(self.__database, ContextModel, self.__db_service.context_fk) + str_service_key = key_to_str([self.__db_context.context_uuid, self.__db_service.service_uuid]) + db_config = get_config_rules(self.__database, str_service_key, 'running') + self.__resolver = anytree.Resolver(pathattr='name') + self.__config = TreeNode('.') + for action, resource_key, resource_value in db_config: + if action == ORM_ConfigActionEnum.SET: + try: + resource_value = json.loads(resource_value) + except: # pylint: disable=bare-except + pass + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + elif action == ORM_ConfigActionEnum.DELETE: + delete_subnode(self.__resolver, self.__config, resource_key) + + def SetEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) != 2: return [] + + service_uuid = self.__db_service.service_uuid + service_settings : TreeNode = get_subnode(self.__resolver, self.__config, 'settings', None) + if service_settings is None: raise Exception('Unable to settings for Service({:s})'.format(str(service_uuid))) + + json_settings : Dict = service_settings.value + capacity_value = json_settings.get('capacity_value', 1) + capacity_unit = json_settings.get('capacity_unit', 'GHz') + layer_proto_name = json_settings.get('layer_proto_name', 'PHOTONIC_MEDIA') + layer_proto_qual = json_settings.get('layer_proto_qual', 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC') + direction = json_settings.get('direction', 'UNIDIRECTIONAL') + + results = [] + try: + device_uuid = endpoints[0][0] + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_set('/service[{:s}]'.format(service_uuid), { + 'uuid' : service_uuid, + 'input_sip' : endpoints[0][1], + 'output_sip' : endpoints[1][1], + 'capacity_unit' : capacity_unit, + 'capacity_value' : capacity_value, + 'layer_protocol_name' : layer_proto_name, + 'layer_protocol_qualifier': layer_proto_qual, + 'direction' : direction, + }), + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetEndpoint for Service({:s})'.format(str(service_uuid))) + results.append(e) + + return results + + def DeleteEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) + if len(endpoints) != 2: return [] + + service_uuid = self.__db_service.service_uuid + results = [] + try: + device_uuid = endpoints[0][0] + db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) + json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) + json_device_config : Dict = json_device.setdefault('device_config', {}) + json_device_config_rules : List = json_device_config.setdefault('config_rules', []) + json_device_config_rules.extend([ + json_config_rule_delete('/service[{:s}]'.format(service_uuid), {'uuid': service_uuid}) + ]) + self.__device_client.ConfigureDevice(Device(**json_device)) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteEndpoint for Service({:s})'.format(str(service_uuid))) + results.append(e) + + return results + + def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[SetConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def DeleteConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[DeleteConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + def SetConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, resource_value = resource + resource_value = json.loads(resource_value) + set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetConfig({:s})'.format(str(resource))) + results.append(e) + + return results + + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_key, _ = resource + delete_subnode(self.__resolver, self.__config, resource_key) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteConfig({:s})'.format(str(resource))) + results.append(e) + + return results diff --git a/src/service/service/service_handlers/tapi_tapi/__init__.py b/src/service/service/service_handlers/tapi_tapi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/service/service/service_handlers/tapi_tapi/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/tests/.gitignore b/src/service/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6b97d6fe3ad32f39097745229ab7f547f26ecb12 --- /dev/null +++ b/src/service/tests/.gitignore @@ -0,0 +1 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. diff --git a/src/service/tests/CommonObjects.py b/src/service/tests/CommonObjects.py new file mode 100644 index 0000000000000000000000000000000000000000..7792ad61d0e537911f593ec29d8366bb59fbb9f6 --- /dev/null +++ b/src/service/tests/CommonObjects.py @@ -0,0 +1,34 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] diff --git a/src/service/tests/MockService_Dependencies.py b/src/service/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..3774e22088e95b2325adf2fb46c386ebd6f8f7a8 --- /dev/null +++ b/src/service/tests/MockService_Dependencies.py @@ -0,0 +1,49 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_DEVICE = ServiceNameEnum.DEVICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Device to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.device_servicer = MockServicerImpl_Device() + add_DeviceServiceServicer_to_server(self.device_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/service/tests/PrepareTestScenario.py b/src/service/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf3cd156ab04e932e440837dc8ca0df645dc0cc --- /dev/null +++ b/src/service/tests/PrepareTestScenario.py @@ -0,0 +1,68 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from service.service.ServiceService import ServiceService +from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from service.service.service_handlers import SERVICE_HANDLERS +from service.tests.MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SERVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SERVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SERVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + _service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) + _service = ServiceService(_service_handler_factory) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def service_client(service_service : ServiceService): # pylint: disable=redefined-outer-name + _client = ServiceClient() + yield _client + _client.close() diff --git a/src/service/tests/ServiceHandler_L3NM_EMU.py b/src/service/tests/ServiceHandler_L3NM_EMU.py new file mode 100644 index 0000000000000000000000000000000000000000..0ac5fbf24cf1937104646374f60ab9487ee1c84d --- /dev/null +++ b/src/service/tests/ServiceHandler_L3NM_EMU.py @@ -0,0 +1,136 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Dict, List, Tuple +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Device import ( + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Service import json_service_id, json_service_l3nm_planned +from .CommonObjects import CONTEXT, CONTEXT_ID, PACKET_PORT_SAMPLE_TYPES, TOPOLOGY, TOPOLOGY_ID + +SERVICE_HANDLER_NAME = 'l3nm_emulated' + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): + return [ + json_endpoint_id(device_id, ep_uuid) + for ep_uuid, _ in endpoint_descriptors + ] + +def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): + return [ + json_endpoint(device_id, ep_uuid, ep_type, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES) + for ep_uuid, ep_type in endpoint_descriptors + ] + +# ----- Devices -------------------------------------------------------------------------------------------------------- +DEVICE_R1_UUID = 'R1' +DEVICE_R1_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP100', 'copper')] +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1 = json_device_emulated_packet_router_disabled(DEVICE_R1_UUID, endpoints=DEVICE_R1_ENDPOINTS) +ENDPOINT_ID_R1_EP1 = DEVICE_R1_ENDPOINT_IDS[0] +ENDPOINT_ID_R1_EP100 = DEVICE_R1_ENDPOINT_IDS[1] + +DEVICE_R2_UUID = 'R2' +DEVICE_R2_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP100', 'copper')] +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2 = json_device_emulated_packet_router_disabled(DEVICE_R2_UUID, endpoints=DEVICE_R2_ENDPOINTS) +ENDPOINT_ID_R2_EP1 = DEVICE_R2_ENDPOINT_IDS[0] +ENDPOINT_ID_R2_EP100 = DEVICE_R2_ENDPOINT_IDS[1] + +DEVICE_R3_UUID = 'R3' +DEVICE_R3_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP100', 'copper')] +DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) +DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3 = json_device_emulated_packet_router_disabled(DEVICE_R3_UUID, endpoints=DEVICE_R3_ENDPOINTS) +ENDPOINT_ID_R3_EP1 = DEVICE_R3_ENDPOINT_IDS[0] +ENDPOINT_ID_R3_EP100 = DEVICE_R3_ENDPOINT_IDS[1] + +DEVICE_O1_UUID = 'O1' +DEVICE_O1_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP2', 'optical'), ('EP3', 'optical')] +DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) +DEVICE_O1_ENDPOINTS = json_endpoints(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +DEVICE_O1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +DEVICE_O1 = json_device_emulated_tapi_disabled(DEVICE_O1_UUID, endpoints=DEVICE_O1_ENDPOINTS) +ENDPOINT_ID_O1_EP1 = DEVICE_O1_ENDPOINT_IDS[0] +ENDPOINT_ID_O1_EP2 = DEVICE_O1_ENDPOINT_IDS[1] +ENDPOINT_ID_O1_EP3 = DEVICE_O1_ENDPOINT_IDS[2] + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_R1_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R1_UUID, ENDPOINT_ID_R1_EP1['endpoint_uuid']['uuid'], + DEVICE_O1_UUID, ENDPOINT_ID_O1_EP1['endpoint_uuid']['uuid']) +LINK_R1_O1_ID = json_link_id(LINK_R1_O1_UUID) +LINK_R1_O1 = json_link(LINK_R1_O1_UUID, [ENDPOINT_ID_R1_EP1, ENDPOINT_ID_O1_EP1]) + +LINK_R2_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R2_UUID, ENDPOINT_ID_R2_EP1['endpoint_uuid']['uuid'], + DEVICE_O1_UUID, ENDPOINT_ID_O1_EP2['endpoint_uuid']['uuid']) +LINK_R2_O1_ID = json_link_id(LINK_R2_O1_UUID) +LINK_R2_O1 = json_link(LINK_R2_O1_UUID, [ENDPOINT_ID_R2_EP1, ENDPOINT_ID_O1_EP2]) + +LINK_R3_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R3_UUID, ENDPOINT_ID_R3_EP1['endpoint_uuid']['uuid'], + DEVICE_O1_UUID, ENDPOINT_ID_O1_EP3['endpoint_uuid']['uuid']) +LINK_R3_O1_ID = json_link_id(LINK_R3_O1_UUID) +LINK_R3_O1 = json_link(LINK_R3_O1_UUID, [ENDPOINT_ID_R3_EP1, ENDPOINT_ID_O1_EP3]) + + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_R1_R3_UUID = 'SVC:{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid'], + DEVICE_R3_UUID, ENDPOINT_ID_R3_EP100['endpoint_uuid']['uuid']) +SERVICE_R1_R3_ENDPOINT_IDS = [ENDPOINT_ID_R1_EP100, ENDPOINT_ID_R3_EP100] +SERVICE_R1_R3_CONSTRAINTS = [ + json_constraint('latency_ms', 15.2), + json_constraint('jitter_us', 1.2), +] +SERVICE_R1_R3_CONFIG_RULES = [ + json_config_rule_set( + '/settings', + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), + {'router_id': '10.10.10.1', 'route_distinguisher': '65000:123', 'sub_interface_index': 400, 'vlan_id': 400, + 'address_ip': '3.3.2.1', 'address_prefix': 24}), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R3_UUID, ENDPOINT_ID_R3_EP100['endpoint_uuid']['uuid']), + {'router_id': '20.20.20.1', 'route_distinguisher': '65000:321', 'sub_interface_index': 400, 'vlan_id': 500, + 'address_ip': '3.3.1.1', 'address_prefix': 24}), +] +SERVICE_R1_R3_ID = json_service_id(SERVICE_R1_R3_UUID, context_id=CONTEXT_ID) +SERVICE_R1_R3_DESCRIPTOR = json_service_l3nm_planned(SERVICE_R1_R3_UUID) + + +# ----- Test Descriptor ------------------------------------------------------------------------------------------------ +TEST_SERVICE_HANDLER = (SERVICE_HANDLER_NAME, { + 'contexts' : [CONTEXT], + 'topologies' : [TOPOLOGY], + 'devices' : [DEVICE_R1, DEVICE_R2, DEVICE_R3, DEVICE_O1], + 'links' : [LINK_R1_O1, LINK_R2_O1, LINK_R3_O1], + + 'service_id' : SERVICE_R1_R3_ID, + 'service_descriptor' : SERVICE_R1_R3_DESCRIPTOR, + 'service_endpoint_ids' : SERVICE_R1_R3_ENDPOINT_IDS, + 'service_config_rules' : SERVICE_R1_R3_CONFIG_RULES, + 'service_constraints' : SERVICE_R1_R3_CONSTRAINTS, +}) diff --git a/src/service/tests/ServiceHandler_L3NM_OC.py b/src/service/tests/ServiceHandler_L3NM_OC.py new file mode 100644 index 0000000000000000000000000000000000000000..0797a4af5505e78e2af49cefc29970f9c8ff11e7 --- /dev/null +++ b/src/service/tests/ServiceHandler_L3NM_OC.py @@ -0,0 +1,150 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import uuid +from typing import Dict, List, Tuple +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, + json_device_id) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Service import json_service_id, json_service_l3nm_planned +from .CommonObjects import CONTEXT, CONTEXT_ID, PACKET_PORT_SAMPLE_TYPES, TOPOLOGY, TOPOLOGY_ID + +SERVICE_HANDLER_NAME = 'l3nm_openconfig' + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): + return [ + json_endpoint_id(device_id, ep_uuid) + for ep_uuid, _ in endpoint_descriptors + ] + +def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): + return [ + json_endpoint(device_id, ep_uuid, ep_type, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES) + for ep_uuid, ep_type in endpoint_descriptors + ] + +# ----- Devices -------------------------------------------------------------------------------------------------------- +DEVICE_R1_UUID = 'R1' +DEVICE_R1_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP100', 'copper')] +DEVICE_R1_ADDRESS = '10.0.0.1' +DEVICE_R1_PORT = 830 +DEVICE_R1_USERNAME = 'admin' +DEVICE_R1_PASSWORD = 'admin' +DEVICE_R1_TIMEOUT = 120 +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1 = json_device_emulated_packet_router_disabled(DEVICE_R1_UUID, endpoints=DEVICE_R1_ENDPOINTS) +ENDPOINT_ID_R1_EP1 = DEVICE_R1_ENDPOINT_IDS[0] +ENDPOINT_ID_R1_EP100 = DEVICE_R1_ENDPOINT_IDS[1] +DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1_PORT, { + 'username': DEVICE_R1_USERNAME, + 'password': DEVICE_R1_PASSWORD, + 'timeout' : DEVICE_R1_TIMEOUT, +}) + + +DEVICE_R2_UUID = 'R2' +DEVICE_R2_ENDPOINT_DEFS = [('EP1', 'optical'), ('EP100', 'copper')] +DEVICE_R2_ADDRESS = '10.0.0.2' +DEVICE_R2_PORT = 830 +DEVICE_R2_USERNAME = 'admin' +DEVICE_R2_PASSWORD = 'admin' +DEVICE_R2_TIMEOUT = 120 +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2 = json_device_emulated_packet_router_disabled(DEVICE_R2_UUID, endpoints=DEVICE_R2_ENDPOINTS) +ENDPOINT_ID_R2_EP1 = DEVICE_R2_ENDPOINT_IDS[0] +ENDPOINT_ID_R2_EP100 = DEVICE_R2_ENDPOINT_IDS[1] +DEVICE_R2_CONNECT_RULES = json_device_connect_rules(DEVICE_R2_ADDRESS, DEVICE_R2_PORT, { + 'username': DEVICE_R2_USERNAME, + 'password': DEVICE_R2_PASSWORD, + 'timeout' : DEVICE_R2_TIMEOUT, +}) + + +DEVICE_O1_UUID = 'O1' +DEVICE_O1_ENDPOINT_DEFS = [(str(uuid.uuid4()), 'optical'), (str(uuid.uuid4()), 'optical')] +DEVICE_O1_ADDRESS = '10.0.0.3' +DEVICE_O1_PORT = 4900 +DEVICE_O1_TIMEOUT = 120 +DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) +DEVICE_O1_ENDPOINTS = json_endpoints(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +DEVICE_O1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +DEVICE_O1 = json_device_emulated_tapi_disabled(DEVICE_O1_UUID, endpoints=DEVICE_O1_ENDPOINTS) +ENDPOINT_ID_O1_EP1 = DEVICE_O1_ENDPOINT_IDS[0] +ENDPOINT_ID_O1_EP2 = DEVICE_O1_ENDPOINT_IDS[1] +DEVICE_O1_CONNECT_RULES = json_device_connect_rules(DEVICE_O1_ADDRESS, DEVICE_O1_PORT, { + 'timeout' : DEVICE_O1_TIMEOUT, +}) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_R1_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R1_UUID, ENDPOINT_ID_R1_EP1['endpoint_uuid']['uuid'], + DEVICE_O1_UUID, ENDPOINT_ID_O1_EP1['endpoint_uuid']['uuid']) +LINK_R1_O1_ID = json_link_id(LINK_R1_O1_UUID) +LINK_R1_O1 = json_link(LINK_R1_O1_UUID, [ENDPOINT_ID_R1_EP1, ENDPOINT_ID_O1_EP1]) + +LINK_R2_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R2_UUID, ENDPOINT_ID_R2_EP1['endpoint_uuid']['uuid'], + DEVICE_O1_UUID, ENDPOINT_ID_O1_EP2['endpoint_uuid']['uuid']) +LINK_R2_O1_ID = json_link_id(LINK_R2_O1_UUID) +LINK_R2_O1 = json_link(LINK_R2_O1_UUID, [ENDPOINT_ID_R2_EP1, ENDPOINT_ID_O1_EP2]) + + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_R1_R2_UUID = 'SVC:{:s}/{:s}-{:s}/{:s}'.format( + DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid'], + DEVICE_R2_UUID, ENDPOINT_ID_R2_EP100['endpoint_uuid']['uuid']) +SERVICE_R1_R2_ENDPOINT_IDS = [ENDPOINT_ID_R1_EP100, ENDPOINT_ID_R2_EP100] +SERVICE_R1_R2_CONSTRAINTS = [ + json_constraint('latency_ms', 15.2), + json_constraint('jitter_us', 1.2), +] +SERVICE_R1_R2_CONFIG_RULES = [ + json_config_rule_set( + '/settings', + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), + {'router_id': '10.10.10.1', 'route_distinguisher': '65000:123', 'sub_interface_index': 400, 'vlan_id': 400, + 'address_ip': '3.3.2.1', 'address_prefix': 24}), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R2_UUID, ENDPOINT_ID_R2_EP100['endpoint_uuid']['uuid']), + {'router_id': '20.20.20.1', 'route_distinguisher': '65000:321', 'sub_interface_index': 400, 'vlan_id': 500, + 'address_ip': '3.3.1.1', 'address_prefix': 24}), +] +SERVICE_R1_R2_ID = json_service_id(SERVICE_R1_R2_UUID, context_id=CONTEXT_ID) +SERVICE_R1_R2_DESCRIPTOR = json_service_l3nm_planned(SERVICE_R1_R2_UUID) + + +# ----- Test Descriptor ------------------------------------------------------------------------------------------------ +TEST_SERVICE_HANDLER = (SERVICE_HANDLER_NAME, { + 'contexts' : [CONTEXT], + 'topologies' : [TOPOLOGY], + 'devices' : [DEVICE_R1, DEVICE_R2, DEVICE_O1], + 'links' : [LINK_R1_O1, LINK_R2_O1], + + 'service_id' : SERVICE_R1_R2_ID, + 'service_descriptor' : SERVICE_R1_R2_DESCRIPTOR, + 'service_endpoint_ids' : SERVICE_R1_R2_ENDPOINT_IDS, + 'service_config_rules' : SERVICE_R1_R2_CONFIG_RULES, + 'service_constraints' : SERVICE_R1_R2_CONSTRAINTS, +}) diff --git a/src/service/tests/ServiceHandlersToTest.py b/src/service/tests/ServiceHandlersToTest.py new file mode 100644 index 0000000000000000000000000000000000000000..43f2a2eb2e720eea5b9f690e374ec3b5830eac1d --- /dev/null +++ b/src/service/tests/ServiceHandlersToTest.py @@ -0,0 +1,29 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Add/comment in this file the service handlers to be tested by the unitry tests. + +SERVICE_HANDLERS_TO_TEST = [] + +try: + from service.tests.ServiceHandler_L3NM_EMU import TEST_SERVICE_HANDLER + SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) +except ImportError: + pass + +try: + from service.tests.ServiceHandler_L3NM_OC import TEST_SERVICE_HANDLER + SERVICE_HANDLERS_TO_TEST.append(TEST_SERVICE_HANDLER) +except ImportError: + pass diff --git a/src/service/tests/__init__.py b/src/service/tests/__init__.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..70a33251242c51f49140e596b8208a19dd5245f7 100644 --- a/src/service/tests/__init__.py +++ b/src/service/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/service/tests/test_unitary.py b/src/service/tests/test_unitary.py index e807cb845ad2abf0d13fca559a0be5e03f4ed795..e12ec2bc4dda856d76acd50c90af4b7d7941fb00 100644 --- a/src/service/tests/test_unitary.py +++ b/src/service/tests/test_unitary.py @@ -1,357 +1,185 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + import copy, grpc, logging, pytest -from google.protobuf.json_format import MessageToDict -#from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID -#from common.tests.Assertions import validate_empty, validate_service, validate_service_id, \ -# validate_service_list_is_empty, validate_service_list_is_not_empty -from service.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +from common.proto.context_pb2 import ( + Context, ContextId, Device, DeviceId, Link, LinkId, Service, ServiceId, Topology, TopologyId) +from common.tests.PytestGenerateTests import pytest_generate_tests # (required) pylint: disable=unused-import +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient from service.client.ServiceClient import ServiceClient -from service.proto.context_pb2 import Service -from service.service.ServiceService import ServiceService - -port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, service_service, context_client, device_client, service_client) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -## use "copy.deepcopy" to prevent propagating forced changes during tests -#CONTEXT_ID = {'contextUuid': {'uuid': DEFAULT_CONTEXT_ID}} -#TOPOLOGY_ID = {'contextId': copy.deepcopy(CONTEXT_ID), 'topoId': {'uuid': DEFAULT_TOPOLOGY_ID}} -#SERVICE_ID = {'contextId': copy.deepcopy(CONTEXT_ID), 'cs_id': {'uuid': 'DEV1'}} -#SERVICE = { -# 'cs_id': copy.deepcopy(SERVICE_ID), -# 'serviceType': ServiceType.L3NM, -# 'serviceConfig': {'serviceConfig': ''}, -# 'serviceState': {'serviceState': ServiceStateEnum.PLANNED}, -# 'constraint': [ -# {'constraint_type': 'latency_ms', 'constraint_value': '100'}, -# {'constraint_type': 'hops', 'constraint_value': '5'}, -# ], -# 'endpointList' : [ -# {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV1'}}, 'port_id': {'uuid' : 'EP5'}}, -# {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV2'}}, 'port_id': {'uuid' : 'EP5'}}, -# {'topoId': copy.deepcopy(TOPOLOGY_ID), 'dev_id': {'device_id': {'uuid': 'DEV3'}}, 'port_id': {'uuid' : 'EP5'}}, -# ] -#} - -@pytest.fixture(scope='session') -def service_service(): - _service = ServiceService(port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def service_client(service_service): - _client = ServiceClient(address='127.0.0.1', port=port) - yield _client - _client.close() - -def test_dummy(service_client : ServiceClient): - reply = service_client.CreateService(Service()) - -#def test_get_services_empty(service_client : ServiceClient): -# # should work -# validate_service_list_is_empty(MessageToDict( -# service_client.GetServiceList(Empty()), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) - -#def test_create_service_wrong_service_attributes(service_client : ServiceClient): -# # should fail with wrong service context -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['cs_id']['contextId']['contextUuid']['uuid'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'service.cs_id.contextId.contextUuid.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with service context does not exist -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['cs_id']['contextId']['contextUuid']['uuid'] = 'wrong-context' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(wrong-context) does not exist in the database.' -# assert e.value.details() == msg -# -# # should fail with wrong service id -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['cs_id']['cs_id']['uuid'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'service.cs_id.cs_id.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with wrong service type -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['serviceType'] = ServiceType.UNKNOWN -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Method(CreateService) does not accept ServiceType(UNKNOWN). '\ -# 'Permitted values for Method(CreateService) are '\ -# 'ServiceType([\'L2NM\', \'L3NM\', \'TAPI_CONNECTIVITY_SERVICE\']).' -# assert e.value.details() == msg -# -# # should fail with wrong service state -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['serviceState']['serviceState'] = ServiceStateEnum.PENDING_REMOVAL -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Method(CreateService) does not accept ServiceState(PENDING_REMOVAL). '\ -# 'Permitted values for Method(CreateService) are '\ -# 'ServiceState([\'PLANNED\']).' -# assert e.value.details() == msg -# -#def test_create_service_wrong_constraint(service_client : ServiceClient): -# # should fail with wrong constraint type -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['constraint'][0]['constraint_type'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'constraint[#0].constraint_type() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with wrong constraint value -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['constraint'][0]['constraint_value'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'constraint[#0].constraint_value() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with dupplicated constraint type -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['constraint'][1] = copy_service['constraint'][0] -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Duplicated ConstraintType(latency_ms) in Constraint(#1) of Context(admin)/Service(DEV1).' -# assert e.value.details() == msg -# -#def test_create_service_wrong_endpoint(service_client : ServiceClient, database : Database): -# # should fail with wrong endpoint context -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['topoId']['contextId']['contextUuid']['uuid'] = 'wrong-context' -# print(copy_service) -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Context(wrong-context) in Endpoint(#0) of '\ -# 'Context(admin)/Service(DEV1) mismatches acceptable Contexts({\'admin\'}). '\ -# 'Optionally, leave field empty to use predefined Context(admin).' -# assert e.value.details() == msg -# -# # should fail with wrong endpoint topology -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['topoId']['topoId']['uuid'] = 'wrong-topo' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Context(admin)/Topology(wrong-topo) in Endpoint(#0) of '\ -# 'Context(admin)/Service(DEV1) mismatches acceptable Topologies({\'admin\'}). '\ -# 'Optionally, leave field empty to use predefined Topology(admin).' -# assert e.value.details() == msg -# -# # should fail with endpoint device is empty -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['dev_id']['device_id']['uuid'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'endpoint_id[#0].dev_id.device_id.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with endpoint device not found -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['dev_id']['device_id']['uuid'] = 'wrong-device' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(admin)/Topology(admin)/Device(wrong-device) in Endpoint(#0) of '\ -# 'Context(admin)/Service(DEV1) does not exist in the database.' -# assert e.value.details() == msg -# -# # should fail with endpoint device duplicated -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][1] = copy_service['endpointList'][0] -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'Duplicated Context(admin)/Topology(admin)/Device(DEV1) in Endpoint(#1) of '\ -# 'Context(admin)/Service(DEV1).' -# assert e.value.details() == msg -# -# # should fail with endpoint port is empty -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['port_id']['uuid'] = '' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'endpoint_id[#0].port_id.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with endpoint port not found -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['port_id']['uuid'] = 'wrong-port' -# service_client.CreateService(Service(**copy_service)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(admin)/Topology(admin)/Device(DEV1)/Port(wrong-port) in Endpoint(#0) of '\ -# 'Context(admin)/Service(DEV1) does not exist in the database.' -# assert e.value.details() == msg -# -#def test_get_service_does_not_exist(service_client : ServiceClient): -# # should fail with service context does not exist -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service_id = copy.deepcopy(SERVICE_ID) -# copy_service_id['contextId']['contextUuid']['uuid'] = 'wrong-context' -# service_client.GetServiceById(ServiceId(**copy_service_id)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(wrong-context) does not exist in the database.' -# assert e.value.details() == msg -# -# # should fail with service does not exist -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# service_client.GetServiceById(ServiceId(**SERVICE_ID)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(admin)/Service(DEV1) does not exist in the database.' -# assert e.value.details() == msg -# -#def test_update_service_does_not_exist(service_client : ServiceClient): -# # should fail with service does not exist -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# service_client.UpdateService(Service(**SERVICE)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(admin)/Service(DEV1) does not exist in the database.' -# assert e.value.details() == msg -# -#def test_create_service(service_client : ServiceClient): -# # should work -# validate_service_id(MessageToDict( -# service_client.CreateService(Service(**SERVICE)), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_create_service_already_exists(service_client : ServiceClient): -# # should fail with service already exists -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# service_client.CreateService(Service(**SERVICE)) -# assert e.value.code() == grpc.StatusCode.ALREADY_EXISTS -# msg = 'Context(admin)/Service(DEV1) already exists in the database.' -# assert e.value.details() == msg -# -#def test_get_service(service_client : ServiceClient): -# # should work -# validate_service(MessageToDict( -# service_client.GetServiceById(ServiceId(**SERVICE_ID)), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_update_service(service_client : ServiceClient): -# # should work -# copy_service = copy.deepcopy(SERVICE) -# copy_service['serviceConfig']['serviceConfig'] = '' -# copy_service['serviceState']['serviceState'] = ServiceStateEnum.ACTIVE -# copy_service['constraint'] = [ -# {'constraint_type': 'latency_ms', 'constraint_value': '200'}, -# {'constraint_type': 'bandwidth_gbps', 'constraint_value': '100'}, -# ] -# copy_service['endpointList'] = [ -# { -# 'topoId': {'contextId': {'contextUuid': {'uuid': 'admin'}}, 'topoId': {'uuid': 'admin'}}, -# 'dev_id': {'device_id': {'uuid': 'DEV1'}}, -# 'port_id': {'uuid' : 'EP5'} -# }, -# { -# 'topoId': {'contextId': {'contextUuid': {'uuid': 'admin'}}, 'topoId': {'uuid': 'admin'}}, -# 'dev_id': {'device_id': {'uuid': 'DEV2'}}, -# 'port_id': {'uuid' : 'EP6'} -# }, -# ] -# validate_service_id(MessageToDict( -# service_client.UpdateService(Service(**copy_service)), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_delete_service_wrong_service_id(service_client : ServiceClient): -# # should fail with service context is empty -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service_id = copy.deepcopy(SERVICE_ID) -# copy_service_id['contextId']['contextUuid']['uuid'] = '' -# service_client.DeleteService(ServiceId(**copy_service_id)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'service_id.contextId.contextUuid.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with service context does not exist -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service_id = copy.deepcopy(SERVICE_ID) -# copy_service_id['contextId']['contextUuid']['uuid'] = 'wrong-context' -# service_client.DeleteService(ServiceId(**copy_service_id)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(wrong-context) does not exist in the database.' -# assert e.value.details() == msg -# -# # should fail with service id is empty -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service_id = copy.deepcopy(SERVICE_ID) -# copy_service_id['cs_id']['uuid'] = '' -# service_client.DeleteService(ServiceId(**copy_service_id)) -# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT -# msg = 'service_id.cs_id.uuid() is out of range: '\ -# 'allow_empty(False) min_length(None) max_length(None) allowed_lengths(None).' -# assert e.value.details() == msg -# -# # should fail with service id is empty -# with pytest.raises(grpc._channel._InactiveRpcError) as e: -# copy_service_id = copy.deepcopy(SERVICE_ID) -# copy_service_id['cs_id']['uuid'] = 'wrong-service' -# service_client.DeleteService(ServiceId(**copy_service_id)) -# assert e.value.code() == grpc.StatusCode.NOT_FOUND -# msg = 'Context(admin)/Service(wrong-service) does not exist in the database.' -# assert e.value.details() == msg -# -#def test_delete_service(service_client : ServiceClient): -# # should work -# validate_empty(MessageToDict( -# service_client.DeleteService(ServiceId(**SERVICE_ID)), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_get_services_empty_2(service_client : ServiceClient): -# # should work -# validate_service_list_is_empty(MessageToDict( -# service_client.GetServiceList(Empty()), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_create_service_empty_endpoints(service_client : ServiceClient): -# # should work -# copy_service = copy.deepcopy(SERVICE) -# copy_service['endpointList'][0]['topoId']['contextId']['contextUuid']['uuid'] = '' -# copy_service['endpointList'][0]['topoId']['topoId']['uuid'] = '' -# validate_service_id(MessageToDict( -# service_client.CreateService(Service(**copy_service)), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# -#def test_get_services_full(service_client : ServiceClient): -# # should work -# validate_service_list_is_not_empty(MessageToDict( -# service_client.GetServiceList(Empty()), -# including_default_value_fields=True, preserving_proto_field_name=True, -# use_integers_for_enums=False)) -# \ No newline at end of file +try: + from .ServiceHandlersToTest import SERVICE_HANDLERS_TO_TEST +except ImportError: + LOGGER.exception('Unable to load service handlers, nothing will be tested.') + SERVICE_HANDLERS_TO_TEST = [] + +class TestServiceHandlers: + scenarios = SERVICE_HANDLERS_TO_TEST + + def test_prepare_environment( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + for context in contexts: context_client.SetContext(Context(**context)) + for topology in topologies: context_client.SetTopology(Topology(**topology)) + for device in devices: device_client.AddDevice(Device(**device)) + for link in links: context_client.SetLink(Link(**link)) + + + def test_service_create_error_cases( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + with pytest.raises(grpc.RpcError) as e: + service_with_endpoints = copy.deepcopy(service_descriptor) + service_with_endpoints['service_endpoint_ids'].extend(service_endpoint_ids) + service_client.CreateService(Service(**service_with_endpoints)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'service.service_endpoint_ids([' + msg_tail = ']) is invalid; RPC method CreateService does not accept Endpoints. '\ + 'Endpoints should be configured after creating the service.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + with pytest.raises(grpc.RpcError) as e: + service_with_config_rules = copy.deepcopy(service_descriptor) + service_with_config_rules['service_config']['config_rules'].extend(service_config_rules) + service_client.CreateService(Service(**service_with_config_rules)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'service.service_config.config_rules([' + msg_tail = ']) is invalid; RPC method CreateService does not accept Config Rules. '\ + 'Config Rules should be configured after creating the service.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + with pytest.raises(grpc.RpcError) as e: + service_with_constraints = copy.deepcopy(service_descriptor) + service_with_constraints['service_constraints'].extend(service_constraints) + service_client.CreateService(Service(**service_with_constraints)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'service.service_constraints([' + msg_tail = ']) is invalid; RPC method CreateService does not accept Constraints. '\ + 'Constraints should be configured after creating the service.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + + def test_service_create_correct( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_client.CreateService(Service(**service_descriptor)) + + + def test_service_get_created( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_data = context_client.GetService(ServiceId(**service_id)) + LOGGER.info('service_data = {:s}'.format(grpc_message_to_json_string(service_data))) + + + def test_service_update_configure( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_with_settings = copy.deepcopy(service_descriptor) + service_with_settings['service_endpoint_ids'].extend(service_endpoint_ids) + service_with_settings['service_config']['config_rules'].extend(service_config_rules) + service_with_settings['service_constraints'].extend(service_constraints) + service_client.UpdateService(Service(**service_with_settings)) + + for endpoint_id in service_endpoint_ids: + device_id = endpoint_id['device_id'] + device_data = context_client.GetDevice(DeviceId(**device_id)) + for i,config_rule in enumerate(device_data.device_config.config_rules): + LOGGER.info('device_data[{:s}][#{:d}] => {:s}'.format( + str(device_id), i, grpc_message_to_json_string(config_rule))) + + + def test_service_update_deconfigure( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_with_settings = copy.deepcopy(service_descriptor) + service_with_settings['service_endpoint_ids'].extend([]) # remove endpoints + service_client.UpdateService(Service(**service_with_settings)) + + for endpoint_id in service_endpoint_ids: + device_id = endpoint_id['device_id'] + device_data = context_client.GetDevice(DeviceId(**device_id)) + for i,config_rule in enumerate(device_data.device_config.config_rules): + LOGGER.info('device_data[{:s}][#{:d}] => {:s}'.format( + str(device_id), i, grpc_message_to_json_string(config_rule))) + + + def test_service_get_updated( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_data = context_client.GetService(ServiceId(**service_id)) + LOGGER.info('service_data = {:s}'.format(grpc_message_to_json_string(service_data))) + + + def test_service_delete( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + service_client.DeleteService(ServiceId(**service_id)) + + + def test_cleanup_environment( + self, service_id, service_descriptor, service_endpoint_ids, service_config_rules, service_constraints, + contexts, topologies, devices, links, + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + service_client : ServiceClient): # pylint: disable=redefined-outer-name + + for link in links: context_client.RemoveLink(LinkId(**link['link_id'])) + for device in devices: device_client.DeleteDevice(DeviceId(**device['device_id'])) + for topology in topologies: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + for context in contexts: context_client.RemoveContext(ContextId(**context['context_id'])) diff --git a/src/slice/.gitlab-ci.yml b/src/slice/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..9393e6b29a2fbe180e74944375c871af4c4ae3d6 --- /dev/null +++ b/src/slice/.gitlab-ci.yml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build slice + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 4040:4040 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test slice + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/slice/Config.py b/src/slice/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/Config.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/slice/Dockerfile b/src/slice/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..96a751d156edcaef38794ecfe5b409cbeb081e82 --- /dev/null +++ b/src/slice/Dockerfile @@ -0,0 +1,71 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/slice +WORKDIR /var/teraflow/slice +COPY src/slice/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/interdomain/. interdomain/ +COPY src/service/. service/ +COPY src/slice/. slice/ + +# Start the service +ENTRYPOINT ["python", "-m", "slice.service"] diff --git a/src/slice/__init__.py b/src/slice/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/slice/client/SliceClient.py b/src/slice/client/SliceClient.py new file mode 100644 index 0000000000000000000000000000000000000000..520f00e6cafa98a3247ea4655c5d36ddeb7c2309 --- /dev/null +++ b/src/slice/client/SliceClient.py @@ -0,0 +1,67 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty, Slice, SliceId +from common.proto.slice_pb2_grpc import SliceServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class SliceClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.SLICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.SLICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = SliceServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def CreateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('CreateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSlice(request) + LOGGER.debug('CreateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def UpdateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('UpdateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.UpdateSlice(request) + LOGGER.debug('UpdateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteSlice(self, request : SliceId) -> Empty: + LOGGER.debug('DeleteSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteSlice(request) + LOGGER.debug('DeleteSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/slice/client/__init__.py b/src/slice/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/slice/old_code/ConstraintsChecker.py b/src/slice/old_code/ConstraintsChecker.py new file mode 100644 index 0000000000000000000000000000000000000000..f87dab65feff7275966ba8dc43ea0cdb396f32fc --- /dev/null +++ b/src/slice/old_code/ConstraintsChecker.py @@ -0,0 +1,52 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_string +from common.exceptions.ServiceException import ServiceException +from common.proto.context_pb2 import Constraint + +def check_constraint( + logger : logging.Logger, constraint_number : int, parent_name : str, constraint : Constraint, + add_constraints : Dict[str, Dict[str, Set[str]]]) -> Tuple[str, str]: + + try: + constraint_type = chk_string('constraint[#{}].constraint_type'.format(constraint_number), + constraint.constraint_type, + allow_empty=False) + constraint_value = chk_string('constraint[#{}].constraint_value'.format(constraint_number), + constraint.constraint_value, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if constraint_type in add_constraints: + msg = 'Duplicated ConstraintType({}) in {}.' + msg = msg.format(constraint_type, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + add_constraints[constraint_type] = constraint_value + return constraint_type, constraint_value + +def check_constraints(logger : logging.Logger, parent_name : str, constraints): + add_constraints : Dict[str, str] = {} + constraint_tuples : List[Tuple[str, str]] = [] + for constraint_number,constraint in enumerate(constraints): + _parent_name = 'Constraint(#{}) of {}'.format(constraint_number, parent_name) + constraint_type, constraint_value = check_constraint( + logger, constraint_number, _parent_name, constraint, add_constraints) + constraint_tuples.append((constraint_type, constraint_value)) + return constraint_tuples diff --git a/src/slice/old_code/SliceCheckers.py b/src/slice/old_code/SliceCheckers.py new file mode 100644 index 0000000000000000000000000000000000000000..660a522d082fdc918eaa895e09f8469ede05713b --- /dev/null +++ b/src/slice/old_code/SliceCheckers.py @@ -0,0 +1,32 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc +from common.database.api.Database import Database +from common.database.api.context.slice.Slice import Slice +from common.exceptions.ServiceException import ServiceException + +def check_slice_exists(database : Database, context_id : str, slice_id : str) -> Slice: + db_context = database.context(context_id).create() + if db_context.slices.contains(slice_id): return db_context.slice(slice_id) + msg = 'Context({})/Slice({}) does not exist in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + +def check_slice_not_exists(database : Database, context_id : str, slice_id : str): + db_context = database.context(context_id).create() + if not db_context.slices.contains(slice_id): return + msg = 'Context({})/Slice({}) already exists in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.ALREADY_EXISTS, msg) diff --git a/src/slice/old_code/Tools.py b/src/slice/old_code/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..4ea7900489f27588399e2eb94b6a5576d8b08fd0 --- /dev/null +++ b/src/slice/old_code/Tools.py @@ -0,0 +1,213 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_options, chk_string +from common.database.api.Database import Database +from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID +from common.database.api.context.service.Service import Service +from common.database.api.context.slice.SliceStatus import SliceStatus, slicestatus_enum_values, to_slicestatus_enum +from common.database.api.context.topology.device.Endpoint import Endpoint +from common.exceptions.ServiceException import ServiceException +from common.proto.slice_pb2 import TransportSlice +from common.tools.service.ConstraintsChecker import check_constraints +from common.tools.service.EndpointIdCheckers import check_endpoint_id +from common.tools.service.DeviceCheckers import check_device_endpoint_exists +from common.tools.service.EnumCheckers import check_enum +from common.tools.service.ServiceCheckers import check_service_exists +from common.tools.service.SliceCheckers import check_slice_exists #, check_slice_not_exists + +# For each method name, define acceptable slice statuses. Empty set means accept all. +ACCEPTED_SLICE_STATUSES : Dict[str, Set[SliceStatus]] = { + 'CreateUpdateSlice': set([SliceStatus.PLANNED, SliceStatus.INIT, SliceStatus.ACTIVE]), + 'DeleteSlice': set([SliceStatus.PLANNED, SliceStatus.DEINIT]), +} + +def _check_slice_exists(method_name : str, database : Database, context_id : str, slice_id : str): + if method_name in ['CreateUpdateSlice']: + # Do nothing; creation implies checking slice does not exist. However, if it exists, we can perform an update. + #check_slice_not_exists(database, context_id, slice_id) + pass + elif method_name in ['DeleteSlice']: + check_slice_exists(database, context_id, slice_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition [_check_slice_exists(method_name={}, slice_id={})]' + msg = msg.format(str(method_name), str(slice_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + +def _check_slice_endpoints( + logger : logging.Logger, database : Database, context_id : str, slice_id : str, slice_endpoints + ) -> List[Tuple[Endpoint, str]]: + + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,slice_endpoint in enumerate(slice_endpoints): + parent_name = 'SliceEndpoint(#{}) of Context({})/Slice({})' + parent_name = parent_name.format(endpoint_number, context_id, slice_id) + + ep_topology_id, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, slice_endpoint.port_id.port_id, add_topology_devices_endpoints, + acceptable_context_ids=set([context_id]), prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + slice_endpoint.port_id.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = check_device_endpoint_exists( + database, parent_name, context_id, ep_topology_id, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + return db_endpoints__port_types + +def _check_services( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_service_ids + ) -> List[Service]: + + add_context_services : Dict[str, Set[str]] = {} + db_services : List[Service] = [] + for service_number,service_id in enumerate(slice_service_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + service_context_id = chk_string ('services[#{}].contextId.contextUuid.uuid'.format(service_number), + service_id.contextId.contextUuid.uuid, + allow_empty=True) + service_id = chk_string ('services[#{}].cs_id.uuid'.format(service_number), + service_id.cs_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(service_context_id) == 0: service_context_id = context_id + + add_services = add_context_services.setdefault(context_id, dict()) + if service_id in add_services: + msg = 'Duplicated Context({})/Service({}) in {}.' + msg = msg.format(service_context_id, service_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_service = check_service_exists(database, service_context_id, service_id) + db_services.append(db_service) + add_services.add(service_id) + return db_services + +def _check_subslices( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_subslice_ids + ) -> List[Slice]: + + add_context_subslices : Dict[str, Set[str]] = {} + db_subslices : List[Slice] = [] + for subslice_number,subslice_id in enumerate(slice_subslice_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + subslice_context_id = chk_string ('subSlicesId[#{}].contextId.contextUuid.uuid'.format(subslice_number), + subslice_id.contextId.contextUuid.uuid, + allow_empty=True) + subslice_id = chk_string ('subSlicesId[#{}].slice_id.uuid'.format(subslice_number), + subslice_id.slice_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(subslice_context_id) == 0: subslice_context_id = context_id + + add_subslices = add_context_subslices.setdefault(context_id, dict()) + if subslice_id in add_subslices: + msg = 'Duplicated Context({})/Slice({}) in {}.' + msg = msg.format(subslice_context_id, subslice_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_subslice = check_slice_exists(database, subslice_context_id, subslice_id) + db_subslices.append(db_subslice) + add_subslices.add(subslice_id) + return db_subslices + +def check_slice_status(method_name : str, value : str) -> SliceStatus: + return check_enum( + 'SliceStatus', method_name, value, to_slicestatus_enum, ACCEPTED_SLICE_STATUSES) + +def check_slice_request( + method_name : str, request : TransportSlice, database : Database, logger : logging.Logger + ): # -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + context_id = chk_string ('slice.slice_id.contextId.contextUuid.uuid', + request.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + slice_id = chk_string ('slice.slice_id.slice_id.uuid', + request.slice_id.slice_id.uuid, + allow_empty=False) + status_context_id = chk_string ('slice.status.slice_id.contextId.contextUuid.uuid', + request.status.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + status_slice_id = chk_string ('slice.status.slice_id.slice_id.uuid', + request.status.slice_id.slice_id.uuid, + allow_empty=True) + slice_status = chk_options('slice.status.status', + request.status.status, + slicestatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(context_id) == 0: context_id = DEFAULT_CONTEXT_ID + + if (len(status_context_id) > 0) and (status_context_id != context_id): + msg = ' '.join([ + 'slice.status.slice_id.contextId.contextUuid.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.contextId.contextUuid.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.contextId.contextUuid.uuid({}), if set,', + 'or, otherwise, the default Context({})' + ]) + msg = msg.format( + status_context_id, context_id, context_id, DEFAULT_CONTEXT_ID) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + if (len(status_slice_id) > 0) and (status_slice_id != slice_id): + msg = ' '.join([ + 'slice.status.slice_id.slice_id.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.slice_id.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.slice_id.uuid({}).', + ]) + msg = msg.format( + status_slice_id, slice_id, slice_id) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + slice_status = check_slice_status(method_name, slice_status) + + # ----- Check if slice exists in database -------------------------------------------------------------------------- + _check_slice_exists(method_name, database, context_id, slice_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + db_endpoints__port_types = _check_slice_endpoints(logger, database, context_id, slice_id, request.endpoints) + + # ----- Parse constraints ------------------------------------------------------------------------------------------ + parent_name = 'Context({})/Slice({})'.format(context_id, slice_id) + constraint_tuples : List[Tuple[str, str]] = check_constraints(logger, parent_name, request.constraints) + + # ----- Parse Service Ids ------------------------------------------------------------------------------------------ + db_services = _check_services(logger, database, parent_name, context_id, request.services) + + # ----- Parse SubSlice Ids ----------------------------------------------------------------------------------------- + db_subslices = _check_subslices(logger, database, parent_name, context_id, request.subSlicesId) + + return context_id, slice_id, slice_status, db_endpoints__port_types, constraint_tuples, db_services, db_subslices diff --git a/src/slice/old_code/Tools_2.py b/src/slice/old_code/Tools_2.py new file mode 100644 index 0000000000000000000000000000000000000000..c29a11a06bc7e4258fe4798ebf632a1f00db3170 --- /dev/null +++ b/src/slice/old_code/Tools_2.py @@ -0,0 +1,190 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +src/common/tools/service/DeviceCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.device.Device import Device + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.exceptions.ServiceException import ServiceException + + def check_device_exists(database : Database, context_id : str, topology_id : str, device_id : str) -> Device: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.devices.contains(device_id): return db_topology.device(device_id) + msg = 'Context({})/Topology({})/Device({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, device_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/LinkCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.link.Link import Link + from common.exceptions.ServiceException import ServiceException + + def check_link_exists(database : Database, context_id : str, topology_id : str, link_id : str) -> Link: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.links.contains(link_id): return db_topology.link(link_id) + msg = 'Context({})/Topology({})/Link({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, link_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/ServiceCheckers.py + import grpc + from common.database.api.Database import Database + from common.exceptions.ServiceException import ServiceException + + def check_service_exists(database : Database, context_id : str, service_id : str): + if not database.contexts.contains(context_id): + msg = 'Context({}) does not exist in the database.' + msg = msg.format(context_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + db_context = database.context(context_id) + if db_context.services.contains(service_id): + return db_context.service(service_id) + + msg = 'Context({})/Service({}) does not exist in the database.' + msg = msg.format(context_id, service_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/device/service/Tools.py + import grpc, logging + from typing import Dict, List, Set, Tuple + from common.Checkers import chk_options, chk_string + from common.database.api.Database import Database + from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.database.api.context.topology.device.OperationalStatus import OperationalStatus, \ + operationalstatus_enum_values, to_operationalstatus_enum + from common.exceptions.ServiceException import ServiceException + from common.tools.service.DeviceCheckers import check_device_endpoint_exists + from common.tools.service.EndpointIdCheckers import check_endpoint_id + from common.tools.service.EnumCheckers import check_enum + from common.tools.service.DeviceCheckers import check_device_exists, check_device_not_exists + from device.proto.context_pb2 import Device, DeviceId + + # For each method name, define acceptable device operational statuses. Empty set means accept all. + ACCEPTED_DEVICE_OPERATIONAL_STATUSES : Dict[str, Set[OperationalStatus]] = { + 'AddDevice': set([OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + 'UpdateDevice': set([OperationalStatus.KEEP_STATE, OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + } + + def _check_device_exists(method_name : str, database : Database, device_id : str): + if method_name in ['AddDevice']: + check_device_not_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + check_device_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_exists(method_name={}, device_id={})' + msg = msg.format(str(method_name), str(device_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def _check_device_endpoint_exists_or_get_pointer( + method_name : str, database : Database, parent_name : str, device_id : str, endpoint_id : str) -> Endpoint: + + if method_name in ['AddDevice']: + db_context = database.context(DEFAULT_CONTEXT_ID) + db_topology = db_context.topology(DEFAULT_TOPOLOGY_ID) + db_device = db_topology.device(device_id) + return db_device.endpoint(endpoint_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + return check_device_endpoint_exists( + database, parent_name, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id, endpoint_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_endpoint_exists_or_get_pointer(method_name={}, ' \ + 'parent_name={}, device_id={}, endpoint_id={})' + msg = msg.format(str(method_name), str(parent_name), str(device_id), str(endpoint_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def check_device_operational_status(method_name : str, value : str) -> OperationalStatus: + return check_enum( + 'OperationalStatus', method_name, value, to_operationalstatus_enum, ACCEPTED_DEVICE_OPERATIONAL_STATUSES) + + def check_device_request( + method_name : str, request : Device, database : Database, logger : logging.Logger + ) -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string ('device.device_id.device_id.uuid', + request.device_id.device_id.uuid, + allow_empty=False) + device_type = chk_string ('device.device_type', + request.device_type, + allow_empty=False) + device_config = chk_string ('device.device_config.device_config', + request.device_config.device_config, + allow_empty=True) + device_opstat = chk_options('device.devOperationalStatus', + request.devOperationalStatus, + operationalstatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + device_opstat = check_device_operational_status(method_name, device_opstat) + + # ----- Check if device exists in database ------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,endpoint in enumerate(request.endpointList): + parent_name = 'Endpoint(#{}) of Context({})/Topology({})/Device({})' + parent_name = parent_name.format(endpoint_number, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + + _, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, endpoint.port_id, add_topology_devices_endpoints, + predefined_device_id=device_id, acceptable_device_ids=set([device_id]), + prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + endpoint.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = _check_device_endpoint_exists_or_get_pointer( + method_name, database, parent_name, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + + return device_id, device_type, device_config, device_opstat, db_endpoints__port_types + + def check_device_id_request( + method_name : str, request : DeviceId, database : Database, logger : logging.Logger) -> str: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string('device_id.device_id.uuid', + request.device_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + # ----- Check if device exists in database --------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + return device_id + + +src/service/service/Tools.py diff --git a/src/centralizedattackdetector/tests/__init__.py b/src/slice/requirements.in similarity index 100% rename from src/centralizedattackdetector/tests/__init__.py rename to src/slice/requirements.in diff --git a/src/slice/service/SliceService.py b/src/slice/service/SliceService.py new file mode 100644 index 0000000000000000000000000000000000000000..7a404d188b783a4f0051195ddf5f35ab26cf6846 --- /dev/null +++ b/src/slice/service/SliceService.py @@ -0,0 +1,28 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from slice.service.SliceServiceServicerImpl import SliceServiceServicerImpl + +class SliceService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.SLICE) + super().__init__(port, cls_name=cls_name) + self.slice_servicer = SliceServiceServicerImpl() + + def install_servicers(self): + add_SliceServiceServicer_to_server(self.slice_servicer, self.server) diff --git a/src/slice/service/SliceServiceServicerImpl.py b/src/slice/service/SliceServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..275a201148940df10afcf446b57ab42e6c6a528c --- /dev/null +++ b/src/slice/service/SliceServiceServicerImpl.py @@ -0,0 +1,135 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc, json, logging +from common.proto.context_pb2 import ( + ConfigActionEnum, Empty, Service, ServiceStatusEnum, ServiceTypeEnum, Slice, SliceId, SliceStatusEnum) +from common.proto.slice_pb2_grpc import SliceServiceServicer +from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from context.client.ContextClient import ContextClient +from interdomain.client.InterdomainClient import InterdomainClient +from service.client.ServiceClient import ServiceClient + +LOGGER = logging.getLogger(__name__) + +SERVICE_NAME = 'Slice' +METHOD_NAMES = ['CreateSlice', 'UpdateSlice', 'DeleteSlice'] +METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) + +class SliceServiceServicerImpl(SliceServiceServicer): + def __init__(self): + LOGGER.debug('Creating Servicer...') + LOGGER.debug('Servicer Created') + + def create_update(self, request : Slice) -> SliceId: + context_client = ContextClient() + + slice_id = context_client.SetSlice(request) + if len(request.slice_endpoint_ids) != 2: return slice_id + + domains = set() + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + domains.add(device_uuid.split('@')[1]) + + is_multi_domain = len(domains) == 2 + if is_multi_domain: + interdomain_client = InterdomainClient() + slice_id = interdomain_client.RequestSlice(request) + else: + # pylint: disable=no-member + service_request = Service() + service_request.service_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + service_request.service_id.service_uuid.uuid = request.slice_id.slice_uuid.uuid + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + service_client = ServiceClient() + service_reply = service_client.CreateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service creation failed. Wrong Service Id was returned') + + config_rule = service_request.service_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '/settings' + config_rule.custom.resource_value = json.dumps( + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}, + sort_keys=True) + + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = slice_endpoint_id.endpoint_uuid.uuid + + endpoint_id = service_request.service_endpoint_ids.add() + endpoint_id.device_id.device_uuid.uuid = device_uuid + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + + config_rule = service_request.service_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '/device[{:s}]/endpoint[{:s}]/settings'.format( + device_uuid, endpoint_uuid) + config_rule.custom.resource_value = json.dumps( + {'router_id': '0.0.0.0', 'route_distinguisher': '0:0', 'sub_interface_index': 0, 'vlan_id': 0, + 'address_ip': '0.0.0.0', 'address_prefix': 0}, + sort_keys=True) + + service_reply = service_client.UpdateService(service_request) + if service_reply != service_request.service_id: # pylint: disable=no-member + raise Exception('Service update failed. Wrong Service Id was returned') + + reply = Slice() + reply.CopyFrom(request) + slice_service_id = reply.slice_service_ids.add() + slice_service_id.CopyFrom(service_reply) + context_client.SetSlice(reply) + slice_id = reply.slice_id + + slice_ = context_client.GetSlice(slice_id) + slice_active = Slice() + slice_active.CopyFrom(slice_) + slice_active.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE + context_client.SetSlice(slice_active) + return slice_id + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def CreateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #try: + # slice_ = context_client.GetSlice(request.slice_id) + # slice_id = slice_.slice_id + #except grpc.RpcError: + # slice_id = context_client.SetSlice(request) + #return slice_id + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def UpdateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #slice_id = context_client.SetSlice(request) + #if len(request.slice_endpoint_ids) != 2: return slice_id + # + #domains = set() + #for slice_endpoint_id in request.slice_endpoint_ids: + # device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + # domains.add(device_uuid.split('@')[0]) + # + #is_multi_domain = len(domains) == 2 + #if is_multi_domain: + # interdomain_client = InterdomainClient() + # return interdomain_client.LookUpSlice(request) + #else: + # raise NotImplementedError('Slice should create local services for single domain slice') + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS, LOGGER) + def DeleteSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: + return Empty() diff --git a/src/slice/service/__init__.py b/src/slice/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/slice/service/__main__.py b/src/slice/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..f77d86bffe9b722f414be4f85adcaf0ef2cc4a8e --- /dev/null +++ b/src/slice/service/__main__.py @@ -0,0 +1,65 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables +from .SliceService import SliceService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level) + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting slice service + grpc_service = SliceService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/slice/tests/__init__.py b/src/slice/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/slice/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/slice/tests/test_unitary.py b/src/slice/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..1fd5a75b4dc1bb0192c8eeda6a0d452c0a9465dd --- /dev/null +++ b/src/slice/tests/test_unitary.py @@ -0,0 +1,49 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, os, pytest +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from slice.client.SliceClient import SliceClient +from slice.service.SliceService import SliceService + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SLICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SLICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SLICE_SERVICE_PORT) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def slice_service(): + _service = SliceService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def slice_client(slice_service : SliceService): # pylint: disable=redefined-outer-name + _client = SliceClient() + yield _client + _client.close() + +#def test_add_device_wrong_attributes(slice_client : SliceClient): +# # should fail with slice uuid is empty +# with pytest.raises(grpc._channel._InactiveRpcError) as e: +# slice_client.CreateUpdateSlice(TransportSlice()) +# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT +# assert e.value.details() == 'slice.slice_id.slice_id.uuid() string is empty.' diff --git a/src/start.sh b/src/start.sh index da0e7789d92a37f4bd0f429a1d01c7bac468deec..dc9db79d27d4d1b459092bf2f9a8f43bb5581511 100755 --- a/src/start.sh +++ b/src/start.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + docker network create -d bridge teraflowbridge docker run -d -p 7070:7070 --name monitoring --network=teraflowbridge monitoring:dockerfile diff --git a/src/start_webui_dev_mode.sh b/src/start_webui_dev_mode.sh new file mode 100755 index 0000000000000000000000000000000000000000..74540bcb36115dc175f371acbb3f80930404eac9 --- /dev/null +++ b/src/start_webui_dev_mode.sh @@ -0,0 +1,33 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# for development purposes only + +K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} + +export CONTEXTSERVICE_SERVICE_HOST=`kubectl get service/contextservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` + +echo Context IP: $CONTEXTSERVICE_SERVICE_HOST + +export DEVICESERVICE_SERVICE_HOST=`kubectl get service/deviceservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` + +echo Device IP: $DEVICESERVICE_SERVICE_HOST + +export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' +export HOST="127.0.0.1" +export FLASK_ENV="development" + +# python3 -m webbrowser http://${HOST}:8004 + +python -m webui.service diff --git a/src/tester_functional/.gitlab-ci.yml b/src/tester_functional/.gitlab-ci.yml deleted file mode 100644 index 15f2cd434174031ee8e461ec33c39a1cf5ff58e9..0000000000000000000000000000000000000000 --- a/src/tester_functional/.gitlab-ci.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry -build funct_test: - variables: - IMAGE_NAME: 'tester_functional' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: build - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - rules: - - changes: - - src/common/** - - src/context/** - - src/device/** - - src/service/** - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test funct_test: - variables: - IMAGE_NAME: 'tester_functional' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: test - needs: - - build funct_test - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - rules: - - changes: - - src/common/** - - src/context/** - - src/device/** - - src/service/** - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Run functional tests in Kubernetes Cluster -funct_test execute: - variables: - IMAGE_NAME: 'tester_functional' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: funct_test - needs: - - build funct_test - - unit_test funct_test - - deploy context - - deploy device - - deploy service - - dependencies all - - integ_test execute - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - kubectl version - - kubectl get all - - kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true - - kubectl get all - - kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never -i --rm - - kubectl get all - #when: manual - #allow_failure: false diff --git a/src/tester_functional/Dockerfile b/src/tester_functional/Dockerfile deleted file mode 100644 index 36883f30bf76fbee7094ee9c5dbe626c6fdec071..0000000000000000000000000000000000000000 --- a/src/tester_functional/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM python:3-slim - -# Install dependencies -RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ - rm -rf /var/lib/apt/lists/* - -# Set Python to show logs as they occur -ENV PYTHONUNBUFFERED=0 - -# Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools - -# Set working directory -WORKDIR /var/teraflow - -# Create module sub-folders -RUN mkdir -p /var/teraflow/tester_functional - -# Get Python packages per module -COPY tester_functional/requirements.in tester_functional/requirements.in -RUN pip-compile --output-file=tester_functional/requirements.txt tester_functional/requirements.in -RUN python3 -m pip install -r tester_functional/requirements.in - -# Add files into working directory -COPY common/. common -COPY context/. context -COPY device/. device -COPY service/. service -COPY tester_functional/. tester_functional - -# Run integration tester -ENTRYPOINT ["pytest", "-v", "--log-level=DEBUG", \ - "tester_functional/test_context_device_service.py" \ -] diff --git a/src/tester_functional/__init__.py b/src/tester_functional/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/tester_functional/definitions.py b/src/tester_functional/definitions.py deleted file mode 100644 index 2b38e74bc9d25199e4f192dbb3f093ec033fe80b..0000000000000000000000000000000000000000 --- a/src/tester_functional/definitions.py +++ /dev/null @@ -1,165 +0,0 @@ -import copy -from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID -from common.database.api.context.service.ServiceState import ServiceState -from common.database.api.context.service.ServiceType import ServiceType -from common.database.api.context.topology.device.OperationalStatus import OperationalStatus - -# use "copy.deepcopy" to prevent propagating forced changes during tests -dc = copy.deepcopy - -CONTEXT_ID = {'contextUuid': {'uuid': DEFAULT_CONTEXT_ID}} - -TOPOLOGY_ID = {'contextId': dc(CONTEXT_ID), 'topoId': {'uuid': DEFAULT_TOPOLOGY_ID}} - -DEVICE_ID_DEV1 = {'device_id': {'uuid': 'dev1'}} -DEVICE_DEV1 = { - 'device_id': dc(DEVICE_ID_DEV1), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -DEVICE_ID_DEV2 = {'device_id': {'uuid': 'dev2'}} -DEVICE_DEV2 = { - 'device_id': dc(DEVICE_ID_DEV2), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -DEVICE_ID_DEV3 = {'device_id': {'uuid': 'dev3'}} -DEVICE_DEV3 = { - 'device_id': dc(DEVICE_ID_DEV3), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -LINK_ID_DEV1_DEV2 = {'link_id': {'uuid': 'dev1/port2 ==> dev2/port1'}} -LINK_DEV1_DEV2 = { - 'link_id': dc(LINK_ID_DEV1_DEV2), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - ] -} - -LINK_ID_DEV1_DEV3 = {'link_id': {'uuid': 'dev1/port3 ==> dev3/port1'}} -LINK_DEV1_DEV3 = { - 'link_id': dc(LINK_ID_DEV1_DEV3), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - ] -} - -LINK_ID_DEV2_DEV1 = {'link_id': {'uuid': 'dev2/port1 ==> dev1/port2'}} -LINK_DEV2_DEV1 = { - 'link_id': dc(LINK_ID_DEV2_DEV1), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - ] -} - -LINK_ID_DEV2_DEV3 = {'link_id': {'uuid': 'dev2/port3 ==> dev3/port2'}} -LINK_DEV2_DEV3 = { - 'link_id': dc(LINK_ID_DEV2_DEV3), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - ] -} - -LINK_ID_DEV3_DEV1 = {'link_id': {'uuid': 'dev3/port1 ==> dev1/port3'}} -LINK_DEV3_DEV1 = { - 'link_id': dc(LINK_ID_DEV3_DEV1), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - ] -} - -LINK_ID_DEV3_DEV2 = {'link_id': {'uuid': 'dev3/port2 ==> dev2/port3'}} -LINK_DEV3_DEV2 = { - 'link_id': dc(LINK_ID_DEV3_DEV2), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - ] -} - -SERVICE_ID_SVC1 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc1'}} -SERVICE_SVC1 = { - 'cs_id': dc(SERVICE_ID_SVC1), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port101'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port101'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port101'}}, - ] -} - -SERVICE_ID_SVC2 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc2'}} -SERVICE_SVC2 = { - 'cs_id': dc(SERVICE_ID_SVC2), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port102'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port102'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port102'}}, - ] -} - -SERVICE_ID_SVC3 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc3'}} -SERVICE_SVC3 = { - 'cs_id': dc(SERVICE_ID_SVC3), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port103'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port103'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port103'}}, - ] -} diff --git a/src/tester_functional/requirements.in b/src/tester_functional/requirements.in deleted file mode 100644 index 25abdad1b5767117956a88b816399635348884c7..0000000000000000000000000000000000000000 --- a/src/tester_functional/requirements.in +++ /dev/null @@ -1,6 +0,0 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis diff --git a/src/tester_functional/test_context_device_service.py b/src/tester_functional/test_context_device_service.py deleted file mode 100644 index 6483569de44cb3cdecafe3316a1ac83ce82ea1d3..0000000000000000000000000000000000000000 --- a/src/tester_functional/test_context_device_service.py +++ /dev/null @@ -1,102 +0,0 @@ -import logging, pytest -from google.protobuf.json_format import MessageToDict -from common.Settings import get_setting -from common.database.Factory import get_database, DatabaseEngineEnum -from common.database.api.Database import Database -from common.tests.Assertions import validate_device_id, validate_link_id, validate_service_id, \ - validate_service_list_is_not_empty, validate_topology_has_devices, validate_topology_has_links, \ - validate_topology_is_empty -from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import Device, Empty, Link -from device.client.DeviceClient import DeviceClient -from tester_functional.definitions import DEVICE_DEV1, DEVICE_DEV2, DEVICE_DEV3 -from tester_functional.definitions import LINK_DEV1_DEV2, LINK_DEV1_DEV3, LINK_DEV2_DEV1, LINK_DEV2_DEV3, \ - LINK_DEV3_DEV1, LINK_DEV3_DEV2 -from tester_functional.definitions import SERVICE_SVC1, SERVICE_SVC2, SERVICE_SVC3 -from service.client.ServiceClient import ServiceClient -from service.proto.service_pb2 import Service - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -@pytest.fixture(scope='session') -def redis_database(): - _database = get_database(engine=DatabaseEngineEnum.REDIS, REDIS_DATABASE_ID=0) - return _database - -@pytest.fixture(scope='session') -def context_client(): - service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST') - service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC') - _client = ContextClient(address=service_host, port=service_port) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def device_client(): - service_host = get_setting('DEVICESERVICE_SERVICE_HOST') - service_port = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC') - _client = DeviceClient(address=service_host, port=service_port) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def service_client(): - service_host = get_setting('SERVICESERVICE_SERVICE_HOST') - service_port = get_setting('SERVICESERVICE_SERVICE_PORT_GRPC') - _client = ServiceClient(address=service_host, port=service_port) - yield _client - _client.close() - -def test_clean_database(redis_database : Database): - # should work - redis_database.clear_all() - -def test_get_topology_empty(context_client : ContextClient): - # should work - validate_topology_is_empty(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_devices(context_client : ContextClient, device_client : DeviceClient): - # should work - for device in [DEVICE_DEV1, DEVICE_DEV2, DEVICE_DEV3]: - validate_device_id(MessageToDict( - device_client.AddDevice(Device(**device)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_topology_has_devices(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_links(context_client : ContextClient): - # should work - for link in [LINK_DEV1_DEV2, LINK_DEV1_DEV3, LINK_DEV2_DEV1, LINK_DEV2_DEV3, LINK_DEV3_DEV1, LINK_DEV3_DEV2]: - validate_link_id(MessageToDict( - context_client.AddLink(Link(**link)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_topology_has_links(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_services(service_client : ServiceClient): - # should work - for service in [SERVICE_SVC1, SERVICE_SVC2, SERVICE_SVC3]: - validate_service_id(MessageToDict( - service_client.CreateService(Service(**service)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_service_list_is_not_empty(MessageToDict( - service_client.GetServiceList(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) diff --git a/src/tester_integration/.gitlab-ci.yml b/src/tester_integration/.gitlab-ci.yml deleted file mode 100644 index 02eccbc9bf9fc1103b373b4d062333c42f52b87e..0000000000000000000000000000000000000000 --- a/src/tester_integration/.gitlab-ci.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Build, tag, and push the Docker images to the GitLab Docker registry -build integ_test: - variables: - IMAGE_NAME: 'tester_integration' # name of the microservice - IMAGE_NAME_TEST: 'tester_integration-test' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: build - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - rules: - - changes: - - src/common/** - - src/context/** - - src/device/** - - src/service/** - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry -unit_test integ_test: - variables: - IMAGE_NAME: 'tester_functional' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: test - needs: - - build integ_test - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - rules: - - changes: - - src/common/** - - src/context/** - - src/device/** - - src/service/** - - src/$IMAGE_NAME/** - - .gitlab-ci.yml - -# Pull, execute, and run integration tests for the Docker image from the GitLab registry -integ_test execute: - variables: - IMAGE_NAME: 'tester_integration' # name of the microservice - IMAGE_NAME_TEST: 'tester_integration-test' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: integ_test - needs: - - build integ_test - - unit_test context - - unit_test device - - unit_test service - - unit_test integ_test - - dependencies all - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - script: - - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run -d -p 6379:6379 --name redis --network=teraflowbridge "redis:6.2" - - docker ps -a - - sleep 5 - - docker ps -a - - docker run -d --name $IMAGE_NAME --network=teraflowbridge --env "DB_ENGINE=redis" --env "REDIS_SERVICE_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis)" --env "REDIS_SERVICE_PORT=6379" --env "REDIS_DATABASE_ID=0" "$IMAGE_NAME:$IMAGE_TAG" bash -c "pytest --log-level=INFO --verbose common/database/tests/test_engine_redis.py tester_integration/test_context_device_service.py" - after_script: - - docker stop $IMAGE_NAME redis - - docker rm $IMAGE_NAME redis - rules: - - changes: - - src/common/** - - src/context/** - - src/device/** - - src/service/** - - src/$IMAGE_NAME/** - - .gitlab-ci.yml diff --git a/src/tester_integration/Dockerfile b/src/tester_integration/Dockerfile deleted file mode 100644 index 31ab8884b62814d43fbadaf624754e10681c8e7c..0000000000000000000000000000000000000000 --- a/src/tester_integration/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM python:3-slim - -# Install dependencies -RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ - rm -rf /var/lib/apt/lists/* - -# Set Python to show logs as they occur -ENV PYTHONUNBUFFERED=0 - -# Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools - -# Set working directory -WORKDIR /var/teraflow - -# Create module sub-folders -RUN mkdir -p /var/teraflow/tester_integration - -# Get Python packages per module -COPY tester_integration/requirements.in tester_integration/requirements.in -RUN pip-compile --output-file=tester_integration/requirements.txt tester_integration/requirements.in -RUN python3 -m pip install -r tester_integration/requirements.in - -# Add files into working directory -COPY common/. common -COPY context/. context -COPY device/. device -COPY service/. service -COPY tester_integration/. tester_integration - -# Run integration tester -ENTRYPOINT ["pytest", "-v", "--log-level=DEBUG", \ - "tester_integration/test_context_device_service.py" \ -] diff --git a/src/tester_integration/__init__.py b/src/tester_integration/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/tester_integration/definitions.py b/src/tester_integration/definitions.py deleted file mode 100644 index 2b38e74bc9d25199e4f192dbb3f093ec033fe80b..0000000000000000000000000000000000000000 --- a/src/tester_integration/definitions.py +++ /dev/null @@ -1,165 +0,0 @@ -import copy -from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID -from common.database.api.context.service.ServiceState import ServiceState -from common.database.api.context.service.ServiceType import ServiceType -from common.database.api.context.topology.device.OperationalStatus import OperationalStatus - -# use "copy.deepcopy" to prevent propagating forced changes during tests -dc = copy.deepcopy - -CONTEXT_ID = {'contextUuid': {'uuid': DEFAULT_CONTEXT_ID}} - -TOPOLOGY_ID = {'contextId': dc(CONTEXT_ID), 'topoId': {'uuid': DEFAULT_TOPOLOGY_ID}} - -DEVICE_ID_DEV1 = {'device_id': {'uuid': 'dev1'}} -DEVICE_DEV1 = { - 'device_id': dc(DEVICE_ID_DEV1), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -DEVICE_ID_DEV2 = {'device_id': {'uuid': 'dev2'}} -DEVICE_DEV2 = { - 'device_id': dc(DEVICE_ID_DEV2), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -DEVICE_ID_DEV3 = {'device_id': {'uuid': 'dev3'}} -DEVICE_DEV3 = { - 'device_id': dc(DEVICE_ID_DEV3), 'device_type': 'ROADM', 'device_config': {'device_config': ''}, - 'devOperationalStatus': OperationalStatus.ENABLED.value, - 'endpointList' : [ - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - 'port_type': 'WDM'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port101'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port102'}}, - 'port_type': 'OCH'}, - {'port_id': {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port103'}}, - 'port_type': 'OCH'}, - ] -} - -LINK_ID_DEV1_DEV2 = {'link_id': {'uuid': 'dev1/port2 ==> dev2/port1'}} -LINK_DEV1_DEV2 = { - 'link_id': dc(LINK_ID_DEV1_DEV2), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - ] -} - -LINK_ID_DEV1_DEV3 = {'link_id': {'uuid': 'dev1/port3 ==> dev3/port1'}} -LINK_DEV1_DEV3 = { - 'link_id': dc(LINK_ID_DEV1_DEV3), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - ] -} - -LINK_ID_DEV2_DEV1 = {'link_id': {'uuid': 'dev2/port1 ==> dev1/port2'}} -LINK_DEV2_DEV1 = { - 'link_id': dc(LINK_ID_DEV2_DEV1), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port1'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port2'}}, - ] -} - -LINK_ID_DEV2_DEV3 = {'link_id': {'uuid': 'dev2/port3 ==> dev3/port2'}} -LINK_DEV2_DEV3 = { - 'link_id': dc(LINK_ID_DEV2_DEV3), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - ] -} - -LINK_ID_DEV3_DEV1 = {'link_id': {'uuid': 'dev3/port1 ==> dev1/port3'}} -LINK_DEV3_DEV1 = { - 'link_id': dc(LINK_ID_DEV3_DEV1), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port1'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port3'}}, - ] -} - -LINK_ID_DEV3_DEV2 = {'link_id': {'uuid': 'dev3/port2 ==> dev2/port3'}} -LINK_DEV3_DEV2 = { - 'link_id': dc(LINK_ID_DEV3_DEV2), - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port2'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port3'}}, - ] -} - -SERVICE_ID_SVC1 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc1'}} -SERVICE_SVC1 = { - 'cs_id': dc(SERVICE_ID_SVC1), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port101'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port101'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port101'}}, - ] -} - -SERVICE_ID_SVC2 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc2'}} -SERVICE_SVC2 = { - 'cs_id': dc(SERVICE_ID_SVC2), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port102'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port102'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port102'}}, - ] -} - -SERVICE_ID_SVC3 = {'contextId': dc(CONTEXT_ID), 'cs_id': {'uuid': 'svc3'}} -SERVICE_SVC3 = { - 'cs_id': dc(SERVICE_ID_SVC3), 'serviceType': ServiceType.L3NM.value, - 'serviceConfig': {'serviceConfig': ''}, 'serviceState': {'serviceState': ServiceState.PLANNED.value}, - 'constraint': [ - {'constraint_type': 'latency_ms', 'constraint_value': '100'}, - {'constraint_type': 'hops', 'constraint_value': '5'}, - ], - 'endpointList' : [ - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV1), 'port_id': {'uuid' : 'port103'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV2), 'port_id': {'uuid' : 'port103'}}, - {'topoId': dc(TOPOLOGY_ID), 'dev_id': dc(DEVICE_ID_DEV3), 'port_id': {'uuid' : 'port103'}}, - ] -} diff --git a/src/tester_integration/requirements.in b/src/tester_integration/requirements.in deleted file mode 100644 index 25abdad1b5767117956a88b816399635348884c7..0000000000000000000000000000000000000000 --- a/src/tester_integration/requirements.in +++ /dev/null @@ -1,6 +0,0 @@ -grpcio-health-checking -grpcio -prometheus-client -pytest -pytest-benchmark -redis diff --git a/src/tester_integration/test_context_device_service.py b/src/tester_integration/test_context_device_service.py deleted file mode 100644 index 2d128800c2e714de242de328c2d00a6134c378d7..0000000000000000000000000000000000000000 --- a/src/tester_integration/test_context_device_service.py +++ /dev/null @@ -1,138 +0,0 @@ -import logging, pytest -from google.protobuf.json_format import MessageToDict -from common.database.Factory import get_database, DatabaseEngineEnum -from common.database.api.Database import Database -from common.tests.Assertions import validate_device_id, validate_link_id, validate_service_id, \ - validate_service_list_is_not_empty, validate_topology_has_devices, validate_topology_has_links, \ - validate_topology_is_empty -from context.Config import GRPC_SERVICE_PORT as GRPC_CONTEXT_SERVICE_PORT, \ - GRPC_MAX_WORKERS as GRPC_CONTEXT_MAX_WORKERS, GRPC_GRACE_PERIOD as GRPC_CONTEXT_GRACE_PERIOD -from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import Device, Empty, Link -from context.service.ContextService import ContextService -from device.Config import GRPC_SERVICE_PORT as GRPC_DEVICE_SERVICE_PORT, \ - GRPC_MAX_WORKERS as GRPC_DEVICE_MAX_WORKERS, GRPC_GRACE_PERIOD as GRPC_DEVICE_GRACE_PERIOD -from device.client.DeviceClient import DeviceClient -from device.service.DeviceService import DeviceService -from service.service.ServiceService import ServiceService -from tester_integration.definitions import DEVICE_DEV1, DEVICE_DEV2, DEVICE_DEV3 -from tester_integration.definitions import LINK_DEV1_DEV2, LINK_DEV1_DEV3, LINK_DEV2_DEV1, LINK_DEV2_DEV3, \ - LINK_DEV3_DEV1, LINK_DEV3_DEV2 -from tester_integration.definitions import SERVICE_SVC1, SERVICE_SVC2, SERVICE_SVC3 -from service.Config import GRPC_SERVICE_PORT as GRPC_SERVICE_SERVICE_PORT, \ - GRPC_MAX_WORKERS as GRPC_SERVICE_MAX_WORKERS, GRPC_GRACE_PERIOD as GRPC_SERVICE_GRACE_PERIOD -from service.client.ServiceClient import ServiceClient -from service.proto.service_pb2 import Service - -PORT_CONTEXT = 10000 + GRPC_CONTEXT_SERVICE_PORT # avoid privileged ports -PORT_DEVICE = 10000 + GRPC_DEVICE_SERVICE_PORT # avoid privileged ports -PORT_SERVICE = 10000 + GRPC_SERVICE_SERVICE_PORT # avoid privileged ports - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -@pytest.fixture(scope='session') -def redis_database(): - _database = get_database(engine=DatabaseEngineEnum.REDIS, REDIS_DATABASE_ID=0) - return _database - -@pytest.fixture(scope='session') -def context_service(redis_database : Database): - context_database = get_database(engine=DatabaseEngineEnum.REDIS, REDIS_DATABASE_ID=0) - _service = ContextService( - context_database, port=PORT_CONTEXT, max_workers=GRPC_CONTEXT_MAX_WORKERS, - grace_period=GRPC_CONTEXT_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(context_service): - _client = ContextClient(address='127.0.0.1', port=PORT_CONTEXT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def device_service(redis_database : Database): - device_database = get_database(engine=DatabaseEngineEnum.REDIS, REDIS_DATABASE_ID=0) - _service = DeviceService( - device_database, port=PORT_DEVICE, max_workers=GRPC_DEVICE_MAX_WORKERS, - grace_period=GRPC_DEVICE_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def device_client(device_service): - _client = DeviceClient(address='127.0.0.1', port=PORT_DEVICE) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def service_service(redis_database : Database): - service_database = get_database(engine=DatabaseEngineEnum.REDIS, REDIS_DATABASE_ID=0) - _service = ServiceService( - service_database, port=PORT_SERVICE, max_workers=GRPC_SERVICE_MAX_WORKERS, - grace_period=GRPC_SERVICE_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def service_client(service_service): - _client = ServiceClient(address='127.0.0.1', port=PORT_SERVICE) - yield _client - _client.close() - -def test_clean_database(redis_database : Database): - # should work - redis_database.clear_all() - -def test_get_topology_empty(context_client : ContextClient): - # should work - validate_topology_is_empty(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_devices(context_client : ContextClient, device_client : DeviceClient): - # should work - for device in [DEVICE_DEV1, DEVICE_DEV2, DEVICE_DEV3]: - validate_device_id(MessageToDict( - device_client.AddDevice(Device(**device)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_topology_has_devices(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_links(context_client : ContextClient): - # should work - for link in [LINK_DEV1_DEV2, LINK_DEV1_DEV3, LINK_DEV2_DEV1, LINK_DEV2_DEV3, LINK_DEV3_DEV1, LINK_DEV3_DEV2]: - validate_link_id(MessageToDict( - context_client.AddLink(Link(**link)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_topology_has_links(MessageToDict( - context_client.GetTopology(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - -def test_add_services(service_client : ServiceClient): - # should work - for service in [SERVICE_SVC1, SERVICE_SVC2, SERVICE_SVC3]: - validate_service_id(MessageToDict( - service_client.CreateService(Service(**service)), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) - - # should work - validate_service_list_is_not_empty(MessageToDict( - service_client.GetServiceList(Empty()), - including_default_value_fields=True, preserving_proto_field_name=True, - use_integers_for_enums=False)) diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..6fcac64803e92b238eb1a63ce92814e67e3138ab --- /dev/null +++ b/src/tests/.gitlab-ci.yml @@ -0,0 +1,18 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# include the individual .gitlab-ci.yml of each integration test +include: + - local: '/src/tests/ofc22/.gitlab-ci.yml' + - local: '/src/tests/oeccpsc22/.gitlab-ci.yml' diff --git a/src/tests/__init__.py b/src/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/tests/oeccpsc22/__init__.py b/src/tests/oeccpsc22/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/oeccpsc22/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/tests/oeccpsc22/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/deploy_in_kubernetes.sh new file mode 100755 index 0000000000000000000000000000000000000000..426e07e1376207065b02db3205e46dd2cbe9a39d --- /dev/null +++ b/src/tests/oeccpsc22/deploy_in_kubernetes.sh @@ -0,0 +1,159 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +# OECC/PSC 22 deployment settings +export REGISTRY_IMAGE="" +export COMPONENTS="context device monitoring service slice interdomain compute" # webui +export IMAGE_TAG="oeccpsc22" +export K8S_HOSTNAME="kubernetes-master" +#export GRAFANA_PASSWORD="admin123+" + +# Constants +GITLAB_REPO_URL="registry.gitlab.com/teraflow-h2020/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +export K8S_NAMESPACE_1="oeccpsc22-1" +export K8S_NAMESPACE_2="oeccpsc22-2" + +export EXTRA_MANIFESTS_1="./oeccpsc22/expose_services_teraflow_1.yaml" +export EXTRA_MANIFESTS_2="./oeccpsc22/expose_services_teraflow_2.yaml" + +echo "Deleting and Creating new namespaces..." +kubectl delete namespace $K8S_NAMESPACE_1 $K8S_NAMESPACE_2 +kubectl create namespace $K8S_NAMESPACE_1 +kubectl create namespace $K8S_NAMESPACE_2 +printf "\n" + +echo "Creating secrets for InfluxDB..." +#TODO: make sure to change this when having a production deployment +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" + +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" +printf "\n" + +echo "Pulling/Updating Docker images..." +docker pull redis:6.2 +docker pull influxdb:1.8 +docker pull grafana/grafana:8.2.6 +printf "\n" + +echo "Deploying components..." +for COMPONENT in $COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$IMAGE_TAG" + IMAGE_URL="$REGISTRY_IMAGE/$IMAGE_NAME" + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + else + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" + fi + + if [ -n "$REGISTRY_IMAGE" ]; then + echo "Pushing Docker image to '$REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + + if [ -n "$REGISTRY_IMAGE" ]; then + + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + + else + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + fi + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_1..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_1.log" + kubectl --namespace $K8S_NAMESPACE_1 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_2..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_2.log" + kubectl --namespace $K8S_NAMESPACE_2 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_1..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_1; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_1 apply -f $EXTRA_MANIFEST + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_2..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_2; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_2 apply -f $EXTRA_MANIFEST + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $COMPONENTS; do + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_1..." + kubectl wait --namespace $K8S_NAMESPACE_1 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" + + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_2..." + kubectl wait --namespace $K8S_NAMESPACE_2 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards.sh + printf "\n\n" +fi + +echo "Removing dangling docker images..." +docker images --filter="dangling=true" --quiet | xargs -r docker rmi +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_1..." +kubectl --namespace $K8S_NAMESPACE_1 get all +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_2..." +kubectl --namespace $K8S_NAMESPACE_2 get all +printf "\n" + +echo "Done!" diff --git a/src/tests/oeccpsc22/dump_logs.sh b/src/tests/oeccpsc22/dump_logs.sh new file mode 100755 index 0000000000000000000000000000000000000000..196002a5fd6b9b208046ba1e22f156f628f60f1d --- /dev/null +++ b/src/tests/oeccpsc22/dump_logs.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +mkdir -p tmp/exec_logs/ + +kubectl --namespace oeccpsc22-1 logs deployment/computeservice -c server > tmp/exec_logs/d1_compute.log +kubectl --namespace oeccpsc22-1 logs deployment/contextservice -c server > tmp/exec_logs/d1_context.log +kubectl --namespace oeccpsc22-1 logs deployment/deviceservice -c server > tmp/exec_logs/d1_device.log +kubectl --namespace oeccpsc22-1 logs deployment/interdomainservice -c server > tmp/exec_logs/d1_interdomain.log +kubectl --namespace oeccpsc22-1 logs deployment/monitoringservice -c server > tmp/exec_logs/d1_monitoring.log +kubectl --namespace oeccpsc22-1 logs deployment/serviceservice -c server > tmp/exec_logs/d1_service.log +kubectl --namespace oeccpsc22-1 logs deployment/sliceservice -c server > tmp/exec_logs/d1_slice.log + +kubectl --namespace oeccpsc22-2 logs deployment/computeservice -c server > tmp/exec_logs/d2_compute.log +kubectl --namespace oeccpsc22-2 logs deployment/contextservice -c server > tmp/exec_logs/d2_context.log +kubectl --namespace oeccpsc22-2 logs deployment/deviceservice -c server > tmp/exec_logs/d2_device.log +kubectl --namespace oeccpsc22-2 logs deployment/interdomainservice -c server > tmp/exec_logs/d2_interdomain.log +kubectl --namespace oeccpsc22-2 logs deployment/monitoringservice -c server > tmp/exec_logs/d2_monitoring.log +kubectl --namespace oeccpsc22-2 logs deployment/serviceservice -c server > tmp/exec_logs/d2_service.log +kubectl --namespace oeccpsc22-2 logs deployment/sliceservice -c server > tmp/exec_logs/d2_slice.log diff --git a/src/tests/oeccpsc22/expose_services_teraflow_1.yaml b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f2b8de0b1629082eab1a5e638c0e712db47ed0bd --- /dev/null +++ b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-2.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +--- +apiVersion: v1 +kind: Service +metadata: + name: contextservice-public + labels: + app: contextservice +spec: + type: NodePort + selector: + app: contextservice + ports: + - name: grpc + protocol: TCP + port: 1010 + targetPort: 1010 + nodePort: 30111 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30001 + - name: redis + protocol: TCP + port: 6379 + targetPort: 6379 + nodePort: 30631 +--- +apiVersion: v1 +kind: Service +metadata: + name: deviceservice-public + labels: + app: deviceservice +spec: + type: NodePort + selector: + app: deviceservice + ports: + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + nodePort: 30221 +--- +apiVersion: v1 +kind: Service +metadata: + name: computeservice-public +spec: + type: NodePort + selector: + app: computeservice + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30881 +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice-public + labels: + app: webuiservice +spec: + type: NodePort + selector: + app: webuiservice + ports: + - name: http + protocol: TCP + port: 8004 + targetPort: 8004 + nodePort: 30801 + - name: grafana + protocol: TCP + port: 3000 + targetPort: 3000 + nodePort: 30301 diff --git a/src/tests/oeccpsc22/expose_services_teraflow_2.yaml b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8254c00aa09c9e15a047fd60b6140c68ef1f0e52 --- /dev/null +++ b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-1.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +--- +apiVersion: v1 +kind: Service +metadata: + name: contextservice-public + labels: + app: contextservice +spec: + type: NodePort + selector: + app: contextservice + ports: + - name: grpc + protocol: TCP + port: 1010 + targetPort: 1010 + nodePort: 30112 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30002 + - name: redis + protocol: TCP + port: 6379 + targetPort: 6379 + nodePort: 30632 +--- +apiVersion: v1 +kind: Service +metadata: + name: deviceservice-public + labels: + app: deviceservice +spec: + type: NodePort + selector: + app: deviceservice + ports: + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + nodePort: 30222 +--- +apiVersion: v1 +kind: Service +metadata: + name: computeservice-public +spec: + type: NodePort + selector: + app: computeservice + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30882 +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice-public + labels: + app: webuiservice +spec: + type: NodePort + selector: + app: webuiservice + ports: + - name: http + protocol: TCP + port: 8004 + targetPort: 8004 + nodePort: 30802 + - name: grafana + protocol: TCP + port: 3000 + targetPort: 3000 + nodePort: 30302 diff --git a/src/tests/oeccpsc22/run_test_01_bootstrap.sh b/src/tests/oeccpsc22/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..e8df6ffb67f6756f9f757ae12c6a438d0c609853 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_01_bootstrap.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Configure the correct folder on the .coveragerc file +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE + +# Destroy old coverage file +rm -f $COVERAGEFILE + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# K8S_HOSTNAME="kubernetes-master" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +# Flush Context database +kubectl --namespace $K8S_NAMESPACE_D1 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL +kubectl --namespace $K8S_NAMESPACE_D2 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_bootstrap.py diff --git a/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..b9ab66cb343b31f34b394b00ff7fcabdac22e8d3 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..b0080ce3759badc047bf218ab9a13c1bea722115 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_04_cleanup.sh b/src/tests/oeccpsc22/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..d0420820c487862e5faa469dc4000dda3da71be6 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_04_cleanup.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_cleanup.py diff --git a/src/tests/oeccpsc22/show_deploy.sh b/src/tests/oeccpsc22/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..90d6914890cfd37db37ed3b3ea8266372c067c20 --- /dev/null +++ b/src/tests/oeccpsc22/show_deploy.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Deploy TeraFlow instance 1 +printf "TeraFlow Instance 1:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-1" +kubectl --namespace $K8S_NAMESPACE get all + +printf "\n\n" + +# Deploy TeraFlow instance 2 +printf "TeraFlow Instance 2:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-2" +kubectl --namespace $K8S_NAMESPACE get all diff --git a/src/tests/oeccpsc22/tests/.gitignore b/src/tests/oeccpsc22/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/oeccpsc22/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_1.py b/src/tests/oeccpsc22/tests/Objects_Domain_1.py new file mode 100644 index 0000000000000000000000000000000000000000..8b26348c94b827e4e418a458f21b28a863c4cb68 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_1.py @@ -0,0 +1,133 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D1_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +D1_CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D1_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=D1_CONTEXT_ID) +D1_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=D1_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D1_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D1_DEVICE_D1R1_UUID = 'R1@D1' +D1_DEVICE_D1R1_ID = json_device_id(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R2_UUID = 'R2@D1' +D1_DEVICE_D1R2_ID = json_device_id(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R3_UUID = 'R3@D1' +D1_DEVICE_D1R3_ID = json_device_id(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R4_UUID = 'R4@D1' +D1_DEVICE_D1R4_ID = json_device_id(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D1_DEVICE_D2R1_UUID = 'R1@D2' +D1_DEVICE_D2R1_ID = json_device_id(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D2R4_UUID = 'R4@D2' +D1_DEVICE_D2R4_ID = json_device_id(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_ENDPOINT_IDS = {} +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R2_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R3_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R4_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R4_ID, D1_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D1_LINK_D1R1_D1R2_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']) +D1_LINK_D1R1_D1R2_ID = json_link_id(D1_LINK_D1R1_D1R2_UUID) +D1_LINK_D1R1_D1R2 = json_link(D1_LINK_D1R1_D1R2_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']]) + +D1_LINK_D1R2_D1R3_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']) +D1_LINK_D1R2_D1R3_ID = json_link_id(D1_LINK_D1R2_D1R3_UUID) +D1_LINK_D1R2_D1R3 = json_link(D1_LINK_D1R2_D1R3_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']]) + +D1_LINK_D1R3_D1R4_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']) +D1_LINK_D1R3_D1R4_ID = json_link_id(D1_LINK_D1R3_D1R4_UUID) +D1_LINK_D1R3_D1R4 = json_link(D1_LINK_D1R3_D1R4_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']]) + +D1_LINK_D1R4_D1R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']) +D1_LINK_D1R4_D1R1_ID = json_link_id(D1_LINK_D1R4_D1R1_UUID) +D1_LINK_D1R4_D1R1 = json_link(D1_LINK_D1R4_D1R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']]) + +# Inter-domain links +D1_LINK_D1R4_D2R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']) +D1_LINK_D1R4_D2R1_ID = json_link_id(D1_LINK_D1R4_D2R1_UUID) +D1_LINK_D1R4_D2R1 = json_link(D1_LINK_D1R4_D2R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D1_CONTEXTS = [D1_CONTEXT] +D1_TOPOLOGIES = [D1_TOPOLOGY] + +D1_DEVICES = [ + (D1_DEVICE_D1R1, D1_DEVICE_D1R1_CONNECT_RULES), + (D1_DEVICE_D1R2, D1_DEVICE_D1R2_CONNECT_RULES), + (D1_DEVICE_D1R3, D1_DEVICE_D1R3_CONNECT_RULES), + (D1_DEVICE_D1R4, D1_DEVICE_D1R4_CONNECT_RULES), + (D1_DEVICE_D2R1, D1_DEVICE_D2R1_CONNECT_RULES), + (D1_DEVICE_D2R4, D1_DEVICE_D2R4_CONNECT_RULES), +] + +D1_LINKS = [ + D1_LINK_D1R1_D1R2, D1_LINK_D1R2_D1R3, D1_LINK_D1R3_D1R4, D1_LINK_D1R4_D1R1, + D1_LINK_D1R4_D2R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_2.py b/src/tests/oeccpsc22/tests/Objects_Domain_2.py new file mode 100644 index 0000000000000000000000000000000000000000..f9133809243effc0a7d22c953046a4af4d6bad3e --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_2.py @@ -0,0 +1,133 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D2_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +D2_CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D2_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=D2_CONTEXT_ID) +D2_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=D2_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D2_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D2_DEVICE_D2R1_UUID = 'R1@D2' +D2_DEVICE_D2R1_ID = json_device_id(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R2_UUID = 'R2@D2' +D2_DEVICE_D2R2_ID = json_device_id(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R3_UUID = 'R3@D2' +D2_DEVICE_D2R3_ID = json_device_id(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R4_UUID = 'R4@D2' +D2_DEVICE_D2R4_ID = json_device_id(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D2_DEVICE_D1R1_UUID = 'R1@D1' +D2_DEVICE_D1R1_ID = json_device_id(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D1R4_UUID = 'R4@D1' +D2_DEVICE_D1R4_ID = json_device_id(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_ENDPOINT_IDS = {} +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R2_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R3_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R4_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R4_ID, D2_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D2_LINK_D2R1_D2R2_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']) +D2_LINK_D2R1_D2R2_ID = json_link_id(D2_LINK_D2R1_D2R2_UUID) +D2_LINK_D2R1_D2R2 = json_link(D2_LINK_D2R1_D2R2_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']]) + +D2_LINK_D2R2_D2R3_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']) +D2_LINK_D2R2_D2R3_ID = json_link_id(D2_LINK_D2R2_D2R3_UUID) +D2_LINK_D2R2_D2R3 = json_link(D2_LINK_D2R2_D2R3_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']]) + +D2_LINK_D2R3_D2R4_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']) +D2_LINK_D2R3_D2R4_ID = json_link_id(D2_LINK_D2R3_D2R4_UUID) +D2_LINK_D2R3_D2R4 = json_link(D2_LINK_D2R3_D2R4_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']]) + +D2_LINK_D2R4_D2R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']) +D2_LINK_D2R4_D2R1_ID = json_link_id(D2_LINK_D2R4_D2R1_UUID) +D2_LINK_D2R4_D2R1 = json_link(D2_LINK_D2R4_D2R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']]) + +# Inter-domain links +D2_LINK_D2R4_D1R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']) +D2_LINK_D2R4_D1R1_ID = json_link_id(D2_LINK_D2R4_D1R1_UUID) +D2_LINK_D2R4_D1R1 = json_link(D2_LINK_D2R4_D1R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D2_CONTEXTS = [D2_CONTEXT] +D2_TOPOLOGIES = [D2_TOPOLOGY] + +D2_DEVICES = [ + (D2_DEVICE_D2R1, D2_DEVICE_D2R1_CONNECT_RULES), + (D2_DEVICE_D2R2, D2_DEVICE_D2R2_CONNECT_RULES), + (D2_DEVICE_D2R3, D2_DEVICE_D2R3_CONNECT_RULES), + (D2_DEVICE_D2R4, D2_DEVICE_D2R4_CONNECT_RULES), + (D2_DEVICE_D1R1, D2_DEVICE_D1R1_CONNECT_RULES), + (D2_DEVICE_D1R4, D2_DEVICE_D1R4_CONNECT_RULES), +] + +D2_LINKS = [ + D2_LINK_D2R1_D2R2, D2_LINK_D2R2_D2R3, D2_LINK_D2R3_D2R4, D2_LINK_D2R4_D2R1, + D2_LINK_D2R4_D1R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Service.py b/src/tests/oeccpsc22/tests/Objects_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..a9ffadc0fdbe5f464772e195c892112131a2fb69 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Service.py @@ -0,0 +1,37 @@ +from .Objects_Domain_1 import D1_DEVICE_D1R1_UUID, D1_ENDPOINT_IDS +from .Objects_Domain_2 import D2_DEVICE_D2R4_UUID, D2_ENDPOINT_IDS +from .Tools import compose_bearer, compose_service_endpoint_id + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_SEP_D1R1_ID = compose_service_endpoint_id(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SEP_D1R1_ROUTER_ID = '10.10.10.1' +WIM_SEP_D1R1_ROUTER_DIST = '65000:111' +WIM_SEP_D1R1_SITE_ID = '1' +WIM_SEP_D1R1_BEARER = compose_bearer(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SRV_D1R1_VLAN_ID = 400 + +WIM_SEP_D2R4_ID = compose_service_endpoint_id(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SEP_D2R4_ROUTER_ID = '20.20.20.1' +WIM_SEP_D2R4_ROUTER_DIST = '65000:222' +WIM_SEP_D2R4_SITE_ID = '2' +WIM_SEP_D2R4_BEARER = compose_bearer(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SRV_D2R4_VLAN_ID = 500 + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +WIM_MAPPING = [ + {'device-id': D1_DEVICE_D1R1_UUID, 'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D1R1_BEARER}, 'site-id': WIM_SEP_D1R1_SITE_ID}}, + {'device-id': D2_DEVICE_D2R4_UUID, 'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D2R4_BEARER}, 'site-id': WIM_SEP_D2R4_SITE_ID}}, +] +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D1R1_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D2R4_VLAN_ID}}, +] diff --git a/src/tests/oeccpsc22/tests/Tools.py b/src/tests/oeccpsc22/tests/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..a782b6bb3e541e4331f5f95164e69def5640f556 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Tools.py @@ -0,0 +1,25 @@ +from typing import Dict, List, Tuple +from common.tools.object_factory.EndPoint import json_endpoint_id + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return { + device_id['device_uuid']['uuid']: { + ep_uuid: json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + } + } + +def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + a_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +def compose_bearer(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) diff --git a/src/tests/oeccpsc22/tests/__init__.py b/src/tests/oeccpsc22/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/oeccpsc22/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/tests/oeccpsc22/tests/test_functional_bootstrap.py b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..452394c0165b268c2defa69b899ba554ef4b1504 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py @@ -0,0 +1,213 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, logging, pytest +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology +from device.client.DeviceClient import DeviceClient +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d1_device_client(): + _client = DeviceClient( + get_setting('D1_DEVICESERVICE_SERVICE_HOST'), get_setting('D1_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_device_client(): + _client = DeviceClient( + get_setting('D2_DEVICESERVICE_SERVICE_HOST'), get_setting('D2_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_scenario_empty( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + per_domain(d1_context_client) + per_domain(d2_context_client) + + +def test_prepare_scenario( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_client): + for context in contexts: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in topologies: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, d2_context_client) + + +def test_scenario_ready( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_CONTEXT_ID, d2_context_client) + + +def test_devices_bootstraping( + d1_device_client : DeviceClient, # pylint: disable=redefined-outer-name + d2_device_client : DeviceClient): # pylint: disable=redefined-outer-name + + def per_domain(devices, device_client): + for device, connect_rules in devices: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + device_with_connect_rules = copy.deepcopy(device) + device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- + per_domain(D1_DEVICES, d1_device_client) + per_domain(D2_DEVICES, d2_device_client) + + +def test_devices_bootstrapped( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_CONTEXT_ID, d2_context_client) + + +def test_links_creation( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(links, context_client): + for link in links: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Adding Link {:s}'.format(link_uuid)) + response = context_client.SetLink(Link(**link)) + assert response.link_uuid.uuid == link_uuid + + # ----- Create Links and Validate Collected Events ----------------------------------------------------------------- + per_domain(D1_LINKS, d1_context_client) + per_domain(D2_LINKS, d2_context_client) + + +def test_links_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_cleanup.py b/src/tests/oeccpsc22/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..eb78a585079e3ee757a836433bf23423a3ad899d --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_cleanup.py @@ -0,0 +1,123 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, check_events +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Delete Links and Validate Collected Events ----------------------------------------------------------------- + for link in LINKS: + link_id = link['link_id'] + link_uuid = link_id['link_uuid']['uuid'] + LOGGER.info('Deleting Link {:s}'.format(link_uuid)) + context_client.RemoveLink(LinkId(**link_id)) + expected_events.append(('LinkEvent', EVENT_REMOVE, json_link_id(link_uuid))) + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _ in DEVICES: + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..e6f6ccbc96152eb7e3a33317293261e28c89d713 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py @@ -0,0 +1,129 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is up ---------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_creation( + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Create Inter-domain Slice ---------------------------------------------------------------------------------- + service_uuid = d1_osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + d1_osm_wim.get_connectivity_service_status(service_uuid) + + +def test_scenario_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..40a954868620564aef7d60c5ec0023ea0a32337b --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py @@ -0,0 +1,144 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure Inter-domain slice is created ------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_removal( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Remove Inter-domain Slice ---------------------------------------------------------------------------------- + # TODO: implement retrieval of inter-domain slice to be deleted + #response = d1_context_client.ListSliceIds(ContextId(**D1_CONTEXT_ID)) + #LOGGER.info('SliceIds[{:d}] = {:s}'.format(len(response.slice_ids), grpc_message_to_json_string(response))) + #assert len(response.service_ids) == 2 # L3NM + TAPI + #service_uuids = set() + #for service_id in response.service_ids: + # service_uuid = service_id.service_uuid.uuid + # if service_uuid.endswith(':optical'): continue + # service_uuids.add(service_uuid) + # osm_wim.conn_info[service_uuid] = {} + + # TODO: implement removal of service + #assert len(service_uuids) == 1 # assume a single service has been created + #service_uuid = set(service_uuids).pop() + #osm_wim.delete_connectivity_service(service_uuid) + pass + + +def test_interdomain_slice_removed( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure services removed -------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/ofc22/.gitignore b/src/tests/ofc22/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/ofc22/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/ofc22/__init__.py b/src/tests/ofc22/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/ofc22/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/tests/ofc22/descriptors_emulated.json b/src/tests/ofc22/descriptors_emulated.json new file mode 100644 index 0000000000000000000000000000000000000000..eb22506238e03a161f0e2b8aaeadf5fd31cf547b --- /dev/null +++ b/src/tests/ofc22/descriptors_emulated.json @@ -0,0 +1,108 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, + "device_ids": [], + "link_ids": [] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R2-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R3-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R4-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "O1-OLS"}}, + "device_type": "emu-optical-line-system", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"aade6001-f00b-5e2f-a357-6a0a9d3de870\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"eb287d83-f05e-53ec-ab5a-adf6bd2b5418\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"0ef74f99-1acc-57bd-ab9d-4b958b06c513\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"50296d99-58cc-5ce7-82f5-fc8ee4eec2ec\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1-EMU/13/0/0==O1-OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2-EMU/13/0/0==O1-OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3-EMU/13/0/0==O1-OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4-EMU/13/0/0==O1-OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} + ] + } + ] +} diff --git a/src/tests/ofc22/run_test_01_bootstrap.sh b/src/tests/ofc22/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..be30b15189786de3fd2f593a1584c73890e9e4fe --- /dev/null +++ b/src/tests/ofc22/run_test_01_bootstrap.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +pytest --verbose src/tests/ofc22/tests/test_functional_bootstrap.py diff --git a/src/tests/ofc22/run_test_02_create_service.sh b/src/tests/ofc22/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..20fc3db65dd57ae8697253443050b1767d9b77a1 --- /dev/null +++ b/src/tests/ofc22/run_test_02_create_service.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +pytest --verbose src/tests/ofc22/tests/test_functional_create_service.py diff --git a/src/tests/ofc22/run_test_03_delete_service.sh b/src/tests/ofc22/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..98073013d84e9d64e56dd9022ac163b6321ce389 --- /dev/null +++ b/src/tests/ofc22/run_test_03_delete_service.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +pytest --verbose src/tests/ofc22/tests/test_functional_delete_service.py diff --git a/src/tests/ofc22/run_test_04_cleanup.sh b/src/tests/ofc22/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..f7c0aad8da0b0446d188ec1fad3f0fc0e7dc2b4a --- /dev/null +++ b/src/tests/ofc22/run_test_04_cleanup.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +pytest --verbose src/tests/ofc22/tests/test_functional_cleanup.py diff --git a/src/tests/ofc22/run_tests_and_coverage.sh b/src/tests/ofc22/run_tests_and_coverage.sh new file mode 100755 index 0000000000000000000000000000000000000000..fa5026db2310c8753d8e4476707ce46a38ecb0f2 --- /dev/null +++ b/src/tests/ofc22/run_tests_and_coverage.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Configure the correct folder on the .coveragerc file +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE + +# Destroy old coverage file +rm -f $COVERAGEFILE + +# Force a flush of Context database +kubectl --namespace $TFS_K8S_NAMESPACE exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL + +# Run functional tests and analyze code coverage at the same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/ofc22/tests/test_functional_bootstrap.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/ofc22/tests/test_functional_create_service.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/ofc22/tests/test_functional_delete_service.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/ofc22/tests/test_functional_cleanup.py diff --git a/src/tests/ofc22/tests/.gitignore b/src/tests/ofc22/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/ofc22/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/ofc22/tests/BuildDescriptors.py b/src/tests/ofc22/tests/BuildDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..5c5419190487eb5089e4a30f523dca43fa3870f2 --- /dev/null +++ b/src/tests/ofc22/tests/BuildDescriptors.py @@ -0,0 +1,35 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, json, sys +from .Objects import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +def main(): + with open('tests/ofc22/descriptors_emulated.json', 'w', encoding='UTF-8') as f: + devices = [] + for device,connect_rules in DEVICES: + device = copy.deepcopy(device) + device['device_config']['config_rules'].extend(connect_rules) + devices.append(device) + + f.write(json.dumps({ + 'contexts': CONTEXTS, + 'topologies': TOPOLOGIES, + 'devices': devices, + 'links': LINKS + })) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/ofc22/tests/LoadDescriptors.py b/src/tests/ofc22/tests/LoadDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..4d3af78f5c9a3fd9b09d94f24bb8aaec48af6b7a --- /dev/null +++ b/src/tests/ofc22/tests/LoadDescriptors.py @@ -0,0 +1,40 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json, logging, sys +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Context, Device, Link, Topology +from device.client.DeviceClient import DeviceClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def main(): + context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + device_client = DeviceClient( + get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + + with open('tests/ofc22/descriptors.json', 'r', encoding='UTF-8') as f: + descriptors = json.loads(f.read()) + + for context in descriptors['contexts' ]: context_client.SetContext (Context (**context )) + for topology in descriptors['topologies']: context_client.SetTopology(Topology(**topology)) + for device in descriptors['devices' ]: device_client .AddDevice (Device (**device )) + for link in descriptors['links' ]: context_client.SetLink (Link (**link )) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/ofc22/tests/Objects.py b/src/tests/ofc22/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..bda08d7761ab3ad794246e6f94932c147a787993 --- /dev/null +++ b/src/tests/ofc22/tests/Objects.py @@ -0,0 +1,231 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from typing import Dict, List, Tuple +from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from context.proto.kpi_sample_types_pb2 import KpiSampleType + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) +CONTEXT = json_context(DEFAULT_CONTEXT_UUID) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +# ----- Device Credentials and Settings -------------------------------------------------------------------------------- +try: + from .Credentials import DEVICE_R1_ADDRESS, DEVICE_R1_PORT, DEVICE_R1_USERNAME, DEVICE_R1_PASSWORD + from .Credentials import DEVICE_R3_ADDRESS, DEVICE_R3_PORT, DEVICE_R3_USERNAME, DEVICE_R3_PASSWORD + from .Credentials import DEVICE_O1_ADDRESS, DEVICE_O1_PORT + USE_REAL_DEVICES = True # Use real devices +except ImportError: + USE_REAL_DEVICES = False # Use emulated devices + + DEVICE_R1_ADDRESS = '0.0.0.0' + DEVICE_R1_PORT = 830 + DEVICE_R1_USERNAME = 'admin' + DEVICE_R1_PASSWORD = 'admin' + + DEVICE_R3_ADDRESS = '0.0.0.0' + DEVICE_R3_PORT = 830 + DEVICE_R3_USERNAME = 'admin' + DEVICE_R3_PASSWORD = 'admin' + + DEVICE_O1_ADDRESS = '0.0.0.0' + DEVICE_O1_PORT = 4900 + +#USE_REAL_DEVICES = False # Uncomment to force to use emulated devices + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + ] + +def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint(device_id, ep_uuid, ep_type, topology_id=None, kpi_sample_types=ep_sample_types) + for ep_uuid, ep_type, ep_sample_types in endpoint_descriptors + ] + +def get_link_uuid(a_device_id : Dict, a_endpoint_id : Dict, z_device_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_device_id['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_device_id['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +if not USE_REAL_DEVICES: + json_device_packetrouter_disabled = json_device_emulated_packet_router_disabled + json_device_tapi_disabled = json_device_emulated_tapi_disabled + +DEVICE_R1_UUID = 'R1-EMU' +DEVICE_R1_TIMEOUT = 120 +DEVICE_R1_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +#DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1 = json_device_packetrouter_disabled(DEVICE_R1_UUID) +ENDPOINT_ID_R1_13_0_0 = DEVICE_R1_ENDPOINT_IDS[0] +ENDPOINT_ID_R1_13_1_2 = DEVICE_R1_ENDPOINT_IDS[1] +DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1_PORT, { + 'username': DEVICE_R1_USERNAME, + 'password': DEVICE_R1_PASSWORD, + 'timeout' : DEVICE_R1_TIMEOUT, +}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R1_ENDPOINT_DEFS) + + +DEVICE_R2_UUID = 'R2-EMU' +DEVICE_R2_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +#DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2 = json_device_emulated_packet_router_disabled(DEVICE_R2_UUID) +ENDPOINT_ID_R2_13_0_0 = DEVICE_R2_ENDPOINT_IDS[0] +ENDPOINT_ID_R2_13_1_2 = DEVICE_R2_ENDPOINT_IDS[1] +DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_DEFS) + + +DEVICE_R3_UUID = 'R3-EMU' +DEVICE_R3_TIMEOUT = 120 +DEVICE_R3_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) +#DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3 = json_device_packetrouter_disabled(DEVICE_R3_UUID) +ENDPOINT_ID_R3_13_0_0 = DEVICE_R3_ENDPOINT_IDS[0] +ENDPOINT_ID_R3_13_1_2 = DEVICE_R3_ENDPOINT_IDS[1] +DEVICE_R3_CONNECT_RULES = json_device_connect_rules(DEVICE_R3_ADDRESS, DEVICE_R3_PORT, { + 'username': DEVICE_R3_USERNAME, + 'password': DEVICE_R3_PASSWORD, + 'timeout' : DEVICE_R3_TIMEOUT, +}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R3_ENDPOINT_DEFS) + + +DEVICE_R4_UUID = 'R4-EMU' +DEVICE_R4_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R4_ID = json_device_id(DEVICE_R4_UUID) +#DEVICE_R4_ENDPOINTS = json_endpoints(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) +DEVICE_R4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) +DEVICE_R4 = json_device_emulated_packet_router_disabled(DEVICE_R4_UUID) +ENDPOINT_ID_R4_13_0_0 = DEVICE_R4_ENDPOINT_IDS[0] +ENDPOINT_ID_R4_13_1_2 = DEVICE_R4_ENDPOINT_IDS[1] +DEVICE_R4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R4_ENDPOINT_DEFS) + + +DEVICE_O1_UUID = 'O1-OLS' +DEVICE_O1_TIMEOUT = 120 +DEVICE_O1_ENDPOINT_DEFS = [ + ('aade6001-f00b-5e2f-a357-6a0a9d3de870', 'optical', []), # node_1_port_13 + ('eb287d83-f05e-53ec-ab5a-adf6bd2b5418', 'optical', []), # node_2_port_13 + ('0ef74f99-1acc-57bd-ab9d-4b958b06c513', 'optical', []), # node_3_port_13 + ('50296d99-58cc-5ce7-82f5-fc8ee4eec2ec', 'optical', []), # node_4_port_13 +] +DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) +DEVICE_O1 = json_device_tapi_disabled(DEVICE_O1_UUID) +#DEVICE_O1_ENDPOINTS = json_endpoints(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +DEVICE_O1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) +ENDPOINT_ID_O1_EP1 = DEVICE_O1_ENDPOINT_IDS[0] +ENDPOINT_ID_O1_EP2 = DEVICE_O1_ENDPOINT_IDS[1] +ENDPOINT_ID_O1_EP3 = DEVICE_O1_ENDPOINT_IDS[2] +ENDPOINT_ID_O1_EP4 = DEVICE_O1_ENDPOINT_IDS[3] +DEVICE_O1_CONNECT_RULES = json_device_connect_rules(DEVICE_O1_ADDRESS, DEVICE_O1_PORT, { + 'timeout' : DEVICE_O1_TIMEOUT, +}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_O1_ENDPOINT_DEFS) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_R1_O1_UUID = get_link_uuid(DEVICE_R1_ID, ENDPOINT_ID_R1_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP1) +LINK_R1_O1_ID = json_link_id(LINK_R1_O1_UUID) +LINK_R1_O1 = json_link(LINK_R1_O1_UUID, [ENDPOINT_ID_R1_13_0_0, ENDPOINT_ID_O1_EP1]) + +LINK_R2_O1_UUID = get_link_uuid(DEVICE_R2_ID, ENDPOINT_ID_R2_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP2) +LINK_R2_O1_ID = json_link_id(LINK_R2_O1_UUID) +LINK_R2_O1 = json_link(LINK_R2_O1_UUID, [ENDPOINT_ID_R2_13_0_0, ENDPOINT_ID_O1_EP2]) + +LINK_R3_O1_UUID = get_link_uuid(DEVICE_R3_ID, ENDPOINT_ID_R3_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP3) +LINK_R3_O1_ID = json_link_id(LINK_R3_O1_UUID) +LINK_R3_O1 = json_link(LINK_R3_O1_UUID, [ENDPOINT_ID_R3_13_0_0, ENDPOINT_ID_O1_EP3]) + +LINK_R4_O1_UUID = get_link_uuid(DEVICE_R4_ID, ENDPOINT_ID_R4_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP4) +LINK_R4_O1_ID = json_link_id(LINK_R4_O1_UUID) +LINK_R4_O1 = json_link(LINK_R4_O1_UUID, [ENDPOINT_ID_R4_13_0_0, ENDPOINT_ID_O1_EP4]) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +WIM_SEP_R1_ID = compose_service_endpoint_id(ENDPOINT_ID_R1_13_1_2) +WIM_SEP_R1_SITE_ID = '1' +WIM_SEP_R1_BEARER = WIM_SEP_R1_ID +WIM_SRV_R1_VLAN_ID = 400 + +WIM_SEP_R3_ID = compose_service_endpoint_id(ENDPOINT_ID_R3_13_1_2) +WIM_SEP_R3_SITE_ID = '2' +WIM_SEP_R3_BEARER = WIM_SEP_R3_ID +WIM_SRV_R3_VLAN_ID = 500 + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +WIM_MAPPING = [ + {'device-id': DEVICE_R1_UUID, 'service_endpoint_id': WIM_SEP_R1_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R1_BEARER}, 'site-id': WIM_SEP_R1_SITE_ID}}, + {'device-id': DEVICE_R3_UUID, 'service_endpoint_id': WIM_SEP_R3_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R3_BEARER}, 'site-id': WIM_SEP_R3_SITE_ID}}, +] +WIM_SERVICE_TYPE = 'ELINE' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_R1_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_R1_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_R3_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_R3_VLAN_ID}}, +] + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [ + (DEVICE_R1, DEVICE_R1_CONNECT_RULES), + (DEVICE_R2, DEVICE_R2_CONNECT_RULES), + (DEVICE_R3, DEVICE_R3_CONNECT_RULES), + (DEVICE_R4, DEVICE_R4_CONNECT_RULES), + (DEVICE_O1, DEVICE_O1_CONNECT_RULES), +] + +LINKS = [LINK_R1_O1, LINK_R2_O1, LINK_R3_O1, LINK_R4_O1] diff --git a/src/tests/ofc22/tests/__init__.py b/src/tests/ofc22/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/tests/ofc22/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/tests/ofc22/tests/test_functional_bootstrap.py b/src/tests/ofc22/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..334d7894babedfed2ffb30e4682a1d56e4261cb9 --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_bootstrap.py @@ -0,0 +1,204 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import copy, logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_scenario_empty(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + +def test_prepare_scenario(context_client : ContextClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + for context in CONTEXTS: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + expected_events.append(('ContextEvent', EVENT_CREATE, json_context_id(context_uuid))) + + for topology in TOPOLOGIES: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + context_id = json_context_id(context_uuid) + expected_events.append(('TopologyEvent', EVENT_CREATE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_ready(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_devices_bootstraping( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client, log_events_received=True) + events_collector.start() + + expected_events = [] + + # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- + for device, connect_rules in DEVICES: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + + device_with_connect_rules = copy.deepcopy(device) + device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + expected_events.extend([ + # Device creation, update for automation to start the device + ('DeviceEvent', EVENT_CREATE, json_device_id(device_uuid)), + #('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid)), + ]) + + #response = context_client.GetDevice(response) + #for endpoint in response.device_endpoints: + # for _ in endpoint.kpi_sample_types: + # # Monitoring configures monitoring for endpoint + # expected_events.append(('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_links_creation(context_client : ContextClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Create Links and Validate Collected Events ----------------------------------------------------------------- + for link in LINKS: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Adding Link {:s}'.format(link_uuid)) + response = context_client.SetLink(Link(**link)) + assert response.link_uuid.uuid == link_uuid + expected_events.append(('LinkEvent', EVENT_CREATE, json_link_id(link_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_links_created(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 diff --git a/src/tests/ofc22/tests/test_functional_cleanup.py b/src/tests/ofc22/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..eb78a585079e3ee757a836433bf23423a3ad899d --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_cleanup.py @@ -0,0 +1,123 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, check_events +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Delete Links and Validate Collected Events ----------------------------------------------------------------- + for link in LINKS: + link_id = link['link_id'] + link_uuid = link_id['link_uuid']['uuid'] + LOGGER.info('Deleting Link {:s}'.format(link_uuid)) + context_client.RemoveLink(LinkId(**link_id)) + expected_events.append(('LinkEvent', EVENT_REMOVE, json_link_id(link_uuid))) + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _ in DEVICES: + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/ofc22/tests/test_functional_create_service.py b/src/tests/ofc22/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..f3389fdbfce4e9262ffddbad876bb86f9b300551 --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_create_service.py @@ -0,0 +1,129 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events +from common.tools.object_factory.Connection import json_connection_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Service import json_service_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, Empty +from .Objects import ( + CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, + WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client, log_events_received=True) + events_collector.start() + + # ----- Create Service --------------------------------------------------------------------------------------------- + service_uuid = osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + osm_wim.get_connectivity_service_status(service_uuid) + + # ----- Validate collected events ---------------------------------------------------------------------------------- + + packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) + optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_EMU_OLS) + optical_service_uuid = '{:s}:optical'.format(service_uuid) + + expected_events = [ + # Create packet service and add first endpoint + ('ServiceEvent', EVENT_CREATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + + # Configure OLS controller, create optical service, create optical connection + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_O1_UUID)), + ('ServiceEvent', EVENT_CREATE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), + ('ConnectionEvent', EVENT_CREATE, json_connection_id(optical_connection_uuid)), + + # Configure endpoint packet devices, add second endpoint to service, create connection + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), + ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + ('ConnectionEvent', EVENT_CREATE, json_connection_id(packet_connection_uuid)), + ] + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_service_created(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2 # L3NM + TAPI + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service diff --git a/src/tests/ofc22/tests/test_functional_delete_service.py b/src/tests/ofc22/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..51e91a5967e1696fa2fdfe7dd06d2efb46642248 --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_delete_service.py @@ -0,0 +1,134 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, EVENT_UPDATE, check_events +from common.tools.object_factory.Connection import json_connection_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Service import json_service_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, Empty +from .Objects import ( + CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, WIM_MAPPING, + WIM_PASSWORD, WIM_USERNAME) + + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2 # L3NM + TAPI + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + +def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client, log_events_received=True) + events_collector.start() + + # ----- Delete Service --------------------------------------------------------------------------------------------- + response = context_client.ListServiceIds(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.service_ids), grpc_message_to_json_string(response))) + assert len(response.service_ids) == 2 # L3NM + TAPI + service_uuids = set() + for service_id in response.service_ids: + service_uuid = service_id.service_uuid.uuid + if service_uuid.endswith(':optical'): continue + service_uuids.add(service_uuid) + osm_wim.conn_info[service_uuid] = {} + + assert len(service_uuids) == 1 # assume a single service has been created + service_uuid = set(service_uuids).pop() + + osm_wim.delete_connectivity_service(service_uuid) + + # ----- Validate collected events ---------------------------------------------------------------------------------- + packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) + optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_EMU_OLS) + optical_service_uuid = '{:s}:optical'.format(service_uuid) + + expected_events = [ + ('ConnectionEvent', EVENT_REMOVE, json_connection_id(packet_connection_uuid)), + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), + ('ServiceEvent', EVENT_REMOVE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + ('ConnectionEvent', EVENT_REMOVE, json_connection_id(optical_connection_uuid)), + ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_O1_UUID)), + ('ServiceEvent', EVENT_REMOVE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), + ] + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 diff --git a/src/webui/.gitlab-ci.yml b/src/webui/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..e939d834761834f60e13045f7ce941f41887b956 --- /dev/null +++ b/src/webui/.gitlab-ci.yml @@ -0,0 +1,106 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build webui: + variables: + IMAGE_NAME: 'webui' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test webui: + variables: + IMAGE_NAME: 'webui' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build webui + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 8004:8004 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec --user root -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose ${IMAGE_NAME}/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec --user root -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy webui: + variables: + IMAGE_NAME: 'webui' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test webui + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/webui/Config.py b/src/webui/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..f7573f681aa4da3046850676aaeabe694cf490de --- /dev/null +++ b/src/webui/Config.py @@ -0,0 +1,18 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +HOST = '0.0.0.0' # accepts connections coming from any address +DEBUG = False +SECRET_KEY = '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(' +MAX_CONTENT_LENGTH = 1024*1024 diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7760416be32b893ed5f2408b70e874fb89721e17 --- /dev/null +++ b/src/webui/Dockerfile @@ -0,0 +1,85 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +FROM python:3.9-slim + +# Ref: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ + +# Install dependencies +# RUN apt-get --yes --quiet --quiet update && \ +# apt-get --yes --quiet --quiet install wget g++ && \ +# rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 +ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' + +# Download the gRPC health probe -- not needed here... health will be asserted using HTTP +# RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ +# wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ +# chmod +x /bin/grpc_health_probe + +# Creating a user for security reasons +RUN groupadd -r webui && useradd --no-log-init -r -m -g webui webui +USER webui + +# set working directory +RUN mkdir -p /home/webui/teraflow +WORKDIR /home/webui/teraflow + +# Get Python packages per module +ENV VIRTUAL_ENV=/home/webui/venv +RUN python3 -m venv ${VIRTUAL_ENV} +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +COPY --chown=webui:webui common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +COPY --chown=webui:webui src/common/. common/ +RUN rm -rf common/proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p common/proto +WORKDIR /home/webui/teraflow/common/proto +RUN touch __init__.py +COPY --chown=webui:webui proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; +WORKDIR /home/webui/teraflow + +COPY --chown=webui:webui src/webui/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN pip install -r requirements.txt + +# Add files into working directory +COPY --chown=webui:webui src/context/__init__.py context/__init__.py +COPY --chown=webui:webui src/context/client/. context/client/ +COPY --chown=webui:webui src/device/__init__.py device/__init__.py +COPY --chown=webui:webui src/device/client/. device/client/ +COPY --chown=webui:webui src/service/__init__.py service/__init__.py +COPY --chown=webui:webui src/service/client/. service/client/ +COPY --chown=webui:webui src/webui/. webui/ + +# Start the service +ENTRYPOINT ["python", "-m", "webui.service"] diff --git a/src/webui/__init__.py b/src/webui/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/grafana_dashboard.json b/src/webui/grafana_dashboard.json new file mode 100644 index 0000000000000000000000000000000000000000..a845ac20c7861b86fd1931452b7802b3f1e57aa8 --- /dev/null +++ b/src/webui/grafana_dashboard.json @@ -0,0 +1,323 @@ +{"overwrite": true, "folderId": 0, "dashboard": + { + "id": null, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": null, + "graphTooltip": 0, + "iteration": 1646406031197, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".* PACKETS_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "unit", + "value": "pps" + }, + { + "id": "custom.axisLabel", + "value": "Packets / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".* BYTES_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "unit", + "value": "Bps" + }, + { + "id": "custom.axisLabel", + "value": "Bytes / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 19, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "first", + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "alias": "$tag_device_id $tag_endpoint_id $tag_kpi_sample_type", + "groupBy": [ + { + "params": [ + "device_id" + ], + "type": "tag" + }, + { + "params": [ + "endpoint_id" + ], + "type": "tag" + }, + { + "params": [ + "kpi_sample_type" + ], + "type": "tag" + } + ], + "measurement": "samples", + "orderByTime": "ASC", + "policy": "autogen", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "kpi_value" + ], + "type": "field" + } + ] + ], + "tags": [ + { + "key": "device_id", + "operator": "=~", + "value": "/^$device_id$/" + }, + { + "condition": "AND", + "key": "endpoint_id", + "operator": "=~", + "value": "/^$endpoint_id$/" + }, + { + "condition": "AND", + "key": "kpi_sample_type", + "operator": "=~", + "value": "/^$kpi_sample_type$/" + } + ] + } + ], + "title": "L3 Monitoring Packets/Bytes Received/Sent", + "transformations": [], + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 32, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "R1-EMU", + "R3-EMU" + ], + "value": [ + "R1-EMU", + "R3-EMU" + ] + }, + "datasource": null, + "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"device_id\"", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_id", + "options": [], + "query": "SHOW TAG VALUES FROM samples WITH KEY=\"device_id\"", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "13/1/2" + ], + "value": [ + "13/1/2" + ] + }, + "datasource": null, + "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"endpoint_id\" WHERE \"device_id\"=~/^$device_id$/", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "EndPoint", + "multi": true, + "name": "endpoint_id", + "options": [], + "query": "SHOW TAG VALUES FROM samples WITH KEY=\"endpoint_id\" WHERE \"device_id\"=~/^$device_id$/", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": null, + "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"kpi_sample_type\"", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Kpi Sample Type", + "multi": true, + "name": "kpi_sample_type", + "options": [], + "query": "SHOW TAG VALUES FROM samples WITH KEY=\"kpi_sample_type\"", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "L3 Monitoring", + "uid": "tf-l3-monit", + "version": 2 + } +} diff --git a/src/webui/requirements.in b/src/webui/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..fc13bdc5d79f8a8e703638c923e8dc76a4e1a063 --- /dev/null +++ b/src/webui/requirements.in @@ -0,0 +1,5 @@ +Flask==2.1.3 +Flask-WTF==1.0.0 +flask-healthz==0.0.3 +flask-unittest==0.1.2 +lorem-text==2.1 diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9187d90e76acd256bcac752ce7e7be025889e133 --- /dev/null +++ b/src/webui/service/__init__.py @@ -0,0 +1,87 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json +from flask import Flask, request, session +from flask_healthz import healthz, HealthError +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient + +def get_working_context() -> str: + if 'context_uuid' in session: + return session['context_uuid'] + else: + return 'Not selected' + +def liveness(): + pass + +def readiness(): + try: # this component is ready when it is able to connect with the other components it depends on + context_client = ContextClient() + context_client.connect() + context_client.close() + device_client = DeviceClient() + device_client.connect() + device_client.close() + except Exception as e: + raise HealthError('Can\'t connect with the service: ' + e.details()) + +def from_json(json_str): + return json.loads(json_str) + +class SetSubAppMiddleware(): + def __init__(self, app, web_app_root): + self.app = app + self.web_app_root = web_app_root + + def __call__(self, environ, start_response): + environ['SCRIPT_NAME'] = self.web_app_root + environ['APPLICATION_ROOT'] = self.web_app_root + return self.app(environ, start_response) + +def create_app(use_config=None, web_app_root=None): + app = Flask(__name__) + if use_config: + app.config.from_mapping(**use_config) + + app.config.update(HEALTHZ={ + 'live': liveness, + 'ready': readiness + }) + + app.register_blueprint(healthz, url_prefix='/healthz') + + from webui.service.js.routes import js + app.register_blueprint(js) + + from webui.service.main.routes import main + app.register_blueprint(main) + + from webui.service.service.routes import service + app.register_blueprint(service) + + from webui.service.device.routes import device + app.register_blueprint(device) + + from webui.service.link.routes import link + app.register_blueprint(link) + + app.jinja_env.filters['from_json'] = from_json + + app.jinja_env.globals.update(get_working_context=get_working_context) + + if web_app_root is not None: + app.wsgi_app = SetSubAppMiddleware(app.wsgi_app, web_app_root) + return app diff --git a/src/webui/service/__main__.py b/src/webui/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..c194be4bcfe71f3665dba75a109aa5fdf9646a8d --- /dev/null +++ b/src/webui/service/__main__.py @@ -0,0 +1,59 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import os, sys, logging +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, get_service_baseurl_http, + get_service_port_http, get_setting, wait_for_environment_variables) +from webui.service import create_app +from webui.Config import MAX_CONTENT_LENGTH, HOST, SECRET_KEY, DEBUG + +def main(): + log_level = get_log_level() + logging.basicConfig(level=log_level) + logger = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + logger.info('Starting...') + + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + host = get_setting('HOST', default=HOST) + service_port = get_service_port_http(ServiceNameEnum.WEBUI) + web_app_root = get_service_baseurl_http(ServiceNameEnum.WEBUI) + debug = get_setting('DEBUG', default=DEBUG) + if isinstance(debug, str): debug = (debug.upper() in {'T', '1', 'TRUE'}) + + app = create_app(use_config={ + 'SECRET_KEY': SECRET_KEY, + 'MAX_CONTENT_LENGTH': MAX_CONTENT_LENGTH, + }, web_app_root=web_app_root) + app.run(host=host, port=service_port, debug=debug) + + logger.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/webui/service/context/__init__.py b/src/webui/service/context/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/service/context/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/service/context/routes.py b/src/webui/service/context/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..29910cbc34509f1dc0848359fd7367a07174b6dc --- /dev/null +++ b/src/webui/service/context/routes.py @@ -0,0 +1,23 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask import render_template, Blueprint, flash + +context = Blueprint('context', __name__) + +@context.route('/') +def home(): + flash('This is an info message', 'info') + flash('This is a danger message', 'danger') + return render_template('main/home.html') diff --git a/src/webui/service/device/__init__.py b/src/webui/service/device/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/service/device/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/service/device/forms.py b/src/webui/service/device/forms.py new file mode 100644 index 0000000000000000000000000000000000000000..d1880d321c4cb2cc825baed5353b892aae90aae9 --- /dev/null +++ b/src/webui/service/device/forms.py @@ -0,0 +1,54 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# external imports +from flask_wtf import FlaskForm +from wtforms import StringField, SelectField, TextAreaField, SubmitField +from wtforms.validators import DataRequired, Length, NumberRange, Regexp, ValidationError +from common.proto.context_pb2 import DeviceDriverEnum, DeviceOperationalStatusEnum +from webui.utils.form_validators import key_value_validator + +class AddDeviceForm(FlaskForm): + device_id = StringField('ID', + validators=[DataRequired(), Length(min=5)]) + device_type = StringField('Type', + validators=[DataRequired(), Length(min=5)]) + device_config = TextAreaField('Configurations', validators=[key_value_validator()]) + operational_status = SelectField('Operational Status', + # choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], + coerce=int, + validators=[NumberRange(min=0)]) + device_drivers = TextAreaField('Drivers', validators=[DataRequired(), Regexp(r'^\d+(,\d+)*$')]) + submit = SubmitField('Add') + + def validate_operational_status(form, field): + if field.data not in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_number: + raise ValidationError('The operational status value selected is incorrect!') + + def validate_device_drivers(form, field): + if ',' not in field.data: + data = str(field.data) + ',' + else: + data = field.data + for value in data.split(','): + value = value.strip() + if len(value) == 0: + continue + try: + value_int = int(value) + except: + raise ValidationError(f'The value "{value}" is not a valid driver identified.') + if value_int not in DeviceDriverEnum.DESCRIPTOR.values_by_number: + values = ', '.join([str(x) for x in DeviceDriverEnum.DESCRIPTOR.values_by_number]) + raise ValidationError(f'The device driver {value_int} is not correct. Allowed values are: {values}.') diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..f1423e92ed63fa778448978167c1c8e646414885 --- /dev/null +++ b/src/webui/service/device/routes.py @@ -0,0 +1,132 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask import current_app, render_template, Blueprint, flash, session, redirect, url_for +from common.proto.context_pb2 import ( + ConfigActionEnum, ConfigRule, + Device, DeviceDriverEnum, DeviceId, DeviceList, DeviceOperationalStatusEnum, + Empty) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from webui.service.device.forms import AddDeviceForm + +device = Blueprint('device', __name__, url_prefix='/device') +context_client = ContextClient() +device_client = DeviceClient() + +@device.get('/') +def home(): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + context_client.connect() + response: DeviceList = context_client.ListDevices(Empty()) + context_client.close() + return render_template('device/home.html', devices=response.devices, + dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) + +@device.route('add', methods=['GET', 'POST']) +def add(): + form = AddDeviceForm() + + # listing enum values + form.operational_status.choices = [(-1, 'Select...')] + for key, value in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): + form.operational_status.choices.append( + (DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) + + # device driver ids + device_driver_ids = [] + for key in DeviceDriverEnum.DESCRIPTOR.values_by_name: + device_driver_ids.append(f"{DeviceDriverEnum.Value(key)}={key.replace('DEVICEDRIVER_', '')}") + device_driver_ids = ', '.join(device_driver_ids) + + if form.validate_on_submit(): + device = Device() + device.device_id.device_uuid.uuid = form.device_id.data + device.device_type = form.device_type.data + if '\n' not in form.device_config.data: + data = form.device_config.data.strip() + '\n' + else: + data = form.device_config.data.strip() + + for config in data.split('\n'): + if len(config.strip()) > 0: + parts = config.strip().split('=') + config_rule: ConfigRule = ConfigRule() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = parts[0].strip() + config_rule.custom.resource_value = parts[1].strip() + device.device_config.config_rules.append(config_rule) + + device.device_operational_status = form.operational_status.data + + if ',' not in form.device_drivers.data: + data = form.device_drivers.data.strip() + ',' + else: + data = form.device_drivers.data.strip() + + for driver in data.split(','): + driver = driver.strip() + if len(driver) == 0: + continue + device.device_drivers.append(int(driver)) + try: + device_client.connect() + response: DeviceId = device_client.AddDevice(device) + device_client.close() + + flash(f'New device was created with ID "{response.device_uuid.uuid}".', 'success') + return redirect(url_for('device.home')) + except Exception as e: + flash(f'Problem adding the device. {e.details()}', 'danger') + + return render_template('device/add.html', form=form, + submit_text='Add New Device', + device_driver_ids=device_driver_ids) + +@device.route('detail/', methods=['GET', 'POST']) +def detail(device_uuid: str): + request = DeviceId() + request.device_uuid.uuid = device_uuid + context_client.connect() + response = context_client.GetDevice(request) + context_client.close() + return render_template('device/detail.html', device=response, + dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) + +@device.get('/delete') +def delete(device_uuid): + try: + + # first, check if device exists! + # request: DeviceId = DeviceId() + # request.device_uuid.uuid = device_uuid + # response: Device = client.GetDevice(request) + # TODO: finalize implementation + + request = DeviceId() + request.device_uuid.uuid = device_uuid + device_client.connect() + response = device_client.DeleteDevice(request) + device_client.close() + + flash(f'Device "{device_uuid}" deleted successfully!', 'success') + except Exception as e: + flash(f'Problem deleting device "{device_uuid}": {e.details()}', 'danger') + current_app.logger.exception(e) + return redirect(url_for('device.home')) diff --git a/src/webui/service/js/__init__.py b/src/webui/service/js/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/service/js/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/service/js/routes.py b/src/webui/service/js/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..fee4109df048a29954ce924ef57ec62d6adc27fb --- /dev/null +++ b/src/webui/service/js/routes.py @@ -0,0 +1,25 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask import render_template, Blueprint + +js = Blueprint('js', __name__, url_prefix='/js') + +@js.get('site.js') +def site_js(): + return render_template('js/site.js') + +@js.get('topology.js') +def topology_js(): + return render_template('js/topology.js') diff --git a/src/compute/proto/__init__.py b/src/webui/service/link/__init__.py similarity index 100% rename from src/compute/proto/__init__.py rename to src/webui/service/link/__init__.py diff --git a/src/webui/service/link/routes.py b/src/webui/service/link/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..04c4b1de59283832b17c92c91727fa716a2c0fea --- /dev/null +++ b/src/webui/service/link/routes.py @@ -0,0 +1,35 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from flask import render_template, Blueprint, flash, session, redirect, url_for +from common.proto.context_pb2 import Empty, LinkList +from context.client.ContextClient import ContextClient + +link = Blueprint('link', __name__, url_prefix='/link') +context_client = ContextClient() + +@link.get('/') +def home(): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + request = Empty() + context_client.connect() + response = context_client.ListLinks(request) + context_client.close() + return render_template( + "link/home.html", + links=response.links, + ) \ No newline at end of file diff --git a/src/webui/service/main/__init__.py b/src/webui/service/main/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/service/main/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/service/main/forms.py b/src/webui/service/main/forms.py new file mode 100644 index 0000000000000000000000000000000000000000..abef11e06d6222c6bbab527f3a41ccdc5918480f --- /dev/null +++ b/src/webui/service/main/forms.py @@ -0,0 +1,38 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# external imports +from flask_wtf import FlaskForm +from flask_wtf.file import FileAllowed +from wtforms import SelectField, FileField, SubmitField +from wtforms.validators import DataRequired, Length + + +class ContextForm(FlaskForm): + context = SelectField( 'Context', + choices=[], + validators=[ + DataRequired(), + Length(min=1) + ]) + + submit = SubmitField('Submit') + + +class DescriptorForm(FlaskForm): + descriptors = FileField('Descriptors', + validators=[ + FileAllowed(['json'], 'JSON Descriptors only!') + ]) + submit = SubmitField('Submit') diff --git a/src/webui/service/main/routes.py b/src/webui/service/main/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..85d3aeeb7c6f23ab4123412173cdfda4d27b23a4 --- /dev/null +++ b/src/webui/service/main/routes.py @@ -0,0 +1,128 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import json, logging +from flask import jsonify, redirect, render_template, Blueprint, flash, session, url_for, request +from common.proto.context_pb2 import Context, Device, Empty, Link, Topology, ContextIdList +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from webui.service.main.forms import ContextForm, DescriptorForm + +main = Blueprint('main', __name__) + +context_client = ContextClient() +device_client = DeviceClient() + +logger = logging.getLogger(__name__) + +def process_descriptor(item_name_singluar, item_name_plural, grpc_method, grpc_class, items): + num_ok, num_err = 0, 0 + for item in items: + try: + grpc_method(grpc_class(**item)) + num_ok += 1 + except Exception as e: # pylint: disable=broad-except + flash(f'Unable to add {item_name_singluar} {str(item)}: {str(e)}', 'error') + num_err += 1 + if num_ok : flash(f'{str(num_ok)} {item_name_plural} added', 'success') + if num_err: flash(f'{str(num_err)} {item_name_plural} failed', 'danger') + +def process_descriptors(descriptors): + logger.warning(str(descriptors.data)) + logger.warning(str(descriptors.name)) + try: + logger.warning(str(request.files)) + descriptors_file = request.files[descriptors.name] + logger.warning(str(descriptors_file)) + descriptors_data = descriptors_file.read() + logger.warning(str(descriptors_data)) + descriptors = json.loads(descriptors_data) + logger.warning(str(descriptors)) + except Exception as e: # pylint: disable=broad-except + flash(f'Unable to load descriptor file: {str(e)}', 'danger') + return + + context_client.connect() + device_client.connect() + process_descriptor('Context', 'Contexts', context_client.SetContext, Context, descriptors['contexts' ]) + process_descriptor('Topology', 'Topologies', context_client.SetTopology, Topology, descriptors['topologies']) + process_descriptor('Device', 'Devices', device_client .AddDevice, Device, descriptors['devices' ]) + process_descriptor('Link', 'Links', context_client.SetLink, Link, descriptors['links' ]) + device_client.close() + context_client.close() + +@main.route('/', methods=['GET', 'POST']) +def home(): + context_client.connect() + device_client.connect() + response: ContextIdList = context_client.ListContextIds(Empty()) + context_form: ContextForm = ContextForm() + context_form.context.choices.append(('', 'Select...')) + for context in response.context_ids: + context_form.context.choices.append((context.context_uuid.uuid, context.context_uuid)) + if context_form.validate_on_submit(): + session['context_uuid'] = context_form.context.data + flash(f'The context was successfully set to `{context_form.context.data}`.', 'success') + return redirect(url_for("main.home")) + if 'context_uuid' in session: + context_form.context.data = session['context_uuid'] + descriptor_form: DescriptorForm = DescriptorForm() + try: + if descriptor_form.validate_on_submit(): + process_descriptors(descriptor_form.descriptors) + return redirect(url_for("main.home")) + except Exception as e: + logger.exception('Descriptor load failed') + flash(f'Descriptor load failed: `{str(e)}`', 'danger') + finally: + context_client.close() + device_client.close() + return render_template('main/home.html', context_form=context_form, descriptor_form=descriptor_form) + +@main.route('/topology', methods=['GET']) +def topology(): + context_client.connect() + try: + response = context_client.ListDevices(Empty()) + devices = [{ + 'id': device.device_id.device_uuid.uuid, + 'name': device.device_id.device_uuid.uuid, + 'type': device.device_type, + } for device in response.devices] + + response = context_client.ListLinks(Empty()) + links = [{ + 'id': link.link_id.link_uuid.uuid, + 'source': link.link_endpoint_ids[0].device_id.device_uuid.uuid, + 'target': link.link_endpoint_ids[1].device_id.device_uuid.uuid, + } for link in response.links] + + return jsonify({'devices': devices, 'links': links}) + except: + logger.exception('Error retrieving topology') + finally: + context_client.close() + +@main.get('/about') +def about(): + return render_template('main/about.html') + +@main.get('/debug') +def debug(): + return render_template('main/debug.html') + +@main.get('/resetsession') +def reset_session(): + session.clear() + return redirect(url_for("main.home")) diff --git a/src/webui/service/service/__init__.py b/src/webui/service/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70a33251242c51f49140e596b8208a19dd5245f7 --- /dev/null +++ b/src/webui/service/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/service/service/routes.py b/src/webui/service/service/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..81031490ef840ff63262444a5487932a4e72c111 --- /dev/null +++ b/src/webui/service/service/routes.py @@ -0,0 +1,103 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +import grpc +from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for +from common.proto.context_pb2 import ContextId, Service, ServiceId, ServiceList, ServiceTypeEnum, ServiceStatusEnum +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient + +service = Blueprint('service', __name__, url_prefix='/service') + +context_client = ContextClient() +service_client = ServiceClient() + +@service.get('/') +def home(): + # flash('This is an info message', 'info') + # flash('This is a danger message', 'danger') + + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + request = ContextId() + request.context_uuid.uuid = context_uuid + context_client.connect() + try: + service_list = context_client.ListServices(request) + # print(service_list) + services = service_list.services + context_not_found = False + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise + if e.details() != 'Context({:s}) not found'.format(context_uuid): raise + services = [] + context_not_found = True + + context_client.close() + return render_template('service/home.html', services=services, + context_not_found=context_not_found, + ste=ServiceTypeEnum, + sse=ServiceStatusEnum) + + +@service.route('add', methods=['GET', 'POST']) +def add(): + flash('Add service route called', 'danger') + raise NotImplementedError() + return render_template('service/home.html') + + +@service.get('/detail') +def detail(service_uuid: str): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + request: ServiceId = ServiceId() + request.service_uuid.uuid = service_uuid + request.context_id.context_uuid.uuid = context_uuid + try: + context_client.connect() + response: Service = context_client.GetService(request) + context_client.close() + except Exception as e: + flash('The system encountered an error and cannot show the details of this service.', 'warning') + current_app.logger.exception(e) + return redirect(url_for('service.home')) + return render_template('service/detail.html', service=response) + + +@service.get('/delete') +def delete(service_uuid: str): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + try: + request = ServiceId() + request.service_uuid.uuid = service_uuid + request.context_id.context_uuid.uuid = context_uuid + service_client.connect() + response = service_client.DeleteService(request) + service_client.close() + + flash('Service "{:s}" deleted successfully!'.format(service_uuid), 'success') + except Exception as e: + flash('Problem deleting service "{:s}": {:s}'.format(service_uuid, str(e.details())), 'danger') + current_app.logger.exception(e) + return redirect(url_for('service.home')) diff --git a/src/webui/service/static/partners.png b/src/webui/service/static/partners.png new file mode 100644 index 0000000000000000000000000000000000000000..0c2b89eb9321caf8d1f1d63e0e20fd3e4b6ddeb7 Binary files /dev/null and b/src/webui/service/static/partners.png differ diff --git a/src/webui/service/static/topology_icons/Acknowledgements.txt b/src/webui/service/static/topology_icons/Acknowledgements.txt new file mode 100644 index 0000000000000000000000000000000000000000..c646efdec0d79148f9bd066116d6ca3985f6f909 --- /dev/null +++ b/src/webui/service/static/topology_icons/Acknowledgements.txt @@ -0,0 +1,12 @@ +Network Topology Icons taken from https://vecta.io/symbols + +https://symbols.getvecta.com/stencil_240/51_cloud.4d0a827676.png => cloud.png + +https://symbols.getvecta.com/stencil_240/15_atm-switch.1bbf9a7cca.png => packet-switch.png +https://symbols.getvecta.com/stencil_241/45_atm-switch.6a7362c1df.png => emu-packet-switch.png + +https://symbols.getvecta.com/stencil_240/204_router.7b208c1133.png => packet-router.png +https://symbols.getvecta.com/stencil_241/224_router.be30fb87e7.png => emu-packet-router.png + +https://symbols.getvecta.com/stencil_240/269_virtual-layer-switch.ed10fdede6.png => optical-line-system.png +https://symbols.getvecta.com/stencil_241/281_virtual-layer-switch.29420aff2f.png => emu-optical-line-system.png diff --git a/src/webui/service/static/topology_icons/cloud.png b/src/webui/service/static/topology_icons/cloud.png new file mode 100644 index 0000000000000000000000000000000000000000..0f8e9c9714edd1c11904367ef1e9c60ef7ed3295 Binary files /dev/null and b/src/webui/service/static/topology_icons/cloud.png differ diff --git a/src/webui/service/static/topology_icons/emu-optical-line-system.png b/src/webui/service/static/topology_icons/emu-optical-line-system.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c30d679170c6e080dee3cc5239bf7ecaefe743 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-optical-line-system.png differ diff --git a/src/webui/service/static/topology_icons/emu-packet-router.png b/src/webui/service/static/topology_icons/emu-packet-router.png new file mode 100644 index 0000000000000000000000000000000000000000..95fc8b9f35a0cda9440a07ac0df3d0d417cdd0f2 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-packet-router.png differ diff --git a/src/webui/service/static/topology_icons/emu-packet-switch.png b/src/webui/service/static/topology_icons/emu-packet-switch.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d431cd29b9eebc7eb6ec503ba8ed777082fa21 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-packet-switch.png differ diff --git a/src/webui/service/static/topology_icons/optical-line-system.png b/src/webui/service/static/topology_icons/optical-line-system.png new file mode 100644 index 0000000000000000000000000000000000000000..b51f094216755ed9fc5c7a7e8957bab88090c954 Binary files /dev/null and b/src/webui/service/static/topology_icons/optical-line-system.png differ diff --git a/src/webui/service/static/topology_icons/packet-router.png b/src/webui/service/static/topology_icons/packet-router.png new file mode 100644 index 0000000000000000000000000000000000000000..5d2ad4dabe730f78206afddb21886c6678e88a26 Binary files /dev/null and b/src/webui/service/static/topology_icons/packet-router.png differ diff --git a/src/webui/service/static/topology_icons/packet-switch.png b/src/webui/service/static/topology_icons/packet-switch.png new file mode 100644 index 0000000000000000000000000000000000000000..14f81111f9fbb4236f60f92cac1147365112bc41 Binary files /dev/null and b/src/webui/service/static/topology_icons/packet-switch.png differ diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..d314acb3d5cbe607e82474be7e66302f3d620d6a --- /dev/null +++ b/src/webui/service/templates/base.html @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + TeraFlow OFC 2022 Demo + + + + + + +
+
+
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} + + + {% endfor %} + {% endif %} + {% endwith %} +
+
+
+
+ {% block content %}{% endblock %} +
+
+
+ +
+
+
+
+

© 2021-2023

+
+
+
+
+

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101015857.

+
+
+ 5g ppp EU logo +
+
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/webui/service/templates/context/home.html b/src/webui/service/templates/context/home.html new file mode 100644 index 0000000000000000000000000000000000000000..9e1d1cd531c5542efdfbf87dbe9d452cd1956f14 --- /dev/null +++ b/src/webui/service/templates/context/home.html @@ -0,0 +1,95 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Service

+ +
+ +
+ {{ services | length }} services found +
+
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + {% if services %} + {% for service in services %} + + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
#TypeEnd pointsConstraintsStateConfiguration
{{ service.cs_id.contextId.contextUuid.uuid }} / {{ service.cs_id.cs_id.uuid }}{{ service.serviceType }} +
    + {% for end_point in service.endpointList %} +
  • {{ end_point }}
  • + {% endfor %} +
+
+
    + {% for constraint in service.constraint %} +
  • {{ constraint }}
  • + {% endfor %} +
+
{{ service.serviceState }}{{ service.serviceConfig }} + + + + + + +
No services found
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/add.html b/src/webui/service/templates/device/add.html new file mode 100644 index 0000000000000000000000000000000000000000..fe1ba31f26579fcf681ccf4da64a7906cae9cff5 --- /dev/null +++ b/src/webui/service/templates/device/add.html @@ -0,0 +1,116 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Add New Device

+ +
+ {{ form.hidden_tag() }} +
+
+ {{ form.device_id.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_id.errors %} + {{ form.device_id(class="form-control is-invalid") }} +
+ {% for error in form.device_id.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_id(class="form-control") }} + {% endif %} +
+
+
+ {{ form.device_type.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_type.errors %} + {{ form.device_type(class="form-control is-invalid") }} +
+ {% for error in form.device_type.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_type(class="form-control") }} + {% endif %} +
+
+
+ {{ form.operational_status.label(class="col-sm-2 col-form-label") }} +
+ {% if form.operational_status.errors %} + {{ form.operational_status(class="form-control is-invalid") }} +
+ {% for error in form.operational_status.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.operational_status(class="form-control") }} + {% endif %} +
+
+
+ {{ form.device_config.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_config.errors %} + {{ form.device_config(class="form-control is-invalid", rows=5) }} +
+ {% for error in form.device_config.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_config(class="form-control", rows=5) }} + {% endif %} +
+
The device configurations should follow a key=value format, one configuration per line.
+
+
+ {{ form.device_drivers.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_drivers.errors %} + {{ form.device_drivers(class="form-control is-invalid", rows=5) }} +
+ {% for error in form.device_drivers.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_drivers(class="form-control", rows=5) }} + {% endif %} +
+
+ List the device drivers by their numerical ID, separated by commas, without spaces between them. Numerical IDs: {{ device_driver_ids }}. +
+
+
+ + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/detail.html b/src/webui/service/templates/device/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..b4cf6b715250d3e96b5026c3e19758a2be9a9607 --- /dev/null +++ b/src/webui/service/templates/device/detail.html @@ -0,0 +1,111 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Device {{ device.device_id.device_uuid.uuid }}

+ +
+
+ +
+ +
+ + +
+
+ +
+
UUID:
+
+ {{ device.device_id.device_uuid.uuid }} +
+
Type:
+
+ {{ device.device_type }} +
+
+
+
Drivers:
+
+
    + {% for driver in device.device_drivers %} +
  • {{ dde.Name(driver).replace('DEVICEDRIVER_', '').replace('UNDEFINED', 'EMULATED') }}
  • + {% endfor %} +
+
+
+
+ Endpoints: +
+
    + {% for endpoint in device.device_endpoints %} +
  • {{ endpoint.endpoint_id.endpoint_uuid.uuid }}: {{ endpoint.endpoint_type }}
  • + {% endfor %} +
+
+
+
+ Configurations: +
+
    + {% for config in device.device_config.config_rules %} + {% if config.WhichOneof('config_rule') == 'custom' %} +
  • {{ config.custom.resource_key }}: +
      + {% for key, value in (config.custom.resource_value | from_json).items() %} +
    • {{ key }}: {{ value }}
    • + {% endfor %} +
    +
  • + {% endif %} + {% endfor %} +
+
+
+ + + + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/home.html b/src/webui/service/templates/device/home.html new file mode 100644 index 0000000000000000000000000000000000000000..2c108add96df7de413f5310d4bd9e3c3fb69a6ed --- /dev/null +++ b/src/webui/service/templates/device/home.html @@ -0,0 +1,109 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Devices

+ +
+ +
+ {{ devices | length }} devices found in context {{ session['context_uuid'] }} +
+ +
+ + + + + + + + + + + + + + + {% if devices %} + {% for device in devices %} + + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
#TypeEndpointsDriversStatus
+ + {{ device.device_id.device_uuid.uuid }} + + + {{ device.device_type }} + +
    + {% for end_point in device.device_endpoints %} +
  • {{ end_point.endpoint_id.endpoint_uuid.uuid }}
  • + {% endfor %} +
+
+
    + {% for driver in device.device_drivers %} +
  • {{ dde.Name(driver).replace('DEVICEDRIVER_', '').replace('UNDEFINED', 'EMULATED') }}
  • + {% endfor %} +
+
{{ dose.Name(device.device_operational_status).replace('DEVICEOPERATIONALSTATUS_', '') }} + + + + + + +
No devices found
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/js/site.js b/src/webui/service/templates/js/site.js new file mode 100644 index 0000000000000000000000000000000000000000..1cd015f17cf87a6efe319d8d7090d81889e03062 --- /dev/null +++ b/src/webui/service/templates/js/site.js @@ -0,0 +1,20 @@ +/** + * Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) + * + * 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. + */ + +var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) +var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { + return new bootstrap.Tooltip(tooltipTriggerEl) +}) diff --git a/src/webui/service/templates/js/topology.js b/src/webui/service/templates/js/topology.js new file mode 100644 index 0000000000000000000000000000000000000000..05216fb98808d5b574d613344c63a7e19cb2c472 --- /dev/null +++ b/src/webui/service/templates/js/topology.js @@ -0,0 +1,150 @@ +// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// +// 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. + +// Based on: +// https://www.d3-graph-gallery.com/graph/network_basic.html +// https://bl.ocks.org/steveharoz/8c3e2524079a8c440df60c1ab72b5d03 + +// set the dimensions and margins of the graph +const margin = {top: 5, right: 5, bottom: 5, left: 5}; + +const icon_width = 40; +const icon_height = 40; + +width = 800 - margin.left - margin.right; +height = 500 - margin.top - margin.bottom; + +// append the svg object to the body of the page +const svg = d3.select('#topology') + .append('svg') + .attr('width', width + margin.left + margin.right) + .attr('height', height + margin.top + margin.bottom) + .append('g') + .attr('transform', `translate(${margin.left}, ${margin.top})`); + +// svg objects +var link, node; + +// values for all forces +forceProperties = { + center: {x: 0.5, y: 0.5}, + charge: {enabled: true, strength: -500, distanceMin: 10, distanceMax: 2000}, + collide: {enabled: true, strength: 0.7, iterations: 1, radius: 5}, + forceX: {enabled: false, strength: 0.1, x: 0.5}, + forceY: {enabled: false, strength: 0.1, y: 0.5}, + link: {enabled: true, distance: 100, iterations: 1} +} + +/**************** FORCE SIMULATION *****************/ + +var simulation = d3.forceSimulation(); + +// load the data +d3.json("{{ url_for('main.topology') }}", function(data) { + // set the data and properties of link lines and node circles + link = svg.append("g").attr("class", "links").style('stroke', '#aaa') + .selectAll("line") + .data(data.links) + .enter() + .append("line"); + node = svg.append("g").attr("class", "devices").attr('r', 20).style('fill', '#69b3a2') + .selectAll("circle") + .data(data.devices) + .enter() + .append("image") + .attr('xlink:href', function(d) { + return "{{ url_for('static', filename='/topology_icons/') }}" + d.type + ".png"; + }) + .attr('width', icon_width) + .attr('height', icon_height) + .call(d3.drag().on("start", dragstarted).on("drag", dragged).on("end", dragended)); + + // node tooltip + node.append("title").text(function(d) { return d.id; }); + + // link style + link + .attr("stroke-width", forceProperties.link.enabled ? 2 : 1) + .attr("opacity", forceProperties.link.enabled ? 1 : 0); + + // set up the simulation and event to update locations after each tick + simulation.nodes(data.devices); + + // add forces, associate each with a name, and set their properties + simulation + .force("link", d3.forceLink() + .id(function(d) {return d.id;}) + .distance(forceProperties.link.distance) + .iterations(forceProperties.link.iterations) + .links(forceProperties.link.enabled ? data.links : [])) + .force("charge", d3.forceManyBody() + .strength(forceProperties.charge.strength * forceProperties.charge.enabled) + .distanceMin(forceProperties.charge.distanceMin) + .distanceMax(forceProperties.charge.distanceMax)) + .force("collide", d3.forceCollide() + .strength(forceProperties.collide.strength * forceProperties.collide.enabled) + .radius(forceProperties.collide.radius) + .iterations(forceProperties.collide.iterations)) + .force("center", d3.forceCenter() + .x(width * forceProperties.center.x) + .y(height * forceProperties.center.y)) + .force("forceX", d3.forceX() + .strength(forceProperties.forceX.strength * forceProperties.forceX.enabled) + .x(width * forceProperties.forceX.x)) + .force("forceY", d3.forceY() + .strength(forceProperties.forceY.strength * forceProperties.forceY.enabled) + .y(height * forceProperties.forceY.y)); + + // after each simulation tick, update the display positions + simulation.on("tick", ticked); +}); + +// update the display positions +function ticked() { + link + .attr('x1', function(d) { return d.source.x; }) + .attr('y1', function(d) { return d.source.y; }) + .attr('x2', function(d) { return d.target.x; }) + .attr('y2', function(d) { return d.target.y; }); + + node + .attr('x', function(d) { return d.x-icon_width/2; }) + .attr('y', function(d) { return d.y-icon_height/2; }); +} + +/******************** UI EVENTS ********************/ + +function dragstarted(d) { + if (!d3.event.active) simulation.alphaTarget(0.3).restart(); + d.fx = d.x; + d.fy = d.y; +} + +function dragged(d) { + d.fx = d3.event.x; + d.fy = d3.event.y; +} + +function dragended(d) { + if (!d3.event.active) simulation.alphaTarget(0.0001); + d.fx = null; + d.fy = null; +} + +// update size-related forces +d3.select(window).on("resize", function(){ + width = +svg.node().getBoundingClientRect().width; + height = +svg.node().getBoundingClientRect().height; + simulation.alpha(1).restart(); +}); diff --git a/src/webui/service/templates/link/home.html b/src/webui/service/templates/link/home.html new file mode 100644 index 0000000000000000000000000000000000000000..d0c122f6aafd0de8e2937be056d1c2e787c91710 --- /dev/null +++ b/src/webui/service/templates/link/home.html @@ -0,0 +1,96 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Links

+ +
+
+ +
+
+ {{ links | length }} links found +
+ +
+ + + + + + + + + + + {% if links %} + {% for link in links %} + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
#Endpoints
+ + {{ link.link_id.link_uuid.uuid }} + + + + + +
No links found
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/about.html b/src/webui/service/templates/main/about.html new file mode 100644 index 0000000000000000000000000000000000000000..4ba3a5845b0e8e70b029d4ec459733468899698b --- /dev/null +++ b/src/webui/service/templates/main/about.html @@ -0,0 +1,25 @@ + + +{% extends 'base.html' %} +{% block content %} +

TeraFlow OS

+ +

For more information, visit the TeraFlow H2020 webpage.

+ + Consortium + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/debug.html b/src/webui/service/templates/main/debug.html new file mode 100644 index 0000000000000000000000000000000000000000..d065cc49d7262940beedd5eb9aa44a2ab890a07e --- /dev/null +++ b/src/webui/service/templates/main/debug.html @@ -0,0 +1,36 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Debug

+ +

Dump ContextDB:

+ + +{% endblock %} diff --git a/src/webui/service/templates/main/home.html b/src/webui/service/templates/main/home.html new file mode 100644 index 0000000000000000000000000000000000000000..3cc9fbcffce6cfbb6ebb40dec9d3359f59df5a15 --- /dev/null +++ b/src/webui/service/templates/main/home.html @@ -0,0 +1,84 @@ + + +{% extends 'base.html' %} + +{% block content %} +

TeraFlow OS SDN Controller

+ + {% for field, message in context_form.errors.items() %} + + + {% endfor %} + +
+ {{ context_form.hidden_tag() }} +
+ Select the working context, or upload a JSON descriptors file +
+ {{ context_form.context.label(class="col-sm-1 col-form-label") }} +
+ {% if context_form.context.errors %} + {{ context_form.context(class="form-select is-invalid") }} +
+ {% for error in context_form.context.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ context_form.context(class="form-select") }} + {% endif %} +
+
+ {{ context_form.submit(class='btn btn-primary') }} +
+
+
+
+ +
+ {{ context_form.hidden_tag() }} +
+ Upload a JSON descriptors file +
+ {{ descriptor_form.descriptors.label(class="col-sm-1 col-form-label") }} +
+ {% if descriptor_form.descriptors.errors %} + {{ descriptor_form.descriptors(class="form-control is-invalid") }} +
+ {% for error in descriptor_form.descriptors.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ descriptor_form.descriptors(class="form-control") }} + {% endif %} +
+
+ {{ descriptor_form.submit(class='btn btn-primary') }} +
+
+
+
+ + +
+ + +{% endblock %} diff --git a/src/webui/service/templates/service/detail.html b/src/webui/service/templates/service/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..1e58b9eaad3155524808f60b49840edab7f17739 --- /dev/null +++ b/src/webui/service/templates/service/detail.html @@ -0,0 +1,101 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Service {{ service.service_id.service_uuid.uuid }}

+ +
+
+ +
+ +
+ + +
+
+ +
+
UUID:
+
+ {{ service.service_id.service_uuid.uuid }} +
+
Type:
+
+ {{ service.service_type }} +
+
+
+ Endpoints: +
+
    + {% for endpoint in service.service_endpoint_ids %} +
  • {{ endpoint.endpoint_uuid.uuid }}: {{ endpoint.endpoint_type }}
  • + {% endfor %} +
+
+
+
+ Configurations: +
+
    + {% for config in service.service_config.config_rules %} + {% if config.WhichOneof('config_rule') == 'custom' %} +
  • {{ config.custom.resource_key }}: +
      + {% for key, value in (config.custom.resource_value | from_json).items() %} +
    • {{ key }}: {{ value }}
    • + {% endfor %} +
    +
  • + {% endif %} + {% endfor %} +
+
+
+ + + + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/service/home.html b/src/webui/service/templates/service/home.html new file mode 100644 index 0000000000000000000000000000000000000000..0e152006c149df35d477ecfb81bb4fcc0b562d9a --- /dev/null +++ b/src/webui/service/templates/service/home.html @@ -0,0 +1,99 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Services

+ +
+ +
+ {{ services | length }} services found in context {{ session['context_uuid'] }} +
+ +
+ + + + + + + + + + + + + + + {% if services %} + {% for service in services %} + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
#TypeEnd pointsConstraintsStatus
+ + {{ service.service_id.service_uuid.uuid }} + + + {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }} + +
    + {% for end_point in service.service_endpoint_ids %} +
  • {{ end_point.device_id.device_uuid.uuid }} / {{ end_point.endpoint_uuid.uuid }}
  • + {% endfor %} +
+
+
    + {% for constraint in service.service_constraints %} +
  • {{ constraint.constraint_type }}: {{ constraint.constraint_value }}
  • + {% endfor %} +
+
{{ sse.Name(service.service_status.service_status).replace('SERVICESTATUS_', '') }} + + + + + + +
No services found
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/tests/__init__.py b/src/webui/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/src/webui/tests/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/tests/test_unitary.py b/src/webui/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..945a60186e04cc1bd3ee7678b340e9321646df97 --- /dev/null +++ b/src/webui/tests/test_unitary.py @@ -0,0 +1,177 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +# import pytest +from flask_unittest import ClientTestCase +from unittest import mock +from flask.testing import FlaskClient +from flask.app import Flask +from flask.helpers import url_for +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ContextIdList, Empty, DeviceId, DeviceList, TopologyIdList +# from device.client.DeviceClient import DeviceClient +from webui.service import create_app + +class TestWebUI(ClientTestCase): + app = create_app(use_config={ + 'TESTING': True, + 'SERVER_NAME': 'localhost.localdomain', + 'SECRET_KEY': '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(', + 'WTF_CSRF_ENABLED': False, + }) + + def setUp(self, client: FlaskClient) -> None: + + self.mocker_delete_device = mock.patch('webui.service.device.routes.device_client.DeleteDevice') + self.mocker_delete_device.return_value = Empty() + self.mocker_delete_device.start() + self.addCleanup(self.mocker_delete_device.stop) + + self.mocker_list_context_ids = mock.patch('webui.service.device.routes.context_client.ListContextIds') + self.mocker_list_context_ids.return_value = ContextIdList() # returns an empty list + self.mocker_list_context_ids.start() + self.addCleanup(self.mocker_list_context_ids.stop) + + self.mocker_list_devices = mock.patch('webui.service.device.routes.context_client.ListDevices') + self.mocker_list_devices.return_value = DeviceList() # returns an empty list + self.mocker_list_devices.start() + self.addCleanup(self.mocker_list_devices.stop) + + self.mocker_add_device = mock.patch('webui.service.device.routes.device_client.AddDevice') + self.mocker_add_device.return_value = DeviceId() + self.mocker_add_device.start() + self.addCleanup(self.mocker_add_device.stop) + + self.mocker_list_topology_ids = mock.patch('webui.service.device.routes.context_client.ListTopologyIds') + self.mocker_list_topology_ids.return_value = TopologyIdList() + self.mocker_list_topology_ids.start() + self.addCleanup(self.mocker_list_topology_ids.stop) + + return super().setUp(client) + + def tearDown(self, client: FlaskClient) -> None: + mock.patch.stopall() + return super().tearDown(client) + + def test_routes(self, _) -> None: + with self.app.app_context(): + url_for('main.home') + url_for('service.home') + url_for('device.home') + url_for('link.home') + #url_for('main.debug') + url_for('main.about') + url_for('js.topology_js') + url_for('js.site_js') + + def test_device_add_action_success(self, client) -> None: + with client.session_transaction() as sess: + sess['context_uuid'] = 'admin' + DEVICE_EMU = { + 'device_id': 'EMULATED', + 'device_type': DeviceTypeEnum.EMULATED_PACKET_ROUTER.value, + 'device_config': '', + 'operational_status': 1, + 'device_drivers': 0, + 'device_endpoints': [], + } + rv = client.post('/device/add', data=DEVICE_EMU, follow_redirects=True) + self.assertInResponse(b'success', rv) + + def test_device_delete_action(self, client): + with client.session_transaction() as sess: + sess['context_uuid'] = 'admin' + + rv = client.get('/device/EMULATED/delete', follow_redirects=True) + # mocked_list.assert_called() + # mocked_delete.assert_called() + self.assertInResponse(b'success', rv) + + # def test_service_up(self, client): + # rw = client.get('/') + # assert rw.status_code == 200, 'Service is not up!' + +# def test_home_page(client): +# rw = client.get('/') +# assert rw.status_code == 200, 'Error in the home page!' +# assert b'Select the working context' in rw.data + +# def test_service_home_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/service/') +# assert rw.status_code == 200 +# assert b'Services' in rw.data +# assert b'Add New Service' in rw.data + +# def test_device_home_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/device/') +# assert rw.status_code == 200 +# assert b'Devices' in rw.data +# assert b'Add New Device' in rw.data + +# @pytest.mark.parametrize('device_id', ( +# 'DEV1', +# 'DEV2', +# 'DEV3', +# )) +# def test_device_detail_page(client, device_id): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get(f'/device/detail/{device_id}') +# assert rw.status_code == 200 +# assert b'Device' in rw.data +# assert device_id in rw.data.decode() +# assert b'Endpoints' in rw.data, 'Missing endpoint information on the device detail page.' +# # assert b'Add New Device' in rw.data + +# def test_device_add_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/device/add') +# assert rw.status_code == 200 +# assert b'Add New Device' in rw.data +# assert b'Operational Status' in rw.data, 'Form is not correctly implemented.' +# assert b'Type' in rw.data, 'Form is not correctly implemented.' +# assert b'Configurations' in rw.data, 'Form is not correctly implemented.' +# assert b'Drivers' in rw.data, 'Form is not correctly implemented.' + +# def test_device_add_action(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# DEVICE_EMU = { +# 'device_id': 'EMULATED', +# 'device_type': DeviceTypeEnum.EMULATED_PACKET_ROUTER.value, +# 'device_config': '', +# 'operational_status': 1, +# 'device_drivers': 0, +# 'device_endpoints': [], +# } +# with mock.patch('webui.service.device.routes.device_client.AddDevice') as mocked_add: +# mocked_add.return_value = DeviceId() +# rw = client.post('/device/add', data=DEVICE_EMU, follow_redirects=True) +# assert b'success' in rw.data + +# def test_device_delete_action(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# with mock.patch('webui.service.device.routes.device_client.DeleteDevice') as mocked_delete,\ +# mock.patch('webui.service.device.routes.context_client.ListDevices') as mocked_list: +# mocked_list.return_value = DeviceList() # returns an empty list +# rw = client.get('/device/EMULATED/delete', follow_redirects=True) +# mocked_list.assert_called() +# mocked_delete.assert_called() +# assert b'success' in rw.data diff --git a/src/webui/utils/__init__.py b/src/webui/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9953c820575d42fa88351cc8de022d880ba96e6a --- /dev/null +++ b/src/webui/utils/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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/src/webui/utils/form_validators.py b/src/webui/utils/form_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..59c5cf998847be5a5a81419264fbc09afd30f595 --- /dev/null +++ b/src/webui/utils/form_validators.py @@ -0,0 +1,28 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + +from wtforms.validators import ValidationError + +def key_value_validator(): + def _validate(form, field): + if len(field.data) > 0: + if '\n' not in field.data: # case in which there is only one configuration + if '=' not in field.data: + raise ValidationError(f'Configuration "{field.data}" does not follow the key=value pattern.') + else: # case in which there are several configurations + configurations = field.data.split('\n') + for configutation in configurations: + if '=' not in configutation: + raise ValidationError(f'Configuration "{configutation}" does not follow the key=value pattern.') + return _validate diff --git a/tutorial/1-0-deployment.md b/tutorial/1-0-deployment.md new file mode 100644 index 0000000000000000000000000000000000000000..6d56808daf6df8ed8ed5ba1f6133858199d19994 --- /dev/null +++ b/tutorial/1-0-deployment.md @@ -0,0 +1,12 @@ +# 1. Deployment Guide + +This section walks you through the process of deploying TeraFlowSDN on top of a Virtual Machine (VM) running MicroK8s +Kubernetes platform. The guide includes the details on configuring and installing the VM, installing and configuring +MicroK8s, and deploying and reporting the status of the TeraFlowSDN controller. + +## Table of Content: +- [1.1. Create VM for the TeraFlowSDN controller](./1-1-create-vm.md) +- [1.2. Install MicroK8s Kubernetes platform](./1-2-install-microk8s.md) +- [1.3. Deploy TeraFlowSDN over MicroK8s](./1-3-deploy-tfs.md) +- [1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) +- [1.5. Show Deployment and Log per Component](./1-5-deploy-logs-troubleshooting.md) diff --git a/tutorial/1-1-1-create-vm-oracle-virtualbox.md b/tutorial/1-1-1-create-vm-oracle-virtualbox.md new file mode 100644 index 0000000000000000000000000000000000000000..ea0da6cabfa46ba2c16166b07cc8c6e345da2246 --- /dev/null +++ b/tutorial/1-1-1-create-vm-oracle-virtualbox.md @@ -0,0 +1,91 @@ +## 1.1.1. Oracle VirtualBox + +### 1.1.1.1. Create a NAT Network in VirtualBox +In "Oracle VM VirtualBox Manager", Menu "File > Preferences... > Network", create a NAT network with the following +specifications: + +|Name |CIDR |DHCP |IPv6 | +|-----------|-----------|--------|--------| +|TFS-NAT-Net|10.0.2.0/24|Disabled|Disabled| + +Within the newly created "TFS-NAT-Net" NAT network, configure the following IPv4 forwarding rules: + +|Name|Protocol|Host IP |Host Port|Guest IP |Guest Port| +|----|--------|---------|---------|---------|----------| +|SSH |TCP |127.0.0.1|2200 |10.0.2.10|22 | +|HTTP|TCP |127.0.0.1|8080 |10.0.2.10|80 | + +__Note__: IP address 10.0.2.10 is the one that will be assigned to the VM. + + +### 1.1.1.2. Create VM in VirtualBox: + +- Name: TFS-VM +- Type/Version: Linux / Ubuntu (64-bit) +- CPU (*): 4 vCPUs @ 100% execution capacity +- RAM: 8 GB +- Disk: 40 GB, Virtual Disk Image (VDI), Dynamically allocated +- Optical Drive ISO Image: "ubuntu-20.04.4-live-server-amd64.iso" + - Download the file "ubuntu-20.04.4-live-server-amd64.iso" from [Ubuntu 20.04 LTS](https://releases.ubuntu.com/20.04/). + - __Note__: use Ubuntu Server image instead of Ubuntu Desktop to create a lightweight VM. +- Network Adapter 1 (*): enabled, attached to NAT Network "TFS-NAT-Net" +- Minor adjustments (*): + - Audio: disabled + - Boot otder: disable "Floppy" + +__Note__: (*) settings to be editing after the VM is created. + +### 1.1.1.3. Install Ubuntu 20.04 LTS Operating System +In "Oracle VM VirtualBox Manager", start the VM in normal mode, and follow the installation procedure. Below we provide +some installation guidelines: +- Installation Language: English +- Autodetect your keyboard +- Configure static network specifications: + +|Interface|IPv4 Method|Subnet |Address |Gateway |Name servers |Search domains| +|---------|-----------|-----------|---------|--------|---------------|--------------| +|enp0s3 |Manual |10.0.2.0/24|10.0.2.10|10.0.2.1|8.8.8.8,8.8.4.4| | + +- Leave proxy and mirror addresses as they are +- Let the installer self-upgrade (if asked). At the time of writing this walkthrough, the version of the installer is 22.06.1. Anyway, Ubuntu 20.04 LTS OS will be installed. +- Use an entire disk for the installation + - Disable setup of the disk as LVM group + - Double check that NO swap space is allocated in the partition table. Kubernetes does not work properly with SWAP. +- Configure your user and system names: + - User name: TeraFlowSDN + - Server's name: tfs-vm + - Username: tfs + - Password: tfs123 +- Install Open SSH Server + - Import SSH keys, if any. +- Featured Server Snaps + - Do not install featured server snaps. It will be done manually later to illustrate how to uninstall and reinstall + them in case of trouble with. +- Let the system install and upgrade the packages. + - This operation might take some minutes depending on how old is the Optical Drive ISO image you use and your + Internet connection speed. +- Restart the VM when the installation is completed. + +## 1.1.1.4. Upgrade the Ubuntu distribution +```bash +sudo apt-get update -y +sudo apt-get dist-upgrade -y +``` + +## 1.1.1.5. Install VirtualBox Guest Additions +On VirtualBox Manager, open the VM main screen. If you are running the VM in headless mode, right click over the VM in +the VirtualBox Manager window and click "Show". If a dialog informing about how to leave the interface of the VM is +hown, confirm pressing "Switch" button. The interface of the VM should appear. + +Click menu "Device > Insert Guest Additions CD image..." + +On the VM terminal, type: +```bash +sudo apt-get install -y linux-headers-$(uname -r) build-essential dkms + # This command might take some minutes depending on your VM specs and your Internet access speed. +sudo mount /dev/cdrom /mnt/ +cd /mnt/ +sudo ./VBoxLinuxAdditions.run + # This command might take some minutes depending on your VM specs. +sudo reboot +``` diff --git a/tutorial/1-1-2-create-vm-vmware-fusion.md b/tutorial/1-1-2-create-vm-vmware-fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..7147c24af8a2cc182c8e6987387254218a3f9db9 --- /dev/null +++ b/tutorial/1-1-2-create-vm-vmware-fusion.md @@ -0,0 +1,54 @@ +## 1.1.2. VMWare Fusion + +### 1.1.2.1. Create VM in VMWare Fusion: + +In "VMWare Fusion" manager, create a new network from the "Settings/Network" menu. + +- Unlock to make changes +- Press the + icon and create a new network +- Change the name to TFS-NAT-Net +- Check "Allow virtual machines on this networkto connect to external network (NAT)" +- Do not check "Enable IPv6" +- Add port forwarding for HTTP and SSH +- Uncheck "Provide address on this network via DHCP" + +Create a new VM an Ubuntu 20.04 iso: + +- Display Name: TeraFlowSDN +- Username: tfs +- Password: tfs123 + +On the next screen press "Customize Settings", save the VM and in "Settings" change: +- Change to use 4 CPUs +- Change to access 8 GB of RAM +- Change disk to size 40 GB +- Change the network interface to use the previously created TFS-NAT-Net + +Run the VM to start the installation. + +### 1.1.2.2. Install Ubuntu 20.04 LTS Operating System + +The installation will be automatic, without any configuration required. + +- Configure the guest ip, gateway and DNS: + + Using the Network Settings for the wired connection, set the IP to 10.0.2.10, + the mask to 255.255.255.0, the gatway to 10.0.2.2 and the DNS to 10.0.2.2. + +- Disable and remove swap file: + + $ sudo swapoff -a + $ sudo rm /swapfile + + Then you can remove or comment the /swapfile entry in /etc/fstab + +- Install Open SSH Server + - Import SSH keys, if any. + +- Restart the VM when the installation is completed. + +### 1.1.2.3. Upgrade the Ubuntu distribution +```bash +sudo apt-get update -y +sudo apt-get dist-upgrade -y +``` diff --git a/tutorial/1-1-create-vm.md b/tutorial/1-1-create-vm.md new file mode 100644 index 0000000000000000000000000000000000000000..ce74e6dc6f8df07d5f7cf42d979a7b54d61bc9a6 --- /dev/null +++ b/tutorial/1-1-create-vm.md @@ -0,0 +1,13 @@ +# 1.1. Create VM for the TeraFlowSDN controller + +In this section, we install a VM to be used as the deployment, execution, and development environment for the ETSI +TeraFlowSDN controller. If you already have a remote physical server fitting the requirements specified in this section +feel free to use it instead of deploying a local VM. Other virtualization environments can also be used; in that case, +you will need to adapt these instructions to your particular case. + +Different Hypervisors are considered for that. Check the table of contents for available options. If you want to +contribute with other Hypervisors, [contact](./README.md#contact) the TFS team through Slack. + +## Table of Content: +- [1.1.1. Oracle VirtualBox](./1-1-1-create-vm-oracle-virtualbox.md) +- [1.1.2. VMWare Fusion](./1-1-2-create-vm-vmware-fusion.md) diff --git a/tutorial/1-2-install-microk8s.md b/tutorial/1-2-install-microk8s.md new file mode 100644 index 0000000000000000000000000000000000000000..09e0b41a36a9b6c88883377be6c0737157f7afba --- /dev/null +++ b/tutorial/1-2-install-microk8s.md @@ -0,0 +1,121 @@ +# 1.2. Install MicroK8s Kubernetes platform + +This section describes how to deploy the MicroK8s Kubernetes platform and configure it to be used with ETSI TeraFlowSDN +controller. Besides, Docker is installed to build docker images for the ETSI TeraFlowSDN controller. + +The steps described in this section might take some minutes depending on your internet connection speed and the +resources assigned to your VM, or the specifications of your physical server. + + +## 1.2.1. Upgrade the Ubuntu distribution +Skip this step if you already did it during the creation of the VM. +```bash +sudo apt-get update -y +sudo apt-get dist-upgrade -y +``` + + +## 1.2.2. Install prerequisites +```bash +sudo apt-get install -y ca-certificates curl gnupg lsb-release snapd jq +``` + + +## 1.2.3. Install Docker CE +Install Docker CE +```bash +sudo apt-get install -y docker.io +``` + +Add key "insecure-registries" with the private repository to the daemon configuration. It is done in two commands since +sometimes read from and write to same file might cause trouble. + +```bash +if [ -s /etc/docker/daemon.json ]; then cat /etc/docker/daemon.json; else echo '{}'; fi \ + | jq 'if has("insecure-registries") then . else .+ {"insecure-registries": []} end' -- \ + | jq '."insecure-registries" |= (.+ ["localhost:32000"] | unique)' -- \ + | tee tmp.daemon.json +sudo mv tmp.daemon.json /etc/docker/daemon.json +sudo chown root:root /etc/docker/daemon.json +sudo chmod 600 /etc/docker/daemon.json +``` + +Restart the Docker daemon +```bash +sudo systemctl restart docker +``` + + +## 1.2.4. Install MicroK8s +Ref: https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s +Ref: https://microk8s.io/#install-microk8s + +```bash +# Install MicroK8s +sudo snap install microk8s --classic --channel=1.24/stable + +# Create alias for command "microk8s.kubectl" to be usable as "kubectl" +sudo snap alias microk8s.kubectl kubectl + +# Verify status of ufw firewall +sudo ufw status + +# If ufw is active, install following rules to enable access pod-to-pod and pod-to-internet +sudo ufw allow in on cni0 && sudo ufw allow out on cni0 +sudo ufw default allow routed +``` + + +## 1.2.5. Add user to the docker and microk8s groups +```bash +sudo usermod -a -G docker $USER +sudo usermod -a -G microk8s $USER +sudo chown -f -R $USER ~/.kube +sudo reboot +``` + +## 1.2.6. Check status of Kubernetes +```bash +microk8s.status --wait-ready +``` + + +## 1.2.7. Check all resources in Kubernetes +```bash +microk8s.kubectl get all --all-namespaces +``` + + +## 1.2.8. Enable addons +The Addons enabled are: +- `dns`: enables resolving the pods and services by name +- `hostpath-storage`: enables providing storage for the pods (required by `registry`) +- `ingress`: deploys an ingress controller to expose the microservices outside Kubernetes +- `registry`: deploys a private registry for the TFS controller images + +```bash +microk8s.enable dns hostpath-storage ingress registry +``` + +__Note__: enabling some of the addons might take few minutes. + [Check status](./1-2-install-microk8s.md#124-check-status-of-kubernetes) periodically until all addons are + shown as enabled. Then [Check resources](./1-2-install-microk8s.md#125-check-all-resources-in-kubernetes) + periodically until all pods are Ready and Running. + + +## 1.2.9. Stop, Restart, and Redeploy +Find below some additional commands you might need while you work with MicroK8s: +```bash +microk8s.stop # stop MicroK8s cluster (for instance, before power off your computer) +microk8s.start # start MicroK8s cluster +microk8s.reset # reset infrastructure to a clean state +``` + +If the following commands does not work to recover the MicroK8s cluster, you can redeploy it. +First remove the current deployment as follows: +```bash +sudo snap remove microk8s +sudo apt-get remove --purge docker.io +``` + +Then, redeploy as it is described in this section. diff --git a/tutorial/1-3-deploy-tfs.md b/tutorial/1-3-deploy-tfs.md new file mode 100644 index 0000000000000000000000000000000000000000..07c79d7ab34f12b9042a38489752b28bd4fd474e --- /dev/null +++ b/tutorial/1-3-deploy-tfs.md @@ -0,0 +1,94 @@ +# 1.3. Deploy TeraFlowSDN over MicroK8s + +This section describes how to deploy TeraFlowSDN controller on top of MicroK8s using the environment configured in the +previous sections. + + +## 1.3.1. Install prerequisites +```bash +sudo apt-get install -y git curl jq +``` + + +## 1.3.2. Clone the Git repository of the TeraFlowSDN controller +__Important__: Right now, we have two repositories hosting the code of TeraFlowSDN: GitLab.com and ETSI owned GitLab + repository. Nowadays, only GitLab.com repository accepts code contributions that are periodically + mirrored to ETSI labs. In the near future, we plan to swap the repository roles and new contributions + will be accepted only at ETSI labs, while GitLab.com will probably be kept as a mirror of ETSI. If you + plan to contribute code to the TeraFlowSDN controller, by now, clone from GitLab.com. We will update the + tutorial as soon as roles of repositories are swapped. + +Clone from GitLab (if you want to contribute code to TeraFlowSDN): +```bash +mkdir ~/tfs-ctrl +git clone https://gitlab.com/teraflow-h2020/controller.git ~/tfs-ctrl +``` + +Clone from ETSI owned GitLab (if you do not plan to contribute code): +```bash +mkdir ~/tfs-ctrl +git clone https://labs.etsi.org/rep/tfs/controller.git ~/tfs-ctrl +``` + + +## 1.3.3. Checkout the appropriate Git branch +By default 'master' branch is checked out. If you want to deploy 'develop' that incorporates the most up-to-date code +contributions and features, run the following command: +```bash +cd ~/tfs-ctrl +git checkout develop +``` + +__Important__: During the elaboration and validation of the tutorials, you should checkout branch + "feat/microk8s-deployment". Otherwise, you will not have important files such as "my_deploy.sh" or + "deploy.sh". As soon as the tutorials are completed and approved, we will remove this note and merge the + "feat/microk8s-deployment" into "develop" and later into "master", and then the previous step will be + effective. + + +## 1.3.4. Prepare a deployment script with the deployment settings +Create a new deployment script, e.g., `my_deploy.sh`, adding the appropriate settings as follows. This script, by +default, makes use of the private Docker registry enabled in MicroK8s, as specified in `TFS_REGISTRY_IMAGE`. It builds +the Docker images for the subset of components defined in `TFS_COMPONENTS`, tags them with the tag defined in +`TFS_IMAGE_TAG`, deploys them in the namespace defined in `TFS_K8S_NAMESPACE`, and (optionally) deploys the extra +Kubernetes manifests listed in `TFS_EXTRA_MANIFESTS`. Besides, it lets you specify in `TFS_GRAFANA_PASSWORD` the +password to be set for the Grafana `admin` user. + +```bash +cd ~/tfs-ctrl +tee my_deploy.sh >/dev/null </dev/null || export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init -)" +``` + + +## 2.1.4. Restart the VM +Restart the VM for all the changes to take effect. +```bash +sudo reboot +``` + + +## 2.1.5. Install Python 3.9 over PyEnv +```bash +pyenv install 3.9.13 + # This command might take some minutes depending on your Internet connection speed and the performance of your VM. +``` + + +## 2.1.6. Create the Virtual Environment for TeraFlowSDN +The following commands create a virtual environment named as `tfs` using Python v3.9.13 and associate that environment +with the current folder, i.e., `~/tfs-ctrl`. That way, when you are in that folder, the associated virtual environment +will be used, thus inheriting the Python interpreter, i.e., Python v3.9.13, and the Python packages installed on it. + +```bash +cd ~/tfs-ctrl +pyenv virtualenv 3.9.13 tfs +pyenv local 3.9.13/envs/tfs +``` + +After completing these commands, you should see in your prompt that now you're within the virtual environment +`3.9.13/envs/tfs` on folder `~/tfs-ctrl`: +``` +(3.9.13/envs/tfs) tfs@tfs-vm:~/tfs-ctrl$ +``` + + +## 2.1.7. Install the basic Python packages within the virtual environment +From within the `3.9.13/envs/tfs` environment on folder `~/tfs-ctrl`, run the following commands to install the basic +Python packages required to work with TeraFlowSDN. +```bash +cd ~/tfs-ctrl +./install_requirements.sh +``` diff --git a/tutorial/2-2-ofc22.md b/tutorial/2-2-ofc22.md new file mode 100644 index 0000000000000000000000000000000000000000..5a0547d640267ebd45030d10ce8673d984c6b137 --- /dev/null +++ b/tutorial/2-2-ofc22.md @@ -0,0 +1,121 @@ +# 2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services + +This functional test reproduces the live demonstration "Demonstration of Zero-touch Device and L3-VPN Service Management +Using the TeraFlow Cloud-native SDN Controller" carried out at +[OFC'22](https://www.ofcconference.org/en-us/home/program-speakers/demo/). + + +## 2.2.1. Functional test folder + +This functional test can be found in folder `./src/tests/ofc22/`. A convenience alias `./ofc22/` pointing to that folder +has been defined. + + +## 2.2.2. Execute with real devices + +This functional test is designed to operate both with real and emulated devices. +By default, emulated devices are used; however, if you have access to real devices, you can create/modify the files +`./ofc22/tests/Objects.py` and `./ofc22/tests/Credentials.py` to point to your devices, and map to your own network +topology. +Otherwise, you can modify the `./ofc22/tests/descriptors_emulated.json` that is designed to be uploaded through the +WebUI instead of using the command line scripts. +Note that the default scenario assumes devices R2 and R4 are always emulated, while devices R1, R3, and O1 +can be configured as emulated or real devices. + +__Important__: The device drivers operating with real devices, e.g., OpenConfigDriver, P4Driver, and TransportApiDriver, + have to be considered as experimental. The configuration and monitoring capabilities they support are + limited or partially implemented/tested. Use them with care. + + +## 2.2.3. Deployment and Dependencies + +To run this functional test, it is assumed you have deployed a MicroK8s-based Kubernetes environment and a TeraFlowSDN +controller instance as described in the [Tutorial: Deployment Guide](./1-0-deployment.md), and you configured +the Python environment as described in +[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md). +Remember to source the scenario settings appropriately, e.g., `cd ~/tfs-ctrl && source my_deploy.sh` in each terminal +you open. + + +## 2.2.4. Access to the WebUI and Dashboard + +When the deployment completes, you can connect to the TeraFlowSDN WebUI and Dashboards as described in +[Tutorial: Deployment Guide > 1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) + +Notes: +- the default credentials for the Grafana Dashboiard is user/pass: `admin`/`admin123+`. +- in Grafana, you will find the "L3-Monitorng" in the "Starred dashboards" section. + + +## 2.2.5. Test execution + +To execute this functional test, four main steps needs to be carried out: +1. Device bootstrapping +2. L3VPN Service creation +3. L3VPN Service removal +4. Cleanup + +Upon the execution of each test progresses, a report will be generated indicating PASSED / FAILED / SKIPPED. If there +is some error during the execution, you should see a detailed report on the error. See the troubleshooting section if +needed. + +You can check the logs of the different components using the appropriate `scripts/show_logs_[component].sh` scripts +after you execute each step. + + +### 2.2.5.1. Device bootstrapping + +This step configures some basic entities (Context and Topology), the devices, and the links in the topology. The +expected results are: +- The devices to be added into the Topology. +- The devices to be pre-configured and initialized as ENABLED by the Automation component. +- The monitoring for the device ports (named as endpoints in TeraFlowSDN) to be activated and data collection to + automatically start. +- The links to be added to the topology. + +To run this step, you can do it from the WebUI by uploading the file `./ofc22/tests/descriptors_emulated.json` that +contains the descriptors of the contexts, topologies, devices, and links, or by executing the +`./ofc22/run_test_01_bootstrap.sh` script. + +When the bootstrapping finishes, check in the Grafana L3-Monitoring Dashboard and you should see the monitoring data +being plotted and updated every 5 seconds (by default). Given that there is no service configured, you should see a +0-valued flat plot. + +In the WebUI, select the "admin" Context. Then, in the "Devices" tab you should see that 5 different emulated devices +have been created and activated: 4 packet routers, and 1 optical line system controller. Besides, in the "Services" tab +you should see that there is no service created. Note here that the emulated devices produce synthetic +randomly-generated data and do not care about the services configured. + + +### 2.2.5.2. L3VPN Service creation + +This step configures a new service emulating the request an OSM WIM would make by means of a Mock OSM instance. + +To run this step, execute the `./ofc22/run_test_02_create_service.sh` script. + +When the script finishes, check the WebUI "Services" tab. You should see that two services have been created, one for +the optical layer and another for the packet layer. Besides, you can check the "Devices" tab to see the configuration +rules that have been configured in each device. In the Grafana Dashboard, given that there is now a service configured, +you should see the plots with the monitored data for the device. By default, device R1-EMU is selected. + + +### 2.2.5.3. L3VPN Service removal + +This step deconfigures the previously created services emulating the request an OSM WIM would make by means of a Mock +OSM instance. + +To run this step, execute the `./ofc22/run_test_03_delete_service.sh` script, or delete the L3NM service from the WebUI. + +When the script finishes, check the WebUI "Services" tab. You should see that the two services have been removed. +Besides, in the "Devices" tab you can see that the appropriate configuration rules have been deconfigured. In the +Grafana Dashboard, given that there is no service configured, you should see a 0-valued flat plot again. + + +### 2.2.5.4. Cleanup + +This last step performs a cleanup of the scenario removing all the TeraFlowSDN entities for completeness. + +To run this step, execute the `./ofc22/run_test_04_cleanup.sh` script. + +When the script finishes, check the WebUI "Devices" tab, you should see that the devices have been removed. Besides, in +the "Services" tab you can see that the "admin" Context has no services given that that context has been removed. diff --git a/tutorial/2-3-oeccpsc22.md b/tutorial/2-3-oeccpsc22.md new file mode 100644 index 0000000000000000000000000000000000000000..2ea7261d8a032b6543b3f3e9ed2fa702d9066616 --- /dev/null +++ b/tutorial/2-3-oeccpsc22.md @@ -0,0 +1,8 @@ +# 2.3. OECC/PSC'22 Demo - Interdomain slices (WORK IN PROGRESS) + +This functional test reproduces the experiment in paper "... paper title ..." presented at OECC/PSC'22 conference +[OECC/PSC'22](... demo link ...). + +## 2.3.1. Functional test folder +This functional test can be found in folder `./src/tests/oeccpsc22/`. A convenience alias `./oeccpsc22/` pointing to +that folder has been defined. diff --git a/tutorial/2-4-ecoc22.md b/tutorial/2-4-ecoc22.md new file mode 100644 index 0000000000000000000000000000000000000000..f752bda840a3eb2fbde6c907e4ce139de3f8ce82 --- /dev/null +++ b/tutorial/2-4-ecoc22.md @@ -0,0 +1 @@ +# 2.4. ECOC'22 Demo (PENDING) diff --git a/tutorial/2-5-nfvsdn22.md b/tutorial/2-5-nfvsdn22.md new file mode 100644 index 0000000000000000000000000000000000000000..35fae3af31420f401997377d9b10a47acc92d490 --- /dev/null +++ b/tutorial/2-5-nfvsdn22.md @@ -0,0 +1 @@ +# 2.5. NFV-SDN'22 Demo (PENDING) diff --git a/tutorial/3-0-development.md b/tutorial/3-0-development.md new file mode 100644 index 0000000000000000000000000000000000000000..c2b13315aec7ee506684a3b7cc2be40b9f6407fe --- /dev/null +++ b/tutorial/3-0-development.md @@ -0,0 +1,10 @@ +# 3. Development Guide (WORK IN PROGRESS) + +This section walks you through the process of developing new components for the TeraFlowSDN controller. For convenience, +this guide assumes you are using the Oracle VirtualBox-based VM running MicroK8s Kubernetes platform as described in the +[Deployment Guide](./1-0-deployment.md). The guide includes the details on + +## Table of Content: +- [3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md) +- [3.2. Development Commands, Tricks, and Hints (WORK IN PROGRESS)](./3-2-develop-cth.md) +- [3.3. Debugging individual components in VSCode](./3.3-debug-comp.md) diff --git a/tutorial/3-1-configure-vscode.md b/tutorial/3-1-configure-vscode.md new file mode 100644 index 0000000000000000000000000000000000000000..10493ce225d67043bcfcf9914905f19d270f060f --- /dev/null +++ b/tutorial/3-1-configure-vscode.md @@ -0,0 +1,92 @@ +# 3.1. Configure VSCode and Connect to the VM + + +## 3.1.1. Install VSCode and the required extensions +If not already done, install [VSCode](https://code.visualstudio.com/) and the "Remote SSH" extension on your local +machine, not in the VM. + +__Note__: "Python" extension is not required here. It will be installed later on the VSCode server running on the VM. + + +## 3.1.2. Configure the "Remote SSH" extension +- Go to left icon "Remote Explorer" +- Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar +- Choose to edit "<...>/.ssh/config" file (or equivalent) +- Add the following entry (assuming previous port forwarding configuration): +``` +Host TFS-VM + HostName 127.0.0.1 + Port 2200 + ForwardX11 no + User tfs +``` +- Save the file +- An entry "TFS-VM" should appear on "SSH TARGETS". + + +## 3.1.3. Connect VSCode to the VM through "Remote SSH" extension +- Right-click on "TFS-VM" +- Select "Connect to Host in Current Window" +- Reply to the questions asked + - Platform of the remote host "TFS-VM": Linux + - "TFS-VM" has fingerprint "". Do you want to continue?: Continue + - Type tfs user's password: tfs123 +- You should be now connected to the TFS-VM. + +__Note__: if you get a connection error message, the reason might be due to wrong SSH server fingerprint. Edit file + "<...>/.ssh/known_hosts" on your local user account, check if there is a line starting with + "[127.0.0.1]:2200" (assuming previous port forwarding configuration), remove the entire line, save the file, + and retry connection. + + +## 3.1.4. Add SSH key to prevent typing the password every time +This step creates an SSH key in the VM and installs it on the VSCode to prevent having to type the password every time. + +- In VSCode (connected to the VM), click menu "Terminal > New Terminal" +- Run the following commands on the VM's terminal through VSCode +```bash +ssh-keygen -t rsa -b 4096 -f ~/.ssh/tfs-vm.key + # leave password empty +ssh-copy-id -i ~/.ssh/tfs-vm.key.pub tfs@10.0.2.10 + # tfs@10.0.2.10's password: +rm .ssh/known_hosts +``` + +- In VSCode, click left "Explorer" panel to expand, if not expanded, and click "Open Folder" button. + - Choose "/home/tfs/" + - Type tfs user's password when asked + - Trust authors of the "/home/tfs [SSH: TFS-VM]" folder when asked +- Right click on the file "tfs-vm.key" in the file explorer + - Select "Download..." option + - Download the file into your user's accout ".ssh" folder +- Delete files "tfs-vm.key" and "tfs-vm.key.pub" on the TFS-VM. + +- In VSCode, click left "Remote Explorer" panel to expand + - Click the "gear" icon next to "SSH TARGETS" on top of "Remote Explorer" bar + - Choose to edit "<...>/.ssh/config" file (or equivalent) + - Find entry "Host TFS-VM" and update it as follows: +``` +Host TFS-VM + HostName 127.0.0.1 + Port 2200 + ForwardX11 no + User tfs + IdentityFile "" +``` + - Save the file +- From now, VSCode will use the identity file to connect to the TFS-VM instead of the user's password. + + +## 3.1.5. Install VSCode Python Extension (in VSCode server) +This step installs Python extensions in VSCode server running in the VM. + +- In VSCode (connected to the VM), click left button "Extensions" +- Search "Python" extension in the extension Marketplace. +- Install official "Python" extension released by Microsoft. + - By default, since you're connected to the VM, it will be installed in the VSCode server running in the VM. + +- In VSCode (connected to the VM), click left button "Explorer" +- Click "Ctrl+Alt+P" and type "Python: Select Interpreter". Select option "Python: 3.9.13 64-bit ('tfs')" + +in terminal: set python path to be used by VSCode: +`echo "PYTHONPATH=./src" > ~/tfs-ctrl/.env` diff --git a/tutorial/3-2-develop-cth.md b/tutorial/3-2-develop-cth.md new file mode 100644 index 0000000000000000000000000000000000000000..eda70c9e8c411c8cc6a0ed0832f573ca787962ca --- /dev/null +++ b/tutorial/3-2-develop-cth.md @@ -0,0 +1,37 @@ +# 3.2. Development Commands, Tricks, and Hints (WORK IN PROGRESS) + + + +## Items to be addressed: +- pytest flags: --log-level=INFO --verbose -o log_cli=true -o log_file=my_log_file.log -o log_file_level=DEBUG +- code coverage +- nginx ingress grpc to enable access from external sources + + +# interesting Docker commands + +Build by hand: +cd src +docker build -t "context:lgr-test" -f ./context/Dockerfile . + +Run by hand: +docker run --rm --name lgr-test -it --env "DB_BACKEND=inmemory" --entrypoint /bin/bash context:lgr-test + + +## Expose gRPC ports through Ingress Controller +source `my_deploy.sh` +run script `./expose_ingress_grpc.sh` + +to test: +sudo apt-get install nmap +nmap -p 1010 127.0.0.1 # test if context is reachable +should retrieve something like: +$ nmap -p 1010 127.0.0.1 +Starting Nmap 7.80 ( https://nmap.org ) at 2022-07-29 15:06 UTC +Nmap scan report for localhost (127.0.0.1) +Host is up (0.00035s latency). + +PORT STATE SERVICE +1010/tcp open surf + +Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds diff --git a/tutorial/3.3-debug-comp.md b/tutorial/3.3-debug-comp.md new file mode 100644 index 0000000000000000000000000000000000000000..380c5add26729c7d403135b20813b112ba214908 --- /dev/null +++ b/tutorial/3.3-debug-comp.md @@ -0,0 +1,55 @@ +# 3.3 Debugging individual components in VSCode + +## 3.3.1 Source TeraFlow environment variables into .bashrc + +With any text editor, open the file `~/.bashrc` and add the following line at the end: +```bash +source ~/tfs-ctrl/tfs_runtime_env_vars.sh +``` + +"tfs-ctrl" can be substituted by the appropriate path where the controller is deployed. + +## 3.3.2 Install VSCode Python extensions +The following extensions are required to execute and debug TeraFlow components in VSCode: + +- *Python*. New versions of the extension are known to have some unsolved bugs, it is recommended to downgrade to version **v2022.10.0**. Go to the extension window, select Python, click the arrow next to the "Uninstall" button and select "Install Another Version..." +- *Pylance* + +## 3.3.3 Configure VSCode workspace and launch settings +Run VSCode and open the folder with the source code of TeraFlow, this will be the main workspace. Create (if it does not exist) the subfolder `.vscode`. Inside, create and edit the following files: + +- `settings.json` + ```bash + { + "python.analysis.extraPaths": ["/.pyenv/versions/3.9.7/envs/teraflow/lib/python3.9/site-packages"], + } + ``` + `` should be replaced by the path of your home folder. If in the future another version of Python is used, or the virtual environment changes, this file should be updated to reflect the new path of the installed pip packages. + +- `launch.json` + ```bash + { + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "TFS compute.service", + "module": "compute.service", + "python": "${command:python.interpreterPath}", + "type": "python", + "request": "launch", + "justMyCode": true, + "console": "internalConsole", + "env": { + "PYTHONPATH": "${config:python.analysis.extraPaths}:${workspaceRoot}/src", + "LOG_LEVEL": "DEBUG", + } + } + ] + } + ``` + This file contains the configuration necessary to execute the `"compute"` component from the TeraFlow controller, while providing debugging capabilities (e.g., breaking points, console log output etc.). After saving, the debugging can be started from the "Run and Debug" menu. + + Additional profiles can be added to the JSON file under the `"configurations"` arrray. Copy & paste the existing one and change the `"name"` and `"module"` fields. \ No newline at end of file diff --git a/tutorial/README.md b/tutorial/README.md new file mode 100644 index 0000000000000000000000000000000000000000..836434e51b8797cf91a49a3f47298eec712fbe43 --- /dev/null +++ b/tutorial/README.md @@ -0,0 +1,39 @@ +# ETSI TeraFlowSDN Controller Tutorials + + +## Abstract +This document provides a walkthrough on how to prepare your environment for executing and contributing to the +[ETSI TeraFlowSDN OSG](https://tfs.etsi.org/). + +This walkthrough makes some reasonable assumptions to simplify the deployment of the ETSI TeraFlowSDN controller, the +execution of experiments and tests, and development of new contributions. In particular, we assume: + +- [VirtualBox](https://www.virtualbox.org/) version 6.1.34 r150636 +- [VSCode](https://code.visualstudio.com/) with the "Remote SSH" extension +- VM software: + - [Ubuntu Server 20.04 LTS](https://releases.ubuntu.com/20.04/) + - [MicroK8s](https://microk8s.io/) + + +## Contact +If your environment does not fit with the proposed assumptions and you experience some trouble preparing it to work +with the ETSI TeraFlowSDN controller, contact the ETSI TeraFlowSDN OSG team through +[Slack](https://join.slack.com/t/teraflowsdn/shared_invite/zt-18gc5jvkh-1_DEZHFhxeuOqzJZPq~U~A) + + +## Table of Content: +- [1. Deployment Guide](./1-0-deployment.md) + - [1.1. Create VM for the TeraFlowSDN controller](./1-1-create-vm.md) + - [1.2. Install MicroK8s Kubernetes platform](./1-2-install-microk8s.md) + - [1.3. Deploy TeraFlowSDN over MicroK8s](./1-3-deploy-tfs.md) + - [1.4. Access TeraFlowSDN WebUI and Grafana Dashboards](./1-4-access-webui.md) + - [1.5. Show Deployment and Log per Component](./1-5-deploy-logs-troubleshooting.md) +- [2. Run Experiments Guide (WORK IN PROGRESS)](./2-0-run-experiments.md) + - [2.1. Configure the Python environment](./2-1-python-environment.md) + - [2.2. OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services](./2-2-ofc22.md) + - [2.3. OECC/PSC'22 Demo (WORK IN PROGRESS)](./2-3-oeccpsc22.md) + - [2.4. ECOC'22 Demo (PENDING)](./2-4-ecoc22.md) + - [2.5. NFV-SDN'22 Demo (PENDING)](./2-5-nfvsdn22.md) +- [3. Development Guide (WORK IN PROGRESS)](./3-0-development.md) + - [3.1. Configure VSCode and Connect to the VM](./3-1-configure-vscode.md) + - [3.2. Development Commands, Tricks, and Hints (WORK IN PROGRESS)](./3-2-develop-cth.md) diff --git a/update_tfs_runtime_env_vars.sh b/update_tfs_runtime_env_vars.sh new file mode 100755 index 0000000000000000000000000000000000000000..db68e17ea49c035af085f2eb461f704b42c287e2 --- /dev/null +++ b/update_tfs_runtime_env_vars.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the list of components you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh +echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT + +for COMPONENT in $TFS_COMPONENTS; do + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +echo "Done!"